An application template for Hydra, the cozy RESTfull PHP5.3 micro-framework.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Hydra application skeleton

This is an application for Hydra, the cozy RESTfull PHP5.3 micro-framework. See


There is a main configuration file - /app/config.php, where you can adjust the settings to your likes.

To adjust core config options, you'll have to edit /web/index.php.

/data folder

You should give web server write access ONLY to this folder and its contents.

The /data/web subfolder will store uploaded files accesible at an address of the form

/web folder

Store all your public assets (images, css, js) there.

If you use 3rd party libraries, use CDN, like If there is no CDN for your lib, then drop it in it's own /web/vendor/LIBRARY-NAME subfolder.

If you need to serve dynamic assets, append a '.php' extension.

Example: to serve a create a /web/js/deynamic.js.php file like this:

expires(60 * 60 * 24, true); // cache response for 1 day ?>

alert(query['foo']) ?>);

/app/src subfolder

Store hooks in directly in src folder.

Store all application classes here.

IMPORTANT: Use App namespace. For example, a \App\Controller\SampleController class should be stored in src/App/Controller/SampleController.php.

/app/views subfolder

Store all your Twig views here.

/app/plugins subfolder

Store 3rd party Hydra plugins here Each plugin may contain the following:

  • 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.

  • web/ folder with web assets, accesible at 3rd party libraries should be placed in a web/vendor/ subfolders.

  • hooks/ folder with any number of *.hook.php files (auto-detected).

  • views/ folder (templates should be explicitly registered).

  • vendor/ PHP libraries.

  • file.

  • composer.json file if the plugin has PHP dependecies (see vendor/ libs).

Plugins may be nested in subfolder, but in this case the "web" directory should be served by the plugin itself.

IDE integration

If you have method or service declarations in your hook files, create src/ide_helper.php file with php docs describing your method signatures.