当前位置: 首页>>代码示例>>PHP>>正文


PHP Installer::init方法代码示例

本文整理汇总了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();
         }
     }
 }
开发者ID:amanpreetsinghmalhotra,项目名称:redaxscript,代码行数:18,代码来源:Module.php

示例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);
开发者ID:redaxmedia,项目名称:redaxscript,代码行数:31,代码来源:bootstrap.php

示例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;
 }
开发者ID:balitax,项目名称:plansys,代码行数:15,代码来源:Setting.php

示例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;
		}
开发者ID:RogWilco,项目名称:Bedrock-Framework,代码行数:31,代码来源:index.php

示例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');
开发者ID:EtienneBruines,项目名称:redaxscript,代码行数:31,代码来源:bootstrap.php


注:本文中的Installer::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。