예제 #1
0
 /**
  * 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
0
$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 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
0
파일: Setting.php 프로젝트: balitax/plansys
 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
0
<?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
0
        $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');