summaryrefslogtreecommitdiff
path: root/app/Core
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-13 16:56:51 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-13 16:56:51 -0400
commit4b6672d0b33563ab8888d592ef86616ca9238007 (patch)
tree0ba5c0b2244f08ddac55169161271ca2a25ce005 /app/Core
parentd400f7c5be4b3f7371dce73510e5fd4a54375025 (diff)
Move budget outside of the core
The budget planning feature is now a plugin See: https://github.com/kanboard/plugin-budget
Diffstat (limited to 'app/Core')
-rw-r--r--app/Core/Base.php2
-rw-r--r--app/Core/PluginBase.php16
-rw-r--r--app/Core/PluginLoader.php11
3 files changed, 18 insertions, 11 deletions
diff --git a/app/Core/Base.php b/app/Core/Base.php
index 3db0cf74..5ed8f40a 100644
--- a/app/Core/Base.php
+++ b/app/Core/Base.php
@@ -35,7 +35,6 @@ use Pimple\Container;
* @property \Model\Action $action
* @property \Model\Authentication $authentication
* @property \Model\Board $board
- * @property \Model\Budget $budget
* @property \Model\Category $category
* @property \Model\Color $color
* @property \Model\Comment $comment
@@ -43,7 +42,6 @@ use Pimple\Container;
* @property \Model\Currency $currency
* @property \Model\DateParser $dateParser
* @property \Model\File $file
- * @property \Model\HourlyRate $hourlyRate
* @property \Model\LastLogin $lastLogin
* @property \Model\Link $link
* @property \Model\Notification $notification
diff --git a/app/Core/PluginBase.php b/app/Core/PluginBase.php
index 9c3d6e32..457afa03 100644
--- a/app/Core/PluginBase.php
+++ b/app/Core/PluginBase.php
@@ -28,4 +28,20 @@ abstract class PluginBase extends Base
{
return array();
}
+
+ /**
+ * Listen on internal events
+ *
+ * @access public
+ * @param string $event
+ * @param callable $callback
+ */
+ public function on($event, $callback)
+ {
+ $container = $this->container;
+
+ $this->container['dispatcher']->addListener($event, function() use ($container, $callback) {
+ call_user_func($callback, $container);
+ });
+ }
}
diff --git a/app/Core/PluginLoader.php b/app/Core/PluginLoader.php
index 6030ded4..c7c254f7 100644
--- a/app/Core/PluginLoader.php
+++ b/app/Core/PluginLoader.php
@@ -21,21 +21,14 @@ class PluginLoader extends Base
const TABLE_SCHEMA = 'plugin_schema_versions';
/**
- * Plugin folder
- *
- * @var string
- */
- const PATH = __DIR__.'/../../plugins';
-
- /**
* Scan plugin folder and load plugins
*
* @access public
*/
public function scan()
{
- if (file_exists(self::PATH)) {
- $dir = new DirectoryIterator(self::PATH);
+ if (file_exists(__DIR__.'/../../plugins')) {
+ $dir = new DirectoryIterator(__DIR__.'/../../plugins');
foreach ($dir as $fileinfo) {
if (! $fileinfo->isDot() && $fileinfo->isDir()) {