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:
		@@ -1,6 +1,7 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Spark\SparkApplication;
 | 
			
		||||
use Spark\Environment\Environment;
 | 
			
		||||
 | 
			
		||||
abstract class SparkPlug
 | 
			
		||||
{
 | 
			
		||||
@@ -11,12 +12,22 @@ abstract class SparkPlug
 | 
			
		||||
        return SparkApplication::$instance->getPluginManager()->getPlugin($name);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function getResource(string $name)
 | 
			
		||||
    public function getResource(string $name)
 | 
			
		||||
    {
 | 
			
		||||
        return SparkApplication::$instance->getResourceManager()->getNamedResource($name);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public function getEnvironment(): Environment
 | 
			
		||||
    {
 | 
			
		||||
        return SparkApplication::$instance->getEnvironment();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function readConfig($file=null)
 | 
			
		||||
    public function getApplication(): SparkApplication
 | 
			
		||||
    {
 | 
			
		||||
        return SparkApplication::$instance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function readConfig($file=null)
 | 
			
		||||
    {
 | 
			
		||||
        if (!$file) return;
 | 
			
		||||
        $abs = get_environment()->getConfigDirectory() . "/" . $file;
 | 
			
		||||
@@ -32,5 +43,9 @@ abstract class SparkPlug
 | 
			
		||||
        return SparkApplication::$instance->getEnvironment()->getProjectDirectory();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getConfigDirectory()
 | 
			
		||||
    {
 | 
			
		||||
        return SparkApplication::$instance->getEnvironment()->getConfigDirectory();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user