CodeIgniter,新手问题

发布于 2024-08-13 00:23:20 字数 255 浏览 1 评论 0原文

我想在 Linux 机器下的 CodeIgniter 几个域和 2 个管理员中进行编程。

one.com 两网 三网 ....com

除此之外,我还需要两个后端系统。

报告 cms

域之间只有很少的东西是相似的。并且可以共享 最好的文件夹结构是什么?

在你建议你的结构之后,我该如何在路由器和index.php中做到这一点。 我读了一些文章,但没有一篇文章解释它,所以它对于新手来说是可行的。

谢谢

I want to program in the CodeIgniter few domain and 2 admins under a linux machine.

one.com
two.com
three.com
....com

and in addition to i need two backend systems.

reports
cms

only few things are similar between the domains. and can be shared
what is the best folder structures for that?

after you suggest your structure, how do i do it in the router and in the index.php.
i read some articles but none of them explain it so it can be doable for a newbie.

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

末骤雨初歇 2024-08-20 00:23:20
/var/www-virtual
    | -- /system  
    |    |-- /cache
    |    |-- ...
    |
    | -- /apps
    |     | -- /one.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |     | -- /two.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |
    | -- /public    
    |    | -- /one.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...
    |    | -- /two.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...

这就是我的装备方式。每个虚拟主机都指向 /var/www-virtual/public/??.com
在每个 /var/www-virtual/public/??.com/index.php 我有......

$system_folder = "../../system";
$application_folder = "../../apps/??.com";

希望这是有道理的。

/var/www-virtual
    | -- /system  
    |    |-- /cache
    |    |-- ...
    |
    | -- /apps
    |     | -- /one.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |     | -- /two.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |
    | -- /public    
    |    | -- /one.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...
    |    | -- /two.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...

This is how I rig it. Each virtual host points at /var/www-virtual/public/??.com
and in each /var/www-virtual/public/??.com/index.php I have...

$system_folder = "../../system";
$application_folder = "../../apps/??.com";

Hope that makes sense.

子栖 2024-08-20 00:23:20

如果只有很少的共同点,为什么不为每个域安装一个 Codeigniter 实例呢?

但如果您只想拥有一个 Codeigniter 实例,那么我建议您为每个域创建一个主控制器 (controller_domain1,...,controller_domainX),并将视图分隔在子文件夹中,例如 (domain1,domain2,domain3)。

问候,
佩德罗

If there is just few things in common why you don't install one instance of Codeigniter for each domain?

But if you want to have just one Codeigniter instance, so I recomend that you create one main controller per domain (controller_domain1,...,controller_domainX), and separate the views in subfolders like (domain1,domain2,domain3).

Regards,
Pedro

醉态萌生 2024-08-20 00:23:20

我还建议为每个域使用不同的 Codeigniter 安装。但是,如果您确实只想对不同的应用程序使用一次安装,那么用户指南将在此处解释如何操作:
管理您的应用程序:CodeIgniter 用户指南

I would also recommend using a different installation of Codeigniter for each domain. However, if you do want to use just one installtion for different applications then the user guide explains how here:
Managing your applications: CodeIgniter User Guide

这是您需要执行的操作:

  1. 将“system”文件夹向上移动一个
    目录。

    旧文件夹结构:
    www\codeignitor\应用程序\系统
    到:
    www\codeignitor\system

  2. 更改index.php中的$system_folder
    =“系统”; index.php 中的变量指向上一级。

这样做可以让您共享系统文件夹,并且您可以拥有许多应用程序文件夹。

在 config.php 中,

    $system_folder = "system";
    To:
    $system_folder = "../system";

为了额外的安全性,您可以将系统文件夹重命名为人们无法猜测的其他名称,或者将系统文件夹移动两层到您的主目录。

This is what you need to do:

  1. Move the "system" folder up one
    directory.

    old folder structure:
    www\codeignitor\application\system
    to:
    www\codeignitor\system

  2. Change the $system_folder in the index.php
    = "system"; variable in index.php to point one level up.

Doing this allows you to share the system folder and you can have many application folders.

In config.php

    $system_folder = "system";
    To:
    $system_folder = "../system";

For extra security you may rename the system folder to something else people can't guess or move the system folder two levels up to your home directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文