Skip to content
rynop edited this page Dec 28, 2011 · 11 revisions

CakePlate is intended for Linux/Mac dev's who wish to get up and going fast on a CakePHP project with some best practices already baked in. CakePlate does not support windows, however you should be able to get it to work by replacing symlinks with the content that they point to.

Quickstart

  1. Fork CakePlate then, git clone --recursive git://github.com/you/yourRepo.git YourProject && git submodule init && git submodule update --recursive. Don't use git? Just download and put into your version control system.
  2. Install APC. I have bootstrap.php and core.php setup to use it by default. I recommend v3.1.9. Simple sudo pecl install apc-3.1.9 should do the trick. If you are running multiple CakePHP apps on the same server, make sure to add a unique prefix in core.php and bootstrap.php.
  3. Change Security.cipherSeed and Security.salt
  4. Use PHP 5.3.
  5. AssetCompress is a plugin that combines, minifies and compresses your CSS and JS files. Configure webapp/app/Config/asset_compress.ini to use the css and JS filters you wish to use. I have it setup to use YuiCompressor for css and uglifyjs for JS. Uglifyjs requires a NodeJs server to be installed. You also need to put yuicompressor.jar into app/Vendor/yuicompressor dir (mv build/yuicompressor-2.4.7.jar Vendor/yuicompressor/yuicompressor.jar). Download YUICompressor here. See AssetCompress docs for more info.
  6. For production, edit webroot/index.php and hard code (yes I said hard code) ROOT and APP_DIR
  7. Setup your webserver. I use nginx and php5-fpm. I create a symlink from myProject/webapp/app/webroot to the root specified in the nginx config. Ex: ln -sf /pathTo/myProject/webapp/app/webroot /opt/myProject/webroot

Then: cd into yourProject/webapp/app (ex: /opt/coolapp/webapp/app) and run

sudo chown -R <youruser>:www-data tmp
sudo chmod -R g+w tmp
sudo chown -R <youruser>:www-data webroot/cache_*
sudo chmod -R g+w webroot/cache_*

I typically make an entry in /etc/hosts from 127.0.0.1 to the domain - like: 127.0.0.1 www.myreallycoolcakeapp.com.

Restart Nginx, then point your browser to: http://www.myreallycoolcakeapp.com/examples

Recommendations

  • Read the docs for all the external projects, plugins, etc that I use. Getting up and running quick is cool, but knowing wtf ur doing will save you time in the long run.
  • Look at etc/zzz_php_overrides.ini. If you don't know what the directives do - you should. Look them up on php.net.
  • submodules are put in the submodules dir and symlinked in. This allows you to easily identify external dependencies, and keep things clean (and easily update-able).
Clone this wiki locally