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


PHP Flight::mc方法代碼示例

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


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

示例1: mcCacheProps

 private function mcCacheProps($filePath, $device, $channel)
 {
     $mc = Flight::mc();
     $cache = $mc->get($filePath);
     if (!$cache && Memcached::RES_NOTFOUND == $mc->getResultCode()) {
         $buildpropArray = explode("\n", file_get_contents('zip://' . $filePath . '#system/build.prop'));
         if ($device == $this->getBuildPropValue($buildpropArray, 'ro.product.device')) {
             $api_level = intval($this->getBuildPropValue($buildpropArray, 'ro.build.version.sdk'));
             $incremental = $this->getBuildPropValue($buildpropArray, 'ro.build.version.incremental');
             $timestamp = intval($this->getBuildPropValue($buildpropArray, 'ro.build.date.utc'));
             $url = $this->getBuildPropValue($buildpropArray, 'ro.build.ota.url');
             $cache = array($device, $api_level, $incremental, $timestamp, Utils::getMD5($filePath), $url);
             $mc->set($filePath, $cache);
             $mc->set($incremental, array($device, $channel, $filePath));
         } else {
             throw new Exception("{$device}: {$filePath} is in invalid path");
         }
     }
     assert($cache[0] == $device);
     $this->api_level = $cache[1];
     $this->incremental = $cache[2];
     $this->timestamp = $cache[3];
     $this->md5sum = $cache[4];
     $this->url = $cache[5];
 }
開發者ID:jfdesignnet,項目名稱:CyanogenModOTA,代碼行數:25,代碼來源:Tokens.php

示例2: mcCacheProps

 private function mcCacheProps($filePath, $device, $channel)
 {
     $mc = Flight::mc();
     $cache = $mc->get($filePath);
     if (true) {
         $buildpropArray = explode("\n", file_get_contents($filePath . '.build.prop'));
         if ($device == $this->getBuildPropValue($buildpropArray, 'ro.product.device') || $device == $this->getBuildPropValue($buildpropArray, 'ro.cm.device')) {
             $api_level = intval($this->getBuildPropValue($buildpropArray, 'ro.build.version.sdk'));
             $incremental = $this->getBuildPropValue($buildpropArray, 'ro.build.version.incremental');
             $timestamp = intval($this->getBuildPropValue($buildpropArray, 'ro.build.date.utc'));
             if (file_exists($filePath . '.url')) {
                 $url = explode("\n", file_get_contents($filePath . '.url'))[0];
             } else {
                 $url = 'https://' . $_SERVER['HTTP_HOST'] . '/_builds/' . explode("/", $filePath)[4];
             }
             $cache = array($device, $api_level, $incremental, $timestamp, Utils::getMD5($filePath), $url);
             $mc->set($filePath, $cache);
             $mc->set($incremental, array($device, $channel, $filePath));
         } else {
             throw new Exception("{$device}: {$filePath} is in invalid path");
         }
     }
     assert($cache[0] == $device);
     $this->api_level = $cache[1];
     $this->incremental = $cache[2];
     $this->timestamp = $cache[3];
     $this->md5sum = $cache[4];
     $this->url = $cache[5];
 }
開發者ID:invisiblek,項目名稱:CyanogenModOTA,代碼行數:29,代碼來源:Tokens.php

示例3: mcFind

 public static function mcFind($incremental)
 {
     $mc = Flight::mc();
     list($device, $channel, $zip) = $mc->get($incremental);
     if ($zip && !file_exists($zip)) {
         $mc->delete($zip);
         $mc->delete($incremental);
         $zip = NULL;
         $channel = NULL;
         $device = NULL;
     }
     return array($device, $channel, $zip);
 }
開發者ID:invisiblek,項目名稱:CyanogenModOTA,代碼行數:13,代碼來源:Utils.php


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