PHP 클래스 Puli\Manager\Api\Container

Use this class to access the managers provided by this module: php $puli = new Puli(getcwd()); $puli->start(); $moduleManager = $puli->getModuleManager(); The Puli class either operates in the global or a project context: * The "global context" is not tied to a specific root module. A global context only loads the settings of the "config.json" file in the home directory. The Puli class operates in the global context if no project root directory is passed to the constructor. In the global context, only the global config file manager is available. * The "project context" is tied to a specific Puli project. You need to pass the path to the project's root directory to the constructor or to {@link setRootDirectory()}. The configuration of the "puli.json" file in the root directory is used to configure the managers. The Puli class creates four kinds of managers: * The "config file manager" allows you to modify entries of the "config.json" file in the home directory. * The "module file manager" manages modifications to the "puli.json" file of a Puli project. * The "module manager" manages the module repository of a Puli project. * The "repository manager" manages the resource repository of a Puli project. * The "discovery manager" manages the resource discovery of a Puli project. The home directory is read from the context variable "PULI_HOME". If this variable is not set, the home directory defaults to: * $HOME/.puli on Linux, where $HOME is the context variable "HOME". * $APPDATA/Puli on Windows, where $APPDATA is the context variable "APPDATA". If none of these variables can be found, an exception is thrown. A .htaccess file is put into the home directory to protect it from web access.
부터: 1.0
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: puli/manager 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string | null $rootDir = null, string $env = Environment::DEV ) Creates a new instance for the given Puli project.
arePluginsEnabled ( ) : boolean Returns whether Puli plugins are enabled.
disablePlugins ( ) Disables all Puli plugins.
enablePlugins ( ) Enables all Puli plugins.
getAssetManager ( ) : Puli\Manager\Api\Asset\AssetManager Returns the asset manager.
getConfigFileConverter ( ) : Puli\Manager\Config\ConfigFileConverter Returns the configuration file serializer.
getConfigFileManager ( ) : Puli\Manager\Api\Config\ConfigFileManager Returns the configuration file manager.
getContext ( ) : Puli\Manager\Api\Context\Context | Puli\Manager\Api\Context\ProjectContext Returns the context.
getDiscovery ( ) : Puli\Discovery\Api\EditableDiscovery Returns the resource discovery of the project.
getDiscoveryManager ( ) : Puli\Manager\Api\Discovery\DiscoveryManager Returns the resource discovery manager.
getEnvironment ( ) : string Retturns the environment of the managed Puli project.
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | null Returns the used event dispatcher.
getFactory ( ) : object
getFactoryManager ( ) : Puli\Manager\Api\Factory\FactoryManager
getInstallationManager ( ) : Puli\Manager\Api\Installation\InstallationManager Returns the installation manager.
getInstallerManager ( ) : Puli\Manager\Api\Installer\InstallerManager Returns the installer manager.
getJsonDecoder ( ) : JsonDecoder Returns the JSON decoder.
getJsonEncoder ( ) : JsonEncoder Returns the JSON encoder.
getJsonValidator ( ) : JsonValidator Returns the JSON validator.
getLegacyModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter Returns the module file serializer with support for legacy versions.
getLegacyRootModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter Returns the module file serializer with support for legacy versions.
getLogger ( ) : Psr\Log\LoggerInterface Returns the logger.
getModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter Returns the module file converter.
getModuleManager ( ) : Puli\Manager\Api\Module\ModuleManager Returns the module manager.
getRepository ( ) : Puli\Repository\Api\EditableRepository Returns the resource repository of the project.
getRepositoryManager ( ) : Puli\Manager\Api\Repository\RepositoryManager Returns the resource repository manager.
getRootDirectory ( ) : string | null Returns the root directory of the managed Puli project.
getRootModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter Returns the module file converter.
getRootModuleFileManager ( ) : Puli\Manager\Api\Module\RootModuleFileManager Returns the root module file manager.
getServerManager ( ) : Puli\Manager\Api\Server\ServerManager Returns the server manager.
getStorage ( ) : Puli\Manager\Api\Storage\Storage Returns the file storage.
getUrlGenerator ( ) : Puli\UrlGenerator\Api\UrlGenerator Returns the resource URL generator.
isStarted ( ) : boolean Returns whether the service container is started.
setEnvironment ( string $env ) Sets the environment of the managed Puli project.
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher ) Sets the event dispatcher to use.
setLogger ( Psr\Log\LoggerInterface $logger ) Sets the logger to use.
setRootDirectory ( string | null $rootDir ) Sets the root directory of the managed Puli project.
start ( ) Starts the service container.

