From 9c9ed02cd7ebc5dbbc99bcaed6f80988ce8a9677 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 13 Oct 2015 22:19:17 -0400 Subject: Change namespace to add Kanboard as prefix --- app/Core/Base.php | 162 +++++++++++----------- app/Core/Cache/Base.php | 2 +- app/Core/Cache/CacheInterface.php | 2 +- app/Core/Cache/MemoryCache.php | 2 +- app/Core/Csv.php | 2 +- app/Core/EmailClient.php | 2 +- app/Core/Helper.php | 4 +- app/Core/HttpClient.php | 2 +- app/Core/Lexer.php | 2 +- app/Core/Markdown.php | 4 +- app/Core/NotificationInterface.php | 2 +- app/Core/OAuth2.php | 2 +- app/Core/ObjectStorage/FileStorage.php | 2 +- app/Core/ObjectStorage/ObjectStorageException.php | 2 +- app/Core/ObjectStorage/ObjectStorageInterface.php | 2 +- app/Core/Paginator.php | 2 +- app/Core/Plugin/Base.php | 4 +- app/Core/Plugin/Hook.php | 2 +- app/Core/Plugin/Loader.php | 12 +- app/Core/Request.php | 2 +- app/Core/Response.php | 2 +- app/Core/Router.php | 5 +- app/Core/Security.php | 2 +- app/Core/Session.php | 2 +- app/Core/Template.php | 2 +- app/Core/Tool.php | 4 +- app/Core/Translator.php | 2 +- 27 files changed, 118 insertions(+), 117 deletions(-) (limited to 'app/Core') diff --git a/app/Core/Base.php b/app/Core/Base.php index 7503e840..331b67e3 100644 --- a/app/Core/Base.php +++ b/app/Core/Base.php @@ -1,6 +1,6 @@ helpers[$name])) { - $class = '\Helper\\'.ucfirst($name); + $class = '\Kanboard\Helper\\'.ucfirst($name); $this->helpers[$name] = new $class($this->container); } diff --git a/app/Core/HttpClient.php b/app/Core/HttpClient.php index 99534cfe..4ec5396e 100644 --- a/app/Core/HttpClient.php +++ b/app/Core/HttpClient.php @@ -1,6 +1,6 @@ container); Tool::buildDic($this->container, $instance->getClasses()); @@ -90,7 +90,7 @@ class Loader extends \Core\Base */ public function migrateSchema($plugin) { - $last_version = constant('\Plugin\\'.$plugin.'\Schema\VERSION'); + $last_version = constant('\Kanboard\Plugin\\'.$plugin.'\Schema\VERSION'); $current_version = $this->getSchemaVersion($plugin); try { @@ -99,7 +99,7 @@ class Loader extends \Core\Base $this->db->getDriver()->disableForeignKeys(); for ($i = $current_version + 1; $i <= $last_version; $i++) { - $function_name = '\Plugin\\'.$plugin.'\Schema\version_'.$i; + $function_name = '\Kanboard\Plugin\\'.$plugin.'\Schema\version_'.$i; if (function_exists($function_name)) { call_user_func($function_name, $this->db->getConnection()); diff --git a/app/Core/Request.php b/app/Core/Request.php index d0fcdb8e..f553d7cd 100644 --- a/app/Core/Request.php +++ b/app/Core/Request.php @@ -1,6 +1,6 @@ controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller); + $class = '\Kanboard\\'; + $class .= empty($plugin) ? 'Controller\\'.ucfirst($this->controller) : 'Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller); $instance = new $class($this->container); $instance->beforeAction($this->controller, $this->action); diff --git a/app/Core/Security.php b/app/Core/Security.php index 0bd7c991..126de2fd 100644 --- a/app/Core/Security.php +++ b/app/Core/Security.php @@ -1,6 +1,6 @@ $classes) { foreach ($classes as $name) { - $class = '\\'.$namespace.'\\'.$name; + $class = '\\Kanboard\\'.$namespace.'\\'.$name; $container[lcfirst($name)] = function ($c) use ($class) { return new $class($c); }; diff --git a/app/Core/Translator.php b/app/Core/Translator.php index e9aa1f3f..7dd67363 100644 --- a/app/Core/Translator.php +++ b/app/Core/Translator.php @@ -1,6 +1,6 @@