/** * autoload * - module 裡面所需載入的程式 */ public function autoloader() { $basePath = $this->get('basePath'); $loader = new Composer\Autoload\ClassLoader(); $loader->addPsr4('AppModule\\', "{$basePath}/app/homePackage/app/"); $loader->addPsr4('CommandModule\\', "{$basePath}/app/homePackage/command/"); $filesMap = $this->findFoldersFiles(["{$basePath}/app/homePackage/app/components", "{$basePath}/app/homePackage/command/components"]); $loader->addClassMap($filesMap); $loader->register(); }
/** * Registers the namespace for each extension directory with the autoloader. * * @param Composer\Autoload\ClassLoader $loader * The supplied autoloader. * @param array $dirs * An associative array of extension directories, keyed by extension name. */ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $loader, $dirs) { foreach ($dirs as $extension => $dir) { if (is_dir($dir . '/src')) { // Register the PSR-4 directory for module-provided classes. $loader->addPsr4('Drupal\\' . $extension . '\\', $dir . '/src'); } if (is_dir($dir . '/tests/src')) { // Register the PSR-4 directory for PHPUnit test classes. $loader->addPsr4('Drupal\\' . $extension . '\\Tests\\', $dir . '/tests/src'); } } }
function __construct($config = []) { $this->config = array_merge(require_once __DIR__ . '/Config.php', $config); if (!defined('ROOT')) { define('ROOT', dirname(debug_backtrace()[0]['file'])); } $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('app\\', ROOT); }
public function loader() { $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4($this->name(), array(avail::$dir->root), true); // $loader->loadClass(\App\Private\Configuration); $loader->register(true); // $loader->setUseIncludePath(true); // return $loader; // print_r($loader); }
public static function getLoader() { if (null !== self::$loader) { return self::$loader; } spl_autoload_register(array('ComposerAutoloaderInitWrapper', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitWrapper', 'loadClassLoader')); $loader->addPsr4('', __DIR__); $loader->register(true); return $loader; }
/** * @param array $aOptions * @return int The exit status code. */ public static function go(array $aOptions = []) { $exitCode = 1; try { //register the composer autoloader require_once $aOptions['projectPackageFilePath'] . '/vendor/autoload.php'; $autoloader = new \Composer\Autoload\ClassLoader(); $autoloader->addPsr4('App\\', realpath($aOptions['appPackageFilePath'] . '/App')); $autoloader->register(); //boot the environment \App\Environment::init(['projectPackageFilePath' => $aOptions['projectPackageFilePath'], 'appPackageFilePath' => $aOptions['appPackageFilePath']]); //boot the controller $exitCode = \App\Controller::bootstrap(); } catch (Throwable $e) { error_log($e); } return $exitCode; }
themosis_set_paths($paths); /* * Register all paths into the service container. */ $theme->registerAllPaths(themosis_path()); /* * Load theme configuration files. */ $theme['config.finder']->addPaths([themosis_path('theme.resources') . 'config' . DS]); /* * Autoloading. */ $loader = new \Composer\Autoload\ClassLoader(); $classes = \Themosis\Facades\Config::get('loading'); foreach ($classes as $prefix => $path) { $loader->addPsr4($prefix, $path); } $loader->register(); /* * Register theme views folder path. */ $theme['view.finder']->addLocation(themosis_path('theme.resources') . 'views'); /* * Register theme public assets folder [dist directory]. */ $theme['asset.finder']->addPaths([themosis_theme_assets() => themosis_path('theme') . 'dist']); /* * Theme constants. */ $constants = new Themosis\Config\Constant($theme['config']->get('constants')); $constants->make();
<?php /** * Created by PhpStorm. * User: nms * Date: 31.05.16 * Time: 19:40 */ include_once __DIR__ . '/../vendor/autoload.php'; $classLoader = new \Composer\Autoload\ClassLoader(); $classLoader->addPsr4("React\\PublisherPulsar\\", __DIR__ . '/../src/'); $classLoader->register();
<?php if (defined('VENDOR_DIRECTORY')) { return; } ini_set("session.use_cookies", 0); ini_set("session.cache_limiter", ''); if (file_exists(__DIR__ . '/../vendor/')) { define('VENDOR_DIRECTORY', __DIR__ . '/../vendor/'); } elseif (file_exists(__DIR__ . '/../../../../vendor/')) { define('VENDOR_DIRECTORY', __DIR__ . '/../../../../vendor/'); } else { die('vendor directory not found'); } /** @noinspection PhpIncludeInspection */ require_once VENDOR_DIRECTORY . 'autoload.php'; $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('tests\\', __DIR__); $loader->register();
<?php include_once __DIR__ . '/../vendor/autoload.php'; $classLoader = new \Composer\Autoload\ClassLoader(); $classLoader->addPsr4("TheSportsDb\\Test\\", __DIR__ . DIRECTORY_SEPARATOR . 'src'); $classLoader->register();
<?php $autoloadFile = __DIR__ . '/../vendor/autoload.php'; if (!file_exists($autoloadFile)) { throw new RuntimeException('Install dependencies to run phpunit.'); } require_once $autoloadFile; $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('Acquia\\Hmac\\Test\\', 'test'); $loader->register();
<?php require __DIR__ . '/../vendor/autoload.php'; $loader = new Composer\Autoload\ClassLoader(); $loader->addPsr4('CodePress\\CodeTag\\', __DIR__ . '/../../codetag/src/CodeTag/'); $loader->register();
<?php require_once __DIR__ . '/../vendor/autoload.php'; $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('Prsr\\', __DIR__); $loader->register();
<?php $autoloadFile = __DIR__ . '/../vendor/autoload.php'; if (!file_exists($autoloadFile)) { throw new RuntimeException('Install dependencies to run phpunit.'); } require_once $autoloadFile; $loader = new \Composer\Autoload\ClassLoader(); $loader->addPsr4('Cpliakas\\DynamoDb\\ODM\\Test\\', 'test/'); $loader->register();
<?php require __DIR__ . '/../vendor/autoload.php'; $loader = new Composer\Autoload\ClassLoader(); $loader->addPsr4('CodePress\\CodePost\\', __DIR__ . '/../../codepost/src/CodePost/'); $loader->register();