本文整理汇总了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();
}
}
示例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();
}
示例3: get
/**
* Return the image content as binary data
*
*/
function get()
{
return $this->driver->get($this);
}
示例4: __construct
/**
* Construtor
* @param string $driver com o tipo de driver desejado
*/
private function __construct($options)
{
static::setObject(Driver::get($options));
}
示例5: getProjects
public function getProjects()
{
return GroupedList::create(Driver::get()->sort('Project'))->GroupedBy('Project');
}
示例6: result
public function result($partition = null)
{
$definition = $this->projectionsDriver->get($this->projectionName);
return $this->resultSerializer->unserialize($this->projectionClassName, $this->projectionsDriver->result($definition, $partition));
}
示例7: testGetFileDriverShouldWork
public function testGetFileDriverShouldWork()
{
$options = array('driver' => 'file', 'path' => 'cache/');
$file = Driver::get($options);
}