Configures the app

@throws NailsException
@return void
507696
protected function configure()
    {
        if (empty(static::COMMAND)) {
            throw new NailsException('static::COMMAND must be defined');
        }

        if (empty(static::ALIAS)) {
            throw new NailsException('static::ALIAS must be defined');
        }

        // --------------------------------------------------------------------------

        $this->setName(static::ALIAS);
        $this->setDescription('Alias to <info>' . static::COMMAND . '</info>');
    }
615613
protected function configure()
    {
        $this->basePath = getcwd();
        $this->projectName = basename($this->basePath);
        $this->defaultProjectName = $this->slug($this->projectName);

        $this
            ->setName('make')
            ->setDescription('Install Homestead into the current project')
            ->addOption('name', null, InputOption::VALUE_OPTIONAL, 'The name of the virtual machine.', $this->defaultProjectName)
            ->addOption('hostname', null, InputOption::VALUE_OPTIONAL, 'The hostname of the virtual machine.', $this->defaultProjectName)
            ->addOption('ip', null, InputOption::VALUE_OPTIONAL, 'The IP address of the virtual machine.')
            ->addOption('no-after', null, InputOption::VALUE_NONE, 'Determines if the after.sh file is not created.')
            ->addOption('no-aliases', null, InputOption::VALUE_NONE, 'Determines if the aliases file is not created.')
            ->addOption('example', null, InputOption::VALUE_NONE, 'Determines if a Homestead example file is created.')
            ->addOption('json', null, InputOption::VALUE_NONE, 'Determines if the Homestead settings file will be in json format.');
    }
584125
protected function configure()
    {
        $this->setName('clear-cache')
        ->setDescription('Clears the cache');

        $c = new Configuration();
        $this->_config = $c->from('app');
    }
137945
protected function configure()
    {
        $this->setName(static::NAME);
        $this->setDescription(static::DESCRIPTION);

        foreach ($this->defineOptions() as $option) {
            call_user_func_array([$this, 'addOption'], $option);
        }

        foreach ($this->defineArguments() as $argument) {
            call_user_func_array([$this, 'addArgument'], $argument);
        }
    }
532651
protected function configure()
    {
        parent::configure();
        $this
            ->addOption(
                'oldstore',
                null,
                InputOption::VALUE_OPTIONAL,
                'Environment Location Storage to Migrate',
                self::BASH_VAGRANT_TRANSIENT_STORE
            );
    }
