Пример #1
0
<?php

/**
 * @license   http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
 * @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
 */
/**
 * 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;
}
if (!file_exists('vendor/autoload.php')) {
    throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
}
// Setup autoloading
include 'vendor/autoload.php';
if (!defined('APPLICATION_PATH')) {
    define('APPLICATION_PATH', realpath(__DIR__ . '/../'));
}
$appConfig = (include APPLICATION_PATH . '/config/application.config.php');
if (file_exists(APPLICATION_PATH . '/config/development.config.php')) {
    $appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, include APPLICATION_PATH . '/config/development.config.php');
}
// Run the application!
Zend\Mvc\Application::init($appConfig)->run();
Пример #2
0
<?php

/**
 * ITEA Office copyright message placeholder
 *
 * @category    Organisation
 * @package     Config
 * @author      Johan van der Heide <*****@*****.**>
 * @copyright   Copyright (c) 2004-2015 ITEA Office (https://itea3.org)
 */
use Organisation\Acl;
use Organisation\Controller;
use Organisation\Factory;
use Organisation\Form\View\Helper\OrganisationFormElement;
use Organisation\Options;
use Organisation\Service;
use Organisation\View\Helper;
$config = ['controllers' => ['invokables' => [], 'abstract_factories' => [Controller\Factory\ControllerInvokableAbstractFactory::class]], 'view_manager' => ['template_map' => include __DIR__ . '/../template_map.php'], 'view_helpers' => ['invokables' => ['organisationformelement' => OrganisationFormElement::class, 'createLogoFromArray' => Helper\CreateLogoFromArray::class, 'createOrganisationFromArray' => Helper\CreateOrganisationFromArray::class, 'organisationHandler' => Helper\OrganisationHandler::class, 'organisationServiceProxy' => Helper\OrganisationServiceProxy::class, 'organisationLink' => Helper\OrganisationLink::class, 'organisationLogo' => Helper\OrganisationLogo::class]], 'service_manager' => ['factories' => [Options\ModuleOptions::class => Factory\ModuleOptionsFactory::class, Service\OrganisationService::class => Factory\OrganisationServiceFactory::class, Service\FormService::class => Factory\FormServiceFactory::class], 'abstract_factories' => [Acl\Factory\AssertionInvokableAbstractFactory::class], 'invokables' => ['organisation_organisation_form_filter' => 'Organisation\\Form\\FilterOrganisation', 'organisation_financial_form_filter' => 'Organisation\\Form\\FilterOrganisation']], 'doctrine' => ['driver' => ['organisation_annotation_driver' => ['class' => 'Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver', 'paths' => [__DIR__ . '/../src/Organisation/Entity/']], 'orm_default' => ['drivers' => ['Organisation\\Entity' => 'organisation_annotation_driver']]], 'eventmanager' => ['orm_default' => ['subscribers' => ['Gedmo\\Timestampable\\TimestampableListener', 'Gedmo\\Sluggable\\SluggableListener']]]]];
$configFiles = [__DIR__ . '/module.config.routes.php', __DIR__ . '/module.config.navigation.php', __DIR__ . '/module.config.authorize.php', __DIR__ . '/module.option.organisation.php'];
foreach ($configFiles as $configFile) {
    $config = Zend\Stdlib\ArrayUtils::merge($config, include $configFile);
}
return $config;
Пример #3
0
<?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 'vendor/autoload.php';
$appConfig = (require 'config/application.config.php');
if (file_exists('config/development.config.php')) {
    $appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, require 'config/development.config.php');
}
// Run the application!
Zend\Mvc\Application::init($appConfig)->run();
Пример #4
0
$dir = __DIR__;
//-------------------------------------------------------------------------------------
// php configuration
//-------------------------------------------------------------------------------------
date_default_timezone_set('UTC');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', (int) ($env === 'development'));
//-------------------------------------------------------------------------------------
// include the config based on the environment
//-------------------------------------------------------------------------------------
$config1 = (require_once __DIR__ . '/config/production.php');
$config2 = $env !== 'production' ? require_once sprintf('%s/config/%s.php', __DIR__, $env) : [];
$config3 = sprintf('%s/module/%s/config/%s.php', __DIR__, $mod, $env);
$config = Zend\Stdlib\ArrayUtils::merge($config1, $config2);
if (file_exists($config3)) {
    $config = Zend\Stdlib\ArrayUtils::merge($config, require_once $config3);
}
//-------------------------------------------------------------------------------------
// creating the application instance
//-------------------------------------------------------------------------------------
$app = new \Oito\Micro\Application($config);
//-------------------------------------------------------------------------------------
// storing root directory for future usage
//-------------------------------------------------------------------------------------
$app['dir.root'] = $dir;
$app['app.env'] = $env;
$app['app.module'] = $mod;
//-------------------------------------------------------------------------------------
// Including other necessary files
//-------------------------------------------------------------------------------------
require_once sprintf('%s/module/%s/events.php', __DIR__, $app['app.module']);