Kohana 3.3 migration

This commit is contained in:
Alexander Yakovlev 2012-12-28 13:31:24 +07:00
parent c95b8a90e9
commit 34059aa157
13 changed files with 20 additions and 15 deletions

View file

@ -3,17 +3,17 @@
// -- Environment setup -------------------------------------------------------- // -- Environment setup --------------------------------------------------------
// Load the core Kohana class // Load the core Kohana class
require SYSPATH.'classes/kohana/core'.EXT; require SYSPATH.'classes/Kohana/Core'.EXT;
if (is_file(APPPATH.'classes/kohana'.EXT)) if (is_file(APPPATH.'classes/Kohana'.EXT))
{ {
// Application extends the core // Application extends the core
require APPPATH.'classes/kohana'.EXT; require APPPATH.'classes/Kohana'.EXT;
} }
else else
{ {
// Load empty core extension // Load empty core extension
require SYSPATH.'classes/kohana'.EXT; require SYSPATH.'classes/Kohana'.EXT;
} }
/** /**
@ -97,6 +97,11 @@ Kohana::$log->attach(new Log_File(APPPATH.'logs'));
*/ */
Kohana::$config->attach(new Config_File); Kohana::$config->attach(new Config_File);
/**
* Set cookie salt (required)
*/
Cookie::$salt = 'Dz75cE_QoUDXvo2';
/** /**
* Enable modules. Modules are referenced by a relative or absolute path. * Enable modules. Modules are referenced by a relative or absolute path.
*/ */
@ -119,11 +124,11 @@ Kohana::modules(array(
*/ */
Route::set('error', 'error/<action>(/<message>)', array('action' => '[0-9]++','message' => '.+')) Route::set('error', 'error/<action>(/<message>)', array('action' => '[0-9]++','message' => '.+'))
->defaults(array( ->defaults(array(
'controller' => 'error', 'controller' => 'Error',
)); ));
Route::set('default', '(<controller>(/<action>(/<id>)))') Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array( ->defaults(array(
'controller' => 'error', 'controller' => 'Error',
'action' => 'view', 'action' => '404',
)); ));

View file

@ -3,5 +3,5 @@
class Controller_Footer extends Controller_Template { class Controller_Footer extends Controller_Template {
public $template = 'footer'; public $template = 'footer';
public function action_standard() { } public function action_standard() { }
public function action_view(){$this->request->redirect('');} public function action_view(){$this->redirect('');}
} }

View file

@ -3,7 +3,7 @@
class Controller_Login extends Controller_Template { class Controller_Login extends Controller_Template {
public $template = 'login'; public $template = 'login';
public function action_view() { public function action_view() {
if(Auth::instance()->logged_in()) return $this->request->redirect(''); if(Auth::instance()->logged_in()) return $this->redirect('');
if ($_POST){ if ($_POST){
$user = ORM::factory('user'); $user = ORM::factory('user');
$status = Auth::instance()->login($this->request->post('login'), $this->request->post('password')); $status = Auth::instance()->login($this->request->post('login'), $this->request->post('password'));

View file

@ -2,7 +2,7 @@
class Controller_Logout extends Controller { class Controller_Logout extends Controller {
public function action_view() { public function action_view() {
if (Auth::instance()->logout()) return $this->request->redirect('login'); if (Auth::instance()->logout()) return $this->redirect('login');
else $this->template->error = "Ошибка выхода пользователя."; else $this->template->error = "Ошибка выхода пользователя.";
} }
} }

@ -1 +1 @@
Subproject commit 24073ab4d4424ea51ceab01ef9021ee563051177 Subproject commit 74f29951da75a3d665e9468b8c54768f917bb7c1

@ -1 +1 @@
Subproject commit f0944e8586ef2f8230042d822a3781c4835c3a75 Subproject commit 264e3a24bd6be3b83154816abda2e7713ddfa2c3

@ -1 +1 @@
Subproject commit bb5f9ef98e8f4a0cc7274f6331aa9eaebcba4b4d Subproject commit cb4be3a6d9442ef9ab978c7306c5e0841e3d75d9

2
system

@ -1 +1 @@
Subproject commit 44fcb1b68a760f4d9ab46607776671b2d40d3647 Subproject commit f3c027d476b96ad22e238759f23538707f550960