當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。