Sets license key Bitrix CMS.

@param InputInterface $input
@param OutputInterface $output
@param string $licenseKey
322579
protected function configureLicenseKey(InputInterface $input, OutputInterface $output, $licenseKey)
    {
        if (!is_string($licenseKey)) {
            throw new \InvalidArgumentException('Config "licenseKey" must be string type.');
        }

        $licenseFileContent = "<" . "? $" . "LICENSE_KEY = \"" . EscapePHPString($licenseKey) . "\"; ?" . ">";
        File::putFileContents(Application::getDocumentRoot() . BX_ROOT . '/license_key.php', $licenseFileContent);
    }
1261082
public static function set($slug, $license)
    {
        $licenses = self::getLicenseFile();
        $data = (array)$licenses->content();
        $slug = strtolower($slug);

        if ($license && !self::validate($license)) {
            return false;
        }

        if (!\is_string($license)) {
            if (isset($data['licenses'][$slug])) {
                unset($data['licenses'][$slug]);
            } else {
                return false;
            }
        } else {
            $data['licenses'][$slug] = $license;
        }

        $licenses->save($data);
        $licenses->free();

        return true;
    }
626709
protected function execute(InputInterface $input, OutputInterface $output) : void
    {

        $io     = $this->getIO($input, $output);
        $config = $this->getConfig($input->getOption('configuration'), true);
        $repo   = new Repository(dirname($input->getOption('git-directory')));

        $installer = new Installer($io, $config, $repo);
        $installer->setForce($input->getOption('force'))
                  ->setHook((string) $input->getArgument('hook'));

        $installer->run();
    }
910843
function setKey($key) {
		$this->cnxn->confirmTransaction('setKey');
		$currKey = $this->key;
		if (!is_null($currKey) && is_null($key)) {
			$this->cnxn->unregisterStructWithKey($this, $currKey);
		} else if (is_null($currKey) && !is_null($key)) {
			$this->cnxn->registerStructWithKey($this, $key);
		} else if ($currKey != $key) {
			$this->cnxn->unregisterStructWithKey($this, $currKey);
			$this->cnxn->registerStructWithKey($this, $key);
		}
		$this->key = $key;
	}
910792
public function all(OutputInterface $output, array $response)
    {
        $this->printTable($output,
            ['Key', 'Name', 'Type', 'Public', 'Dependencies', 'Outdated', 'Updated At', 'Bad Licenses', 'Unknown Licenses'],
            ['ids', 'name', 'project_type', 'public', 'dep_number', 'out_number', 'updated_at', 'licenses_red', 'licenses_unknown'],
            $response,
            function ($key, $value) use ($output) {
                if ('public' === $key) {
                    return $value === 1 ? 'Yes' : 'No';
                }

                if (!in_array($key, ['out_number', 'licenses_red', 'licenses_unknown'], true)) {
                    return $value;
                }

                return $this->printBoolean($output, $value > 0 ? $value : 'No', $value, !$value, false);
            }
        );
    }
677052
protected function setIO(InputInterface $input, OutputInterface $output)
    {
        $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
    }
231814
private function setPrefix(InputInterface $input, OutputInterface $output)
    {
        $this->prefix = $input->getOption('prefix');

        if ($this->prefix === null) {
            $this->prefix = $this->getTransifexConfigValue('/prefix');

            if ($this->prefix === null) {
                throw new \RuntimeException('Error: unable to determine transifex prefix.');
            }
            $this->writelnVerbose($output, sprintf('<info>automatically using prefix: %s</info>', $this->prefix));
        }

        $this->checkValidSlug($this->prefix);
    }
21631
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setup->getLocator()->setParams(
            array(
                'release' => $input->getArgument('release'),
                'path' => $input->getOption('path'),
                'scriptName' => $input->getOption('script')
            )
        );

        $queries = $this->setup($input);

        $this->display($input, $output, $queries);
    }
869287
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginRepository
            ->findAll();

        /**
         * @var Plugin $plugin
         */
        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                $plugin->getNamespace() . ' - [Hash : ' . $plugin->getHash() . ']'
            );
        }

        $this->finishCommand($output);
    }
934367
public function licenseCheck($license_key, \JaegerApp\License $license)
    {
        if ($license_key == '') {
            $this->setError('license_number', 'missing_license_number');
        } else {
            if (! $license->validLicense($license_key)) {
                $this->setError('license_number', 'invalid_license_number');
            }
        }
        
        return $this;
    }
