From 4faf9477bb6df589625f6b23972f5f5e316137aa Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Thu, 3 Apr 2014 14:06:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BB=D0=BE=D0=B0=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/app.php | 21 ++--------- .../{controller.php => Controller.php} | 0 ground/classes/{model.php => Model.php} | 0 ground/classes/singleton.php | 35 ------------------- ground/models/{category.php => Category.php} | 0 ground/models/{point.php => Point.php} | 0 public/index.php | 23 ++++++++---- 7 files changed, 20 insertions(+), 59 deletions(-) rename ground/classes/{controller.php => Controller.php} (100%) rename ground/classes/{model.php => Model.php} (100%) delete mode 100644 ground/classes/singleton.php rename ground/models/{category.php => Category.php} (100%) rename ground/models/{point.php => Point.php} (100%) diff --git a/ground/app.php b/ground/app.php index b673594..14e24a6 100644 --- a/ground/app.php +++ b/ground/app.php @@ -31,15 +31,6 @@ class App } } - /** - * Загружает класс контроллера. - * @param string $controllerName - */ - private static function loadController($controllerName) - { - include_once 'controllers/' . strtolower($controllerName) . '.php'; - } - /** * Основной метод для запуска приложения. * @param array $config @@ -50,21 +41,15 @@ class App self::$config = is_array($config) ? $config : array(); self::parseUrl(); - //var_dump(self::$controller, self::$action);die; - if (self::getConfig('DB')) { try { $confDB = self::getConfig('DB'); self::$DB = new PDO('mysql:host=' . $confDB['host'] . ';dbname=' . $confDB['dbname'].';charset=utf8;', $confDB['user'], $confDB['password']); - - foreach (glob(App::getBasedir() . "models/*.php") as $filename) - { - include_once $filename; - } - } catch (PDOException $e) - { + } + catch (PDOException $e) + { echo $e->getMessage(); } } diff --git a/ground/classes/controller.php b/ground/classes/Controller.php similarity index 100% rename from ground/classes/controller.php rename to ground/classes/Controller.php diff --git a/ground/classes/model.php b/ground/classes/Model.php similarity index 100% rename from ground/classes/model.php rename to ground/classes/Model.php diff --git a/ground/classes/singleton.php b/ground/classes/singleton.php deleted file mode 100644 index c89fe56..0000000 --- a/ground/classes/singleton.php +++ /dev/null @@ -1,35 +0,0 @@ -