/** * Plant the seed of life into Kisma! * * @param array $options * * @return bool */ public static function conceive($options = array()) { // Set any passed in options... if (is_callable($options)) { $options = call_user_func($options); } // Set any application-level options passed in static::$_options = Option::merge(static::$_options, $options); // Register our faux-destructor if (false === ($_conceived = static::get(CoreSettings::CONCEPTION))) { \register_shutdown_function(function ($eventName = KismaEvents::DEATH) { \Kisma::__sleep(); EventManager::trigger($eventName); }); // Try and detect the framework being used... Detector::framework(); // We done baby! static::set(CoreSettings::CONCEPTION, true); if (null === static::get(CoreSettings::AUTO_LOADER) && class_exists('\\ComposerAutoloaderInit', false)) { static::set(CoreSettings::AUTO_LOADER, \ComposerAutoloaderInit::getLoader()); } // And let the world know we're alive EventManager::trigger(KismaEvents::BIRTH); } // Load any session data... static::__wakeup(); return $_conceived; }
<?php if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } define('APP_SRC', dirname(__FILE__)); $root = dirname(dirname(__FILE__)); $lib = $root . DS . 'lib'; //require composer autoloader require_once $lib . DS . 'autoload.php'; //get composer loader that already has vendors loaded $loader = ComposerAutoloaderInit::getLoader(); //load application namespaces $namespaces = array_fill_keys(['Domain', 'Infrastructure', 'Test', 'Presentation'], APP_SRC); foreach ($namespaces as $namespace => $path) { $loader->add($namespace, $path); } $classes = ['TwigView' => $lib . DS . '/slim/extras/Views/TwigView.php', 'Slim_View' => $lib . DS . '/slim/slim/Slim/View.php', 'Slim_Http_Request' => $lib . DS . '/slim/slim/Slim/Http/Request.php']; $map = []; foreach ($classes as $class => $path) { if (file_exists($path)) { $map[$class] = $path; } } $loader->addClassMap($map);
<?php /* * Copyright 2004-2015, AfterLogic Corp. * Licensed under AGPLv3 license or AfterLogic license * if commercial version of the product was purchased. * See the LICENSE file for a full license statement. */ // autoload.php generated by Composer require_once __DIR__ . '/composer' . '/autoload_real.php'; return ComposerAutoloaderInit::getLoader();