public function index5Action() { $autoloader = new \Zend\Loader\ClassMapAutoloader(array(LIBRARY_PATH . '/../../../Autoloader/Autoloader.php', LIBRARY_PATH . '/../../../Autoloader/classmap.php')); $autoloader->register(); $student = new \Database\Student(); $teacher = new \Database\Teacher(); $worker = new \Database\Oracle\Worker(); $upload = new \File\Abc\Upload(); return false; }
public function index05Action() { echo "<h3 style='color:red;font-weight:bold'>" . __METHOD__ . "</h3>"; $autoLoader = new \Zend\Loader\ClassMapAutoloader(array(LIB_PATH . "/ClassMap/AutoLoader.php", LIB_PATH . "/AutoLoader2.php")); $autoLoader->register(); $student = new \Database\Student(); $teacher = new \Database\Teacher(); $people = new \Database\basetada\People(); $sontung_m = new \Art\Singer(); $sender = new \Mail_Sender(); return false; }
<?php require_once __DIR__ . '/../library/Zend/Loader/ClassMapAutoloader.php'; $loader = new Zend\Loader\ClassMapAutoloader(); $loader->registerAutoloadMap(__DIR__ . '/../library/Zend/.classmap.php'); $loader->register(); if (!class_exists('Zend\\Controller\\Action')) { echo "Could not find action class!\n"; } else { echo "Found action class!\n"; } if (!class_exists('Zend\\Version')) { echo "Could not find version class!\n"; } else { echo "Found version class!\n"; }
// No errors for missing classes due to implementation if (file_exists("{$dir}{$item}.class.php")) { include_once "{$dir}{$item}.class.php"; if (isset($_SESSION['glpi_use_mode']) && $_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { $DEBUG_AUTOLOAD[] = $classname; } } else { if (!isset($notfound["x{$classname}"])) { // trigger an error to get a backtrace, but only once (use prefix 'x' to handle empty case) // trigger_error("GLPI autoload : file $dir$item.class.php not founded trying to load class '$classname'"); $notfound["x{$classname}"] = true; } } } require_once GLPI_ROOT . '/lib/Zend/Loader/ClassMapAutoloader.php'; $loader = new Zend\Loader\ClassMapAutoloader(); // Register the class map: $loader->registerAutoloadMap(GLPI_ROOT . '/lib/Zend/autoload_classmap.php'); // Register with spl_autoload: $loader->register(); // SimplePie autoloader spl_autoload_register(array(new SimplePie_Autoloader(), 'autoload')); // Use spl autoload to allow stackable autoload. spl_autoload_register('glpi_autoload'); /** * Autoloader class * * @since version 0.84 * * @package SimplePie **/
* @package ModelTest * @author Eugene Myazin <*****@*****.**> * @copyright 2008-20013 Eugene Myazin <*****@*****.**> * @license https://github.com/meniam/model/blob/master/MIT-LICENSE.txt MIT License */ // Drop system include path set_include_path(''); require_once __DIR__ . '/vendor/autoload.php'; if (!is_file(__DIR__ . '/config/config.php')) { die("Config not found; copy config/config.sample.php config/config.php"); } require_once __DIR__ . '/config/config.php'; /** * Setup autoloading */ $loader = new \Zend\Loader\StandardAutoloader(array('autoregister_zf' => true, Zend\Loader\StandardAutoloader::LOAD_NS => array('Model' => __DIR__ . '/../library/Model', 'ModelTest' => __DIR__ . '/ModelTest'))); $loader->register(); if (is_file(GENERATE_OUTPUT . '/_autoload_classmap.php')) { $a = (require GENERATE_OUTPUT . '/_autoload_classmap.php'); $loader = new \Zend\Loader\ClassMapAutoloader(array($a)); $loader->register(); } if (defined('CACHE_DIR') && CACHE_DIR) { /** @var Zend\Cache\Storage\Adapter\Filesystem $cache */ $cache = \Zend\Cache\StorageFactory::factory(array('adapter' => array('name' => 'filesystem', 'options' => array('cache_dir' => __DIR__ . '/cache'), 'dir_level' => 3, 'dir_permission' => 0777, 'file_permission' => 0666, 'no_atime' => true))); $plugin = new \Zend\Cache\Storage\Plugin\Serializer(); $cache->addPlugin($plugin); \Model\Cluster\Schema::setCacheAdapter($cache); } $db = new Model\Db\Mysql('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=UTF8', DB_USER, DB_PASSWORD); ModelTest\TestCase::setDb($db);