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


PHP static::options方法代码示例

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


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

示例1: input

 public static function input($arguments)
 {
     if (!defined("STDIN")) {
         define("STDIN", fopen('php://stdin', 'r'));
     }
     $_argv = array();
     $_argv['command'] = null;
     $_argv['args'] = array();
     $_argv['options'] = array();
     $i = 0;
     foreach ($arguments as $k => $v) {
         $v = strtolower($v);
         if (substr($v, 0, 2) == '--') {
             $_argv['options'][] = $v;
         } else {
             if ($i == 1) {
                 $_argv['command'] = $v;
             }
             if ($i > 1) {
                 $_argv['args'][] = $v;
             }
         }
         $i++;
     }
     $command = $_argv['command'];
     $method = 'help';
     if (strpos($command, ':') !== false) {
         list($command, $method) = explode(':', $command);
     }
     static::$command = $command;
     static::$method = $method;
     static::$arguments = $_argv['args'];
     static::$options = $_argv['options'];
     return $_argv;
 }
开发者ID:fluorine-framework,项目名称:framework,代码行数:35,代码来源:hydrogen.php

示例2: init

 public static function init($options)
 {
     static::$options = $options;
     if (empty($options['transports'])) {
         $options['transports'] = array('default' => array('driver' => 'smtp', 'host' => 'localhost', 'port' => 25));
     }
     $first = '';
     foreach ($options['transports'] as $key => $value) {
         $value['name'] = $key;
         if (!isset($value['driver'])) {
             throw new \Exception('[Norm] Cannot instantiate transport "' . $key . '", Driver "' . @$value['driver'] . '" not found!');
         } elseif (isset(static::$aliases[$value['driver']])) {
             $value['driver'] = static::$aliases[$value['driver']];
         }
         $Driver = $value['driver'];
         static::$transports[$key] = new $Driver($value);
         if (!static::$transports[$key] instanceof Transport) {
             throw new \Exception('BonoMail transport [' . $key . '] should be instance of Transport');
         }
         if (!$first) {
             $first = $key;
         }
     }
     if (!static::$defaultTransport) {
         static::$defaultTransport = $first;
     }
 }
开发者ID:xinix-technology,项目名称:bono-mail,代码行数:27,代码来源:Mail.php

示例3: __construct

 public function __construct($options = [], Application $app = null, RepositoryContract $config = null, Dispatcher $dispatcher = null)
 {
     static::$options = $config !== null ? array_merge($options, $config->get('tracy')) : $options;
     TracyDebugger::$time = array_get($_SERVER, 'REQUEST_TIME_FLOAT', microtime(true));
     TracyDebugger::$maxDepth = array_get(static::$options, 'maxDepth');
     TracyDebugger::$maxLen = array_get(static::$options, 'maxLen');
     TracyDebugger::$showLocation = array_get(static::$options, 'showLocation');
     TracyDebugger::$strictMode = array_get(static::$options, 'strictMode');
     TracyDebugger::$editor = array_get(static::$options, 'editor');
     $bar = TracyDebugger::getBar();
     foreach (array_get(static::$options, 'panels') as $key => $enabled) {
         if ($enabled === true) {
             $class = '\\' . __NAMESPACE__ . '\\Panels\\' . ucfirst($key) . 'Panel';
             if (class_exists($class) === false) {
                 $class = $key;
             }
             $this->panels[$key] = new $class($app, static::$options);
             $bar->addPanel($this->panels[$key], $class);
         }
     }
     if ($dispatcher !== null) {
         $dispatcher->listen('kernel.handled', function ($request, $response) {
             return static::appendDebugbar($request, $response);
         });
     } else {
         TracyDebugger::enable();
     }
 }
开发者ID:dasim,项目名称:laravel-tracy,代码行数:28,代码来源:Debugger.php

示例4: fetchAll

 /**
  * Fetch all options
  *
  * @return mixed
  */
 public function fetchAll()
 {
     if (static::$options === null) {
         static::$options = $this->createModel()->orderBy('key', 'asc')->get();
     }
     return static::$options;
 }
开发者ID:adminarchitect,项目名称:options,代码行数:12,代码来源:EloquentOptionsDriver.php

