1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 14:16:46 +02:00

latest 20171218

This commit is contained in:
Sebastian
2017-12-18 10:20:36 +01:00
parent 4cb743c2ae
commit 5fa14fb838
18 changed files with 175 additions and 115 deletions

View File

@@ -12,7 +12,6 @@ class Plugins
/* iterate over plugin folders */
foreach($pluginFolder as $plugin)
{
$className = DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . $plugin . DIRECTORY_SEPARATOR . $plugin;
/* if plugin-class and subscribe-method exists, add classname to array */
@@ -26,7 +25,6 @@ class Plugins
public function getNewRoutes($className, $routes)
{
/* if route-method exists in plugin-class */
if(method_exists($className, 'addNewRoutes'))
{
@@ -59,13 +57,19 @@ class Plugins
return $routes;
}
public function getNewMiddleware($className)
public function getNewMiddleware($className, $middleware)
{
if(method_exists($className, 'addNewMiddleware'))
{
/* check array */
return $className::addNewMiddleware();
$pluginMiddleware = $className::addNewMiddleware();
if($pluginMiddleware)
{
$middleware[] = $pluginMiddleware;
}
}
return $middleware;
}
private function checkRouteArray($routes,$route)