비공개 메소드들

메소드 설명
activatePlugins ( )
createGlobalContext ( )
createProjectContext ( string $rootDir, $env ) : Puli\Manager\Api\Context\ProjectContext Creates the context of a Puli project.
createValidatingConverter ( Webmozart\Json\Conversion\JsonConverter $innerConverter, string | callable | null $schema = null ) : ValidatingConverter Decorates a converter with a {@link ValidatingConverter}.
getJsonStorage ( ) : JsonStorage Returns the JSON file storage.
getJsonVersioner ( ) : Webmozart\Json\Versioning\JsonVersioner Returns the JSON versioner.
getModuleFileMigrationManager ( ) : MigrationManager Returns the migration manager for module files.
loadConfigFile ( $homeDir, Puli\Manager\Api\Config\Config $baseConfig )
parseHomeDirectory ( ) : null | string Parses the system context for a home directory.
validatePluginClass ( string $pluginClass ) Validates the given plugin class name.

메소드 상세

__construct() 공개 메소드

Creates a new instance for the given Puli project.
public __construct ( string | null $rootDir = null, string $env = Environment::DEV )
$rootDir string | null The root directory of the Puli project. If none is passed, the object operates in the global context. You can set or switch the root directories later on by calling {@link setRootDirectory()}.
$env string One of the {@link Environment} constants.

arePluginsEnabled() 공개 메소드

Returns whether Puli plugins are enabled.
public arePluginsEnabled ( ) : boolean
리턴 boolean Returns `true` if Puli plugins will be loaded and `false` otherwise.

disablePlugins() 공개 메소드

Disables all Puli plugins.
public disablePlugins ( )

enablePlugins() 공개 메소드

Enables all Puli plugins.
public enablePlugins ( )

getAssetManager() 공개 메소드

Returns the asset manager.
public getAssetManager ( ) : Puli\Manager\Api\Asset\AssetManager
리턴 Puli\Manager\Api\Asset\AssetManager The asset manager.

getConfigFileConverter() 공개 메소드

Returns the configuration file serializer.
public getConfigFileConverter ( ) : Puli\Manager\Config\ConfigFileConverter
리턴 Puli\Manager\Config\ConfigFileConverter The configuration file serializer.

getConfigFileManager() 공개 메소드

Returns the configuration file manager.
public getConfigFileManager ( ) : Puli\Manager\Api\Config\ConfigFileManager
리턴 Puli\Manager\Api\Config\ConfigFileManager The configuration file manager.

getContext() 공개 메소드

Returns the context.
public getContext ( ) : Puli\Manager\Api\Context\Context | Puli\Manager\Api\Context\ProjectContext
리턴 Puli\Manager\Api\Context\Context | Puli\Manager\Api\Context\ProjectContext The context.

getDiscovery() 공개 메소드

Returns the resource discovery of the project.
public getDiscovery ( ) : Puli\Discovery\Api\EditableDiscovery
리턴 Puli\Discovery\Api\EditableDiscovery The resource discovery.

getDiscoveryManager() 공개 메소드

Returns the resource discovery manager.
public getDiscoveryManager ( ) : Puli\Manager\Api\Discovery\DiscoveryManager
리턴 Puli\Manager\Api\Discovery\DiscoveryManager The discovery manager.

getEnvironment() 공개 메소드

Retturns the environment of the managed Puli project.
public getEnvironment ( ) : string
리턴 string One of the {@link Environment} constants.

getEventDispatcher() 공개 메소드

Returns the used event dispatcher.
public getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | null
리턴 Symfony\Component\EventDispatcher\EventDispatcherInterface | null The used logger.

getFactory() 공개 메소드

public getFactory ( ) : object
리턴 object

getFactoryManager() 공개 메소드

public getFactoryManager ( ) : Puli\Manager\Api\Factory\FactoryManager
리턴 Puli\Manager\Api\Factory\FactoryManager

getInstallationManager() 공개 메소드

Returns the installation manager.
public getInstallationManager ( ) : Puli\Manager\Api\Installation\InstallationManager
리턴 Puli\Manager\Api\Installation\InstallationManager The installation manager.