示例5: option

 /**
  * Get an option from the config file
  *
  * @param string $option The key of the option
  *
  * @return mixed Its value
  */
 public static function option($option)
 {
     // Get config file
     if (!static::$options) {
         static::$options = (include __DIR__ . '/../config/config.php');
     }
     return ArraysMethods::get(static::$options, $option);
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:15,代码来源:Underscore.php

示例6: configure

 /**
  * Configure the Logger.
  *
  * @param null|array $options
  */
 public static function configure($options = null)
 {
     if (empty($options) || !is_array($options)) {
         $options = array();
     }
     $options = array_replace(static::$defaults, static::$options, $options);
     static::$options = $options;
 }
开发者ID:Top-Tech,项目名称:Top-tech,代码行数:13,代码来源:LoggerManager.php

示例7: opts

 protected static function opts($key = null)
 {
     if (is_null(static::$options)) {
         static::$options = App::getInstance()['bind9'] ?: [];
     }
     if (0 === func_num_args()) {
         return static::$options;
     } else {
         return isset(static::$options[$key]) ? static::$options[$key] : null;
     }
 }
开发者ID:reekoheek,项目名称:docker-reverseproxy,代码行数:11,代码来源:Base.php

示例8: config

 /**
  * 
  * @param array $options
  */
 public static function config(array $options = array())
 {
     if (!static::$options) {
         $defaults = array('session.name' => basename(RADIUM_APP_PATH), 'session.cookie_lifetime' => 1209600, 'session.gc_maxlifetime' => 1209600);
         $options += $defaults;
         static::$options = $options;
     } else {
         static::$options = $options + static::$options;
     }
     return static::$options;
 }
开发者ID:nariyu,项目名称:radium,代码行数:15,代码来源:Session.php

示例9: using

 public static function using($driver, $options = null)
 {
     $class = 'Email\\' . ucfirst(strtolower($driver));
     if (!class_exists($class)) {
         throw new Exception("[core.email] : {$driver} driver not found.");
     }
     static::$driver_name = $driver;
     static::$options = $options;
     static::$driver = new $class();
     static::$driver->onInit($options);
 }
开发者ID:caffeina-core,项目名称:core,代码行数:11,代码来源:Email.php

示例10: initialize

 /**
  * Initializes the cache.
  *
  * With the $options array it's possible to define:
  * - expiration of the key, (time in seconds)
  * - a namespace for the key
  *
  * this last one is useful in the case two applications use
  * a shared key/store (for instance a shared Memcached db)
  *
  * Ex:
  * $cfg_ar = ActiveRecord\Config::instance();
  * $cfg_ar->set_cache('memcache://localhost:11211',array('namespace' => 'my_cool_app',
  *																											 'expire'		 => 120
  *																											 ));
  *
  * In the example above all the keys expire after 120 seconds, and the
  * all get a postfix 'my_cool_app'.
  *
  * (Note: expiring needs to be implemented in your cache store.)
  *
  * @param string $url URL to your cache server
  * @param array $options Specify additional options
  */
 public static function initialize($url, $options = array())
 {
     if ($url) {
         $url = parse_url($url);
         $file = ucwords(Inflector::instance()->camelize($url['scheme']));
         $class = "ActiveRecord\\{$file}";
         require_once __DIR__ . "/cache/{$file}.php";
         static::$adapter = new $class($url);
     } else {
         static::$adapter = null;
     }
     static::$options = array_merge(array('expire' => 30, 'namespace' => ''), $options);
 }
开发者ID:imranweb7,项目名称:msitc-erp,代码行数:37,代码来源:cache.php

示例11: toOptionArray

 /**
  * Return array of options as value-label pairs
  *
  * @param bool $addEmptyEntry
  *
  * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
  */
 public function toOptionArray($addEmptyEntry = true)
 {
     if (null === static::$options) {
         static::$options = [];
         if ($addEmptyEntry) {
             static::$options[] = ['label' => __('No Cms Block ...'), 'value' => ''];
         }
         /** @var \Magento\Cms\Model\Block $block */
         foreach ($this->getCmsBlockCollection() as $block) {
             static::$options[] = ['label' => $block->getTitle(), 'value' => $block->getIdentifier()];
         }
     }
     return static::$options;
 }
开发者ID:davidverholen,项目名称:magento2-cms,代码行数:21,代码来源:Block.php

示例12: register

 public static function register(Di $di)
 {
     static::$di = $di;
     $di->set('Phalcon\\Http\\Cookie', 'Phwoolcon\\Http\\Cookie');
     static::$cookies = static::$di->getShared('cookies');
     static::$cookies->reset();
     static::$options = $options = Config::get('cookies');
     static::$cookies->useEncryption($encrypt = $options['encrypt']);
     $encrypt and static::$di->getShared('crypt')->setKey($options['encrypt_key'])->setPadding(Crypt::PADDING_ZERO);
     /* @var \Phalcon\Http\Response $response */
     if ($response = $di->getShared('response')) {
         $response->setCookies(static::$cookies);
     }
     Events::attach('view:generatePhwoolconJsOptions', function (Event $event) {
         $options = $event->getData() ?: [];
         $options['cookies'] = ['domain' => static::$options['domain'], 'path' => static::$options['path']];
         $event->setData($options);
         return $options;
     });
 }
开发者ID:phwoolcon,项目名称:phwoolcon,代码行数:20,代码来源:Cookies.php

示例13: init

 public static function init($options)
 {
     static::$options = $options;
     $first = null;
     if (!empty($options['spools'])) {
         foreach ($options['spools'] as $key => $spool) {
             $spool['name'] = $key;
             if (isset(static::$aliases[$spool['driver']])) {
                 $spool['driver'] = static::$aliases[$spool['driver']];
             }
             $Driver = $spool['driver'];
             static::$spools[$key] = new $Driver($spool);
             if (is_null($first)) {
                 $first = $key;
             }
         }
         if (!static::$defaultSpool) {
             static::$defaultSpool = $first;
         }
     }
 }
开发者ID:reekoheek,项目名称:bono-jobs,代码行数:21,代码来源:Jobs.php

示例14: driver

 public static function driver($options)
 {
     static::$options = $options;
     static::$cache = Cache::getInstance(static::$options);
 }
开发者ID:escapework,项目名称:cache,代码行数:5,代码来源:Facade.php

示例15: setOptions

 /**
  * Set the options value
  *
  * @param      array  $options  The options value
  *
  * @static
  */
 public static function setOptions(array $options)
 {
     static::$options = $options;
 }
开发者ID:ZiperRom1,项目名称:awesomeChatRoom,代码行数:11,代码来源:DataBase.php


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