928937
private function _update_licenses( $licenses, $module_id ) {
            $this->_logger->entrance();

            if ( is_array( $licenses ) ) {
                for ( $i = 0, $len = count( $licenses ); $i < $len; $i ++ ) {
                    $licenses[ $i ]->updated = time();
                }
            }

            $this->_store_licenses( true, $module_id, $licenses );
        }
1268747
def set_license(self, key):
        
        data = {'LicenseKey': key}
        license_service_uri = (utils.get_subresource_path_by(self,
                               ['Oem', 'Hpe', 'Links', 'LicenseService']))
        self._conn.post(license_service_uri, data=data)
141113
public function setOutput(\Symfony\Component\Console\Output\OutputInterface $output)
    {
        $this->output = $output;
    }
908298
protected function execute( InputInterface $input, OutputInterface $output ) {
		Log::instance()->setOutput( $output );

		$repository = $input->getArgument( 'repository' );

		$region            = $input->getOption( 'region' );
		$access_key_id     = $input->getOption( 'aws_key' );
		$secret_access_key = $input->getOption( 'aws_secret' );

		if ( empty( $region ) ) {
			$region = 'us-west-1';
		}

		$config = Config::get();

		if ( ! empty( $config['repositories'][ $repository ] ) ) {
			Log::instance()->write( 'Repository config already exists. Proceeding will overwrite it.' );
		}

		$repo_config = [
			'repository' => $repository,
		];

		$helper = $this->getHelper( 'question' );

		$i = 0;

		/**
		 * Loop until we get S3 credentials that work
		 */
		while ( true ) {

			if ( 0 < $i || empty( $access_key_id ) ) {
				$access_key_id = $helper->ask( $input, $output, new Question( 'AWS Access Key ID: ' ) );
			}

			if ( 0 < $i || empty( $secret_access_key ) ) {
				$secret_access_key = $helper->ask( $input, $output, new Question( 'AWS Secret Access Key: ' ) );
			}

			$repo_config['access_key_id']     = $access_key_id;
			$repo_config['secret_access_key'] = $secret_access_key;
			$repo_config['region']            = $region;

			$test = S3::test( $repo_config );

			if ( true !== $test ) {
				break;
			} else {
				if ( 'InvalidAccessKeyId' === $test ) {
					Log::instance()->write( 'Repository connection did not work. Try again?', 0, 'warning' );
				} elseif ( 'NoSuchBucket' === $test ) {
					Log::instance()->write( 'We successfully connected to AWS. However, no repository has been created. Run `wpsnapshots create-repository` after configuration is complete.', 0, 'warning' );
					break;
				} else {
					break;
				}
			}

			$i++;
		}

		$name  = $input->getOption( 'user_name' );
		$email = $input->getOption( 'user_email' );

		if ( empty( $name ) ) {
			$name_question = new Question( 'Your Name: ' );
			$name_question->setValidator( '\WPSnapshots\Utils\not_empty_validator' );
			$name = $helper->ask( $input, $output, $name_question );
		}

		$config['name'] = $name;

		if ( empty( $email ) ) {
			$email = $helper->ask( $input, $output, new Question( 'Your Email: ' ) );
		}

		if ( ! empty( $email ) ) {
			$config['email'] = $email;
		}

		$create_dir = Utils\create_snapshot_directory();

		if ( ! $create_dir ) {
			Log::instance()->write( 'Cannot create necessary snapshot directory.', 0, 'error' );

			return 1;
		}

		$repositories = $config['repositories'];

		$repositories[ $repository ] = $repo_config;

		$config['repositories'] = $repositories;

		$config->write();

		Log::instance()->write( 'WP Snapshots configuration verified and saved.', 0, 'success' );
	}
935911
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $uuids = array();

        $count = filter_var(
            $input->getOption('count'),
            FILTER_VALIDATE_INT,
            array(
                'default' => 1,
                'min_range' => 1,
            )
        );

        for ($i = 0; $i < $count; $i++) {
            $uuids[] = $this->createUuid(
                $input->getArgument('version'),
                $input->getArgument('namespace'),
                $input->getArgument('name')
            );
        }

        foreach ($uuids as $uuid) {
            $output->writeln((string) $uuid);
        }
    }
203724
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!$this->verifyInstalled($output)) {
            return;
        }

        $output->write(Lang::get('updating_phpci'));

        shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"');

        $output->writeln('<info>'.Lang::get('ok').'</info>');
    }
792257
protected function execute(InputInterface $input, OutputInterface $output) : void
    {
        if ($this->command !== null) {
            $helper = new DescriptorHelper();
            $helper->describe($output, $this->command);
            return;
        }

        $io = $this->getIO($input, $output);
        $io->write($this->getHelpLines());
    }