• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fgc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fgc函数的典型用法代码示例。如果您正苦于以下问题:PHP fgc函数的具体用法?PHP fgc怎么用?PHP fgc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: processRequest

 /**
  * Function processing raw HTTP request headers & body
  * and populates them to class variables.
  */
 private function processRequest()
 {
     $this->request['resource'] = isset($_GET['RESTurl']) && !empty($_GET['RESTurl']) ? $_GET['RESTurl'] : 'index';
     unset($_GET['RESTurl']);
     $this->request['method'] = Inflector::lower($_SERVER['REQUEST_METHOD']);
     $this->request['headers'] = $this->getHeaders();
     $this->request['format'] = isset($_GET['format']) ? trim($_GET['format']) : null;
     switch ($this->request['method']) {
         case 'get':
             $this->request['params'] = $_GET;
             break;
         case 'post':
             $this->request['params'] = array_merge($_POST, $_GET);
             break;
         case 'put':
             parse_str(fgc('php://input'), $this->request['params']);
             break;
         case 'delete':
             $this->request['params'] = $_GET;
             break;
         default:
             break;
     }
     $this->request['content-type'] = $this->getResponseFormat($this->request['format']);
     if (!function_exists('trim_value')) {
         function trim_value(&$value)
         {
             $value = trim($value);
         }
     }
     array_walk_recursive($this->request, 'trim_value');
 }
开发者ID:schpill,项目名称:thin,代码行数:36,代码来源:Rest.php


示例2: all

 public function all()
 {
     $data = $this->cached('all_db_JDB_' . $this->type);
     if (empty($data)) {
         $data = fgc($this->db);
         $data = strlen($data) ? $this->id(json_decode($data, true)) : array();
     }
     return $data;
 }
开发者ID:schpill,项目名称:thin,代码行数:9,代码来源:Jsondb.php


示例3: __construct

 public function __construct($namespace, $entity)
 {
     $this->db = STORAGE_PATH . DS . 'dbNode_' . $namespace . '::' . $entity . '.data';
     $this->lock = STORAGE_PATH . DS . 'dbNode_' . $namespace . '::' . $entity . '.lock';
     if (!File::exists($this->db)) {
         File::put($this->db, json_encode(array()));
     }
     $this->buffer = json_decode(fgc($this->db), true);
     $this->clean();
 }
开发者ID:schpill,项目名称:thin,代码行数:10,代码来源:Driver.php


示例4: urlToPng

 public static function urlToPng($url, $name = 'image')
 {
     $purl = 'http://195.154.233.154/api/png.php?url=' . urlencode($url);
     $pdf = fgc($purl);
     header("Content-type: image/png");
     header("Content-Disposition: attachment; filename=\"{$name}.png\"");
     header("Pragma: no-cache");
     header("Expires: 0");
     die($pdf);
 }
开发者ID:schpill,项目名称:thin,代码行数:10,代码来源:Png.php


示例5: getCoords

 public static function getCoords($address, $region = 'FR')
 {
     $address = urlencode($address);
     $json = fgc("http://maps.google.com/maps/api/geocode/json?address={$address}&sensor=false&region={$region}");
     $json = json_decode($json);
     $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
     $long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
     $coords = new Coords();
     return $coords->setLatitude($lat)->setLongitude($long);
 }
开发者ID:noikiy,项目名称:inovi,代码行数:10,代码来源:Geoloc.php


示例6: retrieve

 /**
  * Retrieve an item from the cache driver.
  *
  * @param  string  $key
  * @return mixed
  */
 protected function retrieve($key)
 {
     if (!File::exists($this->path . $key)) {
         return null;
     }
     // File based caches store have the expiration timestamp stored in
     // UNIX format prepended to their contents. We'll compare the
     // timestamp to the current time when we read the file.
     if (time() >= substr($cache = fgc($this->path . $key), 0, 10)) {
         return $this->forget($key);
     }
     return unserialize(substr($cache, 10));
 }
开发者ID:schpill,项目名称:thin,代码行数:19,代码来源:Cache.php


示例7: getMetas

 public function getMetas($url)
 {
     $content = fgc($url);
     if ($content) {
         $array = array('title' => '', 'description' => '');
         $pattern = "|<[\\s]*title[\\s]*>([^<]+)<[\\s]*/[\\s]*title[\\s]*>|Ui";
         if (preg_match($pattern, $content, $match)) {
             $array['title'] = $match[1];
         }
         $data = get_meta_tags($url);
         unset($content);
         unset($match);
         return $data + $array;
     }
     return null;
 }
开发者ID:schpill,项目名称:standalone,代码行数:16,代码来源:shortcode.php


