Init commit > skeleton Monarc Project

remotes/origin/master
Thomas Metois 2016-04-12 14:39:18 +02:00
commit 9b818dd54f
15 changed files with 307 additions and 0 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
nbproject
._*
.~lock.*
.buildpath
.DS_Store
.idea
.project
.settings
composer.lock
vendor/bin
migrations
*.sublime-*

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "vendor/ZF2"]
path = vendor/ZF2
url = https://github.com/zendframework/zf2.git

27
LICENSE.txt Normal file
View File

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

60
README.md Normal file
View File

@ -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:
<VirtualHost *:80>
ServerName monarc.localhost
DocumentRoot /path/to/monarc/public
SetEnv APPLICATION_ENV "development"
<Directory /path/to/monarc/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

28
composer.json Normal file
View File

@ -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"
}
}
}
]
}

BIN
composer.phar Executable file

Binary file not shown.

View File

@ -0,0 +1,23 @@
<?php
/**
* Configuration file generated by ZFTool
* The previous configuration file is stored in application.config.old
*
* @see https://github.com/zendframework/ZFTool
*/
return array(
'modules' => array(
'DoctrineModule',
'DoctrineORMModule',
'MonarcCore',
),
'module_listener_options' => array(
'module_paths' => array(
'./module',
'./vendor'
),
'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php'
)
),
);

2
config/autoload/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
local.php
*.local.php

View File

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

View File

@ -0,0 +1,40 @@
<?php
/**
* Global Configuration Override
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
return array(
'doctrine' => 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',
),
),
),
);

View File

@ -0,0 +1,15 @@
<?php
/**
* Local Configuration Override
*
* This configuration override file is for overriding environment-specific and
* security-sensitive configuration information. Copy this file without the
* .dist extension at the end and populate values as needed.
*
* @NOTE: This file is ignored from Git by default with the .gitignore included
* in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
* credentials from accidentally being committed into version control.
*/
return array(
);

2
data/cache/.gitignore vendored Executable file
View File

@ -0,0 +1,2 @@
*
!.gitignore

54
init_autoloader.php Normal file
View File

@ -0,0 +1,54 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 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';
}
if (class_exists('Zend\Loader\AutoloaderFactory')) {
return;
}
$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);
$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.');
}

16
public/.htaccess Normal file
View File

@ -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]

17
public/index.php Normal file
View File

@ -0,0 +1,17 @@
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();