Should I have a separate copy of all CakePHP files for each new application?

I am very new to CakePHP. From what I put together, it seems that I can have several applications that use the same applications and directories for the cake.

So let's say I have two applications. CakeFacebookApp and GenericCakeBlog. These applications are completely separate from each other and will have completely separate URLs, but they will be on the same web host. Should they both be in the same pie structure or should they have a full cake setting in separate directories?

Technically, I'm sure this will work anyway, but I guess I'm looking for the best approach. Thanks.

+4
source share
2 answers

If your two applications are really different, chances are:

  • One fine day, you can upgrade CakePHP for one β€” and don’t necessarily want to do the same for the other (or not at the same time)
  • If you start getting a lot of users, you can host each application on a separate server.

In any of these two situations, having two different versions of the framework can help :-)


A few things that can be β€œbad” using two separate versions:

  • Take a couple MB on a disk - well, considering the size of the disks that we have now, is this really important?
  • If you use the opcode cache, such as APC, this means that you will have two copies of the same files stored in memory in RAM; but the same note about a couple of MB compared to the amount of RAM that we have on our servers.


I personally (especially with two applications, may differ from 10), use in this situation two separate copies of the structure; the most important reason would be easier to upgrade one version of the application without any risk of impact on another.

+6
source

I think it’s a good idea to share the same cake directory, but it would be nice to keep the application directory between the two applications. Take a look at the advanced installation from the documentation: http://book.cakephp.org/view/35/Advanced-Installation

If two applications have the same behaviors, components, etc., it might be nice to create a cakephp plugin, since it does not require much effort.

http://book.cakephp.org/view/115/Creating-a-Plugin

0
source

Source: https://habr.com/ru/post/1306386/


All Articles