2013-04-25 25 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中,可以将单独的生产和开发配置文件存储在与您的环境变量命名相同的文件夹下。

相关问题