/** * Constructor without handling of classloaders. * This allows for testing without pthreads extension * * @param \AppserverIo\Configuration\Interfaces\NodeInterface $systemConfiguration The system configuration */ public function __construct(NodeInterface $systemConfiguration) { // initialize the storage $initialContextNode = $systemConfiguration->getInitialContext(); $storageNode = $initialContextNode->getStorage(); $reflectionClass = $this->newReflectionClass($storageNode->getType()); // create the storage instance $storage = $reflectionClass->newInstance(); // append the storage servers registered in system configuration foreach ($storageNode->getStorageServers() as $storageServer) { $storage->addServer($storageServer->getAddress(), $storageServer->getPort(), $storageServer->getWeight()); } // add the storage to the initial context $this->setStorage($storage); // attach the system configuration to the initial context $this->setSystemConfiguration($systemConfiguration); }
/** * Adds the .dodeploy flag file in the deploy folder, therefore the * app will be deployed with the next restart. * * @param \AppserverIo\Appserver\Core\Api\Node\ContainerInterface $containerNode The container the app is bound to * @param \AppserverIo\Configuration\Interfaces\NodeInterface $appNode The application node object * * @return void */ public function deploy(ContainerNodeInterface $containerNode, NodeInterface $appNode) { // prepare file name $extractor = $this->getExtractor(); $fileName = $appNode->getName() . $extractor->getExtensionSuffix(); // load the file info $archive = new \SplFileInfo($this->getDeployDir($containerNode) . DIRECTORY_SEPARATOR . $fileName); // flag the archive => deploy it with the next restart $extractor->flagArchive($archive, ExtractorInterface::FLAG_DODEPLOY); }