Exemple #1
0
 /**
  * @inheritdoc
  */
 public function initializeClasses(SymfonyRequest $symfonyRequest)
 {
     Utf8\Bootup::initAll();
     // Enables the portability layer and configures PHP for UTF-8
     Utf8\Bootup::filterRequestUri();
     // Redirects to an UTF-8 encoded URL if it's not already the case
     Utf8\Bootup::filterRequestInputs();
     // Normalizes HTTP inputs to UTF-8 NFC
     $file = $this->appPath->getCacheDir() . 'container.php';
     $this->dumpContainer($symfonyRequest, $file);
     require_once $file;
     $this->container = new \ACP3ServiceContainer();
     $this->container->set('core.environment.application_path', $this->appPath);
     $this->container->set('core.http.symfony_request', $symfonyRequest);
 }
Exemple #2
0
 /**
  * Application constructor.
  *
  * @param object $loader The autoloader instance.
  * @param array $config The custom configuration of the application.
  * @param string $appPath The application absolute path.
  * @param array $classesMap The custom classes map of the application.
  */
 public function __construct($loader, array $config = [], $appPath = null, array $classesMap = [])
 {
     # Utilities
     $this->utilities = new Utilities($this);
     # Register start time
     $this->utilities->registerStartTime();
     # Store application path
     $this->utilities->setApplicationPath($appPath);
     # Store classes map
     $this['class'] = $this->utilities->setClassesMap($classesMap);
     # Call container constructor
     parent::__construct($this->utilities->setConfiguration($config));
     # Register core services providers
     $this->register(new FilesystemServiceProvider());
     $this->register(new FinderServiceProvider());
     $this->register(new HttpServiceProvider());
     $this->register(new LoggerServiceProvider());
     $this->register(new MessagesServiceProvider());
     $this->register(new RouterServiceProvider());
     $this->register(new SupportServiceProvider());
     $this->register(new TemplatingServiceProvider());
     $this->register(new TriggersServiceProvider());
     # Enables the portablity layer and configures PHP for UTF-8
     Utf8Bootup::initAll();
     # Redirects to an UTF-8 encoded URL if it's not already the case
     Utf8Bootup::filterRequestUri();
     # Normalizes HTTP inputs to UTF-8 NFC
     Utf8Bootup::filterRequestInputs();
     # Print errors in debug mode
     if ($this['debug']) {
         $whoops = new WhoopsRun();
         $whoops->pushHandler(new WhoopsHandler());
         $whoops->register();
     } else {
         ErrorHandler::register($this['phpLogger']);
     }
     # Only enable Kint in debug mode
     \Kint::enabled($this['debug']);
 }
 * ----------------------------------------------------------------------------
 */
use Concrete\Core\Application\Application;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\File\Type\TypeList;
use Concrete\Core\Foundation\ClassAliasList;
use Concrete\Core\Foundation\Service\ProviderList;
use Concrete\Core\Permission\Key\Key as PermissionKey;
use Concrete\Core\Support\Facade\Facade;
use Patchwork\Utf8\Bootup as PatchworkUTF8;
/**
 * ----------------------------------------------------------------------------
 * Handle text encoding.
 * ----------------------------------------------------------------------------
 */
PatchworkUTF8::initAll();
/**
 * ----------------------------------------------------------------------------
 * Instantiate concrete5.
 * ----------------------------------------------------------------------------
 */
/** @var Application $cms */
$cms = (require DIR_APPLICATION . '/bootstrap/start.php');
$cms->instance('app', $cms);
// Bind fully application qualified class names
$cms->instance('Concrete\\Core\\Application\\Application', $cms);
$cms->instance('Illuminate\\Container\\Container', $cms);
/**
 * ----------------------------------------------------------------------------
 * Bind the IOC container to our facades
 * Completely indebted to Taylor Otwell & Laravel for this.
Exemple #4
0
// increase maximum execution time for php scripts
// (does not work in safe mode)
@set_time_limit(120);
// include composer autoloader (if available)
if (@file_exists(INSTALL_PATH . 'vendor/autoload.php')) {
    require INSTALL_PATH . 'vendor/autoload.php';
}
// include Roundcube Framework
require_once 'Roundcube/bootstrap.php';
// register autoloader for rcmail app classes
spl_autoload_register('rcmail_autoload');
// backward compatybility (to be removed)
require_once INSTALL_PATH . 'program/include/bc.php';
// load the UTF-8 portablity layer from Patchwor
if (!function_exists('iconv') || !function_exists('utf8_encode') || !extension_loaded('mbstring')) {
    \Patchwork\Utf8\Bootup::initAll();
}
/**
 * PHP5 autoloader routine for dynamic class loading
 */
function rcmail_autoload($classname)
{
    if (strpos($classname, 'rcmail') === 0) {
        $filepath = INSTALL_PATH . "program/include/{$classname}.php";
        if (is_readable($filepath)) {
            include_once $filepath;
            return true;
        }
    }
    return false;
}
 */
$list = new ProviderList($cms);
$list->registerProviders($config->get('app.providers'));
/**
 * ----------------------------------------------------------------------------
 * Setup file cache directories. Has to come after we define services
 * because we use the file service.
 * ----------------------------------------------------------------------------
 */
$cms->setupFilesystem();
/**
 * ----------------------------------------------------------------------------
 * Handle text encoding.
 * ----------------------------------------------------------------------------
 */
Bootup::initAll();
/**
 * ----------------------------------------------------------------------------
 * Registries for theme paths, assets, routes and file types.
 * ----------------------------------------------------------------------------
 */
$asset_list = AssetList::getInstance();
$asset_list->registerMultiple($config->get('app.assets', array()));
$asset_list->registerGroupMultiple($config->get('app.asset_groups', array()));
Route::registerMultiple($config->get('app.routes'));
Route::setThemesByRoutes($config->get('app.theme_paths', array()));
$type_list = TypeList::getInstance();
$type_list->defineMultiple($config->get('app.file_types', array()));
$type_list->defineImporterAttributeMultiple($config->get('app.importer_attributes', array()));
/**
 * ----------------------------------------------------------------------------
 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     Bootup::initAll();
     $this->container->addScope(new Scope(self::SCOPE_BACKEND, 'request'));
     $this->container->addScope(new Scope(self::SCOPE_FRONTEND, 'request'));
 }
 /**
  * {@inheritdoc}
  */
 public function boot()
 {
     Bootup::initAll();
 }