Exemplo n.º 1
0
 public function stage1()
 {
     if (Input::method() == 'POST') {
         // run patch containing the changes
         require PATH . 'upgrade/patch.php';
         Migrations::apply();
         Config::write(PATH . 'config.php', Config::get());
         return redirect('complete');
     }
     render('stage1');
 }
Exemplo n.º 2
0
// apply changes
$migration->apply();
// update config
Config::set('application.admin_folder', 'admin');
Config::set('application.key', random(32));
/*
	0.5 --> 0.6
*/
$migration = new Migrations();
$sql = "create table if not exists `sessions` (\n\t`id` char( 32 ) not null ,\n\t`date` datetime not null ,\n\t`ip` varchar( 15 ) not null ,\n\t`ua` varchar( 140 ) not null ,\n\t`data` text not null\n) engine=innodb charset=utf8 collate=utf8_general_ci;";
$migration->query($sql);
// comments auto published option
if (Schema::has('meta', 'key', 'auto_published_comments') === false) {
    $sql = "insert into `meta` (`key`, `value`) values ('auto_published_comments', '0')";
    $migration->query($sql);
}
// pagination
if (Schema::has('meta', 'key', 'posts_per_page') === false) {
    $sql = "insert into `meta` (`key`, `value`) values ('posts_per_page', '10')";
    $migration->query($sql);
}
// apply changes
$migration->apply();
// update config
Config::set('session.name', 'anchorcms');
Config::set('session.expire', 3600);
Config::set('session.path', '/');
Config::set('session.domain', '');
Config::set('error.ignore', array(E_NOTICE, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED));
Config::set('error.detail', true);
Config::set('error.log', false);