當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::data方法代碼示例

本文整理匯總了PHP中static::data方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::data方法的具體用法?PHP static::data怎麽用?PHP static::data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::data方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public static function init()
 {
     parse_str(file_get_contents("php://input"), static::$data);
     static::$data = array_merge($_GET, $_POST);
     $met = $_SERVER['REQUEST_METHOD'];
     static::$header['method'] = $met;
     $path = str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);
     static::$header['path'] = $path;
     $queries = [];
     $sQuery = $_SERVER['QUERY_STRING'];
     $a = explode('&', $sQuery);
     if (count($a) > 0) {
         foreach ($a as $b) {
             $c = explode('=', $b);
             if (is_array($c) && count($c) === 2) {
                 $d = '';
                 $v = $c[1];
                 if (is_numeric($v)) {
                     $d = 1 * $v;
                 } else {
                     if (is_string($v)) {
                         $d = urldecode($v);
                     }
                 }
                 $queries[$c[0]] = $d;
             }
         }
     }
     static::$header['query'] = (object) $queries;
 }
開發者ID:ndaidong,項目名稱:bella.php,代碼行數:30,代碼來源:Request.php

示例2: getData

 /**
  * @return DataGenerator
  */
 public static function getData()
 {
     if (!isset(static::$data)) {
         static::$data = new DataGenerator();
     }
     return static::$data;
 }
開發者ID:younes0,項目名稱:blade-extensions,代碼行數:10,代碼來源:TestCase.php

示例3: grabUnadjUnemploymentData

 /**
  * Given a State FIPS code and an ending year, returns the (unadjusted) county-level unemployment levels for the previous 10 year period.
  * Seasonally adjusted data does not appear to be available at the county level.
  *
  * @param string stateId
  * @param string endYear
  * @return string[] $data
  */
 public static function grabUnadjUnemploymentData($stateId, $endYear)
 {
     ini_set('max_execution_time', 0);
     static::$data = array();
     $codes = FipsCodeGenerator::getFipsList($stateId);
     $index = 0;
     $tableList = array();
     foreach ($codes as $code) {
         if (count($tableList) >= 25) {
             $results = static::queryAPI($tableList, $endYear);
             static::addToData($results);
             $tableList = array();
         }
         $entry = '';
         if (substr($code, -3) == '000') {
             //the code is a state code
             $entry .= static::$tablePrefixes['stateUnadjUnemployRate'];
             $entry .= $code;
             $entry .= static::$tableSuffixes['stateUnadjUnemployRate'];
         } else {
             $entry .= static::$tablePrefixes['countyUnadjUnemployRate'];
             $entry .= $code;
             $entry .= static::$tableSuffixes['countyUnadjUnemployRate'];
         }
         array_push($tableList, $entry);
         //appends the entry to the indexed list
     }
     $results = static::queryAPI($tableList, $endYear);
     static::addToData($results);
     ksort(static::$data);
     return static::$data;
 }
開發者ID:BallStateCBER,項目名稱:cber-data-grabber,代碼行數:40,代碼來源:BLSDataGrabber.php

示例4: add

 /**
  * Add data to pass.
  *
  * @param array $data
  */
 public static function add(array $data)
 {
     // Filter and merge data
     $data = array_filter($data, function ($value) {
         return !is_null($value);
     });
     $data = array_merge_recursive(static::$data, $data);
     static::$data = $data;
 }
開發者ID:anahkiasen,項目名稱:arrounded,代碼行數:14,代碼來源:JavascriptBridge.php

