当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Application::getAutoloader方法代码示例

本文整理汇总了PHP中Zend_Application::getAutoloader方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Application::getAutoloader方法的具体用法?PHP Zend_Application::getAutoloader怎么用?PHP Zend_Application::getAutoloader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Application的用法示例。


在下文中一共展示了Zend_Application::getAutoloader方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: app

 /**
  * Setup application
  *
  * @param  mixed $appPath Path to application root
  * @param  array $options Options to setup application
  * @access public
  * @return Zend_Application Application
  */
 public static function app($appPath, array $options = array())
 {
     defined('GENE_APP_PATH') || define('GENE_APP_PATH', $appPath);
     defined('GENE_LIB_PATH') || define('GENE_LIB_PATH', dirname(__FILE__));
     self::$_appPath = GENE_APP_PATH;
     if (!isset($options['ini'])) {
         $options['ini'] = rtrim(GENE_APP_PATH, '\\/') . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.ini';
     }
     if (!isset($options['env'])) {
         $options['env'] = 'production';
     }
     self::$_env = $options['env'];
     require_once 'Zend/Application.php';
     $app = new Zend_Application($options['env'], $options['ini']);
     $autoloader = $app->getAutoloader();
     $autoloader->setFallbackAutoloader(true)->suppressNotFoundWarnings(false);
     $app->getBootstrap()->setAppPath($appPath);
     if (isset($options['config'])) {
         $app->setConfigPath($options['config']);
     }
     $resources = null;
     if (isset($options['resources'])) {
         $resources = $options['resources'];
     }
     $bootstrap = $app->getBootstrap()->bootstrap($resources);
     $params = $bootstrap->getParams();
     self::$_params = $params;
     return $app;
 }
开发者ID:heavenshell,项目名称:gene,代码行数:37,代码来源:Base.php

示例2: testPassingZfVersionAutoloaderInformationConfiguresAutoloader

 public function testPassingZfVersionAutoloaderInformationConfiguresAutoloader()
 {
     if (!constant('TESTS_ZEND_LOADER_AUTOLOADER_MULTIVERSION_ENABLED')) {
         $this->markTestSkipped();
     }
     if (!constant('TESTS_ZEND_LOADER_AUTOLOADER_MULTIVERSION_LATEST')) {
         $this->markTestSkipped();
     }
     $path = constant('TESTS_ZEND_LOADER_AUTOLOADER_MULTIVERSION_PATH');
     $latest = constant('TESTS_ZEND_LOADER_AUTOLOADER_MULTIVERSION_LATEST');
     $application = new Zend_Application('production', array('autoloaderZfPath' => $path, 'autoloaderZfVersion' => 'latest'));
     $autoloader = $application->getAutoloader();
     $actual = $autoloader->getZfPath();
     $this->assertContains($latest, $actual);
 }
开发者ID:nbcutech,项目名称:o3drupal,代码行数:15,代码来源:ApplicationTest.php

示例3: catch

// We load main application configuration file, all sections (null) and we allow to further modify configuration values (true)
try {
	$config = new Zend_Config_Ini(APPLICATION_PATH . DS . 'configs' . DS . 'application.ini', null, true);
	$config->merge(new Zend_Config_Ini(APPLICATION_PATH . DS . 'configs' . DS . 'routing.ini'));
	if (is_file(APPLICATION_PATH . DS . 'configs' . DS . 'custom.ini')) {
		$config->merge(new Zend_Config_Ini(APPLICATION_PATH . DS . 'configs' . DS . 'custom.ini'));
	}
} catch (Zend_Config_Exception $e) {
	if (PHP_SAPI !== 'cli') header('Content-Type: text/plain; charset=UTF-8');
	exit('The application was unable to read one of the main configuration file (application.ini or routing.ini). It makes me a sad panda as well.' . PHP_EOL);
}

try {
	// Instantiate the application, bootstrap, and run
	$application = new Zend_Application(APPLICATION_ENV, $config->{APPLICATION_ENV});

	$autoloader = $application->getAutoloader();

	// We want the autoloader to load any namespace
	$autoloader->setFallbackAutoloader(false);
	// We want to be informed about missing classes in a clear way
	// There's a conflict with Doctrine trying to load non-existing (created at run-time) classes
	$autoloader->suppressNotFoundWarnings(true);

// Catch any uncaught exceptions
} catch (Exception $e) {
	if (PHP_SAPI !== 'cli') header('Content-Type: text/plain; charset=UTF-8');
	exit('Application error: ' . $e->getMessage() . PHP_EOL . $e->getTraceAsString() . PHP_EOL);
}
开发者ID:niieani,项目名称:nandu,代码行数:29,代码来源:initenv.php

示例4: realpath

<?php

require realpath('../application') . '/config.php';
/** Zend_Application */
require_once 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . 'configs/application.ini');
Zend_Session::start();
/**
 * Thiết lập không hiển thị lỗi nếu là phiên bản production
 *
 */
if ('production' !== APPLICATION_ENV) {
    $application->getAutoloader()->suppressNotFoundWarnings(false);
}
$application->bootstrap()->run();
开发者ID:hoaitn,项目名称:bmw-site,代码行数:15,代码来源:index.php

示例5: define

 * with loading,  using,  modifying and/or developing or reproducing the
 * software by the user in light of its specific status of free software,
 * that may mean  that it is complicated to manipulate,  and  that  also
 * therefore means  that it is reserved for developers  and  experienced
 * professionals having in-depth computer knowledge. Users are therefore
 * encouraged to load and test the software's suitability as regards their
 * requirements in conditions enabling the security of their systems and/or
 * data to be ensured and,  more generally, to use and operate it in the
 * same conditions as regards security.
 *
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL-C license and that you accept its terms.
 *
 * @author Copyright (c) PadCMS (http://www.padcms.net)
 * @version $DOXY_VERSION
 */
// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'application'));
//Define path to the public directory
define('SITE_PATH', realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'front'));
// Define application environment
define('APPLICATION_ENV', 'test');
define('APPLICATION_PREFIX', 'cli');
// Ensure include/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'include'), get_include_path())));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$oApplication = new Zend_Application(APPLICATION_PREFIX . '_' . APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$oApplication->getAutoloader()->setFallbackAutoloader(true);
$oApplication->bootstrap();
开发者ID:pansot2,项目名称:PadCMS-backend,代码行数:31,代码来源:bootstrap.php


注:本文中的Zend_Application::getAutoloader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。