commit 9b818dd54f586e04fc9533a095518f5ffd562790 Author: Thomas Metois Date: Tue Apr 12 14:39:18 2016 +0200 Init commit > skeleton Monarc Project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d680ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +nbproject +._* +.~lock.* +.buildpath +.DS_Store +.idea +.project +.settings +composer.lock +vendor/bin +migrations +*.sublime-* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..040b52e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/ZF2"] + path = vendor/ZF2 + url = https://github.com/zendframework/zf2.git diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..5ad81e9 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2005-2014, 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 100644 index 0000000..6033fd9 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +Skeleton Monarc Project +======================= + +Introduction +------------ +Skeleton Monarc Project. + +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 -sdev --repository-url="https://rhea.netlor.fr:3000/CASES/skeleton.git" monarc/skeleton-application path/to/install + +Alternately, clone the repository and manually invoke `composer` using the shipped +`composer.phar`: + + cd my/project/dir + git clone ssh://gogs@rhea.netlor.fr:2222/CASES/skeleton.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.) + +Web Server Setup +---------------- + +### PHP CLI Server + +The simplest way to get started if you are using PHP 5.4 or above is to start the internal PHP cli-server in the root directory: + + php -S 0.0.0.0:8080 -t public/ public/index.php + +This will start the cli-server on port 8080, and bind it to all network +interfaces. + +**Note: ** The built-in CLI server is *for development only*. + +### Apache Setup + +To setup apache, setup a virtual host to point to the public/ directory of the +project and you should be ready to go! It should look something like below: + + + ServerName monarc.localhost + DocumentRoot /path/to/monarc/public + SetEnv APPLICATION_ENV "development" + + DirectoryIndex index.php + AllowOverride All + Order allow,deny + Allow from all + + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2a579d7 --- /dev/null +++ b/composer.json @@ -0,0 +1,28 @@ +{ + "name": "monarc/skeleton", + "description": "Skeleton for Monarc project", + + "homepage": "http://framework.zend.com/", + "require": { + "php": ">=5.5", + "monarc/core": "dev-master" + }, + "repositories":[ + { + "type": "package", + "package": { + "name": "monarc/core", + "version": "dev-master", + "dist": { + "url": "https://rhea.netlor.fr/CASES/zm_common/archive/master.zip", + "type": "zip" + }, + "source": { + "url": "https://rhea.netlor.fr:3000/CASES/zm_common.git", + "type": "git", + "reference": "dev-master" + } + } + } + ] +} diff --git a/composer.phar b/composer.phar new file mode 100755 index 0000000..7e548b6 Binary files /dev/null and b/composer.phar differ diff --git a/config/application.config.php b/config/application.config.php new file mode 100644 index 0000000..204b059 --- /dev/null +++ b/config/application.config.php @@ -0,0 +1,23 @@ + array( + 'DoctrineModule', + 'DoctrineORMModule', + 'MonarcCore', + ), + 'module_listener_options' => array( + 'module_paths' => array( + './module', + './vendor' + ), + 'config_glob_paths' => array( + 'config/autoload/{,*.}{global,local}.php' + ) + ), +); diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore new file mode 100644 index 0000000..1a83fda --- /dev/null +++ b/config/autoload/.gitignore @@ -0,0 +1,2 @@ +local.php +*.local.php diff --git a/config/autoload/README.md b/config/autoload/README.md new file mode 100644 index 0000000..4e504db --- /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 100644 index 0000000..eed30ce --- /dev/null +++ b/config/autoload/global.php @@ -0,0 +1,40 @@ + array( + 'connection' => array( + 'orm_default' => array( + 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'params' => array( + 'host' => 'localhost', + 'port' => 3306, + 'user' => 'user', + 'password' => 'password', + 'dbname' => 'monarc', + 'charset' => 'utf8', + 'driverOptions' => array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ), + ), + ), + ), + 'migrations_configuration' => array( + 'orm_default' => array( + 'name' => 'Monarc Migrations', + 'directory' => __DIR__."/../../migrations", + 'namespace' => 'Monarc\Migrations', + 'table_name' => 'doctrine_migrations', + ), + ), + ), +); diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist new file mode 100644 index 0000000..78145f3 --- /dev/null +++ b/config/autoload/local.php.dist @@ -0,0 +1,15 @@ +add('Zend', $zf2Path); + $loader->add('ZendXml', $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/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..de2cf3f --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,16 @@ +RewriteEngine On +# 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/index.php b/public/index.php new file mode 100644 index 0000000..4f62596 --- /dev/null +++ b/public/index.php @@ -0,0 +1,17 @@ +run();