PHP Class Aimeos\ShopBundle\Composer\ScriptHandler

Show file Open project: aimeos/aimeos-symfony2

Public Methods

Method Description
installBundle ( Composer\Script\CommandEvent $event ) Installs the shop bundle.
setupDatabase ( Composer\Script\CommandEvent $event ) Sets up the shop database.
updateConfig ( Composer\Script\CommandEvent $event ) Ensure existing config and routing for the shop bundle.

Protected Methods

Method Description
addAsseticBundle ( &$content ) : boolean Adds the AimeosShopBundle to the assetic section of the config file
createDirectory ( string $dir ) Creates a new directory if it doesn't exist yet
executeCommand ( Composer\Script\CommandEvent $event, string $cmd, array $options = [] ) Executes a Symphony command.
getConsoleDir ( Composer\Script\CommandEvent $event ) : string Returns a relative path to the directory that contains the console command.
getOptions ( Composer\Script\CommandEvent $event ) : array Returns the available options defined in the composer file.
getPhp ( ) : string Returns the path to the PHP interpreter.
updateConfigFile ( string $filename ) Adds the Aimeos shop bundle to the config file of the application.
updateRoutingFile ( string $filename ) Adds the Aimeos shop bundle to the routing file of the application.

Method Details

addAsseticBundle() protected static method

Adds the AimeosShopBundle to the assetic section of the config file
protected static addAsseticBundle ( &$content ) : boolean
return boolean True if modified, false if not

createDirectory() protected static method

Creates a new directory if it doesn't exist yet
protected static createDirectory ( string $dir )
$dir string Absolute path of the new directory

executeCommand() protected static method

Executes a Symphony command.
protected static executeCommand ( Composer\Script\CommandEvent $event, string $cmd, array $options = [] )
$event Composer\Script\CommandEvent Command event object
$cmd string Command name to execute, e.g. "aimeos:update"
$options array

getConsoleDir() protected static method

Returns a relative path to the directory that contains the console command.
protected static getConsoleDir ( Composer\Script\CommandEvent $event ) : string
$event Composer\Script\CommandEvent Command event object
return string The path to the console directory

getOptions() protected static method

Returns the available options defined in the composer file.
protected static getOptions ( Composer\Script\CommandEvent $event ) : array
$event Composer\Script\CommandEvent Command event object
return array Associative list of option keys and values

getPhp() protected static method

Returns the path to the PHP interpreter.
protected static getPhp ( ) : string
return string Path to the PHP command

installBundle() public static method

Installs the shop bundle.
public static installBundle ( Composer\Script\CommandEvent $event )
$event Composer\Script\CommandEvent CommandEvent instance

setupDatabase() public static method

Sets up the shop database.
public static setupDatabase ( Composer\Script\CommandEvent $event )
$event Composer\Script\CommandEvent CommandEvent instance

updateConfig() public static method

Ensure existing config and routing for the shop bundle.
public static updateConfig ( Composer\Script\CommandEvent $event )
$event Composer\Script\CommandEvent CommandEvent instance

updateConfigFile() protected static method

Adds the Aimeos shop bundle to the config file of the application.
protected static updateConfigFile ( string $filename )
$filename string Name of the YAML config file

updateRoutingFile() protected static method

Adds the Aimeos shop bundle to the routing file of the application.
protected static updateRoutingFile ( string $filename )
$filename string Name of the YAML config file