示例5: resolveEmailTemplateByWizardPostData

 /**
  * @param EmailTemplate static::$emailTemplate
  * @param array $postData
  * @param string$wizardFormClassName
  */
 public static function resolveEmailTemplateByWizardPostData(EmailTemplate $emailTemplate, array $postData, $wizardFormClassName)
 {
     assert('is_array($postData)');
     assert('is_string($wizardFormClassName)');
     static::$data = ArrayUtil::getArrayValue($postData, $wizardFormClassName);
     static::$emailTemplate = $emailTemplate;
     static::resolveMetadataMembers();
     static::resolveOwner();
     static::resolveFileAttachments();
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:15,代碼來源:DataToEmailTemplateUtil.php

示例6: clear

 /**
  * Clear a key within the cache data, or call without an argument to clear all the cached data.
  *
  * @param string $key The key of the cached data
  *
  * @return void
  */
 public static function clear($key = null)
 {
     if ($key) {
         if (isset(static::$data[$key])) {
             unset(static::$data[$key]);
         }
     } else {
         static::$data = [];
     }
 }
開發者ID:Masterfion,項目名稱:plugin-sonos,代碼行數:17,代碼來源:Cache.php

示例7: loadGlobalProvider

 /**
  * loadGlobalProvider
  *
  * @return  Data
  */
 public static function loadGlobalProvider()
 {
     if (static::$data) {
         return static::$data;
     }
     $event = new Event('loadGlobalProvider');
     $event['data'] = new Data();
     Ioc::getDispatcher()->triggerEvent($event);
     return static::$data = $event['data'];
 }
開發者ID:bgao-ca,項目名稱:vaseman,代碼行數:15,代碼來源:GlobalProvider.php

示例8: remove

 public static function remove($key = null)
 {
     // reset the entire array
     if (is_null($key)) {
         return static::$data = array();
     }
     // unset a single key
     unset(static::$data[$key]);
     // return the array without the removed key
     return static::$data;
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:11,代碼來源:silo.php

示例9: _toData

 public static function _toData()
 {
     if (is_null(static::$data)) {
         static::_get();
         $data = array();
         foreach (static::$array['classes'] as $class) {
             $data[$class['id']] = $class['name'];
         }
         static::$data = $data;
     }
 }
開發者ID:jlawrence11,項目名稱:wowApi,代碼行數:11,代碼來源:Classes.php

示例10: load

 public static function load($config_file = null, $config_data = null)
 {
     if (!empty($config_file) && Helper::checkFile($config_file) && !($yaml = file_get_contents($config_file))) {
         throw new \Exception("Failed to read config file {$config_file}");
     }
     if (empty($config_data) && !($data = Yaml::parse($yaml))) {
         throw new \Exception("Failed to parse config file {$config_file}");
     }
     static::$data = static::$base = array_merge(static::$data, $data);
     self::$cache = array();
 }
開發者ID:yutas,項目名稱:phpdaemon,代碼行數:11,代碼來源:Config.php

示例11: get

 /**
  * Gets a layout.
  *
  * @param  string  $name
  * @param  array   $data
  * @return string
  */
 public static function get(string $name, array $data = []) : string
 {
     // Merge the data.
     static::$data = array_merge_recursive(static::data(), $data);
     // Merge validation errors into the view data.
     if (!isset(static::$data['errors']) && ($errors = Session::flash('validation_errors'))) {
         static::$data['errors'] = $errors;
     }
     // Get the path to the layout.
     $path = path('layouts') . $name . '.layout.php';
     // Load.
     return Component::load($path, static::data());
 }
開發者ID:spire-framework,項目名稱:spire,代碼行數:20,代碼來源:Layout.php

示例12: Export

 /**
  * @param array $options
  * @return string
  * @throws \yii\base\Exception
  */
 public static function Export(array $options = [])
 {
     static::$data = isset($options['data']) ? $options['data'] : [];
     static::$fileName = isset($options['fileName']) ? $options['fileName'] : 'file.csv';
     if (!isset($options['dirName'])) {
         throw new Exception('You must set dirName');
     }
     static::$dirName = $options['dirName'];
     if (static::$dirName[strlen(static::$dirName - 1)] !== '/') {
         static::$dirName .= '/';
     }
     return self::array2csv(static::$data, static::$dirName, static::$fileName);
 }
開發者ID:serrg1994,項目名稱:yii2-csv-export,代碼行數:18,代碼來源:CSVExport.php

示例13: loadData

 protected static function loadData()
 {
     if (static::$loaded) {
         return;
     }
     static::$data = static::$original = Cache::remember('fluxbb.config', 24 * 60, function () {
         $data = DB::table('config')->get();
         $cache = array();
         foreach ($data as $row) {
             $cache[$row->conf_name] = $row->conf_value;
         }
         return $cache;
     });
     static::$loaded = true;
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:15,代碼來源:Config.php

示例14: get

 /**
  * @param string $key
  * @param mixed $default
  * @return mixed
  */
 public static function get($key, $default = null)
 {
     $platform = self::getPlatform();
     if (!preg_match('/[a-z-]/', $key)) {
         throw new \InvalidArgumentException('Invalid config key:' . $key);
     }
     $data = static::$data;
     if ($platform->hasPersonalConfig()) {
         $data = $platform->getConfigByKey('laravelpagseguro');
     }
     if (is_null($data)) {
         $data = (include __DIR__ . '/application-config.php');
         static::$data = $data;
     }
     return array_key_exists($key, $data) ? $data[$key] : $default;
 }
開發者ID:thiagodionizio,項目名稱:laravel-pagseguro,代碼行數:21,代碼來源:Config.php

示例15: init

 public static function init()
 {
     $config = array('db' => array());
     require_once APP . 'config.php';
     static::$data = new stdClass();
     static::$data->title = $config['default']['title'];
     static::$template = $config['default']['template'];
     // Database config options
     define('DB_HOST', $config['db']['host']);
     define('DB_NAME', $config['db']['name']);
     define('DB_USER', $config['db']['user']);
     define('DB_PASS', base64_decode($config['db']['pass']));
     // Path to remove from uri
     static::$path = $config['path'];
     static::$profiler = $config['profiler']['log'];
     static::$profiler_query = $config['profiler']['query'];
     static::$status = $config['status'];
 }
開發者ID:fluorine-framework,項目名稱:framework,代碼行數:18,代碼來源:config.php


注:本文中的static::data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。