PHP Class AppserverIo\Appserver\Core\Scanner\DeploymentScanner

Inheritance: extends AbstractScanner
Datei anzeigen Open project: appserver-io/appserver

Protected Properties

Property 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.

Public Methods

Method 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.

Protected Methods

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

Method Details

__construct() public method

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 method

Returns the file information of the deployment flag
public getDeploymentFlag ( ) : SplFileInfo
return SplFileInfo The deployment flag file information

getDirectory() public method

Returns the path to the deployment directory
public getDirectory ( ) : SplFileInfo
return SplFileInfo The deployment directory

getExtensionsToWatch() protected method

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

getInterval() public method

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

getLastSuccessfullyDeployment() public method

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
return integer The UNIX timestamp with the last successfully deployment date or 0 if no successful deployment has been processed

main() public method

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
return void

Property Details

$directory protected_oe property

The directory we want to watch.
protected array $directory
return array

$extensionsToWatch protected_oe property

A list with extensions of files we want to watch.
protected array $extensionsToWatch
return array

$interval protected_oe property

The interval in seconds we use to scan the directory.
protected int $interval
return integer