getInstallerManager() 공개 메소드

Returns the installer manager.
public getInstallerManager ( ) : Puli\Manager\Api\Installer\InstallerManager
리턴 Puli\Manager\Api\Installer\InstallerManager The installer manager.

getJsonDecoder() 공개 메소드

Returns the JSON decoder.
public getJsonDecoder ( ) : JsonDecoder
리턴 Webmozart\Json\JsonDecoder The JSON decoder.

getJsonEncoder() 공개 메소드

Returns the JSON encoder.
public getJsonEncoder ( ) : JsonEncoder
리턴 Webmozart\Json\JsonEncoder The JSON encoder.

getJsonValidator() 공개 메소드

Returns the JSON validator.
public getJsonValidator ( ) : JsonValidator
리턴 Webmozart\Json\JsonValidator The JSON validator.

getLegacyModuleFileConverter() 공개 메소드

Returns the module file serializer with support for legacy versions.
public getLegacyModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter
리턴 Webmozart\Json\Conversion\JsonConverter The module file converter.

getLegacyRootModuleFileConverter() 공개 메소드

Returns the module file serializer with support for legacy versions.
public getLegacyRootModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter
리턴 Webmozart\Json\Conversion\JsonConverter The module file converter.

getLogger() 공개 메소드

Returns the logger.
public getLogger ( ) : Psr\Log\LoggerInterface
리턴 Psr\Log\LoggerInterface The logger.

getModuleFileConverter() 공개 메소드

Returns the module file converter.
public getModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter
리턴 Webmozart\Json\Conversion\JsonConverter The module file converter.

getModuleManager() 공개 메소드

Returns the module manager.
public getModuleManager ( ) : Puli\Manager\Api\Module\ModuleManager
리턴 Puli\Manager\Api\Module\ModuleManager The module manager.

getRepository() 공개 메소드

Returns the resource repository of the project.
public getRepository ( ) : Puli\Repository\Api\EditableRepository
리턴 Puli\Repository\Api\EditableRepository The resource repository.

getRepositoryManager() 공개 메소드

Returns the resource repository manager.
public getRepositoryManager ( ) : Puli\Manager\Api\Repository\RepositoryManager
리턴 Puli\Manager\Api\Repository\RepositoryManager The repository manager.

getRootDirectory() 공개 메소드

If no Puli project is managed at the moment, null is returned.
public getRootDirectory ( ) : string | null
리턴 string | null The root directory of the managed Puli project or `null` if none is set.

getRootModuleFileConverter() 공개 메소드

Returns the module file converter.
public getRootModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter
리턴 Webmozart\Json\Conversion\JsonConverter The module file converter.

getRootModuleFileManager() 공개 메소드

Returns the root module file manager.
public getRootModuleFileManager ( ) : Puli\Manager\Api\Module\RootModuleFileManager
리턴 Puli\Manager\Api\Module\RootModuleFileManager The module file manager.

getServerManager() 공개 메소드

Returns the server manager.
public getServerManager ( ) : Puli\Manager\Api\Server\ServerManager
리턴 Puli\Manager\Api\Server\ServerManager The server manager.

getStorage() 공개 메소드

Returns the file storage.
public getStorage ( ) : Puli\Manager\Api\Storage\Storage
리턴 Puli\Manager\Api\Storage\Storage The storage.

getUrlGenerator() 공개 메소드

Returns the resource URL generator.
public getUrlGenerator ( ) : Puli\UrlGenerator\Api\UrlGenerator
리턴 Puli\UrlGenerator\Api\UrlGenerator The resource URL generator.

isStarted() 공개 메소드

Returns whether the service container is started.
public isStarted ( ) : boolean
리턴 boolean Returns `true` if the container is started and `false` otherwise.

setEnvironment() 공개 메소드

Sets the environment of the managed Puli project.
public setEnvironment ( string $env )
$env string One of the {@link Environment} constants.

setEventDispatcher() 공개 메소드

Sets the event dispatcher to use.
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher )
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface The event dispatcher to use.

setLogger() 공개 메소드

Sets the logger to use.
public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface The logger to use.

setRootDirectory() 공개 메소드

Sets the root directory of the managed Puli project.
public setRootDirectory ( string | null $rootDir )
$rootDir string | null The root directory of the managed Puli project or `null` to start Puli outside of a specific project.

start() 공개 메소드

Starts the service container.
public start ( )