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


PHP Driver::get方法代码示例

本文整理汇总了PHP中Driver::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Driver::get方法的具体用法?PHP Driver::get怎么用?PHP Driver::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Driver的用法示例。


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

示例1: run

 function run()
 {
     set_time_limit(0);
     try {
         DB::query("UPDATE Driver SET Active = 0");
         DB::query("UPDATE DriverRelease SET Active = 0");
         $url = 'http://stackalytics.com/driverlog/api/1.0/drivers';
         $jsonResponse = @file_get_contents($url);
         $driverArray = json_decode($jsonResponse, true);
         $array = $driverArray['drivers'];
         foreach ($array as $contents) {
             if (!isset($contents['project_name']) || !isset($contents['name'])) {
                 continue;
             }
             $driver = Driver::get()->filter(array("Name" => trim($contents['name']), "Project" => trim($contents['project_name'])))->first();
             if (!$driver) {
                 $driver = new Driver();
             }
             $driver->Name = trim($contents['name']);
             $driver->Description = isset($contents['description']) ? $contents['description'] : null;
             $driver->Project = $contents['project_name'];
             $driver->Vendor = isset($contents['vendor']) ? $contents['vendor'] : null;
             $driver->Url = isset($contents['wiki']) ? $contents['wiki'] : null;
             $driver->Active = 1;
             if (isset($contents['releases_info'])) {
                 $releases = $contents['releases_info'];
                 foreach ($releases as $release) {
                     $driver_release = DriverRelease::get()->filter("Name", trim($release['name']))->first();
                     if (!$driver_release) {
                         $driver_release = new DriverRelease();
                     }
                     $driver_release->Name = trim($release['name']);
                     $driver_release->Url = $release['wiki'];
                     $driver_release->Active = 1;
                     $driver_release->write();
                     $driver->Releases()->add($driver_release);
                 }
             }
             $driver->write();
         }
         return 'OK';
     } catch (Exception $ex) {
         SS_Log::log($ex, SS_Log::ERR);
         echo $ex->getMessage();
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:46,代码来源:UpdateDriversTask.php

示例2: createDriver

 function createDriver()
 {
     $ob = new Driver($this->__masterserver, null, $this->nname);
     $ob->get();
     $os = $this->ostype;
     include "../file/driver/{$os}.inc";
     if (!$driver) {
         print "Error Reading Driver Config File...\n";
         exit;
     }
     $olddriver_b = $ob->driver_b;
     $ob->driver_b = new Driver_b(null, null, $this->nname);
     foreach ($driver as $k => $v) {
         if (is_array($v)) {
             $v = $v[0];
         }
         $var = "pg_" . $k;
         if (isset($olddriver_b->{$var})) {
             $ob->driver_b->{$var} = $olddriver_b->{$var};
         }
     }
     $this->addToDriverObject($ob, $driver);
     $list = module::getModuleList();
     $driver = null;
     foreach ((array) $list as $l) {
         $mod = getreal("/module/") . "/{$l}";
         include_once "{$mod}/lib/driver.inc";
         $dlist = $driver[$os];
         if (isset($driver['all'])) {
             $dlist = lx_array_merge(array($dlist, $driver['all']));
         }
         $this->addToDriverObject($ob, $dlist);
     }
     if ($ob->dbaction === 'clean') {
         $ob->dbaction = 'update';
     }
     $ob->parent_clname = $this->getClName();
     $ob->write();
 }
开发者ID:soar-team,项目名称:kloxo,代码行数:39,代码来源:pservercorelib.php

示例3: get

 /**
  * Return the image content as binary data
  *
  */
 function get()
 {
     return $this->driver->get($this);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:8,代码来源:Image.class.php

示例4: __construct

 /**
  * Construtor
  * @param string $driver com o tipo de driver desejado
  */
 private function __construct($options)
 {
     static::setObject(Driver::get($options));
 }
开发者ID:escapework,项目名称:cache,代码行数:8,代码来源:Cache.php

示例5: getProjects

 public function getProjects()
 {
     return GroupedList::create(Driver::get()->sort('Project'))->GroupedBy('Project');
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:4,代码来源:MarketPlaceDriverPage.php

示例6: result

 public function result($partition = null)
 {
     $definition = $this->projectionsDriver->get($this->projectionName);
     return $this->resultSerializer->unserialize($this->projectionClassName, $this->projectionsDriver->result($definition, $partition));
 }
开发者ID:php-in-practice,项目名称:matters-projections,代码行数:5,代码来源:EventStoreRepository.php

示例7: testGetFileDriverShouldWork

 public function testGetFileDriverShouldWork()
 {
     $options = array('driver' => 'file', 'path' => 'cache/');
     $file = Driver::get($options);
 }
开发者ID:escapework,项目名称:cache,代码行数:5,代码来源:DriverTest.php


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