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


PHP Zend_Loader::registerAutoLoad方法代码示例

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


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

示例1: _setupEnvironment

 protected function _setupEnvironment()
 {
     error_reporting(E_ALL | E_STRICT);
     set_include_path($this->getPath('library') . PATH_SEPARATOR . $this->getPath('models') . PATH_SEPARATOR . $this->getPath('controllers') . PATH_SEPARATOR . get_include_path());
     require_once 'WebVista/Model/ORM.php';
     require_once 'User.php';
     require_once 'Person.php';
     require_once 'Zend/Session.php';
     require_once 'WebVista/Session/SaveHandler.php';
     Zend_Session::setSaveHandler(new WebVista_Session_SaveHandler());
     Zend_Session::start();
     require_once 'Zend/Loader.php';
     Zend_Loader::registerAutoLoad();
     $sessionTimeout = ini_get('session.gc_maxlifetime') - 5 * 60;
     Zend_Registry::set('sessionTimeout', $sessionTimeout);
     $this->_config = new Zend_Config_Ini($this->getPath('application') . "/config/app.ini", APPLICATION_ENVIRONMENT);
     Zend_Registry::set('config', $this->_config);
     Zend_Registry::set('baseUrl', substr($_SERVER['PHP_SELF'], 0, strpos(strtolower($_SERVER['PHP_SELF']), 'index.php')));
     Zend_Registry::set('basePath', $this->getPath('base') . DIRECTORY_SEPARATOR);
     try {
         date_default_timezone_set(Zend_Registry::get('config')->date->timezone);
     } catch (Zend_Exception $e) {
         die($e->getMessage());
     }
     AuditLog::setDbConfig($this->_config->database->toArray());
     // this MUST be required as this is used as DB connection
     // register shutdown function
     register_shutdown_function(array('AuditLog', 'closeConnection'));
     ob_start();
     // this MUST be required after register shutdown
     return $this;
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:32,代码来源:App.php

示例2: execute

 public static function execute($subject, $to, $from, $body)
 {
     sfOpenPNEApplicationConfiguration::registerZend();
     $subject = mb_convert_kana($subject, 'KV');
     $mailer = new Zend_Mail('iso-2022-jp');
     $mailer->setHeaderEncoding(Zend_Mime::ENCODING_BASE64)->setFrom($from)->addTo($to)->setSubject(mb_encode_mimeheader($subject, 'iso-2022-jp'))->setBodyText(mb_convert_encoding($body, 'JIS', 'UTF-8'), 'iso-2022-jp', Zend_Mime::ENCODING_7BIT);
     $result = $mailer->send();
     Zend_Loader::registerAutoLoad('Zend_Loader', false);
     return $result;
 }
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:10,代码来源:sfOpenPNEMailSend.class.php

示例3: init

 public function init()
 {
     file_put_contents('/tmp/ldb.log', "\ninit started", FILE_APPEND);
     error_reporting(E_ALL | E_STRICT);
     set_include_path($this->getPath('library') . PATH_SEPARATOR . $this->getPath('models') . PATH_SEPARATOR . $this->getPath('controllers') . PATH_SEPARATOR . get_include_path());
     require_once 'Zend/Loader.php';
     Zend_Loader::registerAutoLoad();
     $config = new Zend_Config_Ini($this->getPath('application') . '/config/app.ini', APPLICATION_ENVIRONMENT);
     Zend_Registry::set('config', $config);
     date_default_timezone_set($config->date->timezone);
     try {
         $dbConfig = $config->database;
         $dbAdapter = Zend_Db::factory($dbConfig);
         $dbAdapter->query("SET NAMES 'utf8'");
     } catch (Zend_Exception $e) {
         $error = $e->getMessage();
         file_put_contents('/tmp/ldb.log', "\n{$error}", FILE_APPEND);
         die($error);
     }
     Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapter);
     Zend_Registry::set('dbAdapter', $dbAdapter);
     file_put_contents('/tmp/ldb.log', "\ninit done", FILE_APPEND);
     return $this;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:24,代码来源:HandleLDB.php

示例4: unregisterZend

 public static function unregisterZend()
 {
     if (!self::$zendLoaded) {
         return true;
     }
     require_once 'Zend/Loader.php';
     Zend_Loader::registerAutoLoad('Zend_Loader', false);
     self::$zendLoaded = false;
 }
开发者ID:niryuu,项目名称:OpenPNE3,代码行数:9,代码来源:opApplicationConfiguration.class.php

示例5: execute

 public static function execute($subject, $to, $from, $body)
 {
     if (!$to) {
         return false;
     }
     self::initialize();
     opApplicationConfiguration::registerZend();
     $subject = mb_convert_kana($subject, 'KV');
     $mailer = new Zend_Mail('iso-2022-jp');
     $mailer->setHeaderEncoding(Zend_Mime::ENCODING_BASE64)->setFrom($from)->addTo($to)->setSubject(mb_encode_mimeheader($subject, 'iso-2022-jp'))->setBodyText(mb_convert_encoding($body, 'JIS', 'UTF-8'), 'iso-2022-jp', Zend_Mime::ENCODING_7BIT);
     if ($envelopeFrom = sfConfig::get('op_mail_envelope_from')) {
         $mailer->setReturnPath($envelopeFrom);
     }
     $result = $mailer->send();
     Zend_Loader::registerAutoLoad('Zend_Loader', false);
     return $result;
 }
开发者ID:shotaatago,项目名称:OpenPNE3,代码行数:17,代码来源:opMailSend.class.php

示例6: array

$path = array($chAppPath, $chLibraryPath, $chModelsPath, $chTestsPath, get_include_path());
set_include_path(implode(PATH_SEPARATOR, $path));
if (is_readable($chTestsPath . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) {
    require_once $chTestsPath . DIRECTORY_SEPARATOR . 'TestConfiguration.php';
} else {
    require_once $chTestsPath . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist';
}
/**
 * WebVista
 */
require_once 'WebVista/App.php';
/**
 * Zend_Loader
 */
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoLoad();
$frontendOptions = array('lifetime' => 3600, 'automatic_serialization' => true);
$backendOptions = array('file_name_prefix' => 'clearhealth', 'hashed_directory_level' => 1, 'cache_dir' => '/tmp/', 'hashed_directory_umask' => 0700);
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
Zend_Registry::set('cache', $cache);
$cache = new Memcache();
$cache->connect('127.0.0.1', 11211);
$status = $cache->getServerStatus('127.0.0.1', 11211);
if ($status === 0) {
    // memcache server failed, do error trapping?
}
Zend_Registry::set('memcache', $cache);
$config = new Zend_Config_Ini($chAppPath . "/config/app.ini", TESTS_APPLICATION_ENVIRONMENT);
Zend_Registry::set('config', $config);
try {
    $dbAdapter = Zend_Db::factory(Zend_Registry::get('config')->database);
开发者ID:psoas,项目名称:ch3-dev-preview,代码行数:31,代码来源:TestHelper.php

示例7: execute

 public static function execute($subject, $to, $from, $body)
 {
     if (!$to) {
         return false;
     }
     self::initialize();
     opApplicationConfiguration::registerZend();
     $subject = mb_convert_kana($subject, 'KV');
     $mailer = new Zend_Mail('iso-2022-jp');
     $mailer->setHeaderEncoding(Zend_Mime::ENCODING_BASE64)->setFrom($from)->addTo($to)->setSubject(mb_encode_mimeheader($subject, 'iso-2022-jp'))->setBodyText(mb_convert_encoding($body, 'JIS', 'UTF-8'), 'iso-2022-jp', Zend_Mime::ENCODING_7BIT);
     if ($envelopeFrom = sfConfig::get('op_mail_envelope_from')) {
         $mailer->setReturnPath($envelopeFrom);
     }
     try {
         $result = $mailer->send();
     } catch (Zend_Mail_Protocol_Exception $e) {
         if (sfContext::getInstance()->getActionName() === null) {
             error_log('Mail Send Error');
         } else {
             $action = sfContext::getInstance()->getActionStack()->getFirstEntry()->getActionInstance();
             $action->redirect('default/mailError');
         }
     }
     Zend_Loader::registerAutoLoad('Zend_Loader', false);
     return $result;
 }
开发者ID:nothan,项目名称:OpenPNE3,代码行数:26,代码来源:opMailSend.class.php


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