2013-04-25 65 views
0

我即將在本地處理新的Codeigniter應用程序。我很好奇我的正確的文件結構,我應該使用哪些有助於適當的最佳實踐。我沒有改變MAMP裏的默認根目錄。我想要做的事情是,當我準備好上傳到現場時,我不需要做任何額外的工作,以便它能夠正常工作。我確實配置了index.php文件,以便它顯示系統和應用程序文件夾的正確位置。網站一是主要網站。本地工作以準備現場服務器

現在我有這樣的:

本地

/MAMP 
    /htdocs 
     /sites 
      /site1 
       /system 
       /application 
       /public_html 
        index.php 
      /site2 
       /system 
       /application 
       /public_html 
        index.php 
      /site3 
       /system 
       /application 
       /public_html 
        index.php 

LIVE

/root 
    /application 
    /dev 
     /site1 
      /application 
      /system 
      /public_html 
       index.php 
       .htaccess 
     /site2 
      /application 
      /system 
      /public_html 
       index.php 
       .htaccess 
    /sites 
     /site3 
      /application 
      /system 
      /public_html 
       index.php 
       .htaccess 
     /site4 
      /application 
      /system 
      /public_html 
       index.php 
       .htaccess 
    /public_html 
     /public_html 
      /assets 
       /css 
       /js 
       /images 
      index.php 
      .htaccess 
    /system 
+2

爲什麼你不只是模仿你的MAMP目錄的htdocs文件夾中的活動服務器目錄? – 2013-04-25 19:04:42

+0

@Kacey:最有可能隱藏源文件,因此無法從Internet訪問它們。這在存儲重要密碼等時很常見。 – OptimusCrime 2013-04-25 21:13:18

+0

只要您的虛擬域指向每個相應的public_html目錄作爲路徑,安裝就好了。 – Jeemusu 2013-04-26 01:05:41

回答

1

笨在根文件夾中的index.php的環境變量設置,以確定是否您的系統是生產還是發展。這是路由所有傳入請求的index.php。

爲您的開發機器設置此環境變量,併爲您的實時服務器設置單獨的文件。

在application/config中,可以將單獨的生產和開發配置文件存儲在與您的環境變量命名相同的文件夾下。

相關問題