示例8: getCoords

 public static function getCoords($address, $region = 'FR')
 {
     $key = 'loc.coords.' . sha1(serialize(func_get_args()));
     $coords = redis()->get($key);
     if (strlen($coords)) {
         return unserialize($coords);
     }
     $address = urlencode($address);
     $json = fgc("http://maps.google.com/maps/api/geocode/json?address={$address}&sensor=false&region={$region}");
     if (!strstr($json, 'geometry')) {
         return ['lng' => 0, 'lat' => 0];
     }
     $json = json_decode($json);
     $lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
     $lng = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
     $addrComponents = $json->{'results'}[0]->{'address_components'};
     $addrComponents = json_decode(json_encode($addrComponents), true);
     $components = [];
     foreach ($addrComponents as $component) {
         $k = implode('_', $component['types']);
         if ($k == 'locality_political') {
             $k = 'city';
         } elseif ($k == 'route') {
             $k = 'street';
         } elseif ($k == 'administrative_area_level_2_political') {
             $k = 'department';
         } elseif ($k == 'administrative_area_level_1_political') {
             $k = 'region';
         } elseif ($k == 'country_political') {
             $k = 'country';
         } elseif ($k == 'postal_code') {
             $k = 'zip';
         }
         unset($component['types']);
         $components[$k] = $component;
     }
     $components += ['lng' => $lng, 'lat' => $lat, 'geohash' => with(new Geohash())->encode($lat, $lng)];
     ksort($components);
     redis()->set($key, serialize($components));
     return $components;
 }
开发者ID:schpill,项目名称:thin,代码行数:41,代码来源:Geoloc.php


示例9: generate

 public static function generate($model, $overwrite = false)
 {
     $file = APPLICATION_PATH . DS . 'models' . DS . 'Crud' . DS . ucfirst(Inflector::camelize($model)) . '.php';
     if (!File::exists($file) || $overwrite) {
         $db = model($model);
         $crud = new Crud($db);
         File::delete($file);
         $tplModel = fgc(__DIR__ . DS . 'Model.tpl');
         $tplField = fgc(__DIR__ . DS . 'Field.tpl');
         $fields = $crud->fields();
         $singular = ucfirst($model);
         $plural = $singular . 's';
         $default_order = $crud->pk();
         $tplModel = str_replace(array('##singular##', '##plural##', '##default_order##'), array($singular, $plural, $default_order), $tplModel);
         $fieldsSection = '';
         foreach ($fields as $field) {
             if ($field != $crud->pk()) {
                 $label = substr($field, -3) == '_id' ? ucfirst(str_replace('_id', '', $field)) : ucfirst(Inflector::camelize($field));
                 $fieldsSection .= str_replace(array('##field##', '##label##'), array($field, $label), $tplField);
             }
         }
         $tplModel = str_replace('##fields##', $fieldsSection, $tplModel);
         File::put($file, $tplModel);
     }
 }
开发者ID:schpill,项目名称:standalone,代码行数:25,代码来源:Tools.php


示例10: slurpmanifest

