久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

CakePHP 多個(gè)應(yīng)用程序的共享核心

CakePHP Shared core for multiple apps(CakePHP 多個(gè)應(yīng)用程序的共享核心)
本文介紹了CakePHP 多個(gè)應(yīng)用程序的共享核心的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

在我的本地設(shè)置中,我有很多不同的 CakePHP 網(wǎng)站.我使用的是 Mac,因此文件夾結(jié)構(gòu)類似于 ~/Users/cameron/Sites/sample-website,然后在每個(gè)網(wǎng)站中,我將擁有典型的 Cake 文件夾和 App 文件夾.

On my local setup I have a load of different CakePHP websites. I'm using a Mac so the folder structure is something like ~/Users/cameron/Sites/sample-website and then within each of these websites I will have the typical Cake folder and App folder.

我想做的是只有一個(gè)核心蛋糕文件夾,然后讓所有網(wǎng)站都從那個(gè)蛋糕核心中提取出來,這樣我就不會(huì)多次使用相同的東西.我一直在網(wǎng)上閱讀一些教程:http://rickguyer.com/cakephp-一核多應(yīng)用/

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: http://rickguyer.com/cakephp-one-core-many-apps/

所以我的蛋糕文件夾在這里:~/Users/cameron/Sites/cake-1.3/ 然后我的網(wǎng)站在這里:~/Users/cameron/Sites/sample-site/ 在這個(gè)文件夾中,我有常用的 app 文件夾和 htaccess 來告訴它在哪里可以找到 webroot 等.

So I have my cake folder here: ~/Users/cameron/Sites/cake-1.3/ and then my site here: ~/Users/cameron/Sites/sample-site/ and in this folder I have the usual app folder and htaccess to tell it where to find webroot etc.

現(xiàn)在我像教程一樣編輯了 webroot 中的 index.php 文件,但只更改了一行,因?yàn)槲覜]有像他那樣將我的文件移到 App 文件夾之外.所以我唯一改變的像如下:

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:

if (!defined('CAKE_CORE_INCLUDE_PATH'))
{
    define('CAKE_CORE_INCLUDE_PATH', '..'.DS.'..'.DS.'cake-1.3');
}

據(jù)我所知,正確查找兩個(gè)目錄并找到一個(gè)名為 cake-1.3 的文件夾,但它只是給出了錯(cuò)誤 500?

As far as I can tell that is correctly looking two directories up and finding a folder called cake-1.3 however it just gives a error 500?

任何想法是什么問題?謝謝

Any ideas what the problem is? Thanks

即使這樣做也不起作用???如果我回顯:echo CAKE_CORE_INCLUDE_PATH; 給出 /Users/cameron/Sites/cake-1.3 并且如果我將其粘貼到地址欄中,它會(huì)加載蛋糕文件夾,因此它是絕對(duì)是正確的文件夾結(jié)構(gòu),只是它不喜歡在主 url 之外查看蛋糕?

Even doing this doesn't work??? Which If I echo: echo CAKE_CORE_INCLUDE_PATH; gives /Users/cameron/Sites/cake-1.3 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?

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;
}

推薦答案

你是對(duì)的:

define('CAKE_CORE_INCLUDE_PATH', DS.'Users'.DS.'cameron'.DS.'Sites'.DS.'cake-1.3');

只需確保用戶位于 root 中.換句話說,當(dāng)您進(jìn)入終端時(shí),您可以通過鍵入以下內(nèi)容進(jìn)入該目錄:cd/Users/cameron/Sites/cake-1.3

Just make sure that Users sits in root. In other words, when you go to terminal you can get to this directory by typing: cd /Users/cameron/Sites/cake-1.3

看起來您可能使用的是 MAC.如果是這樣,您的鏈接是正確的.大多數(shù)情況下,我發(fā)現(xiàn)您已經(jīng)完成了應(yīng)用程序目錄的復(fù)制粘貼,但它沒有獲得 .htaccess 文件.我會(huì)先檢查那些.但這里有一份您應(yīng)該驗(yàn)證的綜合清單:

