/** * Register application namespaces * @return void */ public static function registerNamespaces() { $classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader(); $classLoader->registerNamespaces(array('Gedmo' => ROOT_PATH . '/vendor/doctrine-extension/lib', 'Symfony' => ROOT_PATH . '/vendor/symfony/src', 'Statme' => ROOT_PATH . '/src', 'Doctrine\\Common' => ROOT_PATH . '/vendor/doctrine-common/lib', 'Doctrine\\DBAL' => ROOT_PATH . '/vendor/doctrine-dbal/lib', 'Doctrine' => ROOT_PATH . '/vendor/doctrine-orm/lib')); $classLoader->register(); return; }
private function autoloadTestsAndApplication() { // Use Symfony component to sort out PSR-0 compatible autoloading $loader = new \Symfony\Component\ClassLoader\UniversalClassLoader(); $loader->registerNamespace('Awin', __DIR__ . '/../../src'); $loader->registerNamespace('AwinTest', __DIR__); $loader->register(); }
/** * @see sfPluginConfiguration */ public function initialize() { // Include the Altumo loader. //require_once( dirname(__FILE__) . '/../lib/vendor/altumo/source/php/loader.php' ); //set default timezone date_default_timezone_set('America/Los_Angeles'); //symfony 2 autoloader (for classes with namespaces only) $altumo_php_source_path = __DIR__ . '/../lib/vendor/altumo/source/php'; require_once $altumo_php_source_path . '/Utils/UniversalClassLoader.php'; $loader = new Symfony\Component\ClassLoader\UniversalClassLoader(); $loader->registerNamespaces(array('sfAltumoPlugin' => __DIR__ . '/../lib', 'Altumo' => $altumo_php_source_path)); $loader->register(); // Add altumo paths to sfConfig sfConfig::set('altumo_plugin_dir', realpath(dirname(__FILE__) . '/../')); sfConfig::set('altumo_javascript_lib_dir', sfConfig::get('altumo_plugin_dir') . '/lib/vendor/altumo/lib/javascript'); sfConfig::set('altumo_javascript_src_dir', sfConfig::get('altumo_plugin_dir') . '/lib/vendor/altumo/source/javascript'); /** * If the AWS module is enabled, set credentials for sdk * * To enable, add a section to settings.yml, like so: * sfAltumoPlugin: * aws: * enable: true * key: "MY_AWS_KE_HERE" * secret: "MY_AWS_SECRET_HERE" */ $aws_configuration = sfConfig::get('sf_sfAltumoPlugin_aws', array('enable' => false)); if ($aws_configuration['enable']) { CFCredentials::set(array('default' => array('key' => $aws_configuration['key'], 'secret' => $aws_configuration['secret'], 'default_cache_config' => '', 'certificate_authority' => false), '@default' => 'default')); } // Add altumo Api Settings (Add this in your api app's config) //sfConfig::set( 'altumo_api_session_cookie_name', 'api_session' ); /** * Execute any commands that the plugin needs when the framework loads, but * before an action is executed. * * Note: this is here because it was used before to load JS and CSS, but * that was relocated to Frontend\Controller */ /* $this->dispatcher->connect( 'context.load_factories', function(){ // this code gets execute when the framework loads. } ); */ }
<?php require_once 'vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php'; if (!defined('MOJIO_FILE_PREFIX')) { define('MOJIO_FILE_PREFIX', 'phar://mojio.phar'); } Phar::mapPhar('mojio.phar'); $classLoader = new Symfony\Component\ClassLoader\UniversalClassLoader(); $classLoader->registerNamespaces(array('Mojio' => MOJIO_FILE_PREFIX . '/src', 'Guzzle' => MOJIO_FILE_PREFIX . '/vendor/guzzle/guzzle/src', 'Symfony\\Component\\EventDispatcher' => MOJIO_FILE_PREFIX . '/vendor/symfony/event-dispatcher', 'Doctrine' => MOJIO_FILE_PREFIX . '/vendor/doctrine/common/lib', 'Monolog' => MOJIO_FILE_PREFIX . '/vendor/monolog/monolog/src')); $classLoader->register(); __halt_compiler();
$known_loader->registerNamespace('Themes', array(dirname(dirname(__FILE__)), dirname(dirname(__FILE__)) . '/hosts/' . $host)); } // Shims include 'shims.php'; // Register our external namespaces (PSR-0 compliant modules that we love, trust and need) // Bonita is being used for templating $known_loader->registerNamespace('Bonita', dirname(dirname(__FILE__)) . '/external/bonita/includes'); // Symfony is used for routing, observer design pattern support, and a bunch of other fun stuff $known_loader->registerNamespace('Symfony\\Component', dirname(dirname(__FILE__)) . '/external'); // Using Toro for URL routing require_once dirname(dirname(__FILE__)) . '/external/torophp/src/Toro.php'; // Using mf2 for microformats parsing, and webignition components to support it $known_loader->registerNamespace('webignition\\Url', dirname(dirname(__FILE__)) . '/external/webignition/url/src'); $known_loader->registerNamespace('webignition\\AbsoluteUrlDeriver', dirname(dirname(__FILE__)) . '/external/webignition/absolute-url-deriver/src'); $known_loader->registerNamespace('webignition\\NormalisedUrl', dirname(dirname(__FILE__)) . '/external/webignition/url/src'); $known_loader->registerNamespace('Mf2', dirname(dirname(__FILE__)) . '/external/mf2'); // Using Simplepie for RSS and Atom parsing include dirname(dirname(__FILE__)) . '/external/simplepie/autoloader.php'; // Using HTMLPurifier for HTML sanitization include dirname(dirname(__FILE__)) . '/external/htmlpurifier-lite/library/HTMLPurifier.auto.php'; // Register the autoloader $known_loader->register(); // Register the idno-templates folder as the place to look for templates in Bonita \Bonita\Main::additionalPath(dirname(dirname(__FILE__))); // Init main system classes $idno = new Idno\Core\Idno(); $account = new Idno\Core\Account(); $admin = new Idno\Core\Admin(); $webfinger = new Idno\Core\Webfinger(); $webmention = new Idno\Core\Webmention(); $pubsubhubbub = new Idno\Core\PubSubHubbub();
<?php require_once $_SERVER['SYMFONY'] . '/Symfony/Component/ClassLoader/UniversalClassLoader.php'; $loader = new Symfony\Component\ClassLoader\UniversalClassLoader(); $loader->registerNamespace('Symfony', $_SERVER['SYMFONY']); $loader->registerNamespace('Assetic', $_SERVER['ASSETIC']); $loader->registerPrefix('Twig_', $_SERVER['TWIG']); $loader->register(); spl_autoload_register(function ($class) { if (0 === strpos($class, 'Symfony\\Bundle\\AsseticBundle\\') && file_exists($file = __DIR__ . '/../' . implode('/', array_slice(explode('\\', $class), 3)) . '.php')) { require_once $file; } });
<?php /** * Copyright Zikula Foundation 2009 - Zikula Application Framework * * This work is contributed to the Zikula Foundation under one or more * Contributor Agreements and licensed to You under the following license: * * @license GNU/LGPLv3 (or at your option, any later version). * @package Zikula * * Please see the NOTICE file distributed with this source code for further * information regarding copyright and licensing. */ if (!defined('HTMLPURIFIER_PREFIX')) { define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/vendor/htmlpurifier')); } if (!defined('PHPIDS_PATH_PREFIX')) { define('PHPIDS_PATH_PREFIX', realpath(dirname(__FILE__) . '/vendor/IDS')); } // include the PHPIDS and get access to the result object set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/vendor')); $autoloader = new Symfony\Component\ClassLoader\UniversalClassLoader(); $autoloader->register(); $autoloader->registerPrefixes(array('HTMLPurifier' => realpath(dirname(__FILE__) . '/vendor/htmlpurifier'), 'IDS' => realpath(dirname(__FILE__) . '/vendor'))); // register event handlers EventUtil::attachEventHandler('SecurityCenterModule\\Listener\\FilterListener');