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


PHP fgc函数代码示例

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


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


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