It looks like you may be on a MAC. If so, your linking is correct. Most of the time what I find is you have done a copy paste of the app directory and it does not get the .htaccess files. I would check those first. But here is a comprehensive list of what you should verify:

  1. 確保主機(jī)指向正確的目錄(/Users/cameron/Sites/sample-site/)
  2. 驗(yàn)證 mod_rewrite 是否真的開啟.
  3. 確認(rèn)您已復(fù)制.htaccess在兩個(gè)文件中/Users/cameron/Sites/sample-site//Users/cameron/Sites/sample-site/webroot目錄.
  4. 確認(rèn)/Users/cameron/Sites/cake-1.3/目錄有一個(gè)名為的目錄蛋糕在里面,里面有核心.
  1. Make sure the host is pointing to the correct directory (/Users/cameron/Sites/sample-site/)
  2. Verify mod_rewrite is in fact on.
  3. Verify you have copied the .htaccess file in both the /Users/cameron/Sites/sample-site/ and the /Users/cameron/Sites/sample-site/webroot directories.
  4. Confirm that the /Users/cameron/Sites/cake-1.3/ directory has a directory called cake in it that contains the core.

一旦這一切都得到確認(rèn),你就會(huì)像金子一樣出色!

Once all of this is confirmed, you will be good as gold!

快樂編碼!

更新:當(dāng) index.php 文件查找 cake core 時(shí),它??會(huì)在您指向的位置中查找另一個(gè)名為 cake 的目錄.所以在你的情況下:

UPDATE: When the index.php file looks for the cake core, it will look for a directory inside the location you are pointing to for another directory called cake. So in your case:

define('CAKE_CORE_INCLUDE_PATH', DS.'Users'.DS.'cameron'.DS.'Sites'.DS.'cake-1.3');

您必須在 /Users/cameron/Sites/cake-1.3 中擁有 cake 目錄.您的目錄結(jié)構(gòu)將如下所示:

You must have the cake directory inside /Users/cameron/Sites/cake-1.3. Your directory structure will look like:

/Users/cameron/Sites/cake-1.3/cake
/Users/cameron/Sites/cake-1.3/cake/libs
/Users/cameron/Sites/cake-1.3/cake/config
/Users/cameron/Sites/cake-1.3/cake/console
etc.

CakePHP 3.0+在 CakePHP 3.0+ 中,這個(gè)配置從 webroot/index.php 移到 App/Config/paths.php

CakePHP 3.0+ In CakePHP 3.0+ this configuration is moved out of webroot/index.php to App/Config/paths.php

這篇關(guān)于CakePHP 多個(gè)應(yīng)用程序的共享核心的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Session is lost after an OAuth redirect(OAuth 重定向后會(huì)話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁(yè)排序)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯(cuò)誤:允許的內(nèi)存大小為 134217728 字節(jié)已用盡(嘗試分配 87 字節(jié)))
How to get complete current url for Cakephp(如何獲取 Cakephp 的完整當(dāng)前 url)
主站蜘蛛池模板: 在线观看成年人视频 | 成人深夜福利网站 | 自拍偷拍亚洲欧美 | 久久99精品久久久久久国产越南 | 欧美一区永久视频免费观看 | 99久久免费精品国产免费高清 | 一区二区三区视频在线免费观看 | 久久久久国产精品 | 欧美日韩专区 | 日韩欧美国产电影 | 成人性生交大免费 | 天天插天天狠天天透 | 国产一级特黄aaa大片评分 | 欧美二区三区 | 亚洲欧美一区二区三区在线 | 国产精品久久久久久久久免费丝袜 | 中文字幕视频网 | 亚洲成人精品一区 | 成人精品一区亚洲午夜久久久 | 国产免费一区二区 | 久久综合伊人一区二区三 | 亚洲毛片在线观看 | 中文二区| 国产精品黄色 | 国产精品夜间视频香蕉 | www视频在线观看 | 欧美一级免费 | 成年人黄色一级片 | 亚洲国产免费 | 亚洲综合在线视频 | 美日韩免费视频 | 成人1区| 久久这里有精品 | 国产精品久久久久永久免费观看 | 欧美大片久久久 | 91麻豆精品国产91久久久更新资源速度超快 | 四虎影院免费在线播放 | 色狠狠一区 | 午夜视频在线 | 99久久久99久久国产片鸭王 | 国产欧美在线 |