Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP Shared core for multiple apps
    text
    copied!<p>On my local setup I have a load of different CakePHP websites. I'm using a Mac so the folder structure is something like <code>~/Users/cameron/Sites/sample-website</code> and then within each of these websites I will have the typical Cake folder and App folder.</p> <p>What I would like to do is have just a core cake folder and then have ALL the sites pull from that one cake core so I don't have the same stuff several times over. I have been reading some tutorials on the web: <a href="http://rickguyer.com/cakephp-one-core-many-apps/" rel="nofollow">http://rickguyer.com/cakephp-one-core-many-apps/</a></p> <p>So I have my cake folder here: <code>~/Users/cameron/Sites/cake-1.3/</code> and then my site here: <code>~/Users/cameron/Sites/sample-site/</code> and in this folder I have the usual app folder and htaccess to tell it where to find webroot etc.</p> <p>Now I have edited the index.php file inside webroot like the tutorial BUT have only changed one line because I haven't moved my files OUTSIDE of the App folder like he does. So the only like I have changed is as follows:</p> <pre><code>if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', '..'.DS.'..'.DS.'cake-1.3'); } </code></pre> <p>As far as I can tell that is correctly looking two directories up and finding a folder called <code>cake-1.3</code> however it just gives a error 500?</p> <p>Any ideas what the problem is? Thanks</p> <p>EDIT:</p> <p>Even doing this doesn't work??? Which If I echo: <code>echo CAKE_CORE_INCLUDE_PATH;</code> gives <code>/Users/cameron/Sites/cake-1.3</code> and if I paste that in the address bar it loads up the cake folder so it's definitely the correct folder structure JUST it doesn't like looking at cake outside of the main url?</p> <pre><code>if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', DS.'Users'.DS.'cameron'.DS.'Sites'.DS.'cake-1.3'); echo CAKE_CORE_INCLUDE_PATH; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload