本文整理汇总了PHP中Configuration类的典型用法代码示例。如果您正苦于以下问题:PHP Configuration类的具体用法?PHP Configuration怎么用?PHP Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
$configuration = new Configuration();
self::$selenium_test_page_path = $configuration->getSeleniumTestPagePath();
self::$selenium_execution_context = new SeleniumExecutionContext("firefox", "file://" . self::$selenium_test_page_path, "jQuery");
self::$selenium_driven_user = new SeleniumDrivenUser(self::$selenium_execution_context);
}
示例2: __construct
/**
* Constructor
*
* Inits the appropriate endpoint and httpconnector objects
* Sets all of the Profiles class properties
*
* @param \Beanstream\Configuration $config
*/
function __construct(Configuration $config)
{
//init endpoint
$this->_endpoint = new Endpoints($config->getPlatform(), $config->getApiVersion());
//init http connector
$this->_connector = new HttpConnector(base64_encode($config->getMerchantId() . ':' . $config->getApiKey()));
}
示例3: run
public function run()
{
$config = new Configuration();
$config->name = 'beer_of_the_day_modification_date';
$config->value = Carbon::now()->format('Y-m-d');
$config->save();
}
示例4: assertConfiguration
protected function assertConfiguration(Configuration $config, $srcDir, array $cloverXml, $jsonPath, $excludeNoStatements = false)
{
$this->assertEquals($srcDir, $config->getSrcDir());
$this->assertEquals($cloverXml, $config->getCloverXmlPaths());
$this->assertEquals($jsonPath, $config->getJsonPath());
$this->assertEquals($excludeNoStatements, $config->isExcludeNoStatements());
}
示例5: reminderInvoker
public static function reminderInvoker(Folder $folder)
{
$configuration = new Configuration();
//parameter to know the max gap between last parsing done on the folder.
$invokeMinutes = $configuration->getConfiguration(ConfigurationKeys::$reminderInvokeMinutes);
//parameter to know the max gap between notifications
$intervalMinutes = $configuration->getConfiguration(ConfigurationKeys::$reminderIntervalMinutes);
$invokeMinutes = intval($invokeMinutes);
$intervalMinutes = intval($intervalMinutes);
$parsedSinceMinutes = self::getDatesDifferenceInMinutes($folder->getLastParsedOn(), date("Y-m-d H:i:s"));
if ($parsedSinceMinutes > 0) {
//OK we have some minutes passed with no parsing undertook
if ($parsedSinceMinutes > $invokeMinutes) {
//if reminder already sent, check interval and send again
if ($folder->getLastRemindedOn() != null) {
$lastRemindedSince = self::getDatesDifferenceInMinutes($folder->getLastRemindedOn(), date("Y-m-d H:i:s"));
if ($lastRemindedSince > $intervalMinutes) {
self::sendNotification($folder);
FolderDataStore::getInstance()->updateLastReminderDate($folder->getSeq());
}
} else {
self::sendNotification($folder);
FolderDataStore::getInstance()->updateLastReminderDate($folder->getSeq());
}
} else {
//time still there to remind
}
}
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->opo_app_config = Configuration::load();
$vs_external_app_config_path = $this->opo_app_config->get('external_applications');
$this->opo_external_app_config = Configuration::load($vs_external_app_config_path);
}
示例7: testSetOptionsWithValidOptions
public function testSetOptionsWithValidOptions()
{
$key = 'steam-api-key';
$options = array(Configuration::STEAM_KEY => $key);
$this->configuration->setOptions($options);
$this->assertEquals($key, $this->configuration->getSteamKey());
}
示例8: testGetInstanceWithWrongConfiguredParameterThrowsException
public function testGetInstanceWithWrongConfiguredParameterThrowsException()
{
$this->setExpectedException('rg\\injektor\\InjectionException', 'Invalid argument without class typehint class: [rg\\injektor\\DICTestClassNoTypeHint] method: [__construct] argument: [two]');
$config = new Configuration(null, '');
$config->setClassConfig('rg\\injektor\\DICTestClassNoTypeHint', array('params' => array('one' => array('value' => 'foo'))));
$dic = $this->getContainer($config);
$dic->getInstanceOfClass('rg\\injektor\\DICTestClassNoTypeHint');
}
示例9: __construct
public function __construct(Configuration $configuration, DatabaseVersion $dbVersion, DeltaDirectory $deltaDirectory)
{
$this->dbName = $configuration->dbName();
$this->dbUsername = $configuration->dbUsername();
$this->dbPassword = $configuration->dbPassword();
$this->dbVersion = $dbVersion;
$this->deltaDirectory = $deltaDirectory;
}
示例10: build
public function build(Configuration $config)
{
$serviceConfig = $config->get(Configuration::SERVICE);
$serviceClass = $this->getServiceClass($serviceConfig);
$serverUrl = $this->extractParameter(AbstractServiceManager::SERVER_URL, $serviceConfig);
$watchedServices = $this->getWatchedServices($serviceConfig);
return new $serviceClass($serverUrl, $config->getConfigDir(), $watchedServices);
}
示例11: testVerify
/**
* @covers Airbrake\Configuration::verify
*/
public function testVerify()
{
$this->object->set('apiKey', null);
try {
$this->object->verify();
} catch (\Exception $e) {
$this->assertInstanceOf('Airbrake\\Exception', $e);
}
}
示例12: add
public function add($key, $value, $ns = 'conf')
{
$config = new Configuration();
$config->setKey($ns . ':' . $key);
$config->setValue($value);
$config->save();
$this->confTab[$ns][$key] = $value;
unset($_SESSION['configuration']);
}
示例13: testNonDefaultValuesDefine
public function testNonDefaultValuesDefine()
{
$name = uniqid('name');
$realValue = uniqid('realValue');
$default = uniqid('value');
$config = new Configuration([$name => $realValue]);
$config->define($name, $default);
$expected = $realValue;
$this->assertEquals(constant($name), $expected, 'The parameter is not defined properly with real value');
}
示例14: testGetPassPhraseWithUsePasswordGetter
/**
* Test get pass phrase with use PasswordGetter system
*/
public function testGetPassPhraseWithUsePasswordGetter()
{
$configuration = new Configuration('name', 'localhost', 80);
$configuration->setUser('user');
$passwordGetter = $this->getMockForAbstractClass('Deployer\\Server\\Password\\PasswordGetterInterface');
$passwordGetter->expects($this->once())->method('getPassword')->with('localhost', 'user')->will($this->returnValue('some-pass-phrase'));
$configuration->setPassPhrase($passwordGetter);
$passPhrase = $configuration->getPassPhrase();
$this->assertEquals('some-pass-phrase', $passPhrase, 'Pass phrases mismatch');
}
示例15: getTempDirectory
/**
* Returns a writable directory for temporary files
*
* @return String
* @see Configuration::setTempDirectory()
* @throws NoTempDirectoryException
*/
public function getTempDirectory()
{
if (!is_null($this->configuration->getTempDirectory())) {
return $this->configuration->getTempDirectory();
}
if (is_null($this->cachedTempDirectory)) {
$this->cachedTempDirectory = $this->findTempDirectory();
}
return $this->cachedTempDirectory;
}