PHP Class AppserverIo\Appserver\Core\Api\AbstractService

Author: Tim Wagner ([email protected])
Author: Bernhard Wick ([email protected])
Inheritance: implements AppserverIo\Appserver\Core\Api\ServiceInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Свойство Type Description
$initialContext AppserverIo\Appserver\Core\InitialContext The initial context instance containing the system configuration.
$node AppserverIo\Configuration\Interfaces\NodeInterface; The initialized base directory node.
$normalizer AppserverIo\Appserver\Core\Api\NormalizerInterface The normalizer instance to use.

Méthodes publiques

Méthode Description
__construct ( InitialContext $initialContext ) Initializes the service with the initial context instance and the default normalizer instance.
getBaseDirectory ( string | null $directoryToAppend = null ) : string Returns the application servers base directory.
getConfDir ( string $relativePathToAppend = '' ) : string Return's the server's main configuration directory.
getConfdDir ( string $relativePathToAppend = '' ) : string Return's the server's configuration subdirectory.
getDeployDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the servers deploy directory.
getDirectories ( ) : array Returns the directory structure to be created at first start.
getEtcDir ( string $relativePathToAppend = '' ) : string Return's the server's base configuration directory.
getFiles ( ) : array Returns the files to be created at first start.
getInitialContext ( ) : InitialContext (non-PHPdoc)
getLogDir ( string $relativePathToAppend = '' ) : string Returns the servers log directory.
getOsIdentifier ( ) : string Will return a three character OS identifier e.g. WIN or LIN
getServerSignature ( ) : string Returns the real server signature depending on the installed appserver version and the PHP version we're running on, for example:
getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface (non-PHPdoc)
getSystemProperties ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode = null ) : AppserverIo\Properties\Properties Returns the system proprties. If a container node has been passed, the container properties will also be appended.
getSystemTmpDir ( string $relativePathToAppend = '' ) : string Return's the system's temporary directory.
getTmpDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the servers tmp directory, append with the passed directory.
getWebappsDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the servers webapps directory.
globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).
makePathAbsolute ( string $path = '' ) : string Makes the path an absolute path or returns null if passed path is empty.
newInstance ( string $className, array $args = [] ) : object (non-PHPdoc)
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface (non-PHPdoc)
persist ( AppserverIo\Configuration\Interfaces\NodeInterface $node ) : void Persists the system configuration.
realpath ( string $relativePathToAppend ) : string Returns the absolute path to the passed directory, also working on Windows.
setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : AppserverIo\Appserver\Core\Api\ServiceInterface (non-PHPdoc)

Method Details

__construct() public méthode

Initializes the service with the initial context instance and the default normalizer instance.
public __construct ( InitialContext $initialContext )
$initialContext AppserverIo\Appserver\Core\InitialContext The initial context instance

getBaseDirectory() public méthode

Returns the application servers base directory.
public getBaseDirectory ( string | null $directoryToAppend = null ) : string
$directoryToAppend string | null Append this directory to the base directory before returning it
Résultat string The base directory

getConfDir() public méthode

Return's the server's main configuration directory.
public getConfDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
Résultat string The server's main configuration directory

getConfdDir() public méthode

Return's the server's configuration subdirectory.
public getConfdDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
Résultat string The server's configuration subdirectory

getDeployDir() public méthode

Returns the servers deploy directory.
public getDeployDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the deployment directory for
$relativePathToAppend string A relative path to append
Résultat string

getDirectories() public méthode

Returns the directory structure to be created at first start.
public getDirectories ( ) : array
Résultat array The directory structure to be created if necessary

getEtcDir() public méthode

Return's the server's base configuration directory.
public getEtcDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
Résultat string The server's base configuration directory

getFiles() public méthode

Returns the files to be created at first start.
public getFiles ( ) : array
Résultat array The files to be created if necessary

getInitialContext() public méthode

(non-PHPdoc)
See also: ServiceInterface::getInitialContext()
public getInitialContext ( ) : InitialContext
Résultat AppserverIo\Appserver\Core\InitialContext The initial Context

getLogDir() public méthode

Returns the servers log directory.
public getLogDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
Résultat string

getOsIdentifier() public méthode

Will return a three character OS identifier e.g. WIN or LIN
public getOsIdentifier ( ) : string
Résultat string

getServerSignature() public méthode

appserver/1.0.1-45 (darwin) PHP/5.5.21
public getServerSignature ( ) : string
Résultat string The server signature

getSystemConfiguration() public méthode

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Api\ServiceInterface::getSystemConfiguration()
public getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface
Résultat AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

getSystemProperties() public méthode

Returns the system proprties. If a container node has been passed, the container properties will also be appended.
public getSystemProperties ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode = null ) : AppserverIo\Properties\Properties
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the system properties for
Résultat AppserverIo\Properties\Properties The system properties

getSystemTmpDir() public méthode

Return's the system's temporary directory.
public getSystemTmpDir ( string $relativePathToAppend = '' ) : string
$relativePathToAppend string A relative path to append
Résultat string The system's temporary directory

getTmpDir() public méthode

Returns the servers tmp directory, append with the passed directory.
public getTmpDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the temporary directory for
$relativePathToAppend string A relative path to append
Résultat string

getWebappsDir() public méthode

Returns the servers webapps directory.
public getWebappsDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the temporary directory for
$relativePathToAppend string A relative path to append
Résultat string

globDir() public méthode

Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).
public globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array
$pattern string The glob pattern used to parse the directories
$flags integer The flags passed to the glob function
$recursive boolean Whether or not to parse directories recursively
Résultat array The directories matches the passed glob pattern

makePathAbsolute() public méthode

Makes the path an absolute path or returns null if passed path is empty.
public makePathAbsolute ( string $path = '' ) : string
$path string A path to absolute
Résultat string The absolute path

newInstance() public méthode

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\InitialContext::newInstance()
public newInstance ( string $className, array $args = [] ) : object
$className string The fully qualified class name to return the instance for
$args array Arguments to pass to the constructor of the instance
Résultat object The instance itself

newService() public méthode

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\InitialContext::newService()
public newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$className string The API service class name to return the instance for
Résultat AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

persist() public méthode

Persists the system configuration.
public persist ( AppserverIo\Configuration\Interfaces\NodeInterface $node ) : void
$node AppserverIo\Configuration\Interfaces\NodeInterface A node to persist
Résultat void

realpath() public méthode

Returns the absolute path to the passed directory, also working on Windows.
public realpath ( string $relativePathToAppend ) : string
$relativePathToAppend string The relativ path to return the absolute path for
Résultat string The absolute path of the passed directory

setSystemConfiguration() public méthode

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Api\ServiceInterface::setSystemConfiguration()
public setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration
Résultat AppserverIo\Appserver\Core\Api\ServiceInterface

Property Details

$initialContext protected_oe property

The initial context instance containing the system configuration.
protected InitialContext,AppserverIo\Appserver\Core $initialContext
Résultat AppserverIo\Appserver\Core\InitialContext

$node protected_oe property

The initialized base directory node.
protected NodeInterface;,AppserverIo\Configuration\Interfaces $node
Résultat AppserverIo\Configuration\Interfaces\NodeInterface;

$normalizer protected_oe property

The normalizer instance to use.
protected NormalizerInterface,AppserverIo\Appserver\Core\Api $normalizer
Résultat AppserverIo\Appserver\Core\Api\NormalizerInterface