function slurpmanifest()
{
    global $baseWorkDir, $workWith, $sdisub, $mfContents, $xht_doc, $charset;
    $fmff = $baseWorkDir . '/' . $workWith . '/' . MFFNAME . $sdisub . MFFDEXT;
    if (file_exists($fmff)) {
        if ($mfContents = @fgc($fmff)) {
            set_time_limit(120);
            // for analyzing the manifest file
            $xht_doc = new xmddoc(explode("\n", $mfContents));
            if (!$xht_doc->error) {
                return '';
            }
            // keeping $mfContents and $xht_doc
            unset($mfContents);
            return get_lang('ManifestSyntax') . ' ' . htmlspecialchars($xht_doc->error, ENT_QUOTES, $charset);
        } else {
            return get_lang('EmptyManifest');
        }
    } else {
        return get_lang('NoManifest');
    }
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:22,代码来源:importmanifest.php


示例11: makeApp

function makeApp($app)
{
    return fgc('http://fr.webz0ne.com/api/check.php?code=' . $app);
}
开发者ID:noikiy,项目名称:inovi,代码行数:4,代码来源:Helper.php


示例12: setSigningKey

 /**
  * Set signing key
  *
  * @param string $keyPairId AWS Key Pair ID
  * @param string $signingKey Private Key
  * @param boolean $isFile Load private key from file, set to false to load string
  * @return boolean
  */
 public static function setSigningKey($keyPairId, $signingKey, $isFile = true)
 {
     self::$__signingKeyPairId = $keyPairId;
     if ((self::$__signingKeyResource = openssl_pkey_get_private($isFile ? fgc($signingKey) : $signingKey)) !== false) {
         return true;
     }
     self::__triggerError('S3::setSigningKey(): Unable to open load private key: ' . $signingKey, __FILE__, __LINE__);
     return false;
 }
开发者ID:schpill,项目名称:thin,代码行数:17,代码来源:Aws.php


示例13: cid

 public function cid($cid)
 {
     $html = fgc('http://maps.google.fr/?cid=' . $cid);
     $seg = Utils::cut('cacheResponse(', ');', $html);
     $ws = $tel = $advice = $name = $formatted_address = $id_hex = $panoId = $rate = $lng = $lat = $address = $zipCity = null;
     eval('$tab = ' . $seg . ';');
     if (strstr($seg, ".ggpht.com/cbk")) {
         $panoSeg = Utils::cut('ggpht.com/cbk', 'u0026', $seg);
         $panoId = Utils::cut('panoid=', '\\', $panoSeg);
     }
     if (isset($tab[8])) {
         if (!empty($tab[8])) {
             // dd($tab);
             $id_hex = $tab[8][0][0];
             $formatted_address = $tab[8][13];
             $lat = $tab[8][0][2][0];
             $lng = $tab[8][0][2][1];
             $rate = $tab[8][3];
             $name = $tab[8][1];
             $address = $tab[8][2][0] . ', ' . $tab[8][2][1];
             $zipCity = isset($tab[8][2][2]) ? $tab[8][2][2] : $tab[8][2][1];
             $tel = str_replace([' '], '', $tab[8][7]);
             $advice = str_replace(['avis', ' '], '', $tab[8][4]);
             $ws = 'http://' . str_replace([' '], '', $tab[8][11][1]);
             if ($ws == 'http://') {
                 $ws = null;
             }
             return ['coords' => $tab[0][0][0], 'pitch' => $tab[0][3], 'key' => $tab[8][27], 'cid' => $cid, 'id_hex' => $id_hex, 'id_pano' => $panoId, 'name' => $name, 'lat' => $lat, 'lng' => $lng, 'formatted_address' => $formatted_address, 'zipCity' => $zipCity, 'tel' => $tel, 'website' => $ws, 'advice' => $advice, 'rate' => $rate, 'type' => $tab[8][12], 'schedule' => $this->schedule($tab[8][9][1])];
         }
     }
     return null;
 }
开发者ID:schpill,项目名称:standalone,代码行数:32,代码来源:geo.php


示例14: getArticle

 public static function getArticle($article)
 {
     return unserialize(fgc($article));
 }
开发者ID:schpill,项目名称:thin,代码行数:4,代码来源:Blog.php


示例15: extract

 public function extract($start = 0)
 {
     set_time_limit(0);
     $file = STORAGE_PATH . DS . 'duproprio.php';
     $data = fgc($file);
     $data = repl('[0', '0', $data);
     $data = repl('[', ',', $data);
     $data = repl(']', '', $data);
     File::delete($file);
     File::put($file, $data);
     $ids = (include $file);
     $i = 0;
     foreach ($ids as $id) {
         if ($start > 0 && $i < $start) {
             $i++;
             continue;
         }
         $this->id = $id;
         $this->getAd()->save();
         $i++;
     }
     echo 'task finished';
     return $this;
 }
开发者ID:schpill,项目名称:thin,代码行数:24,代码来源:Duproprio.php


示例16: _buffer

 private function _buffer($key, $data = null)
 {
     if (false === $this->_buffer) {
         return false;
     }
     $timeToBuffer = false !== $this->_cache ? $this->_cache * 60 : 3600;
     $ext = false !== $this->_cache ? 'cache' : 'buffer';
     $file = CACHE_PATH . DS . $key . '_sql.' . $ext;
     if (File::exists($file)) {
         $age = time() - filemtime($file);
         if ($age > $timeToBuffer) {
             File::delete($file);
         } else {
             return unserialize(fgc($file));
         }
     }
     if (null === $data) {
         return false;
     }
     File::put($file, serialize($data));
 }
开发者ID:schpill,项目名称:thin,代码行数:21,代码来源:Orm.php


示例17: authenticate

 /**
  * Redirect to the facebook login url.
  *
  * @param array $scope
  * @param null $version
  * @return Response
  */
 public function authenticate($scope = array(), $version = null)
 {
     return fgc($this->getLoginUrl($scope, $version));
 }
开发者ID:schpill,项目名称:thin,代码行数:11,代码来源:Facebook.php


示例18: uploadFile

function uploadFile($field, $name)
{
    $bucket = container()->bucket();
    if (Arrays::exists($field, $_FILES)) {
        $fileupload = $_FILES[$field]['tmp_name'];
        $fileuploadName = $_FILES[$field]['name'];
        if (strlen($fileuploadName)) {
            $tab = explode('.', $fileuploadName);
            $data = fgc($fileupload);
            if (!strlen($data)) {
                return null;
            }
            return $bucket->uploadNews(['data' => $data, 'name' => $name]);
        }
    }
    return null;
}
开发者ID:schpill,项目名称:standalone,代码行数:17,代码来源:helpers.php


示例19: getObject

 public static function getObject($object)
 {
     return unserialize(fgc($object));
 }
开发者ID:schpill,项目名称:thin,代码行数:4,代码来源:Admin.php


示例20: loadShowCSS

function loadShowCSS($name)
{
    $content = fgc($name . '.css');
    echo "\r\n" . '<style>' . $content . '</style>' . '<pre class="language-css"><code>' . $content . '</code></pre>';
}
开发者ID:dan-win,项目名称:noUiSlider,代码行数:5,代码来源:helpers.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fgetc函数代码示例发布时间:2022-05-15
下一篇:
PHP fftgl函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap