diff --git a/composer.json b/composer.json index 8e137bc..7bdf654 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "email": "sigma_z@sigma-scripts.de" } ], - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "symfony/event-dispatcher": "~2" }, @@ -18,8 +18,11 @@ } }, "scripts": { - "post-install-cmd": [ + "post-create-project-cmd": [ "php installDefaultApp.php" ] + }, + "config": { + "preferred-install": "dist" } } diff --git a/docs/documentation.md b/docs/documentation.md index 91dc389..3f8d029 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -8,6 +8,8 @@ This implementation of the [MVC (Model-View-Controller) pattern](http://martinfo just provides the basis for an MVC application. It does not provide a Model layer. In fact even the provided View layer is optional. +Jentin requires the [Symfony EventDispatcher](https://github.com/symfony/EventDispatcher). + License --- @@ -20,7 +22,10 @@ Installation Jentin can be installed with [Composer](http://www.getcomposer.org). -Add the following requirement in your ``composer.json`` file: +If you don't know how Composer works, please check out +their [Getting Started](http://getcomposer.org/doc/00-intro.md) to set up. + +Create a ``composer.json`` file with the following requirement: ```js { @@ -30,11 +35,17 @@ Add the following requirement in your ``composer.json`` file: } ``` -Call ``composer install`` from your command line to add ``Jentin`` to your ``vendor`` folder. -If you don't know how Composer works, please check out -their [Getting Started](http://getcomposer.org/doc/00-intro.md) to set up. +Now call the ``install`` command from your command line: -Jentin requires the [Symfony EventDispatcher](https://github.com/symfony/EventDispatcher). +```bash +composer install +``` + +If you like you can create the default app structure as an easy start for using Jentin, you can do so by executing this script: + +```bash +php vendor/sigma-z/jentin/installDefaultApp.php +``` After installing your file structure looks like: @@ -60,13 +71,20 @@ After installing your file structure looks like: `- composer.lock ``` +If you set up your web server that ``public`` is your document root then you can request +``http://your-host/`` in your browser and you should see: + +``` +Jentin MVC Framework has been installed successfully. +``` + Configuration --- -To map your requests to your front controller you usually use for Apache a ``.htaccess`` file. -The document root should be a folder containing your front controller (ie. index.php) and all the client stuff -like css, javascript and other static files. The document root should be the only folder web server should have access to. +To map your requests to your front controller you usually use for Apache an ``.htaccess`` file. +The document root should be the directory (i.e. public) containing your front controller (ie. index.php) and all the client stuff +like css, javascript and other static files. The document root should be the only directory where web server should have access to. ``` RewriteEngine on @@ -81,7 +99,7 @@ RewriteRule ^.*$ index.php [NC] Class loading --- -Most times you be satisfied by loading the ``vendor/autoload.php`` created by Composer. +Auto loading the Jentin classes is done by requiring the ``vendor/autoload.php`` file created by Composer. ```php setNamespace('Jentin', '/path/to/Jentin'); - -// define where to load the Symfony EventDispatcher classes from -$classLoader->setNamespace('Symfony', '/path/to/Symfony'); - -// register class loader for autoloading -$classLoader->register(); - -``` - - Front controller --- @@ -120,7 +117,7 @@ In our example there is no application wrapped around Jentin, which you should d ```php ``. And each action of the controller can have a view script. @@ -219,12 +214,6 @@ Each controller has its own view directory ``views/``. And each `- index.php ``` -If you request ``http://your-host/`` you should see: - -``` -Jentin MVC Framework has been installed successfully. -``` - Customized controller directory structure ---