当前位置: 首页>>代码示例>>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;未经允许,请勿转载。