PHP Class lithium\console\command\Library

In addition, communicate with the a given server to add plugins and extensions to the current application. Push archived plugins to the server.
Inheritance: extends lithium\console\Command
Datei anzeigen Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Properties

Property Type Description
$conf string Absolute path to config file.
$f boolean
$filter string Filter used for including files in archive.
$force string Force operation to complete. Typically used for overwriting files.
$password string The password for corresponding username.
$path string Path to where plugins will be installed. Relative to current working directory.
$port string The port for the server.
$server string Server host to query for plugins.
$username string The username for the server authentication.

Protected Properties

Property Type Description
$_autoConfig array Auto configuration properties.
$_classes array some classes
$_settings array Holds settings from conf file

Public Methods

Method Description
archive ( string $name = null, string $result = null ) : boolean Create the Phar::GZ archive from a given directory. If no params, the current working directory is archived with the name of that directory. If one param, the current working directory will be archive with the name provided. If both params, the first is the name or path to the library to archive and the second is the name of the resulting archive
config ( string $key = null, string $value = null, string $options = true ) : void Add configuration and write data in json format.
extract ( string $name = 'new', string $result = null ) : boolean Extract an archive into a path. If one param exists, the app.phar.gz template will be used.
find ( string $type = 'plugins' ) : void List all the plugins and extensions available on the server.
formulate ( string $name = null ) : boolean Create a formula for the given library name
install ( string $name = null ) : boolean Install plugins or extensions to the current application.
push ( string $name = null ) : void Send a plugin archive to the server. The plugin must have a formula.
update ( ) : boolean Update installed plugins. For plugins, runs update commands specified in Formula.

Protected Methods

Method Description
_init ( ) : void Initialize _settings from --conf.
_toPath ( string $name = null ) : string Take a name and return the path.

Method Details

_init() protected method

Throws an exception if the command is initialized without a request object which is needed by _toPath() in order to determine the current working directory. This most often happens if the command is inspected using the ReflectionClass.
protected _init ( ) : void
return void

_toPath() protected method

Take a name and return the path.
protected _toPath ( string $name = null ) : string
$name string
return string

archive() public method

li3 library archive my_archive : archives current working directory to my_archive.phar.gz li3 library archive myapp my_archive : archives 'myapp' to 'my_archive.phar.gz'
public archive ( string $name = null, string $result = null ) : boolean
$name string if only param, the archive name for the current working directory otherwise, The library name or path to the directory to compress.
$result string if exists, The name of the resulting archive
return boolean

config() public method

Add configuration and write data in json format.
public config ( string $key = null, string $value = null, string $options = true ) : void
$key string (server)
$value string value of key
$options string [optional]
return void

extract() public method

If both parameters exist, then the first will be the template archive and the second will be the name of the extracted archive li3 library extract myapp : uses the command/create/template/app.phar.gz li3 library extract another_archive myapp li3 library extract plugin li3_plugin : uses the command/create/template/plugin.phar.gz
public extract ( string $name = 'new', string $result = null ) : boolean
$name string if only param, command/create/template/app.phar.gz extracted to $name otherwise, the template name or full path to extract `from` phar.gz.
$result string if exists $name is extracted to $result
return boolean

find() public method

List all the plugins and extensions available on the server.
public find ( string $type = 'plugins' ) : void
$type string plugins|extensions
return void

formulate() public method

Create a formula for the given library name
public formulate ( string $name = null ) : boolean
$name string the library name or full path to the plugin
return boolean

install() public method

For plugins, the install commands specified in the formula is run.
public install ( string $name = null ) : boolean
$name string name of plugin to add
return boolean

push() public method

Send a plugin archive to the server. The plugin must have a formula.
public push ( string $name = null ) : void
$name string the library name or full path to the archive to send
return void

update() public method

Update installed plugins. For plugins, runs update commands specified in Formula.
public update ( ) : boolean
return boolean

Property Details

$_autoConfig protected_oe property

Auto configuration properties.
protected array $_autoConfig
return array

$_classes protected_oe property

some classes
protected array $_classes
return array

$_settings protected_oe property

Holds settings from conf file
protected array $_settings
return array

$conf public_oe property

Absolute path to config file.
public string $conf
return string

$f public_oe property

public bool $f
return boolean

$filter public_oe property

Filter used for including files in archive.
public string $filter
return string

$force public_oe property

Force operation to complete. Typically used for overwriting files.
public string $force
return string

$password public_oe property

The password for corresponding username.
public string $password
return string

$path public_oe property

Path to where plugins will be installed. Relative to current working directory.
public string $path
return string

$port public_oe property

The port for the server.
public string $port
return string

$server public_oe property

Server host to query for plugins.
public string $server
return string

$username public_oe property

The username for the server authentication.
public string $username
return string