├── app
│ ├── Module
│ ├── Plugin
│ ├── config
│ ├── init.php
│ └── layouts
├── lib
│ ├── Alloy
│ └── App
├── tests
│ ├── AllTests.php
│ └── Test
├── vendor
│ └── Plugin
└── www
├── .htaccess
├── assets
├── index.php
├── robots.txt
└── web.config
The problem with this organization is when Alloy core changes, it is
difficult to upgrade because sometimes there are more changes than
just in the core library, like changes to routes, new config keys that
are added, the layout plugin that ships with Alloy, etc.
I propose a change to the following structure to better separate Alloy
core and user-level applications with custom code:
├── .htaccess
├── alloy
│ ├── LICENSE.txt
│ ├── Plugin
│ ├── README.md
│ ├── config
│ ├── init.php
│ ├── lib
│ └── tests
└── app
├── Module
├── Plugin
├── config
├── layouts
├── lib
└── www
├── .htaccess
├── assets
├── index.php
├── robots.txt
└── web.config
This organization would place all the core alloy files in a new
directory named "alloy", and all the user-space application files in a
directory named "app". Files like config/app.php and config/routes.php
would be in the "alloy" directory, and might be duplicated in the
"app" directory or included/extended in the initial default install.
This would allow easy upgrading through dragging and dropping or a
single folder or updating a single git submodule.
What do you guys think? Is this change worth the short-term headache?
I like the idea of a one-time config file copy (or setup script) vs
double loading config files for one variable change. Or
putting .example files in their place with a .gitignore on the file
-.example (just thinking aloud). Which ever solution works out to be
easy for the user and efficient.
Two possible hiccups?:
1) What happened to vendors/Spot?
2) What about third party plugins bundled with asset (css, javascript,
image) files?
Chris Boden
sábado, 2 de abril de 2011 11:09
Hi K,
To enable what I was talking about you can add the following line to
your .htaccess file (or httpd.conf as you suggested).
Options +FollowSymlinks
In fact, I'd recommend Vance put that in Alloy's .htaccess file, as
Apache _requires_ FollowSymlinks on in order for mod_rewrite to work.
(http://httpd.apache.org/docs/current/mod/mod_rewrite.html)
K Wasseem
sábado, 2 de abril de 2011 11:01
Hi Chris,
that is fine for those of us who likes to get 'our hands dirty'. But since the aim of this framework is also 'ease of use/deployment', i do not think we should go as far as inside httpd.conf to do that. If you have a look at other frameworks, they all (or at least most of those worth their salt) have WWW outside APP or standing independly as the main Public_html for a reason. ;)
Btw, I'm not sure if this is achieved with .htaccess, you will have to adjust httpd.conf
//Wasseem
Chris Boden
sábado, 2 de abril de 2011 10:41
K,
Keeping the app directory outside the DocumentRoot can be accomplished
by turning FollowSymLinks (in Apache) globally or in the .htaccess
file. You then make a symbolic link from app/www to your
DocumentRoot.
Alternatively, if that's not an option for some reason, .htaccess
files prevent access to the rest of the /app directory if it's in the
DocumentRoot.
K Wasseem
sábado, 2 de abril de 2011 05:33
Hi everyone,
My concern is about the WWW folder residing inside the APP:
I do not think it is a good idea to have the folder WWW inside APP. App will contain some business logics and as a rule of thumb you might even be placing APP outside your doc_root on a prod server. WWW should only reside in doc_root. Don't just focus on isolating the core files, you should also think about future Logics of a system coming on top of this core framework.So, I do not think this new structure, as far as the WWW folder is concerned, makes much sense for the long term..
//Wasseem
Chris Boden
sexta-feira, 1 de abril de 2011 19:29