dev-master
9999999-dev http://z7.github.com/hydraAn application template for Hydra, the cozy RESTfull PHP5.3 micro-framework.
MIT
The Requires
by Sandu Lungu
An application template for Hydra, the cozy RESTfull PHP5.3 micro-framework.
This is an application for Hydra, the cozy RESTfull PHP5.3 micro-framework. See https://github.com/z7/hydra, (*1)
There is a main configuration file - /app/config.php, where you can adjust the settings to your likes., (*2)
To adjust core config options, you'll have to edit /web/index.php., (*3)
You should give web server write access ONLY to this folder and its contents., (*4)
The /data/web subfolder will store uploaded files accesible at an address of the form http://example.com/vendor/data/ASSETS, (*5)
Store all your public assets (images, css, js) there., (*6)
If you use 3rd party libraries, use CDN, like https://developers.google.com/speed/libraries/devguide If there is no CDN for your lib, then drop it in it's own /web/vendor/LIBRARY-NAME subfolder., (*7)
If you need to serve dynamic assets, append a '.php' extension., (*8)
Example: to serve a http://example.com/js/dynamic.js?foo=bar create a /web/js/deynamic.js.php file like this:, (*9)
expires(60 * 60 * 24, true); // cache response for 1 day ?> alert(query['foo']) ?>);, (*10)
Store hooks in directly in src folder., (*11)
Store all application classes here., (*12)
IMPORTANT: Use App namespace. For example, a \App\Controller\SampleController class should be stored in src/App/Controller/SampleController.php., (*13)
Store all your Twig views here., (*14)
Store 3rd party Hydra plugins here Each plugin may contain the following:, (*15)
src/ folder with classes. The plugin is responsable for registering classes with autoloader. If it provides public controllers, routes should be explicitly registered as well., (*16)
web/ folder with web assets, accesible at http://example.com/plugins/PLUGIN-NAME/ASSETS 3rd party libraries should be placed in a web/vendor/ subfolders., (*17)
hooks/ folder with any number of *.hook.php files (auto-detected)., (*18)
Plugins may be nested in subfolder, but in this case the "web" directory should be served by the plugin itself., (*19)
If you have method or service declarations in your hook files, create src/ide_helper.php file with php docs describing your method signatures., (*20)
An application template for Hydra, the cozy RESTfull PHP5.3 micro-framework.
MIT