From 34059aa157b7262553efdec14086bf08d0798fc3 Mon Sep 17 00:00:00 2001 From: Oreolek Date: Fri, 28 Dec 2012 13:31:24 +0700 Subject: [PATCH] Kohana 3.3 migration --- application/bootstrap.php | 19 ++++++++++++------- .../error.php => Controller/Error.php} | 0 .../footer.php => Controller/Footer.php} | 4 ++-- .../header.php => Controller/Header.php} | 0 .../login.php => Controller/Login.php} | 2 +- .../logout.php => Controller/Logout.php} | 2 +- .../Navigation.php} | 0 .../exception.php => Kohana/Exception.php} | 0 .../{model/user.php => Model/User.php} | 0 modules/auth | 2 +- modules/database | 2 +- modules/orm | 2 +- system | 2 +- 13 files changed, 20 insertions(+), 15 deletions(-) rename application/classes/{controller/error.php => Controller/Error.php} (100%) rename application/classes/{controller/footer.php => Controller/Footer.php} (74%) rename application/classes/{controller/header.php => Controller/Header.php} (100%) rename application/classes/{controller/login.php => Controller/Login.php} (86%) rename application/classes/{controller/logout.php => Controller/Logout.php} (75%) rename application/classes/{controller/navigation.php => Controller/Navigation.php} (100%) rename application/classes/{kohana/exception.php => Kohana/Exception.php} (100%) rename application/classes/{model/user.php => Model/User.php} (100%) diff --git a/application/bootstrap.php b/application/bootstrap.php index d34d20d..dca0c81 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -3,17 +3,17 @@ // -- Environment setup -------------------------------------------------------- // 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 - require APPPATH.'classes/kohana'.EXT; + require APPPATH.'classes/Kohana'.EXT; } else { // 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); +/** + * Set cookie salt (required) + */ +Cookie::$salt = 'Dz75cE_QoUDXvo2'; + /** * Enable modules. Modules are referenced by a relative or absolute path. */ @@ -119,11 +124,11 @@ Kohana::modules(array( */ Route::set('error', 'error/(/)', array('action' => '[0-9]++','message' => '.+')) ->defaults(array( - 'controller' => 'error', + 'controller' => 'Error', )); Route::set('default', '((/(/)))') ->defaults(array( - 'controller' => 'error', - 'action' => 'view', + 'controller' => 'Error', + 'action' => '404', )); diff --git a/application/classes/controller/error.php b/application/classes/Controller/Error.php similarity index 100% rename from application/classes/controller/error.php rename to application/classes/Controller/Error.php diff --git a/application/classes/controller/footer.php b/application/classes/Controller/Footer.php similarity index 74% rename from application/classes/controller/footer.php rename to application/classes/Controller/Footer.php index 5eebc5b..74b9681 100644 --- a/application/classes/controller/footer.php +++ b/application/classes/Controller/Footer.php @@ -3,5 +3,5 @@ class Controller_Footer extends Controller_Template { public $template = 'footer'; public function action_standard() { } - public function action_view(){$this->request->redirect('');} -} \ No newline at end of file + public function action_view(){$this->redirect('');} +} diff --git a/application/classes/controller/header.php b/application/classes/Controller/Header.php similarity index 100% rename from application/classes/controller/header.php rename to application/classes/Controller/Header.php diff --git a/application/classes/controller/login.php b/application/classes/Controller/Login.php similarity index 86% rename from application/classes/controller/login.php rename to application/classes/Controller/Login.php index 9ee9ad7..e515fd4 100644 --- a/application/classes/controller/login.php +++ b/application/classes/Controller/Login.php @@ -3,7 +3,7 @@ class Controller_Login extends Controller_Template { public $template = 'login'; public function action_view() { - if(Auth::instance()->logged_in()) return $this->request->redirect(''); + if(Auth::instance()->logged_in()) return $this->redirect(''); if ($_POST){ $user = ORM::factory('user'); $status = Auth::instance()->login($this->request->post('login'), $this->request->post('password')); diff --git a/application/classes/controller/logout.php b/application/classes/Controller/Logout.php similarity index 75% rename from application/classes/controller/logout.php rename to application/classes/Controller/Logout.php index 6f26669..db81ce5 100644 --- a/application/classes/controller/logout.php +++ b/application/classes/Controller/Logout.php @@ -2,7 +2,7 @@ class Controller_Logout extends Controller { 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 = "Ошибка выхода пользователя."; } } diff --git a/application/classes/controller/navigation.php b/application/classes/Controller/Navigation.php similarity index 100% rename from application/classes/controller/navigation.php rename to application/classes/Controller/Navigation.php diff --git a/application/classes/kohana/exception.php b/application/classes/Kohana/Exception.php similarity index 100% rename from application/classes/kohana/exception.php rename to application/classes/Kohana/Exception.php diff --git a/application/classes/model/user.php b/application/classes/Model/User.php similarity index 100% rename from application/classes/model/user.php rename to application/classes/Model/User.php diff --git a/modules/auth b/modules/auth index 24073ab..74f2995 160000 --- a/modules/auth +++ b/modules/auth @@ -1 +1 @@ -Subproject commit 24073ab4d4424ea51ceab01ef9021ee563051177 +Subproject commit 74f29951da75a3d665e9468b8c54768f917bb7c1 diff --git a/modules/database b/modules/database index f0944e8..264e3a2 160000 --- a/modules/database +++ b/modules/database @@ -1 +1 @@ -Subproject commit f0944e8586ef2f8230042d822a3781c4835c3a75 +Subproject commit 264e3a24bd6be3b83154816abda2e7713ddfa2c3 diff --git a/modules/orm b/modules/orm index bb5f9ef..cb4be3a 160000 --- a/modules/orm +++ b/modules/orm @@ -1 +1 @@ -Subproject commit bb5f9ef98e8f4a0cc7274f6331aa9eaebcba4b4d +Subproject commit cb4be3a6d9442ef9ab978c7306c5e0841e3d75d9 diff --git a/system b/system index 44fcb1b..f3c027d 160000 --- a/system +++ b/system @@ -1 +1 @@ -Subproject commit 44fcb1b68a760f4d9ab46607776671b2d40d3647 +Subproject commit f3c027d476b96ad22e238759f23538707f550960