Page MenuHomeDevCentral

No OneTemporary

diff --git a/includes/autoload.php b/includes/autoload.php
index c5e1280..430f09e 100644
--- a/includes/autoload.php
+++ b/includes/autoload.php
@@ -1,58 +1,59 @@
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Classes auto loader
*
* @package ObsidianWorkspaces
* @filesource
*/
/**
* This SPL autoloader method is called when a class or an interface can't be loaded
*/
function obsidian_autoload ($name) {
//Applications
if ($name == 'HelloWorldApplication') { require './apps/helloworld/HelloWorldApplication.php'; return true; }
if ($name == 'MediaWikiMirrorApplication') { require './apps/mediawikimirror/MediaWikiMirrorApplication.php'; return true; }
if ($name == 'MediaWikiMirrorApplicationConfiguration') { require './apps/mediawikimirror/MediaWikiMirrorApplicationConfiguration.php'; return true; }
if ($name == 'StaticContentApplication') { require './apps/staticcontent/StaticContentApplication.php'; return true; }
if ($name == 'StaticContentApplicationConfiguration') { require './apps/staticcontent/StaticContentApplicationConfiguration.php'; return true; }
//Core controllers
if ($name == 'HeaderController') { require './controllers/header.php'; return true; }
if ($name == 'FooterController') { require './controllers/footer.php'; return true; }
if ($name == 'HomepageController') { require './controllers/home.php'; return true; }
//Keruald and Obsidian Workspaces Libraries
if ($name == 'ObjectDeserializable') { require './includes/ObjectDeserializable.php'; return true; }
if ($name == 'Application') { require './includes/apps/Application.php'; return true; }
if ($name == 'ApplicationConfiguration') { require './includes/apps/ApplicationConfiguration.php'; return true; }
if ($name == 'ApplicationContext') { require './includes/apps/ApplicationContext.php'; return true; }
if ($name == 'Cache') { require './includes/cache/cache.php'; return true; }
if ($name == 'CacheMemcached') { require './includes/cache/memcached.php'; return true; }
if ($name == 'CacheVoid') { require './includes/cache/void.php'; return true; }
if ($name == 'Context') { require './includes/controller/Context.php'; return true; }
if ($name == 'Controller') { require './includes/controller/Controller.php'; return true; }
+ if ($name == 'RunnableWithContext') { require './includes/controller/RunnableWithContext.php'; return true; }
if ($name == 'Message') { require './includes/i18n/Message.php'; return true; }
if ($name == 'User') { require './includes/objects/user.php'; return true; }
if ($name == 'UserGroup') { require './includes/objects/usergroup.php'; return true; }
if ($name == 'Workspace') { require './includes/workspaces/Workspace.php'; return true; }
if ($name == 'WorkspaceConfiguration') { require './includes/workspaces/WorkspaceConfiguration.php'; return true; }
return false;
}
spl_autoload_register('obsidian_autoload');
diff --git a/includes/controller/Controller.php b/includes/controller/Controller.php
index d296652..4bf6013 100644
--- a/includes/controller/Controller.php
+++ b/includes/controller/Controller.php
@@ -1,42 +1,42 @@
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Controller class
*
* @package ObsidianWorkspaces
* @subpackage Controller
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
/**
* Controller class
*
* This class describes a controller
*/
-class Controller {
+class Controller implements RunnableWithContext {
/**
* @var string the application name
*/
public static $name;
/**
* @var Context the site context
*/
public $context;
/**
* Initializes a new instance of the controller with the specified context and handle request
*/
public static function Run (Context $context) {
$controller = new static;
$controller->context = $context;
$controller->handleRequest();
}
-}
\ No newline at end of file
+}
diff --git a/includes/controller/RunnableWithContext.php b/includes/controller/RunnableWithContext.php
new file mode 100644
index 0000000..c408e8b
--- /dev/null
+++ b/includes/controller/RunnableWithContext.php
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * _, __, _, _ __, _ _, _, _
+ * / \ |_) (_ | | \ | /_\ |\ |
+ * \ / |_) , ) | |_/ | | | | \|
+ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+ *
+ * Controller class
+ *
+ * @package ObsidianWorkspaces
+ * @subpackage Controller
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @filesource
+ */
+
+/**
+ * RunnableWithContext interface
+ *
+ * Objects implementing this interface can initialize themselves and
+ * execute a task they represent, with a context as parameter.
+ */
+interface RunnableWithContext {
+ /**
+ * Initializes a new instance of the object with the specified context and handle request
+ */
+ public static function Run (Context $context);
+}
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jul 7, 17:16 (13 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3894464
Default Alt Text
(5 KB)

Event Timeline