diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100755 index 0000000000000000000000000000000000000000..36e976016efe1aa4a188b5d4828439cb5484cf12 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2005-2012, Zend Technologies USA, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Zend Technologies USA, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100755 index 0000000000000000000000000000000000000000..0c1438447ab5b7631040a5b7f1edfc9e9cc380b1 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +ZendSkeletonApplication +======================= + +Introduction +------------ +This is a simple, skeleton application using the ZF2 MVC layer and module +systems. This application is meant to be used as a starting place for those +looking to get their feet wet with ZF2. + + +Installation +------------ + +Using Composer (recommended) +---------------------------- +The recommended way to get a working copy of this project is to clone the repository +and use `composer` to install dependencies using the `create-project` command: + + curl -s https://getcomposer.org/installer | php -- + php composer.phar create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application path/to/install + +Alternately, clone the repository and manually invoke `composer` using the shipped +`composer.phar`: + + cd my/project/dir + git clone git://github.com/zendframework/ZendSkeletonApplication.git + cd ZendSkeletonApplication + php composer.phar self-update + php composer.phar install + +(The `self-update` directive is to ensure you have an up-to-date `composer.phar` +available.) + +Another alternative for downloading the project is to grab it via `curl`, and +then pass it to `tar`: + + cd my/project/dir + curl -#L https://github.com/zendframework/ZendSkeletonApplication/tarball/master | tar xz --strip-components=1 + +You would then invoke `composer` to install dependencies per the previous +example. + +Using Git submodules +-------------------- +Alternatively, you can install using native git submodules: + + git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive + +Virtual Host +------------ +Afterwards, set up a virtual host to point to the public/ directory of the +project and you should be ready to go! diff --git a/composer.json b/composer.json new file mode 100755 index 0000000000000000000000000000000000000000..b5064b4175b56955ae9b96c51ccaa3339bbc283e --- /dev/null +++ b/composer.json @@ -0,0 +1,17 @@ +{ + "name": "zendframework/skeleton-application", + "description": "Skeleton Application for ZF2", + "license": "BSD-3-Clause", + "keywords": [ + "framework", + "zf2" + ], + "homepage": "http://framework.zend.com/", + "repositories": [{ "type": "composer", "url": "http://dev.unicaen.fr/packagist" }], + "require": { + "php": ">=5.3.3", + "zendframework/zendframework": "2.1.4", + "unicaen/unicaen-auth": "dev-trunk" + }, + "minimum-stability": "dev" +} diff --git a/config/application.config.php b/config/application.config.php new file mode 100755 index 0000000000000000000000000000000000000000..aa75f7e6c8aae61f34c2bc58fbe5bf781d3c631b --- /dev/null +++ b/config/application.config.php @@ -0,0 +1,19 @@ +<?php +return array( + 'modules' => array( + 'Application', + 'ZfcBase', 'DoctrineModule', 'DoctrineORMModule', 'ZfcUser', 'ZfcUserDoctrineORM', 'BjyAuthorize', + 'UnicaenApp', 'AssetManager', + 'UnicaenAuth', + ), + 'module_listener_options' => array( + 'config_glob_paths' => array( + 'config/autoload/{,*.}{global,local}.php', + ), + 'module_paths' => array( + './module', + './vendor', + ), + ), +); + diff --git a/config/autoload/README.md b/config/autoload/README.md new file mode 100755 index 0000000000000000000000000000000000000000..4e504db024d85325fdc16f0c0d49d61a2649bcd2 --- /dev/null +++ b/config/autoload/README.md @@ -0,0 +1,8 @@ +About this directory: +===================== + +By default, this application is configured to load all configs in +`./config/autoload/{,*.}{global,local}.php`. Doing this provides a +location for a developer to drop in configuration override files provided by +modules, as well as cleanly provide individual, application-wide config files +for things like database connections, etc. diff --git a/config/autoload/global.php b/config/autoload/global.php new file mode 100755 index 0000000000000000000000000000000000000000..86b04f219d54c395811e34cab884d2662e8ab997 --- /dev/null +++ b/config/autoload/global.php @@ -0,0 +1,4 @@ +<?php +return array( + +); diff --git a/config/autoload/local.php b/config/autoload/local.php new file mode 100644 index 0000000000000000000000000000000000000000..f6e98ddd2d91a0ef9a2dcdb86789ba19d4786770 --- /dev/null +++ b/config/autoload/local.php @@ -0,0 +1,10 @@ +<?php +return array( + 'translator' => array( + 'locale' => 'fr_FR', + ), + 'view_manager' => array( + 'display_not_found_reason' => true, + 'display_exceptions' => true, + ), +); diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist new file mode 100755 index 0000000000000000000000000000000000000000..f6e98ddd2d91a0ef9a2dcdb86789ba19d4786770 --- /dev/null +++ b/config/autoload/local.php.dist @@ -0,0 +1,10 @@ +<?php +return array( + 'translator' => array( + 'locale' => 'fr_FR', + ), + 'view_manager' => array( + 'display_not_found_reason' => true, + 'display_exceptions' => true, + ), +); diff --git a/config/autoload/unicaen-app.global.php b/config/autoload/unicaen-app.global.php new file mode 100644 index 0000000000000000000000000000000000000000..ef406d0915259b0b48f7a97fd6761f366291a0b0 --- /dev/null +++ b/config/autoload/unicaen-app.global.php @@ -0,0 +1,28 @@ +<?php +/** + * UnicaenApp Global Configuration + * + * If you have a ./config/autoload/ directory set up for your project, + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Informations concernant cette application + */ + 'app_infos' => array( + 'nom' => "UnicaenSkeletonApplication", + 'desc' => "Squelette d'application Unicaen ZF2", + 'version' => "0.0.1", + 'date' => "19/04/2013", + 'contact' => array('mail' => "dsi.applications@unicaen.fr", /*'tel' => "01 02 03 04 05"*/), + 'mentionsLegales' => "http://www.unicaen.fr/outils-portail-institutionnel/mentions-legales/", + 'informatiqueEtLibertes' => "http://www.unicaen.fr/outils-portail-institutionnel/informatique-et-libertes/", + ), +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-app' => $settings, +); \ No newline at end of file diff --git a/config/autoload/unicaen-app.global.php.dist b/config/autoload/unicaen-app.global.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..7660fc51c6dc18795532c761c95f8eda94d0dd82 --- /dev/null +++ b/config/autoload/unicaen-app.global.php.dist @@ -0,0 +1,28 @@ +<?php +/** + * UnicaenApp Global Configuration + * + * If you have a ./config/autoload/ directory set up for your project, + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Informations concernant cette application + */ + 'app_infos' => array( + 'nom' => "SuperApplication", + 'desc' => "Super application Unicaen ZF2", + 'version' => "0.0.1", + 'date' => "19/04/2013", + 'contact' => array('mail' => "dsi.applications@unicaen.fr", /*'tel' => "01 02 03 04 05"*/), + 'mentionsLegales' => "http://www.unicaen.fr/outils-portail-institutionnel/mentions-legales/", + 'informatiqueEtLibertes' => "http://www.unicaen.fr/outils-portail-institutionnel/informatique-et-libertes/", + ), +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-app' => $settings, +); \ No newline at end of file diff --git a/config/autoload/unicaen-app.local.php b/config/autoload/unicaen-app.local.php new file mode 100644 index 0000000000000000000000000000000000000000..c7e59a515878b3fe7f3939849bc3b3d431e60710 --- /dev/null +++ b/config/autoload/unicaen-app.local.php @@ -0,0 +1,62 @@ +<?php +/** + * UnicaenApp Local Configuration + * + * If you have a ./config/autoload/ directory set up for your project, + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Connexions aux annuaires LDAP. + * NB: Compte admin requis pour récupération coordonnées, affectations, rôles, etc. + */ + 'ldap' => array( + 'connection' => array( + 'default' => array( + 'params' => array( + 'host' => 'ldap.unicaen.fr', + 'username' => "uid=applidev,ou=system,dc=unicaen,dc=fr", + 'password' => "Ifq1pdeS2of_7DC", + 'baseDn' => "ou=people,dc=unicaen,dc=fr", + 'bindRequiresDn' => true, + 'accountFilterFormat' => "(&(objectClass=posixAccount)(supannAliasLogin=%s))", + ) + ) + ) + ), + /** + * Connexions aux bases de données via Doctrine (http://www.doctrine-project.org/). + */ +// 'doctrine' => array( +// 'connection' => array( +// 'orm_default' => array( +// 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', +// 'params' => array( +// 'host' => 'localhost', +// 'port' => '3306', +// 'user' => 'root', +// 'password' => 'root', +// 'dbname' => 'squelette', +// ) +// ), +// ), +// ), + /** + * Options concernant l'envoi de mail + */ + 'mail' => array( + 'transport_options' => array( + 'host' => 'smtp.unicaen.fr', + 'port' => 25, + ), + 'redirect_to' => array('dsi.applications@unicaen.fr'), + 'do_not_send' => false, + ), +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-app' => $settings, +); \ No newline at end of file diff --git a/config/autoload/unicaen-app.local.php.dist b/config/autoload/unicaen-app.local.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..99d1180573ffc1bbab3868ed326a47983fa8a80f --- /dev/null +++ b/config/autoload/unicaen-app.local.php.dist @@ -0,0 +1,62 @@ +<?php +/** + * UnicaenApp Local Configuration + * + * If you have a ./config/autoload/ directory set up for your project, + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Connexions aux annuaires LDAP. + * NB: Compte admin requis pour récupération coordonnées, affectations, rôles, etc. + */ + 'ldap' => array( + 'connection' => array( + 'default' => array( + 'params' => array( + 'host' => 'ldap.unicaen.fr', + 'username' => "uid=xxxxxxxxx,ou=xxxxxxxxxx,dc=domain,dc=fr", + 'password' => "xxxxxxxxxxxx", + 'baseDn' => "ou=xxxxxxxxxxx,dc=domain,dc=fr", + 'bindRequiresDn' => true, + 'accountFilterFormat' => "(&(objectClass=posixAccount)(supannAliasLogin=%s))", + ) + ) + ) + ), + /** + * Connexions aux bases de données via Doctrine (http://www.doctrine-project.org/). + */ +// 'doctrine' => array( +// 'connection' => array( +// 'orm_default' => array( +// 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', +// 'params' => array( +// 'host' => 'localhost', +// 'port' => '3306', +// 'user' => 'root', +// 'password' => 'root', +// 'dbname' => 'squelette', +// ) +// ), +// ), +// ), + /** + * Options concernant l'envoi de mail + */ + 'mail' => array( + 'transport_options' => array( + 'host' => 'smtp.unicaen.fr', + 'port' => 25, + ), + 'redirect_to' => array('dsi.applications@unicaen.fr'), + 'do_not_send' => false, + ), +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-app' => $settings, +); \ No newline at end of file diff --git a/config/autoload/unicaen-auth.global.php b/config/autoload/unicaen-auth.global.php new file mode 100644 index 0000000000000000000000000000000000000000..3c33814e4fdf960a92a814779527f4f37a7dc2a7 --- /dev/null +++ b/config/autoload/unicaen-auth.global.php @@ -0,0 +1,40 @@ +<?php +/** + * UnicaenAuth Global Configuration + * + * If you have a ./config/autoload/ directory set up for your project, you can + * drop this config file in it and change the values as you wish. + */ +$settings = array( + 'bjyauthorize' => array( + // default role for unauthenticated users + 'default_role' => false, + ), + /** + * Mot de passe sésame, chiffré avec l'algo Bcrypt + * $bcrypt = new \Zend\Crypt\Password\Bcrypt(); + * echo $bcrypt->create('votreMotDePasseSesame'); + */ + 'sesame_password' => false, + /** + * Flag indiquant si l'utilisateur authenitifié avec succès via l'annuaire LDAP doit + * être enregistré/mis à jour dans la table des utilisateurs de l'appli. + */ + 'save_ldap_user_in_database' => false, + /** + * Enable registration + * Allows users to register through the website. + * Accepted values: boolean true or false + */ + 'enable_registration' => false, +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-auth' => $settings, + 'zfcuser' => array( + $k='enable_registration' => isset($settings[$k]) ? $settings[$k] : false, + ), +); \ No newline at end of file diff --git a/config/autoload/unicaen-auth.global.php.dist b/config/autoload/unicaen-auth.global.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..3c33814e4fdf960a92a814779527f4f37a7dc2a7 --- /dev/null +++ b/config/autoload/unicaen-auth.global.php.dist @@ -0,0 +1,40 @@ +<?php +/** + * UnicaenAuth Global Configuration + * + * If you have a ./config/autoload/ directory set up for your project, you can + * drop this config file in it and change the values as you wish. + */ +$settings = array( + 'bjyauthorize' => array( + // default role for unauthenticated users + 'default_role' => false, + ), + /** + * Mot de passe sésame, chiffré avec l'algo Bcrypt + * $bcrypt = new \Zend\Crypt\Password\Bcrypt(); + * echo $bcrypt->create('votreMotDePasseSesame'); + */ + 'sesame_password' => false, + /** + * Flag indiquant si l'utilisateur authenitifié avec succès via l'annuaire LDAP doit + * être enregistré/mis à jour dans la table des utilisateurs de l'appli. + */ + 'save_ldap_user_in_database' => false, + /** + * Enable registration + * Allows users to register through the website. + * Accepted values: boolean true or false + */ + 'enable_registration' => false, +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-auth' => $settings, + 'zfcuser' => array( + $k='enable_registration' => isset($settings[$k]) ? $settings[$k] : false, + ), +); \ No newline at end of file diff --git a/config/autoload/unicaen-auth.local.php b/config/autoload/unicaen-auth.local.php new file mode 100644 index 0000000000000000000000000000000000000000..dc5c1f35d6610208b57e6373851443e74e6c7588 --- /dev/null +++ b/config/autoload/unicaen-auth.local.php @@ -0,0 +1,40 @@ +<?php +/** + * UnicaenAuth Configuration + * + * If you have a ./config/autoload/ directory set up for your project, you can + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Paramètres de connexion au serveur CAS : + * - pour désactiver l'authentification CAS, le tableau 'cas' doit être vide. + * - pour l'activer, renseigner les paramètres. + */ + 'cas' => array( +// 'connection' => array( +// 'default' => array( +// 'params' => array( +// 'hostname' => 'cas.unicaen.fr', +// 'port' => 443, +// 'version' => "2.0", +// 'uri' => "", +// 'debug' => false, +// ), +// ), +// ), + ), + /** + * Mot de passe sésame, chiffré avec l'algo Bcrypt + * $bcrypt = new \Zend\Crypt\Password\Bcrypt(); + * echo $bcrypt->create('votreMotDePasseSesame'); + */ + 'sesame_password' => '$2y$14$jbCVltklcys8TQj3hu30.OcKMi7rtUgmu3eo/nxMXynYvcZ5iHF8q', +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-auth' => $settings, +); \ No newline at end of file diff --git a/config/autoload/unicaen-auth.local.php.dist b/config/autoload/unicaen-auth.local.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..dc5c1f35d6610208b57e6373851443e74e6c7588 --- /dev/null +++ b/config/autoload/unicaen-auth.local.php.dist @@ -0,0 +1,40 @@ +<?php +/** + * UnicaenAuth Configuration + * + * If you have a ./config/autoload/ directory set up for your project, you can + * drop this config file in it and change the values as you wish. + */ +$settings = array( + /** + * Paramètres de connexion au serveur CAS : + * - pour désactiver l'authentification CAS, le tableau 'cas' doit être vide. + * - pour l'activer, renseigner les paramètres. + */ + 'cas' => array( +// 'connection' => array( +// 'default' => array( +// 'params' => array( +// 'hostname' => 'cas.unicaen.fr', +// 'port' => 443, +// 'version' => "2.0", +// 'uri' => "", +// 'debug' => false, +// ), +// ), +// ), + ), + /** + * Mot de passe sésame, chiffré avec l'algo Bcrypt + * $bcrypt = new \Zend\Crypt\Password\Bcrypt(); + * echo $bcrypt->create('votreMotDePasseSesame'); + */ + 'sesame_password' => '$2y$14$jbCVltklcys8TQj3hu30.OcKMi7rtUgmu3eo/nxMXynYvcZ5iHF8q', +); + +/** + * You do not need to edit below this line + */ +return array( + 'unicaen-auth' => $settings, +); \ No newline at end of file diff --git a/config/autoload/zenddevelopertools.local.php b/config/autoload/zenddevelopertools.local.php new file mode 100644 index 0000000000000000000000000000000000000000..58e9d2ab8813a24b5a81c2191b30db31dbf15c9e --- /dev/null +++ b/config/autoload/zenddevelopertools.local.php @@ -0,0 +1,136 @@ +<?php +return array( + 'zenddevelopertools' => array( + /** + * General Profiler settings + */ + 'profiler' => array( + /** + * Enables or disables the profiler. + * + * Expects: boolean + * Default: false + */ + 'enabled' => true, + + /** + * Enables or disables the strict mode. If the strict mode is + * enabled, any error will throw an exception, otherwise all + * errors will be added to the report (and shown in the toolbar). + * + * Expects: boolean + * Default: true + */ + 'strict' => false, + + /** + * If enabled, the profiler tries to flush the content before the it + * starts collecting data. This option will be ignored if the Toolbar + * is enabled. + * + * Note: The flush listener listens to the MvcEvent::EVENT_FINISH event + * with a priority of -9400. You have to disbale this function if + * you wish to modify the output with a lower priority. + * + * Expects: boolean + * Default: false + */ + 'flush_early' => false, + + /** + * The cache directory is used in the version check and for every storage + * type that writes to the disk. + * + * Note: The default value assumes that the current working directory is the + * application root. + * + * Expects: string + * Default: 'data/cache' + */ + 'cache_dir' => 'data/cache', + + /** + * If a matches is defined, the profiler will be disabled if the + * request does not match the pattern. + * + * Example: 'matcher' => array('ip' => '127.0.0.1') + * OR + * 'matcher' => array('url' => array('path' => '/admin') + * + * Note: The matcher is not implemented yet! + */ + 'matcher' => array(), + + /** + * Contains a list with all collector the profiler should run. + * Zend Developer Tools ships with 'db' (Zend\Db), 'time', 'event', 'memory', + * 'exception', 'request' and 'mail' (Zend\Mail). If you wish to disable a default + * collector, simply set the value to null or false. + * + * Example: 'collectors' => array('db' => null) + * + * Expects: array + */ + 'collectors' => array(), + ), + /** + * General Toolbar settings + */ + 'toolbar' => array( + /** + * Enables or disables the Toolbar. + * + * Expects: boolean + * Default: false + */ + 'enabled' => true, + + /** + * If enabled, every empty collector will be hidden. + * + * Expects: boolean + * Default: false + */ + 'auto_hide' => false, + + /** + * The Toolbar position. + * + * Expects: string ('bottom' or 'top') + * Default: bottom + */ + 'position' => 'bottom', + + /** + * If enabled, the Toolbar will check if your current Zend Framework version + * is up-to-date. + * + * Note: The check will only occur once every hour. + * + * Expects: boolean + * Default: false + */ + 'version_check' => true, + + /** + * Contains a list with all collector toolbar templates. The name + * of the array key must be same as the name of the collector. + * * + * Example: 'profiler' => array( + * 'collectors' => array( + * // My_Collector_Example::getName() -> mycollector + * 'MyCollector' => 'My_Collector_Example', + * ) + * ), + * 'toolbar' => array( + * 'entries' => array( + * 'mycollector' => 'example/toolbar/my-collector', + * ) + * ), + * + * Expects: array + */ + 'entries' => array(), + ), + ), +); \ No newline at end of file diff --git a/init_autoloader.php b/init_autoloader.php new file mode 100755 index 0000000000000000000000000000000000000000..d568af6421fe5c196e6ab9badd4d114233ac1ad0 --- /dev/null +++ b/init_autoloader.php @@ -0,0 +1,49 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +/** + * This autoloading setup is really more complicated than it needs to be for most + * applications. The added complexity is simply to reduce the time it takes for + * new developers to be productive with a fresh skeleton. It allows autoloading + * to be correctly configured, regardless of the installation method and keeps + * the use of composer completely optional. This setup should work fine for + * most users, however, feel free to configure autoloading however you'd like. + */ + +// Composer autoloading +if (file_exists('vendor/autoload.php')) { + $loader = include 'vendor/autoload.php'; +} + +$zf2Path = false; + +if (is_dir('vendor/ZF2/library')) { + $zf2Path = 'vendor/ZF2/library'; +} elseif (getenv('ZF2_PATH')) { // Support for ZF2_PATH environment variable or git submodule + $zf2Path = getenv('ZF2_PATH'); +} elseif (get_cfg_var('zf2_path')) { // Support for zf2_path directive value + $zf2Path = get_cfg_var('zf2_path'); +} + +if ($zf2Path) { + if (isset($loader)) { + $loader->add('Zend', $zf2Path); + } else { + include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; + Zend\Loader\AutoloaderFactory::factory(array( + 'Zend\Loader\StandardAutoloader' => array( + 'autoregister_zf' => true + ) + )); + } +} + +if (!class_exists('Zend\Loader\AutoloaderFactory')) { + throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'); +} diff --git a/module/Application/Module.php b/module/Application/Module.php new file mode 100755 index 0000000000000000000000000000000000000000..7786cd84887ed5d10b0a33571b19785831c1c91f --- /dev/null +++ b/module/Application/Module.php @@ -0,0 +1,40 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Application; + +use Zend\Mvc\ModuleRouteListener; +use Zend\Mvc\MvcEvent; + +class Module +{ + public function onBootstrap(MvcEvent $e) + { + $e->getApplication()->getServiceManager()->get('translator'); + $eventManager = $e->getApplication()->getEventManager(); + $moduleRouteListener = new ModuleRouteListener(); + $moduleRouteListener->attach($eventManager); + } + + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } +} diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php new file mode 100755 index 0000000000000000000000000000000000000000..de848869c48421dcb89a123a8e63681a31379260 --- /dev/null +++ b/module/Application/config/module.config.php @@ -0,0 +1,80 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +return array( + 'router' => array( + 'routes' => array( + 'home' => array( + 'type' => 'Zend\Mvc\Router\Http\Literal', + 'options' => array( + 'route' => '/', + 'defaults' => array( + 'controller' => 'Application\Controller\Index', // <-- change here + 'action' => 'index', + ), + ), + ), + // The following is a route to simplify getting started creating + // new controllers and actions without needing to create a new + // module. Simply drop new controllers in, and you can access them + // using the path /application/:controller/:action + 'application' => array( + 'type' => 'Literal', + 'options' => array( + 'route' => '/application', + 'defaults' => array( + '__NAMESPACE__' => 'Application\Controller', + 'controller' => 'Index', + 'action' => 'index', + ), + ), + 'may_terminate' => true, + 'child_routes' => array( + 'default' => array( + 'type' => 'Segment', + 'options' => array( + 'route' => '/[:controller[/:action]]', + 'constraints' => array( + 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + ), + 'defaults' => array( + ), + ), + ), + ), + ), + ), + ), + 'service_manager' => array( + 'factories' => array( + + ), + ), + 'translator' => array( + 'locale' => 'fr_FR', // en_US + 'translation_file_patterns' => array( + array( + 'type' => 'gettext', + 'base_dir' => __DIR__ . '/../language', + 'pattern' => '%s.mo', + ), + ), + ), + 'controllers' => array( + 'invokables' => array( + 'Application\Controller\Index' => 'Application\Controller\IndexController', + ), + ), + 'view_manager' => array( + 'template_path_stack' => array( + __DIR__ . '/../view', + ), + ), +); diff --git a/module/Application/language/en_US.mo b/module/Application/language/en_US.mo new file mode 100755 index 0000000000000000000000000000000000000000..063b126de4f1434bbc07bc1adf8dfacfc2541ded Binary files /dev/null and b/module/Application/language/en_US.mo differ diff --git a/module/Application/language/en_US.po b/module/Application/language/en_US.po new file mode 100755 index 0000000000000000000000000000000000000000..dae2601a267b1e8b80ceed7bf97c7b36f9174eb3 --- /dev/null +++ b/module/Application/language/en_US.po @@ -0,0 +1,154 @@ +msgid "" +msgstr "" +"Project-Id-Version: ZendSkeletonApplication\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-05 22:17-0700\n" +"PO-Revision-Date: 2013-04-08 08:49+0100\n" +"Last-Translator: nommerci <nomerci@hotmail.fr>\n" +"Language-Team: ZF Contibutors <zf-devteam@zend.com>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: translate\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: UNITED STATES\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../view/layout/layout.phtml:6 +#: ../view/layout/layout.phtml:33 +#, fuzzy +msgid "Skeleton Application" +msgstr "" + +#: ../view/layout/layout.phtml:36 +msgid "Home" +msgstr "" + +#: ../view/layout/layout.phtml:50 +msgid "All rights reserved." +msgstr "" + +#: ../view/application/index/index.phtml:2 +#, php-format +msgid "Welcome to %sZend Framework 2%s" +msgstr "" + +#: ../view/application/index/index.phtml:3 +#, php-format +msgid "Congratulations! You have successfully installed the %sZF2 Skeleton Application%s. You are currently running Zend Framework version %s. This skeleton can serve as a simple starting point for you to begin building your application on ZF2." +msgstr "" + +#: ../view/application/index/index.phtml:4 +msgid "Fork Zend Framework 2 on GitHub" +msgstr "" + +#: ../view/application/index/index.phtml:10 +msgid "Follow Development" +msgstr "" + +#: ../view/application/index/index.phtml:11 +#, php-format +msgid "Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!" +msgstr "" + +#: ../view/application/index/index.phtml:12 +msgid "ZF2 Development Portal" +msgstr "" + +#: ../view/application/index/index.phtml:16 +msgid "Discover Modules" +msgstr "" + +#: ../view/application/index/index.phtml:17 +#, php-format +msgid "The community is working on developing a community site to serve as a repository and gallery for ZF2 modules. The project is available %son GitHub%s. The site is currently live and currently contains a list of some of the modules already available for ZF2." +msgstr "" + +#: ../view/application/index/index.phtml:18 +msgid "Explore ZF2 Modules" +msgstr "" + +#: ../view/application/index/index.phtml:22 +msgid "Help & Support" +msgstr "" + +#: ../view/application/index/index.phtml:23 +#, php-format +msgid "If you need any help or support while developing with ZF2, you may reach us via IRC: %s#zftalk on Freenode%s. We'd love to hear any questions or feedback you may have regarding the beta releases. Alternatively, you may subscribe and post questions to the %smailing lists%s." +msgstr "" + +#: ../view/application/index/index.phtml:24 +msgid "Ping us on IRC" +msgstr "" + +#: ../view/error/index.phtml:1 +msgid "An error occurred" +msgstr "" + +#: ../view/error/index.phtml:8 +msgid "Additional information" +msgstr "" + +#: ../view/error/index.phtml:11 +#: ../view/error/index.phtml:35 +msgid "File" +msgstr "" + +#: ../view/error/index.phtml:15 +#: ../view/error/index.phtml:39 +msgid "Message" +msgstr "" + +#: ../view/error/index.phtml:19 +#: ../view/error/index.phtml:43 +#: ../view/error/404.phtml:55 +msgid "Stack trace" +msgstr "" + +#: ../view/error/index.phtml:29 +msgid "Previous exceptions" +msgstr "" + +#: ../view/error/index.phtml:58 +msgid "No Exception available" +msgstr "" + +#: ../view/error/404.phtml:1 +msgid "A 404 error occurred" +msgstr "" + +#: ../view/error/404.phtml:10 +msgid "The requested controller was unable to dispatch the request." +msgstr "" + +#: ../view/error/404.phtml:13 +msgid "The requested controller could not be mapped to an existing controller class." +msgstr "" + +#: ../view/error/404.phtml:16 +msgid "The requested controller was not dispatchable." +msgstr "" + +#: ../view/error/404.phtml:19 +msgid "The requested URL could not be matched by routing." +msgstr "" + +#: ../view/error/404.phtml:22 +msgid "We cannot determine at this time why a 404 was generated." +msgstr "" + +#: ../view/error/404.phtml:34 +msgid "Controller" +msgstr "" + +#: ../view/error/404.phtml:41 +#, php-format +msgid "resolves to %s" +msgstr "" + +#: ../view/error/404.phtml:51 +msgid "Exception" +msgstr "" + diff --git a/module/Application/language/fr_FR.mo b/module/Application/language/fr_FR.mo new file mode 100755 index 0000000000000000000000000000000000000000..87372a4cfbfe1627dffcbec53bf02073d824ae6b Binary files /dev/null and b/module/Application/language/fr_FR.mo differ diff --git a/module/Application/language/fr_FR.po b/module/Application/language/fr_FR.po new file mode 100755 index 0000000000000000000000000000000000000000..2d7d79a59c46708718d98ac9ea269a00bedeb434 --- /dev/null +++ b/module/Application/language/fr_FR.po @@ -0,0 +1,153 @@ +msgid "" +msgstr "" +"Project-Id-Version: ZendSkeletonApplication\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-05 22:32-0700\n" +"PO-Revision-Date: 2012-07-05 23:36-0700\n" +"Last-Translator: Evan Coury <me@evancoury.com>\n" +"Language-Team: ZF Contibutors <zf-devteam@zend.com>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: translate\n" +"X-Poedit-Language: French\n" +"X-Poedit-Country: FRANCE\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + +#: ../view/layout/layout.phtml:6 +#: ../view/layout/layout.phtml:33 +msgid "Skeleton Application" +msgstr "Skeleton Application" + +#: ../view/layout/layout.phtml:36 +msgid "Home" +msgstr "Accueil" + +#: ../view/layout/layout.phtml:50 +msgid "All rights reserved." +msgstr "Tous droits réservés." + +#: ../view/application/index/index.phtml:2 +#, php-format +msgid "Welcome to %sZend Framework 2%s" +msgstr "Bienvenue dans le %sZend Framework 2%s" + +#: ../view/application/index/index.phtml:3 +#, php-format +msgid "Congratulations! You have successfully installed the %sZF2 Skeleton Application%s. You are currently running Zend Framework version %s. This skeleton can serve as a simple starting point for you to begin building your application on ZF2." +msgstr "Félicitations ! Vous avez installé avec succès le %sZF2 Skeleton Application%s. Vous utilisez actuellement Zend Framework version %s. Cette structure peut vous servir comme un point de départ simple pour démarrer la construction de votre application avec ZF2." + +#: ../view/application/index/index.phtml:4 +msgid "Fork Zend Framework 2 on GitHub" +msgstr "Faites un Fork de Zend Framework 2 sur GitHub" + +#: ../view/application/index/index.phtml:10 +msgid "Follow Development" +msgstr "Suivre le développement" + +#: ../view/application/index/index.phtml:11 +#, php-format +msgid "Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!" +msgstr "Zend Framework 2 est en cours de développement. Si vous êtes intéressé pour suivre l'évolution de ZF2, il existe un portail dédié à ZF2 sur le site officiel Zend Framework qui propose des liens vers le %swiki%s ZF2, %sdev blog%s, %ssuivi des problèmes%s, et bien plus encore. Il s'agit d'une excellente ressource pour rester à jour sur les dernières évolutions !" + +#: ../view/application/index/index.phtml:12 +msgid "ZF2 Development Portal" +msgstr "Portail sur le développement de ZF2" + +#: ../view/application/index/index.phtml:16 +msgid "Discover Modules" +msgstr "Découvrez les modules" + +#: ../view/application/index/index.phtml:17 +#, php-format +msgid "The community is working on developing a community site to serve as a repository and gallery for ZF2 modules. The project is available %son GitHub%s. The site is currently live and currently contains a list of some of the modules already available for ZF2." +msgstr "La communauté travaille sur le développement d'un site communautaire avec l'objectif de servir de dépôt et de galerie pour les modules ZF2. Le projet est disponible %ssur GitHub%s. Le site est déjà en ligne, et contient une liste non exhaustive des modules déjà disponibles pour ZF2." + +#: ../view/application/index/index.phtml:18 +msgid "Explore ZF2 Modules" +msgstr "Explorer les modules ZF2" + +#: ../view/application/index/index.phtml:22 +msgid "Help & Support" +msgstr "Aide & support" + +#: ../view/application/index/index.phtml:23 +#, php-format +msgid "If you need any help or support while developing with ZF2, you may reach us via IRC: %s#zftalk on Freenode%s. We'd love to hear any questions or feedback you may have regarding the beta releases. Alternatively, you may subscribe and post questions to the %smailing lists%s." +msgstr "Si vous avez besoin d'aide ou de support en développant avec ZF2, vous pouvez nous joindre sur IRC : %s#zftalk sur Freenode%s. Nous aimerions avoir vos questions ou vos commentaires que vous pourriez avoir au sujet des versions bêta. Sinon, vous pouvez vous abonner, et poser des questions sur la %sliste de diffusion%s." + +#: ../view/application/index/index.phtml:24 +msgid "Ping us on IRC" +msgstr "Rejoignez-nous sur IRC" + +#: ../view/error/index.phtml:1 +msgid "An error occurred" +msgstr "Une erreur est survenue" + +#: ../view/error/index.phtml:8 +msgid "Additional information" +msgstr "Informations complémentaires" + +#: ../view/error/index.phtml:11 +#: ../view/error/index.phtml:35 +msgid "File" +msgstr "Fichier" + +#: ../view/error/index.phtml:15 +#: ../view/error/index.phtml:39 +msgid "Message" +msgstr "Message" + +#: ../view/error/index.phtml:19 +#: ../view/error/index.phtml:43 +#: ../view/error/404.phtml:55 +msgid "Stack trace" +msgstr "Pile d'exécution" + +#: ../view/error/index.phtml:29 +msgid "Previous exceptions" +msgstr "Exceptions précédentes" + +#: ../view/error/index.phtml:58 +msgid "No Exception available" +msgstr "Aucune exception disponible" + +#: ../view/error/404.phtml:1 +msgid "A 404 error occurred" +msgstr "Une erreur 404 est survenue" + +#: ../view/error/404.phtml:10 +msgid "The requested controller was unable to dispatch the request." +msgstr "Le contrôleur demandé n'a pas pu dispatcher la requête." + +#: ../view/error/404.phtml:13 +msgid "The requested controller could not be mapped to an existing controller class." +msgstr "Le contrôleur demandé ne correspond pas à une classe existante de contrôleur." + +#: ../view/error/404.phtml:16 +msgid "The requested controller was not dispatchable." +msgstr "Le contrôleur demandé n'est pas dispatchable." + +#: ../view/error/404.phtml:19 +msgid "The requested URL could not be matched by routing." +msgstr "L'URL demandée n'a pas pu trouver de route correspondante." + +#: ../view/error/404.phtml:22 +msgid "We cannot determine at this time why a 404 was generated." +msgstr "Nous ne pouvons pas déterminer pour le moment pourquoi une 404 a été générée." + +#: ../view/error/404.phtml:34 +msgid "Controller" +msgstr "Contrôleur" + +#: ../view/error/404.phtml:41 +#, php-format +msgid "resolves to %s" +msgstr "résout en %s" + +#: ../view/error/404.phtml:51 +msgid "Exception" +msgstr "Exception" + diff --git a/module/Application/src/Application/Controller/IndexController.php b/module/Application/src/Application/Controller/IndexController.php new file mode 100755 index 0000000000000000000000000000000000000000..a1aafaeef50f31f18410f5800d6dffccae32872c --- /dev/null +++ b/module/Application/src/Application/Controller/IndexController.php @@ -0,0 +1,21 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Application\Controller; + +use Zend\Mvc\Controller\AbstractActionController; +use Zend\View\Model\ViewModel; + +class IndexController extends AbstractActionController +{ + public function indexAction() + { + return new ViewModel(); + } +} diff --git a/module/Application/view/application/index/index.phtml b/module/Application/view/application/index/index.phtml new file mode 100755 index 0000000000000000000000000000000000000000..3ead9214a3a0b434e494d370535910e5bfd59efb --- /dev/null +++ b/module/Application/view/application/index/index.phtml @@ -0,0 +1,25 @@ +<div class="hero-unit"> + <h1><?php echo sprintf($this->translate("Bienvenue dans le squelette d'application Unicaen")) ?></h1> + <p><?php echo sprintf($this->translate("Félicitations! Vous avez insallé avec succès le squelette d'application Unicaen propulsé par %sZend Framework 2%s. La version du framework utilisée est la %s."), '<a href="https://github.com/zendframework/ZendSkeletonApplication" target="_blank">', '</a>', \Zend\Version\Version::VERSION) ?></p> + <p><a class="btn btn-success btn-large" href="<?php echo $this->url('zfcuser/login') ?>"><?php echo $this->translate('Connectez-vous...') ?></a></p> +</div> + +<div class="row"> + <div class="span4"> + <h2><?php echo $this->translate('Follow Development') ?></h2> + <p><?php echo sprintf($this->translate('Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!'), '<a href="http://framework.zend.com/wiki/display/ZFDEV2/Home">', '</a>', '<a href="http://framework.zend.com/zf2/blog">', '</a>', '<a href="https://github.com/zendframework/zf2/issues">', '</a>') ?></p> + <p><a class="btn btn-success" href="http://framework.zend.com" target="_blank"><?php echo $this->translate('ZF2 Development Portal') ?> »</a></p> + </div> + + <div class="span4"> + <h2><?php echo $this->translate('Discover Modules') ?></h2> + <p><?php echo sprintf($this->translate('The community is working on developing a community site to serve as a repository and gallery for ZF2 modules. The project is available %son GitHub%s. The site is currently live and currently contains a list of some of the modules already available for ZF2.'), '<a href="https://github.com/zendframework/modules.zendframework.com">', '</a>') ?></p> + <p><a class="btn btn-success" href="http://modules.zendframework.com/" target="_blank"><?php echo $this->translate('Explore ZF2 Modules') ?> »</a></p> + </div> + + <div class="span4"> + <h2><?php echo $this->translate('Help & Support') ?></h2> + <p><?php echo sprintf($this->translate('If you need any help or support while developing with ZF2, you may reach us via IRC: %s#zftalk on Freenode%s. We\'d love to hear any questions or feedback you may have regarding the beta releases. Alternatively, you may subscribe and post questions to the %smailing lists%s.'), '<a href="irc://irc.freenode.net/zftalk">', '</a>', '<a href="http://framework.zend.com/wiki/display/ZFDEV/Mailing+Lists">', '</a>') ?></p> + <p><a class="btn btn-success" href="http://webchat.freenode.net?channels=zftalk" target="_blank"><?php echo $this->translate('Ping us on IRC') ?> »</a></p> + </div> +</div> diff --git a/public/.htaccess b/public/.htaccess new file mode 100755 index 0000000000000000000000000000000000000000..6422bfc3ea5ca505c9018387a91a9e0bacda2f17 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,17 @@ +RewriteEngine On +RewriteBase /unicaen-skeleton-application +# The following rule tells Apache that if the requested filename +# exists, simply serve it. +RewriteCond %{REQUEST_FILENAME} -s [OR] +RewriteCond %{REQUEST_FILENAME} -l [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^.*$ - [NC,L] +# The following rewrites all other queries to index.php. The +# condition ensures that if you are using Apache aliases to do +# mass virtual hosting, the base path will be prepended to +# allow proper resolution of the index.php file; it will work +# in non-aliased environments as well, providing a safe, one-size +# fits all solution. +RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$ +RewriteRule ^(.*) - [E=BASE:%1] +RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L] diff --git a/public/css/app.css b/public/css/app.css new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/index.php b/public/index.php new file mode 100755 index 0000000000000000000000000000000000000000..8bda67b3cd4568c5aa16a1059b26d725c6a09f57 --- /dev/null +++ b/public/index.php @@ -0,0 +1,13 @@ +<?php +define('REQUEST_MICROTIME', microtime(true)); +/** + * This makes our life easier when dealing with paths. Everything is relative + * to the application root now. + */ +chdir(dirname(__DIR__)); + +// Setup autoloading +require 'init_autoloader.php'; + +// Run the application! +Zend\Mvc\Application::init(require 'config/application.config.php')->run(); diff --git a/public/js/app.js b/public/js/app.js new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391