Kraken\Console\Server\Manager\ProjectManagerInterface::createProject PHP Метод

createProject() публичный Метод

Flags might be one of: Runtime::CREATE_DEFAULT - creates a new project only if it does not already exist. Runtime::CREATE_FORCE_SOFT - does the same as CREATE_DEFAULT, but in case of existing project tries to replace it. Replacement is done by destroying existing project by sending shutdown message. Runtime::CREATE_FORCE_HARD - does the same as CREATE_DEFAULT, but in case of existing project tries to replace it. Replacement is done by forcefully destroying existing project. Runtime::CREATE_FORCE - creates a new project if it does not exist or tries to replace existing firstly trying to destroy it gracefully, but it fails doing it forcefully.
public createProject ( integer $flags = Runtime::CREATE_DEFAULT ) : Kraken\Promise\PromiseInterface
$flags integer
Результат Kraken\Promise\PromiseInterface
    public function createProject($flags = Runtime::CREATE_DEFAULT);

Usage Example

Пример #1
0
 /**
  * @override
  * @inheritDoc
  */
 protected function command($params = [])
 {
     if (!isset($params['flags'])) {
         throw new RejectionException('Invalid params.');
     }
     return $this->manager->createProject($params['flags'])->then(function () {
         return 'Project has been created.';
     });
 }