Method | Description | |
---|---|---|
__construct ( string $api, string $class ) | Base constructor. | |
getEnvironment ( ) : string | Get the name of current environment. | |
initRest ( string $api, string $url = '', string $method = '' ) : boolean | |
Initializes the current Rest configuration, tries to match the current URL with the defined Path. | |
processRequest ( ) : boolean | |
Processes the current request and returns an instance of CallbackResult. | |
setEnvironment ( string $env = self::ENV_PRODUCTION ) | Set the component environment. |
Method | Description | |
---|---|---|
initializeCache ( ) | Initializes the compiler cache driver. | |
isDevelopment ( ) : boolean | Returns true if current environment is 'development'. | |
parseClass ( ) | Calls the Parser to parse the class and then Compiler to create a compiled cache file of the parsed class. | |
processRouterResponse ( |
Internal static method that is called when initRest method matches a URL agains the Path. | |
registerClass ( ) | Registers the class and creates a compile cache version of it. |
public __construct ( string $api, string $class ) | ||
$api | string | Name of the api configuration. |
$class | string | Name of the class that will been registered with the api. |
public getEnvironment ( ) : string | ||
return | string |
public static initRest ( string $api, string $url = '', string $method = '' ) : boolean | |
||
$api | string | Api configuration Name |
$url | string | Url on which the to match. Leave blank to use the current url. |
$method | string | Name of the HTTP method that will be used to match the request. Leave blank to use the method from the current HTTP request. |
return | boolean | |
public processRequest ( ) : boolean | |
||
return | boolean | |
public setEnvironment ( string $env = self::ENV_PRODUCTION ) | ||
$env | string | Can either be 'development' or 'production' |