本文整理汇总了PHP中Installer::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::init方法的具体用法?PHP Installer::init怎么用?PHP Installer::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
/**
* uninstall the module
*
* @since 2.6.0
*/
public function uninstall()
{
if (array_key_exists('alias', static::$_moduleArray)) {
Db::forTablePrefix('modules')->where('alias', static::$_moduleArray['alias'])->deleteMany();
/* drop from sql */
$directory = 'modules/' . static::$_moduleArray['alias'] . '/database';
if (is_dir($directory)) {
$installer = new Installer(Config::getInstance());
$installer->init($directory);
$installer->rawDrop();
}
}
}
示例2: getenv
$registry = Registry::getInstance();
$config = Config::getInstance();
/* config */
$dbUrl = getenv('DB_URL');
if ($dbUrl) {
$config->parse($dbUrl);
} else {
$config->set('dbType', 'sqlite');
$config->set('dbHost', ':memory:');
}
/* database */
Db::construct($config);
Db::init();
/* installer */
$installer = new Installer($config);
$installer->init();
$installer->rawDrop();
$installer->rawCreate();
$installer->insertData(['adminName' => 'Test', 'adminUser' => 'test', 'adminPassword' => 'test', 'adminEmail' => 'test@test.com']);
/* test user */
Db::forTablePrefix('users')->whereIdIs(1)->findOne()->set(['password' => 'test', 'description' => 'test', 'language' => 'en'])->save();
/* test module */
if (is_dir('modules/TestDummy')) {
$testDummy = new Modules\TestDummy\TestDummy();
$testDummy->install();
}
/* language */
$language = Language::getInstance();
$language->init();
/* hook */
Hook::construct($registry);
示例3: finalizeConfig
public static function finalizeConfig($config, $type = "main")
{
## check if plansys is installed or not
if (Setting::$mode == "init" || Setting::$mode == "install") {
require_once "Installer.php";
$config = Installer::init($config);
} else {
$config['components']['curl'] = array('class' => 'ext.curl.Curl');
if ($type == "main" && Setting::getThemePath() != "") {
$config['components']['themeManager'] = array('basePath' => Setting::getThemePath());
$config['theme'] = 'default';
}
}
return $config;
}
示例4:
<?php
/**
* Installer Index Page
*
* @package Bedrock
* @author Nick Williams
* @version 1.0.0
* @created 04/08/2009
* @updated 04/08/2009
*/
// Imports
require_once 'Installer.php';
// Setup
Installer::init();
switch($_POST['goto']) {
default:
case 'start':
Installer::reset();
$page = 'step_start.php';
$step = 'start';
break;
// Step 01: Application Details
case 1:
if(Installer::process()) {
$page = 'step_01.php';
$step = 1;
}
示例5: Installer
$config->set('dbUser', 'root');
}
if (in_array('pgsql', $request->getServer('argv'))) {
echo 'PostgreSQL - ';
$config->set('dbType', 'pgsql');
$config->set('dbUser', 'postgres');
}
$config->set('dbHost', 'localhost');
$config->set('dbName', 'test');
$config->set('dbPassword', 'test');
} else {
echo 'SQLite - ';
$config->set('dbType', 'sqlite');
}
/* database */
Db::init($config);
/* installer */
$installer = new Installer();
$installer->init($config);
$installer->rawDrop();
$installer->rawCreate();
$installer->insertData();
if (is_dir('modules/Test')) {
$test = new Modules\Test\Test();
$test->install();
}
/* hook */
Hook::init($registry);
/* language */
$language = Language::getInstance();
$language::init('en');