CakePHP 3 - Defining the Core Outside Webroot

Reading time ~1 minute

One thing that CakePHP 3 documentation has you do when you install is put the CakePHP Core inside the vendor directory of the app. If you want to share the CakePHP core between multiple apps you can follow these simple steps.

Step 1: Install the CakePHP 3 App

cd {webroot}
composer create-project -s dev cakephp/app ./
Step 2: Move the CakePHP 3 core to somewhere external

In this example, I am going to put it inside `/CakeCore/cakephp` but you can put it wherever.

mkdir /CakeCore
mv {webroot}/vendor/cakephp/cakephp /CakeCore/cakephp
Step 3: Change the Core Definition in your App

Lastly we need to point the app to the newly cloned core.

cd {webroot}/App/Config
vim paths.php
And replace this line (approximately line 73):

define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp');
With this line:

define('CAKE_CORE_INCLUDE_PATH', '/CakeCore/cakephp/');
That's it! Continue on your merry way.

Quick Laravel/Lumen install with Docker!

The default installer that comes with Laravel is great, but unfortunately that means you have to install dependencies of PHP and Laravel/...… Continue reading

PHP To Python

Published on February 24, 2016

Aftertouch in Logic Pro X and 2015 Macbook Pro

Published on February 24, 2016