PHP 클래스 AppserverIo\Appserver\Core\Scanner\AbstractScanner

상속: extends AppserverIo\Appserver\Core\AbstractContextThread, implements AppserverIo\Appserver\Core\Interfaces\ScannerInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$distroMapping array The mapping of Linux distributions to their release file's name
$name string The unique scanner name.
$restartCommands array Array that contains the available startup scripts.
$service AppserverIo\Appserver\Core\Api\ContainerService The API service used to load the deployment directory.

공개 메소드들

메소드 설명
__construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, string $name ) Constructor sets initialContext object per default and calls init function to pass other args.
getName ( ) : string Returns the unique scanner name.
getRestartCommand ( string $os, string | null $distVersion = null ) : string Returns the restart command for the passed OS if available.
getService ( ) : ContainerService Returns The API service, e. g. to load the deployment directory.
getSystemLogger ( ) : Psr\Log\LoggerInterface The system logger to use.
init ( ) : void Initalizes the scanner with the necessary service instance.
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface (non-PHPdoc)
restart ( ) : void Restart the appserver using the appserverctl file in the sbin folder.
stop ( ) : void Stop's the scanner.

보호된 메소드들

메소드 설명
getDirectoryHash ( SplFileInfo $directory ) : string Calculates an hash value for all files with certain extensions.
getDistributionVersion ( string | null $distribution = null, array $etcList = [] ) : string | boolean This method will check for the Linux release file normally stored in /etc and will return the version of the distribution
getEtcDir ( ) : string Returns the systems configuration root directory aka "etc"
getExtensionsToWatch ( ) : array Returns an array with file extensions that are used to create the directory hash.
getLastFileTouch ( string $file ) : integer Returns the time when the contents of the file were changed. The time returned is a UNIX timestamp.
getLinuxDistribution ( array $etcList = [] ) : string | boolean This method will check for the Linux release file normally stored in /etc and will return the corresponding distribution

메소드 상세

__construct() 공개 메소드

Constructor sets initialContext object per default and calls init function to pass other args.
public __construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, string $name )
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance
$name string The unique scanner name from the configuration

getDirectoryHash() 보호된 메소드

This is used to test if the hash value changed, so if it changed, the appserver can react accordingly.
protected getDirectoryHash ( SplFileInfo $directory ) : string
$directory SplFileInfo The directory to watch
리턴 string The hash value build out of the found filenames

getDistributionVersion() 보호된 메소드

This method will check for the Linux release file normally stored in /etc and will return the version of the distribution
protected getDistributionVersion ( string | null $distribution = null, array $etcList = [] ) : string | boolean
$distribution string | null Distribution to search a version for
$etcList array List of already collected AND flipped release files we need to filter
리턴 string | boolean

getEtcDir() 보호된 메소드

Returns the systems configuration root directory aka "etc"
protected getEtcDir ( ) : string
리턴 string

getExtensionsToWatch() 추상적인 보호된 메소드

Returns an array with file extensions that are used to create the directory hash.
또한 보기: AppserverIo\Appserver\Core\Scanner\AbstractScanner::getDirectoryHash()
abstract protected getExtensionsToWatch ( ) : array
리턴 array The array with the file extensions

getLastFileTouch() 보호된 메소드

If the file doesn't exists, the method returns 0 to signal that the no successfull depolyment has been processed so far, e. g. the server has been installed and not been started yet.
protected getLastFileTouch ( string $file ) : integer
$file string The deployment directory
리턴 integer The UNIX timestamp with the last successfully deployment date or 0 if no successful deployment has been processed

getLinuxDistribution() 보호된 메소드

This method will check for the Linux release file normally stored in /etc and will return the corresponding distribution
protected getLinuxDistribution ( array $etcList = [] ) : string | boolean
$etcList array List of already collected AND flipped release files we need to filter
리턴 string | boolean

getName() 공개 메소드

Returns the unique scanner name.
또한 보기: AppserverIo\Appserver\Core\Interfaces\ScannerInterface::getName()
public getName ( ) : string
리턴 string The scanner name

getRestartCommand() 공개 메소드

Returns the restart command for the passed OS if available.
public getRestartCommand ( string $os, string | null $distVersion = null ) : string
$os string The OS to return the restart command for
$distVersion string | null Version of the operating system to get the restart command for
리턴 string The restart command

getService() 공개 메소드

Returns The API service, e. g. to load the deployment directory.
public getService ( ) : ContainerService
리턴 AppserverIo\Appserver\Core\Api\ContainerService The API service instance

getSystemLogger() 공개 메소드

The system logger to use.
public getSystemLogger ( ) : Psr\Log\LoggerInterface
리턴 Psr\Log\LoggerInterface The system logger instance

init() 공개 메소드

Initalizes the scanner with the necessary service instance.
또한 보기: AppserverIo\Appserver\Core\AbstractThread::init()
public init ( ) : void
리턴 void

newService() 공개 메소드

(non-PHPdoc)
또한 보기: 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
리턴 AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

restart() 공개 메소드

Restart the appserver using the appserverctl file in the sbin folder.
public restart ( ) : void
리턴 void

stop() 공개 메소드

Stop's the scanner.
또한 보기: AppserverIo\Appserver\Core\Interfaces\ScannerInterface::stop()
public stop ( ) : void
리턴 void

프로퍼티 상세

$distroMapping 보호되어 있는 프로퍼티

The mapping of Linux distributions to their release file's name
protected array $distroMapping
리턴 array

$name 보호되어 있는 프로퍼티

The unique scanner name.
protected string $name
리턴 string

$restartCommands 보호되어 있는 프로퍼티

Array that contains the available startup scripts.
protected array $restartCommands
리턴 array

$service 보호되어 있는 프로퍼티

The API service used to load the deployment directory.
protected ContainerService,AppserverIo\Appserver\Core\Api $service
리턴 AppserverIo\Appserver\Core\Api\ContainerService