SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SlaxWeb\Bootstrap\Commands\Component\BaseCommand Class Reference
Inheritance diagram for SlaxWeb\Bootstrap\Commands\Component\BaseCommand:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\Bootstrap\Commands\Component\BaseCommand:
Collaboration graph
[legend]

Public Member Functions

 init (Application $app,\GuzzleHttp\Client $client)
 

Public Attributes

 key
 

Protected Member Functions

 getComponent (array $component)
 
 checkComposer ()
 
 installComposer ()
 
 componentExists (string $component)
 
 isInstalled (string $component)
 
 parseMetaData (string $name)
 
 remove (string $name)
 
 configComponent (string $name)
 
 addProviders (array $config, array $providers)
 
 removeProviders (array $config, array $providers)
 

Protected Attributes

 $input = null
 
 $output = null
 
 $composer = ""
 
 $app = null
 
 $client = null
 
 $error = ""
 
 $baseUrl = ""
 
 $logger = null
 
 $providersMap
 
 $metaData = []
 

Member Function Documentation

SlaxWeb\Bootstrap\Commands\Component\BaseCommand::addProviders ( array  $config,
array  $providers 
)
protected

Add providers to config

Add providers to provided config file, and the provided configuration key name.

Parameters
array$configConfiguration for provider including the file name and configuration key name
array$providersList of providers to be added to configuration
Returns
void
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::checkComposer ( )
protected

Check Composer Command

Set the composer command. Returns bool(false) if no composer found.

Returns
bool
Todo:
: Install composer locally if not found
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::componentExists ( string  $component)
protected

Check Component Exists

Try to find the component on packagist.

Parameters
string$componentComponent name to check for existance.
Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::configComponent ( string  $name)
protected

Configure installed component

Add providers, hooks, configuration files, and install sub-components if user requests it.

Parameters
string$nameComponent name
Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::getComponent ( array  $component)
protected

Get component info

Obtain component info from configuration if it exists, and was not passed in as command line arguments.

Parameters
array$componentComponent data
Returns
array
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::init ( Application  $app,
\GuzzleHttp\Client  $client 
)

Init Command

Store the GuzzleHTTP Client object to the class property.

Parameters
\SlaxWeb\Bootstrap\Application$appFramework instance
\GuzzleHttp\Client$clientGuzzle Client
Returns
void
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::installComposer ( )
protected

Install composer

Download and install composer and set the $composer property to the newly installed composer executable. Returns a bool status.

Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::isInstalled ( string  $component)
protected

Check component installed

Check if component directory exists. If it does not, consider it removed.

Parameters
string$componentName of the component
Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::parseMetaData ( string  $name)
protected

Parse component meta data

Load the meta data of the component and parse it. If the meta data file is not found, an error is set, and bool(false) is returned.

Parameters
string$nameName of the component
Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::remove ( string  $name)
protected

Remove component

Removes the component, its config files, and set providers with the help of composer.

Parameters
string$nameName of the component
Returns
bool
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::removeProviders ( array  $config,
array  $providers 
)
protected

Remove providers from config

Remove providers from the provided config file, and the provided configuration key name.

Parameters
array$configConfiguration for provider including the file name and configuration key name
array$providersList of providers to be added to configuration
Returns
void

Member Data Documentation

SlaxWeb\Bootstrap\Commands\Component\BaseCommand::$providersMap
protected
Initial value:
= [
"app" => [
"file" => "provider.php"
SlaxWeb\Bootstrap\Commands\Component\BaseCommand::key
Initial value:
=> "providerList"
],
"commands" => [
"file" => "provider.php",
"key" => "commandsList"
],
"hooks" => [
"file" => "provider.php",
"key" => "hooksList"
]
]

The documentation for this class was generated from the following file: