18 $files=self::getControllersFiles($config);
19 foreach ( $files as $file ) {
23 $parser->parse($controller,$config);
25 $restCache=\array_merge($restCache,$parser->asArray());
28 self::$cache->store(
"controllers/rest",
"return " .
UArray::asPhpArray($restCache,
"array") .
";",
'controllers');
30 echo
"Rest cache reset\n";
36 $restCache=self::getRestCache();
37 foreach ($restCache as $controllerClass=>$restAttributes){
38 if(isset($restCache[$controllerClass])){
39 $result[$controllerClass]=[
"restAttributes"=>$restAttributes,
"routes"=>self::getControllerRoutes($controllerClass,
true)];
46 if (self::$cache->exists(
"controllers/rest"))
47 return self::$cache->fetch(
"controllers/rest");
48 throw new RestException(
"Rest cache entry `".self::$cache->getEntryKey(
"controllers/rest").
"` is missing.\nTry to Re-init Rest cache.");
52 $cacheControllerClass=self::getRestCacheController($controllerClass);
53 if(isset($cacheControllerClass))
54 return $cacheControllerClass[
"resource"];
59 $cache=self::getRestCache();
60 if(isset($cache[$controllerClass])){
61 return $cache[$controllerClass];
static getRestResource($controllerClass)
Exceptions for Rest service.
static getRestCacheController($controllerClass)
static initRestCache(&$config, $silent=false)
static asPhpArray($array, $prefix="", $depth=1, $format=false)
static getClassFullNameFromFile($filePathName, $backSlash=false)
get the full name (name \ namespace) of a class from its file path result example: (string) "I\Am\The...