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


PHP static::name方法代码示例

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


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

示例1: parse

 public static function parse($name, $src, $docendpos = 0)
 {
     $info = new static();
     $info->name($name);
     if ($docendpos > 0) {
         $doc = trim(substr($src, 0, $docendpos));
         $startpos = strrpos($doc, '/**');
         if ($startpos !== false) {
             $doc = substr($doc, $startpos);
             if (preg_match('/\\/\\*\\*(.+?)\\*\\//s', $doc, $m)) {
                 $doc = preg_replace('/^[\\s]*\\*[\\s]{0,1}/m', '', $m[1]);
             } else {
                 $doc = '';
             }
         } else {
             $doc = '';
         }
     } else {
         $doc = $src;
     }
     $params = \ebi\Dt\DocParam::parse('param', $doc);
     if (!empty($params)) {
         $info->params($params);
     }
     if (preg_match("/@return\\s+([^\\s]+)(.*)/", $doc, $m)) {
         $info->return(new \ebi\Dt\DocParam('return', $m[1], $m[2]));
     }
     $info->document(trim(preg_replace('/@.+/', '', preg_replace("/^[\\s]*\\*[\\s]{0,1}/m", '', str_replace('*' . '/', '', $doc)))));
     return $info;
 }
开发者ID:tokushima,项目名称:ebi,代码行数:30,代码来源:DocInfo.php

示例2: __callStatic

 public static function __callStatic($name, $arguments)
 {
     if ($name == 'getName') {
         $self = new static();
         return $self->name();
     }
 }
开发者ID:MikhailVolkov,项目名称:magicMethods,代码行数:7,代码来源:Magic.php

示例3: getName

 /**
  * Returns the notifier's name.
  *
  * @return string
  */
 public function getName()
 {
     if (!static::$name) {
         static::$name = str_replace('Notifier', '', join('', array_slice(explode('\\', get_class($this)), -1)));
     }
     return static::$name;
 }
开发者ID:cvo-technologies,项目名称:cakephp-notifier,代码行数:12,代码来源:Notifier.php

示例4: factory

 public static function factory($name)
 {
     $config = static::service('config');
     $assert = static::service('assert');
     $dbConfig = $config->get('databases.#1', null, $name);
     $assert->notNull($dbConfig);
     $db = new static($dbConfig);
     $db->name($name);
     return $db;
 }
开发者ID:ttmdear,项目名称:dbdiffer,代码行数:10,代码来源:Db.php

示例5: setRequest

 /**
  * Check the request for the current domain
  *
  * @param Request $request The request object
  */
 public static function setRequest(Request $request)
 {
     $host = strtolower(preg_replace('/^(.*(\\.|\\/))?([^\\.]+\\.[^\\.]+)$/i', '$3', $request->getHost()));
     $sites = Config::get('app.sites');
     $name = Config::get('app.fallback_site');
     foreach ($sites as $site => $settings) {
         $name = in_array($host, $settings['domains']) ? $site : $name;
     }
     static::$name = $name;
 }
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:15,代码来源:Site.php

示例6: getName

 public function getName()
 {
     if (null !== static::$name) {
         return static::$name;
     }
     $name = get_called_class();
     if ($name !== ($nameSegment = explode('\\', $name))) {
         $name = $nameSegment[count($nameSegment) - 2];
     }
     return static::$name = $name;
 }
开发者ID:panlatent,项目名称:swilab,代码行数:11,代码来源:Module.php

示例7: start

 /**
  * @param string $name
  * @param bool|\Closure $output
  * @param bool $cpu
  * @param bool $memory
  * @param array $ignored
  * @return bool
  */
 public static function start($name = 'xhprof', $output = false, $cpu = true, $memory = true, $ignored = [])
 {
     if (!static::checkEnv()) {
         return false;
     }
     static::$name = $name;
     static::$output = $output;
     $flags = XHPROF_FLAGS_NO_BUILTINS;
     if ($cpu) {
         $flags = $flags | XHPROF_FLAGS_CPU;
     }
     if ($memory) {
         $flags = $flags | XHPROF_FLAGS_MEMORY;
     }
     $ignored = $ignored + [__CLASS__ . '::sendData'];
     xhprof_enable($flags, ['ignored_functions' => $ignored]);
     register_shutdown_function([__CLASS__, 'sendData']);
 }
开发者ID:orbisnull,项目名称:xhprofiler,代码行数:26,代码来源:XHProfiler.php

示例8: createFromArray

 /**
  * Create a route from an array representation
  *
  * @param array $array
  *
  * @return Route
  */
 public static function createFromArray(array $array)
 {
     $route = new static($array['patterns']);
     if (isset($array['name'])) {
         $route->name($array['name']);
     }
     if (isset($array['params'])) {
         $route->params($array['params']);
     }
     if (isset($array['values'])) {
         $route->values($array['values']);
     }
     if (isset($array['conditions'])) {
         $route->conditions($array['conditions']);
     }
     if (isset($array['attributes'])) {
         $route->attributes($array['attributes']);
     }
     return $route;
 }
开发者ID:aurelienlhx,项目名称:PhpComponents,代码行数:27,代码来源:Route.php

示例9: migrate

 /**
  * Run all new migration
  *
  * @param bool			$silent 		In the silent mode the migrator ignores the migration file
  * 
  * @return void
  */
 public static function migrate($silent = false)
 {
     $migrations = $silent ? static::available() : static::unstaged();
     foreach ($migrations as $key => $value) {
         if (empty($value)) {
             continue;
         }
         if (\ClanCats::is_cli()) {
             \CCCli::info('found new "' . $key . '" migrations.');
         }
         foreach ($value as $time => $path) {
             $migration = new static($path);
             // run the migration
             $migration->up();
             if (\ClanCats::is_cli()) {
                 \CCCli::success('migrated ' . $migration->name());
             }
         }
         static::$config->set($key . '.revision', $time);
     }
     if (!$silent) {
         static::$config->write();
     }
 }
开发者ID:clancats,项目名称:core,代码行数:31,代码来源:Migrator.php

示例10: setCacheNameSpace

 public static function setCacheNameSpace($name)
 {
     static::$name = $name;
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:4,代码来源:DataCache.php

示例11: end

 public static function end()
 {
     static::$sections[static::$name] = ob_get_clean();
     static::$name = null;
 }
开发者ID:valeylabs,项目名称:section,代码行数:5,代码来源:Section.php

示例12: setting

 /**
  *  Settings Connection Data
  * 
  * @param  array $args
  * @return void
  */
 public static function setting($args)
 {
     static::$host = $args['host'];
     static::$user = $args['user'];
     static::$pass = $args['pass'];
     static::$name = $args['name'];
 }
开发者ID:Sn4ckEye,项目名称:mariadb-php,代码行数:13,代码来源:mariaDb.php

示例13: init

 /**
  * Sets database connection settings as properties.
  */
 public static function init($dbName, $dbHost, $dbUser, $dbPass, $tablePrefix = '', $dbDriver = 'mysql')
 {
     static::$name = $dbName;
     static::$host = $dbHost;
     static::$user = $dbUser;
     static::$pass = $dbPass;
     static::$prefix = $tablePrefix;
     // Skip driver check if reinitializing with same driver.
     if (isset(static::$driver) && $dbDriver == static::$driver) {
         return;
     }
     $drivers = PDO::getAvailableDrivers();
     if (!in_array($dbDriver, $drivers, true)) {
         throw new OutOfBoundsException("Invalid database driver {$dbDriver}.");
     }
     static::setDriver($dbDriver);
 }
开发者ID:phpf,项目名称:micro,代码行数:20,代码来源:Database.php

示例14: name

 /**
  * Get the route name of this Restful controller.
  *
  * @return string
  */
 public static function name()
 {
     if (!isset(static::$name)) {
         $explodedClass = explode('\\', static::className());
         static::$name = array_pop($explodedClass);
     }
     return static::$name;
 }
开发者ID:vgrish,项目名称:tacit,代码行数:13,代码来源:Restful.php

示例15: init

 public static function init($name = 'alien-session')
 {
     static::$name = $name;
     $handler_class = Config::get('session.handlers')[Config::get('session.handler')];
     static::$handler = new $handler_class();
 }
开发者ID:ramee,项目名称:alien-framework,代码行数:6,代码来源:Session.php


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