本文整理汇总了PHP中Storage::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::factory方法的具体用法?PHP Storage::factory怎么用?PHP Storage::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Storage
的用法示例。
在下文中一共展示了Storage::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _auth
function _auth()
{
$storage = Storage::factory($this->config);
$this->client->setAuthConfig($storage->loadSecrets());
$this->client->addScope(\Google_Service_Analytics::ANALYTICS, \Google_Service_Analytics::ANALYTICS_EDIT);
$credential = $storage->loadCredential();
$this->client->setAccessToken($credential);
$this->client->setClientId(json_decode($credential)->client_id);
}
示例2: __construct
/**
* Creates a new B8 object.
*
* @param array custom configuration
* @return void
*/
public function __construct(array $config = array())
{
// Load the lexer default config file
$this->config = Kohana::$config->load('b8');
// Overwrite with custom config settings
foreach ($config as $key => $value) {
$this->config[$key] = $value;
}
// Setup lexer, passing config settings through in case of custom configuration
$this->lexer = Lexer::factory($this->config['use_lexer'], $this->config['lexer'][$this->config['use_lexer']]);
// Setup storage, passing config settings through in case of custom configuration
$this->storage = Storage::factory($this->config['use_storage'], $this->config['storage'][$this->config['use_storage']]);
}
示例3: session_storage
/**
* session_storage method chaining, e.g.,
* - $session->session_storage()->method()
*
* @return \WebDriver\Storage
*/
public function session_storage()
{
return Storage::factory('session', $this->url . '/session_storage');
}