Misc fixes and improvements
* Added request logging to com.noccy.apiclient * Added plugin com.noccy.watcher * Added pipe command and filter support * Fixes and stubs
This commit is contained in:
@ -153,6 +153,25 @@ class Environment
|
||||
}
|
||||
|
||||
SparkApplication::$instance->getPluginManager()->initializePlugins();
|
||||
|
||||
$this->loadResources();
|
||||
}
|
||||
|
||||
private function loadResources()
|
||||
{
|
||||
$resourceFile = $this->getConfigDirectory() . "/resources.json";
|
||||
if (!file_exists($resourceFile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$json = json_decode(
|
||||
file_get_contents($resourceFile),
|
||||
true
|
||||
);
|
||||
foreach ($json['resources'] as $name=>$uri) {
|
||||
[$type, $uri] = explode("+", $uri, 2);
|
||||
create_resource($name, $type, uri:$uri);
|
||||
}
|
||||
}
|
||||
|
||||
public static function createFromDirectory(string|null $directory=null, bool $parents=false): Environment
|
||||
|
Reference in New Issue
Block a user