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


PHP Modules::upgradeDatabase方法代码示例

本文整理汇总了PHP中Modules::upgradeDatabase方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::upgradeDatabase方法的具体用法?PHP Modules::upgradeDatabase怎么用?PHP Modules::upgradeDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modules的用法示例。


在下文中一共展示了Modules::upgradeDatabase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: finishedAction

 function finishedAction()
 {
     $request = new Bolts_Request($this->getRequest());
     $username = $request->username;
     $users_table = new Users();
     $user = $users_table->fetchByUsername($username);
     $password = substr(md5(rand(50000, 100000)), 0, 8);
     if (!is_null($user)) {
         $user->password = $password;
         $user->save();
         $this->view->username = $username;
         $this->view->password = $password;
         // we should never need this again, so we remove access to it.
         $roles_resources_table = new RolesResources();
         $where = $roles_resources_table->getAdapter()->quoteInto("module = ? ", "bolts");
         $where .= $roles_resources_table->getAdapter()->quoteInto(" and controller = ? ", "Install");
         $roles_resources_table->delete($where);
         $modules_table = new Modules("core");
         $modules_table->upgradeDatabase("bolts");
     } else {
         die("Somehow the admin user didn't get created or didn't get sent with the request. This is bad. Really, really bad.");
     }
 }
开发者ID:jaybill,项目名称:Bolts,代码行数:23,代码来源:InstallController.php

示例2: array

	$databases = new Zend_Config_Ini($config_file, 'databases');
	$dbAdapters = array();
	foreach ($databases->db as $config_name => $db)
	{
		$dbAdapters[$config_name] = Zend_Db::factory($db->adapter, $db->config->toArray());
		if ((boolean)$db->config->default)
		{
			Zend_Db_Table::setDefaultAdapter($dbAdapters[$config_name]);
		}
	}
	// Store the adapter for use anywhere in our app
	$registry = Zend_Registry::getInstance();
	$registry->set('dbAdapters', $dbAdapters);
	// check for database changes
	$modules_table = new Modules('core');
	$modules_table->upgradeDatabase("default");
	$modules_table->setDefaultConfig("default");
	$config_table = new Config();
	$config_array = $config_table->fetchall()->toArray();
	foreach ($config_array as $config_param)
	{
		Zend_Registry::set($config_param['ckey'], $config_param['value']);
	}
	// // Make session use the DB
	// Zend_Session::setSaveHandler(new RivetyCore_SessionSaveHandler());
	// Zend_Session::start();
	// Get the list of modules from the db
	$modules_table = new Modules('modules');
	$enabled_modules = $modules_table->fetchAll("is_enabled = 1");
	if (count($enabled_modules) > 0)
	{
开发者ID:richjoslin,项目名称:rivety,代码行数:31,代码来源:header.php

示例3: finishedAction

	function finishedAction()
	{
		$request = new RivetyCore_Request($this->getRequest());
		$username = $request->username;
		$users_table = new Users();
		$user = $users_table->fetchByUsername($username);
		$password = substr(md5(rand(50000, 100000)), 0, 8);
		if (!is_null($user))
		{
			// TODO: check the referrer !
			// if this page is reloaded, the admin password is going to get reset to something random, and this page is going to get redirected - CRITICAL FIX

			$user->password = $password;
			$user->save();
			$this->view->username = $username;
			$this->view->password = $password;

			// we should never need this again, so we remove access to it.
			$roles_resources_table = new RolesResources();
			$where  = $roles_resources_table->getAdapter()->quoteInto("module = ? ", "default");
			$where .= $roles_resources_table->getAdapter()->quoteInto(" and controller = ? ", "Install");
			$roles_resources_table->delete($where);
			$modules_table = new Modules('core');
			$modules_table->upgradeDatabase('default');
		}
		else
		{
			die("Error creating admin user. Please check for errors in /logs/RivetyCore_log");
		}
		$this->view->admin_theme_url = "/core/default/views/admin/default";
		$this->view->admin_theme_global_path = Zend_Registry::get('basepath') . "/themes/admin/default/global";
	}
开发者ID:richjoslin,项目名称:rivety,代码行数:32,代码来源:InstallController.php

示例4: Constants

 $constants = new Constants();
 set_include_path(get_include_path() . PATH_SEPARATOR . $config['application']['addtl_includes']);
 $databases = new Zend_Config_Ini($config_file, 'databases');
 $dbAdapters = array();
 foreach ($databases->db as $config_name => $db) {
     $dbAdapters[$config_name] = Zend_Db::factory($db->adapter, $db->config->toArray());
     if ((bool) $db->config->default) {
         Zend_Db_Table::setDefaultAdapter($dbAdapters[$config_name]);
     }
 }
 // Store the adapter for use anywhere in our app
 $registry = Zend_Registry::getInstance();
 $registry->set('dbAdapters', $dbAdapters);
 // check for database changes
 $modules_table = new Modules("core");
 $modules_table->upgradeDatabase("bolts");
 $modules_table->setDefaultConfig("bolts");
 $config_table = new Config();
 $config_array = $config_table->fetchall()->toArray();
 foreach ($config_array as $config_param) {
     Zend_Registry::set($config_param['ckey'], $config_param['value']);
 }
 // Make session use the DB
 Zend_Session::setSaveHandler(new Bolts_SessionSaveHandler());
 Zend_Session::start();
 // set up nuts
 $modules_table = new Modules("nuts");
 $enabled_modules = $modules_table->fetchAll("is_enabled = 1");
 if (count($enabled_modules) > 0) {
     foreach ($enabled_modules as $module) {
         $full_dir = $module_dir . "/" . $module->id;
开发者ID:jaybill,项目名称:Bolts,代码行数:31,代码来源:header.php


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