setName('interface:deploy') ->setDescription('Validates an interface for the phpMAE and uploads it into CloudObjects. Updates the configuration if necessary.') ->addArgument('coid', InputArgument::REQUIRED, 'The COID of the object.'); } protected function execute(InputInterface $input, OutputInterface $output): int { $this->parse($input->getArgument('coid')); $this->assertRDF(); if (!in_array('coid://phpmae.dev/Interface', $this->rdfTypes)) throw new \Exception("Object does not have athevalid interface type."); $this->assertPHPExists(); // Running validator $validator = new ClassValidator(); $validator->validateInterface(file_get_contents($this->fullName.'.php'), $this->coid); $output->writeln("Validated successfully, calling cloudobjects ..."); passthru("cloudobjects attachment:put ".(string)$this->coid." ".$this->fullName.".php"); // Updates configuration if necessary if ($this->ensureFilenameInConfig($output, true)) { $this->createConfigurationJob($output); } // Print URL so developer can easily access it $output->writeln(""); $visibility = isset($object['coid://cloudobjects.io/isVisibleTo']) ? $object['coid://cloudobjects.io/isVisibleTo'][0]['value'] : 'coid://cloudobjects.io/Vendor'; $path = $this->coid->getHost().$this->coid->getPath(); return Command::SUCCESS; } }