PHP Class AppserverIo\Appserver\Core\Scanner\DeploymentScanner

Inheritance: extends AbstractScanner
Afficher le fichier Open project: appserver-io/appserver

Protected Properties

Свойство Type Description
$directory array The directory we want to watch.
$extensionsToWatch array A list with extensions of files we want to watch.
$interval integer The interval in seconds we use to scan the directory.

Méthodes publiques

Méthode Description
__construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, string $name, string $directory, integer $interval = 1, string $extensionsToWatch = '' ) Constructor sets initialContext object per default and calls init function to pass other args.
getDeploymentFlag ( ) : SplFileInfo Returns the file information of the deployment flag
getDirectory ( ) : SplFileInfo Returns the path to the deployment directory
getInterval ( ) : integer Returns the interval in seconds we want to scan the directory.
getLastSuccessfullyDeployment ( SplFileInfo $file ) : integer This method returns 0 to signal that the no successful deployment has been processed so far, e. g. the server has been installed and not been started yet.
main ( ) : void Start's the deployment scanner that restarts the server when a PHAR should be deployed or undeployed.

Méthodes protégées

Méthode Description
getExtensionsToWatch ( ) : array Returns an array with file extensions that should be watched for new deployments.

Method Details

__construct() public méthode

Constructor sets initialContext object per default and calls init function to pass other args.
public __construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, string $name, string $directory, integer $interval = 1, string $extensionsToWatch = '' )
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance
$name string The unique scanner name from the configuration
$directory string The directory we want to scan
$interval integer The interval in seconds we want scan the directory
$extensionsToWatch string The comma separated list with extensions of files we want to watch

getDeploymentFlag() public méthode

Returns the file information of the deployment flag
public getDeploymentFlag ( ) : SplFileInfo
Résultat SplFileInfo The deployment flag file information

getDirectory() public méthode

Returns the path to the deployment directory
public getDirectory ( ) : SplFileInfo
Résultat SplFileInfo The deployment directory

getExtensionsToWatch() protected méthode

Returns an array with file extensions that should be watched for new deployments.
protected getExtensionsToWatch ( ) : array
Résultat array The array with the file extensions

getInterval() public méthode

Returns the interval in seconds we want to scan the directory.
public getInterval ( ) : integer
Résultat integer The interval in seconds

getLastSuccessfullyDeployment() public méthode

This method returns 0 to signal that the no successful deployment has been processed so far, e. g. the server has been installed and not been started yet.
public getLastSuccessfullyDeployment ( SplFileInfo $file ) : integer
$file SplFileInfo The deployment directory
Résultat integer The UNIX timestamp with the last successfully deployment date or 0 if no successful deployment has been processed

main() public méthode

Start's the deployment scanner that restarts the server when a PHAR should be deployed or undeployed.
See also: AppserverIo\Appserver\Core\AbstractThread::main()
public main ( ) : void
Résultat void

Property Details

$directory protected_oe property

The directory we want to watch.
protected array $directory
Résultat array

$extensionsToWatch protected_oe property

A list with extensions of files we want to watch.
protected array $extensionsToWatch
Résultat array

$interval protected_oe property

The interval in seconds we use to scan the directory.
protected int $interval
Résultat integer