PHP Class Newscoop\Services\Plugins\ManagerService

Manage plugins installation, status and more...
Show file Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$pluginsDir string Plugins directory

Protected Properties

Property Type Description
$config array Config array
$dev string Application environment
$dispatcher Newscoop\EventDispatcher\EventDispatcher
$em Doctrine\ORM\EntityManager
$logger Symfony\Bridge\Monolog\Logger Logger
$newsoopDir string Newscoop root directory
$pluginsService Newscoop\Services\Plugins\PluginsService Plugins service

Public Methods

Method Description
__construct ( EntityManager $em, Newscoop\EventDispatcher\EventDispatcher $dispatcher, $pluginsService, Symfony\Bridge\Monolog\Logger $logger, array $config )
disablePlugin ( Plugin $plugin ) Disable plugin
dispatchEventForPlugin ( string $pluginName, string $eventName, mixed $output = null ) Dispatch events for plugins
enablePlugin ( Plugin $plugin ) Enable plugin
findAvaiablePlugins ( ) : array Find avaiable plugins
getInstalledPlugins ( ) : array Get installed plugins
installComposer ( ) Install composer
installPlugin ( string $pluginName, string $version, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true ) Install plugin inside Newscoop - it's a wrapper for all tasks connected with plugin installation
isInstalled ( string $pluginName ) : boolean Check if plugin is installed TODO
removePlugin ( string $pluginName, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true ) Remove plugin from newscoop (composer+database+cleaning)
updatePlugin ( string $pluginName, string $version, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true ) Update installed plugin
upgrade ( Symfony\Component\Console\Output\OutputInterface $output, $doUpdate = false ) Reinstall plugins after Newscoop upgrade (re-add them to composer)

Private Methods

Method Description
clearCache ( Symfony\Component\Console\Output\OutputInterface $output ) Clear cache after plugin installation
handleConfig ( array $config )
prepareCacheDir ( )
saveAvaiablePluginsToCacheFile ( )

Method Details

__construct() public method

public __construct ( EntityManager $em, Newscoop\EventDispatcher\EventDispatcher $dispatcher, $pluginsService, Symfony\Bridge\Monolog\Logger $logger, array $config )
$em Doctrine\ORM\EntityManager
$dispatcher Newscoop\EventDispatcher\EventDispatcher
$logger Symfony\Bridge\Monolog\Logger
$config array

disablePlugin() public method

Disable plugin
public disablePlugin ( Plugin $plugin )
$plugin Newscoop\Entity\Plugin

dispatchEventForPlugin() public method

Dispatch events for plugins
public dispatchEventForPlugin ( string $pluginName, string $eventName, mixed $output = null )
$pluginName string
$eventName string
$output mixed

enablePlugin() public method

Enable plugin
public enablePlugin ( Plugin $plugin )
$plugin Newscoop\Entity\Plugin

findAvaiablePlugins() public method

Find avaiable plugins
public findAvaiablePlugins ( ) : array
return array array('plugin/name' => \Class\Name)

getInstalledPlugins() public method

Get installed plugins
public getInstalledPlugins ( ) : array
return array Array with installed plugins info

installComposer() public method

Install composer
public installComposer ( )

installPlugin() public method

Install plugin inside Newscoop - it's a wrapper for all tasks connected with plugin installation
public installPlugin ( string $pluginName, string $version, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true )
$pluginName string
$version string
$output Symfony\Component\Console\Output\OutputInterface
$notify boolean

isInstalled() public method

Check if plugin is installed TODO
public isInstalled ( string $pluginName ) : boolean
$pluginName string
return boolean

removePlugin() public method

Remove plugin from newscoop (composer+database+cleaning)
public removePlugin ( string $pluginName, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true )
$pluginName string
$output Symfony\Component\Console\Output\OutputInterface
$notify boolean

updatePlugin() public method

Update installed plugin
public updatePlugin ( string $pluginName, string $version, Symfony\Component\Console\Output\OutputInterface $output, boolean $notify = true )
$pluginName string
$version string
$output Symfony\Component\Console\Output\OutputInterface
$notify boolean

upgrade() public method

Reinstall plugins after Newscoop upgrade (re-add them to composer)
public upgrade ( Symfony\Component\Console\Output\OutputInterface $output, $doUpdate = false )
$output Symfony\Component\Console\Output\OutputInterface

Property Details

$config protected property

Config array
protected array $config
return array

$dev protected property

Application environment
protected string $dev
return string

$dispatcher protected property

protected EventDispatcher,Newscoop\EventDispatcher $dispatcher
return Newscoop\EventDispatcher\EventDispatcher

$em protected property

protected EntityManager,Doctrine\ORM $em
return Doctrine\ORM\EntityManager

$logger protected property

Logger
protected Logger,Symfony\Bridge\Monolog $logger
return Symfony\Bridge\Monolog\Logger

$newsoopDir protected property

Newscoop root directory
protected string $newsoopDir
return string

$pluginsDir public property

Plugins directory
public string $pluginsDir
return string

$pluginsService protected property

Plugins service
protected Newscoop\Services\Plugins\PluginsService $pluginsService
return Newscoop\Services\Plugins\PluginsService