本文整理汇总了PHP中Engine::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine::getConfig方法的具体用法?PHP Engine::getConfig怎么用?PHP Engine::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::getConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($template)
{
if (file_exists(TEMP_CONFIG_FILE)) {
Engine::getConfig()->setConfigFilename(TEMP_CONFIG_FILE);
Engine::getConfig()->open();
}
}
示例2: onLoad
public function onLoad()
{
$this->config = Engine::getConfig();
$this->config->setConfigFilename(TEMP_CONFIG_FILE);
$this->config->open();
//If it has been done already & we can connect, ignore.
if ($this->try_connect($this->config->DB_HOST, $this->config->DB_USERNAME, $this->config->DB_PASSWORD, $this->config->DB_NAME) === true) {
$this->setEnabled(false);
}
}
示例3: onSubmit
public function onSubmit()
{
ErrorHandler::stop();
$config = Engine::getConfig();
$config->setConfigFilename(TEMP_CONFIG_FILE);
$done_config = $config->save(true);
$done_htaccess = file_put_contents($this->htaccessFilename, "Options -Indexes\r\nRewriteEngine On\r\n#RewriteBase /\r\n#RewriteCond %{HTTPS} !on\r\n#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\r\n\r\nRewriteCond %{REQUEST_FILENAME} -f\r\nRewriteRule \\.(jp[e]?g|gif|png|css|js|ttf|woff|ico|bmp|pdf|doc[x]?)\$ - [L]\r\n\r\n#Redirect all files not match index.php\r\nRewriteCond %{REQUEST_FILENAME} !(.*)/index\\.php\$\r\nRewriteRule ^.*\$ index.php?current_engine_page=\$0 [L,NC,QSA]");
if (!$done_htaccess || !$done_config || !in_array('mod_rewrite', apache_get_modules())) {
$this->sendStatus(true, array($this->addName('write-error')));
}
}
示例4: onSubmit
public function onSubmit()
{
$templateName = $_POST[$this->addName("options")];
if ($this->testTemplate($templateName) === true) {
$config = Engine::getConfig();
$config->setConfigFilename(TEMP_CONFIG_FILE);
$config->TEMPLATE = $templateName;
$template = (include Engine::getTemplate($templateName));
if (!$template instanceof Template) {
$this->sendStatus(true, array($this->addName("error")));
} else {
$template->configure($this);
$config->save(true);
}
} else {
$this->sendStatus(true, array($this->addName("error")));
}
}
示例5: test_getConfig
public function test_getConfig()
{
//Make sure that what we get from the engine, gives us the actual config class and an instantiated object
$this->assertEquals(true, Engine::getConfig() !== null && Engine::getConfig() instanceof Config);
}