208895
public static function setNailsConstants()
    {
        //  Generic and branding constants
        Functions::define('NAILS_PACKAGE_NAME', 'Nails');
        Functions::define('NAILS_PACKAGE_URL', 'http://nailsapp.co.uk/');
        Functions::define('NAILS_BRANDING', true);

        //  Paths
        Functions::define('NAILS_PATH', static::$sBaseDirectory . 'vendor/nails/');
        Functions::define('NAILS_APP_PATH', static::$sBaseDirectory);
        Functions::define('NAILS_COMMON_PATH', NAILS_PATH . 'common/');
        Functions::define('NAILS_CI_APP_PATH', static::$sBaseDirectory . 'vendor/codeigniter/framework/application/');
        Functions::define('NAILS_CI_SYSTEM_PATH', static::$sBaseDirectory . 'vendor/codeigniter/framework/system/');

        //  So CodeIgniter configures itself correctly
        Functions::define('BASEPATH', NAILS_CI_SYSTEM_PATH);

        //  URLs
        Functions::define('BASE_URL', '/');
        Functions::define('SECURE_BASE_URL', preg_replace('/^http:/', 'https:', BASE_URL));
        Functions::define('NAILS_URL', (Functions::isPageSecure() ? SECURE_BASE_URL : BASE_URL) . 'vendor/nails/');

        //  @todo (Pablo - 2018-11-16) - Move these into the asset service
        Functions::define('NAILS_ASSETS_URL', NAILS_URL . 'module-asset/assets/');
        Functions::define('NAILS_ASSETS_PATH', NAILS_PATH . 'module-asset/assets/');

        //  Environment
        Functions::define('ENVIRONMENT', Environment::ENV_DEV);
        Functions::define('NAILS_TIMEZONE', 'UTC');

        //  Cache constants
        //  @todo (Pablo - 2018-11-16) - Move these to the cache service
        Functions::define('CACHE_PATH', static::$sBaseDirectory . 'cache' . DIRECTORY_SEPARATOR . 'private' . DIRECTORY_SEPARATOR);
        Functions::define('CACHE_PUBLIC_PATH', static::$sBaseDirectory . 'cache' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
        Functions::define('CACHE_PUBLIC_URL', rtrim(BASE_URL, '/') . '/cache/public/');

        //  Database
        //  @todo (Pablo - 2018-11-16) - Move these to the database service

        //  Consistent between deployments
        Functions::define('APP_DB_DRIVER', 'mysqli');
        Functions::define('APP_DB_GLOBAL_PREFIX', '');
        Functions::define('APP_DB_PCONNECT', true);
        Functions::define('APP_DB_CACHE', false);
        Functions::define('APP_DB_CHARSET', 'utf8mb4');
        Functions::define('APP_DB_DBCOLLAT', 'utf8mb4_unicode_ci');
        Functions::define('APP_DB_STRICT', true);
        Functions::define('NAILS_DB_PREFIX', 'nails_');
        Functions::define('APP_DB_PREFIX', '');

        //  Potentially vary between deployments
        Functions::define('DEPLOY_DB_HOST', 'localhost');
        Functions::define('DEPLOY_DB_USERNAME', '');
        Functions::define('DEPLOY_DB_PASSWORD', '');
        Functions::define('DEPLOY_DB_DATABASE', '');

        //  App Constants
        Functions::define('APP_PRIVATE_KEY', '');
        Functions::define('APP_NAME', 'Untitled');
        Functions::define('APP_NATIVE_LOGIN_USING', 'BOTH');   //  [EMAIL|USERNAME|BOTH]

        //  Log constants
        //  @todo (Pablo - 2018-11-16) - Move these to the log service
        Functions::define('DEPLOY_LOG_DIR', static::$sBaseDirectory . 'application/logs/');

        //  Email constants
        Functions::define('APP_DEVELOPER_EMAIL', '');
        Functions::define('EMAIL_OVERRIDE', '');
        Functions::define('EMAIL_WHITELIST', '');
        Functions::define('DEPLOY_EMAIL_HOST', '127.0.0.1');
        Functions::define('DEPLOY_EMAIL_USER', '');
        Functions::define('DEPLOY_EMAIL_PASS', '');
        Functions::define('DEPLOY_EMAIL_PORT', 25);

        //  Ensure the app's constants file is also loaded
        //  @todo (Pablo - 2018-11-16) - Remove reliance on this feature
        if (is_file(static::$sBaseDirectory . 'application/config/constants.php')) {
            require_once static::$sBaseDirectory . 'application/config/constants.php';
        }
    }
455770
protected function setConfiguration()
    {
        $this->setDescription($this->description);
        $this->configureArguments($this->arguments, 'addArgument');
        $this->configureArguments($this->options);
    }
828540
protected function configure() {
		$this->setName( 'push' );
		$this->setDescription( 'Push a snapshot to a repository.' );
		$this->addArgument( 'snapshot_id', InputArgument::OPTIONAL, 'Optional snapshot ID to push. If none is provided, a new snapshot will be created from the local environment.' );
		$this->addOption( 'repository', null, InputOption::VALUE_REQUIRED, 'Repository to use. Defaults to first repository saved in config.' );
		$this->addOption( 'no_scrub', false, InputOption::VALUE_NONE, "Don't scrub personal user data." );

		$this->addOption( 'path', null, InputOption::VALUE_REQUIRED, 'Path to WordPress files.' );
		$this->addOption( 'db_host', null, InputOption::VALUE_REQUIRED, 'Database host.' );
		$this->addOption( 'db_name', null, InputOption::VALUE_REQUIRED, 'Database name.' );
		$this->addOption( 'db_user', null, InputOption::VALUE_REQUIRED, 'Database user.' );
		$this->addOption( 'db_password', null, InputOption::VALUE_REQUIRED, 'Database password.' );
		$this->addOption( 'exclude', false, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Exclude a file or directory from the snapshot.' );
		$this->addOption( 'exclude_uploads', false, InputOption::VALUE_NONE, 'Exclude uploads from pushed snapshot.' );
	}
800917
protected function configure()
	{
		// the short description shown while running "php bin/console list"
		if( $this->docs->getIs("description") )
		{
			$this->setDescription($this->docs["description"]);
		}

		// the full command description shown when running the command with
		// the "--help" option
		if( $this->docs->getIs("help") )
		{
			$this->setHelp($this->docs["help"]);
		}
	}
200178
protected function setupConfig()
    {
        $source = realpath(__DIR__.'/../config') . "/nem.php";
        if (! $this->isLumen())
            // console laravel, use config_path helper
            $this->publishes([$source => config_path('nem.php')]);
        else
            // lumen configure app
            $this->app->configure('nem.config');

        $this->mergeConfigFrom($source, 'nem.config');
    }
815219
protected function _configure() {

			// Create my settings object
			$this->config = new Core\Configuration();
			
			// Define some paths
			define("CHICKENWIRE_PATH", dirname(__FILE__));
			define("APP_PATH", APP_ROOT . "/Application");
			define("CONFIG_PATH", APP_PATH . "/Config");
			define("CONTROLLER_PATH", APP_PATH . "/Controllers");
			define("LAYOUT_PATH", APP_PATH . "/Layouts");
			define("MODEL_PATH", APP_PATH . "/Models");
			define("VIEW_PATH", APP_PATH . "/Views");
			define("PUBLIC_PATH", APP_PATH . "/Public");
			define("MODULE_PATH", APP_ROOT . "/Modules");

			define("MODEL_NS", $this->config->applicationNamespace . "\\Models");

			// Include all php files in the config directory
			$dh = opendir(CONFIG_PATH);
			$configFiles = scandir(CONFIG_PATH, SCANDIR_SORT_ASCENDING);
			foreach ($configFiles as $file) {

				// PHP?
				if (preg_match("/\.php$/", $file)) {

					// Load it
					$this->config->load(CONFIG_PATH . '/' . $file);
					
				}

			}

			// Initalize database configuration
			$dbConnections = $this->config->allFor("database");
			$environment = $this->config->environment;
			\ActiveRecord\Config::initialize(function($config) use ($dbConnections, $environment) {

				// Set model path
				$config->setModelDirectory(MODEL_PATH);

				// Apply connections
				$config->setConnections($dbConnections);

				// Set default to my environment
				$config->setDefaultConnection($environment);

			});

			// Set the timezone
			if ($this->config->timezone == '') {
				throw new \Exception("You need to specify the timezone in the Application configuration.", 1);				
			}
			date_default_timezone_set($this->config->timezone);

			// Set self closing slash
			\HtmlObject\Traits\Tag::$useSelfClosingSlash = $this->config->htmlSelfClosingSlash;

			// Set the webPath
			$this->config->webPath = rtrim($this->config->webPath, ' /');

		}
499769
protected function configure()
    {
        parent::configure();

        $this->addOption(
            'json',
            '',
            InputOption::VALUE_OPTIONAL,
            'Path to the json definition.'
        )
            ->addOption(
                'srcDir',
                '',
                InputOption::VALUE_OPTIONAL,
                'Src Dir',
                dirname(__FILE__) . '/../../../'
            )
            ->addOption(
                'bundleBundleName',
                '',
                InputOption::VALUE_OPTIONAL,
                'Which BundleBundle to manipulate to add our stuff',
                'GravitonDynBundleBundle'
            )
            ->setName('graviton:generate:dynamicbundles')
            ->setDescription(
                'Generates all dynamic bundles in the GravitonDyn namespace. Either give a path '.
                'to a single JSON file or a directory path containing multiple files.'
            );
    }
961427
protected function configure()
    {
        $this
            ->setDescription('Add a token')
            ->addArgument(
                'app-name',
                InputArgument::REQUIRED,
                'App name'
            )
            ->addArgument(
                'uuid',
                InputArgument::OPTIONAL,
                'Token UUID. If none defined, a new one will be generated',
                Uuid::uuid4()->toString()
            )
            ->addOption(
                'index-name',
                null,
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
                'Indices',
                []
            )
            ->addOption(
                'endpoint',
                null,
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
                'Endpoints',
                []
            )
            ->addOption(
                'plugin',
                null,
                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL,
                'Plugins',
                []
            )
            ->addOption(
                'ttl',
                null,
                InputOption::VALUE_OPTIONAL,
                'TTL',
                Token::DEFAULT_TTL
            );
    }
200974
protected function configure()
    {
        $request = $this->getRequest();

        $adminCode = $request->get('_sonata_admin');

        if (!$adminCode) {
            throw new \RuntimeException(sprintf(
                'There is no `_sonata_admin` defined for the controller `%s` and the current route `%s`',
                \get_class($this),
                $request->get('_route')
            ));
        }

        $this->admin = $this->container->get('sonata.admin.pool')->getAdminByAdminCode($adminCode);

        if (!$this->admin) {
            throw new \RuntimeException(sprintf(
                'Unable to find the admin class related to the current controller (%s)',
                \get_class($this)
            ));
        }

        $this->templateRegistry = $this->container->get($this->admin->getCode().'.template_registry');
        if (!$this->templateRegistry instanceof TemplateRegistryInterface) {
            throw new \RuntimeException(sprintf(
                'Unable to find the template registry related to the current admin (%s)',
                $this->admin->getCode()
            ));
        }

        $rootAdmin = $this->admin;

        while ($rootAdmin->isChild()) {
            $rootAdmin->setCurrentChild(true);
            $rootAdmin = $rootAdmin->getParent();
        }

        $rootAdmin->setRequest($request);

        if ($request->get('uniqid')) {
            $this->admin->setUniqid($request->get('uniqid'));
        }
    }
1095442
protected function configure()
    {
        if (is_readable($configFile = $this->config('config.path') . '/config.php')) {
            $config = include $configFile;
            if (!is_array($config)) {
                $config = (array) $config;
            }
            $this->config($config);
        }
        if (is_readable($configFile = $this->config('config.path') . '/config-' . $this->config('mode') . '.php')) {
            $config = include $configFile;
            if (!is_array($config)) {
                $config = (array) $config;
            }
            $this->config($config);
        }

        date_default_timezone_set($this->config('bono.timezone') ?: 'UTC');
    }
158126
protected function configure()
    {
        $this->basePath = getcwd();
        $this->projectName = basename($this->basePath);
        $this->defaultName = $this->slug($this->projectName);

        $this
            ->setName('make')
            ->setDescription('Install Artestead into the current project')
            ->addOption('type', null, InputOption::VALUE_REQUIRED, 'Type of hosting: drupal, laravel, symfony, wordpress') // New
            ->addOption('name', null, InputOption::VALUE_OPTIONAL, 'The name of the virtual machine.', $this->defaultName)
            ->addOption('hostname', null, InputOption::VALUE_OPTIONAL, 'The hostname of the virtual machine.', str_replace('.local.local', '.local', "www.{$this->projectName}.local"))
            ->addOption('ip', null, InputOption::VALUE_OPTIONAL, 'The IP address of the virtual machine.')
            ->addOption('after', null, InputOption::VALUE_NONE, 'Determines if the after.sh file is created.')
            ->addOption('aliases', null, InputOption::VALUE_NONE, 'Determines if the aliases.sh file is created.')
            ->addOption('example', null, InputOption::VALUE_NONE, 'Determines if a Artestead example file is created.')
            ->addOption('json', null, InputOption::VALUE_NONE, 'Determines if the Artestead settings file will be in json format.');
    }
787580
protected function configure()
    {
        $this
            ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
            ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
            ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly')
            ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag")
        ;
    }