mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-07 15:16:27 +02:00
update descartes
This commit is contained in:
parent
508aeb0957
commit
e15fb3cf8c
15 changed files with 112 additions and 60 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
namespace descartes;
|
||||
/**
|
||||
* Class to route console query
|
||||
*/
|
||||
class Console
|
||||
|
@ -108,7 +109,7 @@
|
|||
$params[$name] = $value;
|
||||
}
|
||||
|
||||
$reflection = new ReflectionMethod($controller, $method);
|
||||
$reflection = new \ReflectionMethod($controller, $method);
|
||||
$method_arguments = [];
|
||||
|
||||
foreach ($reflection->getParameters() as $parameter)
|
||||
|
@ -168,12 +169,12 @@
|
|||
$retour .= 'Help of Controller ' . $controller . "\n" .
|
||||
"Methods : \n";
|
||||
|
||||
$reflection = new ReflectionClass($controller);
|
||||
$reflection = new \ReflectionClass($controller);
|
||||
$reflection_methods = $reflection->getMethods();
|
||||
}
|
||||
else
|
||||
{
|
||||
$reflection_methods = [new ReflectionMethod($controller, $method)];
|
||||
$reflection_methods = [new \ReflectionMethod($controller, $method)];
|
||||
$retour .= 'Help of Controller ' . $controller . ' and method ' . $method . "\n";
|
||||
}
|
||||
|
||||
|
@ -228,7 +229,14 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
$controller = new $controller(...$args);
|
||||
$reflection = new \ReflectionClass($controller);
|
||||
$reflection_method = $reflection->getMethod($method);
|
||||
|
||||
if (!$reflection_method->isStatic())
|
||||
{
|
||||
$controller = new $controller(...$args);
|
||||
}
|
||||
|
||||
return call_user_func_array([$controller, $method], $params);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue