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


PHP Zend_Application::setOptions方法代码示例

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


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

示例1: getApplication

 /**
  * 
  * @return Zend_Application
  */
 public static function getApplication()
 {
     $application = new Zend_Application(APPLICATION_ENV);
     $applicationini = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
     $options = $applicationini->toArray();
     foreach (self::$_ini as $value) {
         $iniFile = APPLICATION_PATH . self::$_pathConfig . $value;
         if (is_readable($iniFile)) {
             $config = new Zend_Config_Ini($iniFile);
             $options = $application->mergeOptions($options, $config->toArray());
         } else {
             throw new Zend_Exception('error en la configuracion de los .ini');
         }
     }
     //        foreach (self::$_ini as $value) {
     //            $iniFile = APPLICATION_PATH . self::$_pathConfig . $value;
     //
     //            if (is_readable($iniFile)) {
     //                $config = new Zend_Config_Ini($iniFile);
     //                $options = $application->mergeOptions($options,
     //                    $config->toArray());
     //            } else {
     //            throw new Zend_Exception('error en la configuracion de los .ini');
     //            }
     //        }
     Zend_Registry::set('config', $options);
     $a = $application->setOptions($options);
     return $application;
 }
开发者ID:josmel,项目名称:HosPot,代码行数:33,代码来源:index.php

示例2: onRequest

 public function onRequest(GetResponseEvent $event)
 {
     if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
         // don't do anything if it's not the master request
         return;
     }
     $request = $event->getRequest();
     $pos = strpos($request->server->get('REQUEST_URI'), '_profiler');
     // don't call Zend Application for profiler.
     if (false === $pos) {
         // init adodb
         require_once __DIR__ . '/../../../../db_connect.php';
         // Fill zend application options
         $config = $this->container->getParameterBag()->all();
         $application = new \Zend_Application(APPLICATION_ENV);
         $application->setOptions($config);
         $application->bootstrap();
         \Zend_Registry::set('zend_application', $application);
     }
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:20,代码来源:ZendApplicationListener.php

示例3: setOptions

 /**
  * @see    Zend_Application::setOptions()
  * @param  array $options
  * @return Core_Application provides a fluent interface
  */
 public function setOptions(array $options)
 {
     if (!empty($options['config'])) {
         $options = $this->_mergeFilesRecursive($options);
         unset($options['config']);
     }
     if (!empty($options['pluginCache'])) {
         if (!is_string($options['pluginCache'])) {
             throw new Zend_Application_Exception('Plugin cache deve ser string');
         }
         Zend_Loader_PluginLoader::setIncludeFileCache($options['pluginCache']);
         if (file_exists($options['pluginCache'])) {
             include_once $options['pluginCache'];
         }
     }
     return parent::setOptions($options);
 }
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:22,代码来源:Application.php

示例4: define

<?php

/* set crossdomain request */
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS");
header("Access-Control-Allow-Credentials: true");
// Define application environment
if (!isset($_REQUEST['env']) || empty($_REQUEST['env'])) {
    die;
} else {
    define('APPLICATION_DB', $_REQUEST['env']);
}
// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
/* Define application environment */
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), get_include_path())));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$config = $application->getOptions();
$config['resources']['db']['params']['dbname'] = APPLICATION_DB;
$application->setOptions($config)->bootstrap()->run();
开发者ID:tudorfis,项目名称:php-api,代码行数:25,代码来源:index.php

示例5: setOptions

 /**
  * Set options for Centurion_Config_Manager
  *
  * @param array $options Options
  * @return $this
  */
 public function setOptions(array $options)
 {
     parent::setOptions($options);
     Centurion_Config_Manager::add($options);
     return $this;
 }
开发者ID:rom1git,项目名称:Centurion,代码行数:12,代码来源:Application.php

示例6: define

<?php

defined('APPLICATION_ROOT') || define('APPLICATION_ROOT', realpath(__DIR__ . '/../'));
require_once APPLICATION_ROOT . '/app/Init.php';
require_once 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENV);
$config = (include APPLICATION_PATH . '/configs/' . APPLICATION_ENV . '.php');
$application->setOptions($config);
try {
    $application->bootstrap()->run();
} catch (Exception $e) {
    Zend_Debug::dump($e->getMessage());
    Zend_Debug::dump($e->getTraceAsString());
    die;
}
开发者ID:n3r,项目名称:parseKp,代码行数:15,代码来源:index.php


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