Run pre update artisan commands from config.
323649
protected function preUpdateArtisanCommands()
    {
        collect(config('self-update.artisan_commands.pre_update'))->every(function ($commandParams, $commandKey) {
            Artisan::call($commandKey, $commandParams['params']);
        });
    }
730735
public function run(): void
    {
        foreach (self::SETTINGS as $setting_name => $setting_value) {
            DB::table('site_setting')->updateOrInsert([
                'setting_name'  => $setting_name,
            ], [
                'setting_value' => $setting_value,
            ]);
        }
    }
458045
public function update(): void
	{
		$composer = $this->getComposer();

		$command = 'cd ' . $this->path . ';'
			. $composer . ' self-update 2>&1;'
			. $composer . ' update 2>&1;';
		exec($command, $output);
		foreach ($output as $str) {
			if (!empty($str)) {
				Debugger::log($str, 'composer');
			}
		}
	}
47459
def run(self, argv):
        """"""
        try:
            self.options, remainder = self.parser.parse_known_args(argv)
            self._configure_logging()

            if self.options.relative_plugins:
                curdir = os.getcwd()
                sys.path.insert(0, curdir)
                pkg_resources.working_set.add_entry(curdir)


            try:
                self._load_commands_for_current_dir()
            except pkg_resources.DistributionNotFound as e:
                try:
                    error_msg = repr(e)
                except:
                    error_msg = 'Unknown Error'

                log.error('Failed to load project commands with error '
                          '``%s``, have you installed your project?' % error_msg)

        except Exception as err:
            if hasattr(self, 'options'):
                debug = self.options.debug
            else:
                debug = True

            if debug:
                log.exception(err)
            else:
                log.error(err)

            return 1

        return self._run_subcommand(remainder)
598565
def update kwargs={}
      ignore_cksum = kwargs.arg :ignore_cksum, false
      ignore_sigs = kwargs.arg :ignore_sigs, false

      cmd = 'aptly mirror update'
      cmd += ' -ignore-checksums' if ignore_cksum
      cmd += ' -ignore-signatures' if ignore_sigs
      cmd += " #{@name.quote}"

      Aptly::runcmd cmd
    end
834667
def update
      config.update(:remotes) do |rmts|
        yield(rmts || {}).tap do |new_rmts|
          raise_invalid unless validate(new_rmts)
        end
      end
    end
528245
protected function prepareResources()
    {
        // Publish config
        $config = realpath(__DIR__.'/../config/config.php');

        $this->mergeConfigFrom($config, 'cartalyst.sentinel');

        $this->publishes([
            $config => config_path('cartalyst.sentinel.php'),
        ], 'config');

        // Publish migrations
        $migrations = realpath(__DIR__.'/../migrations');

        $this->publishes([
            $migrations => $this->app->databasePath().'/migrations',
        ], 'migrations');
    }
304668
def run(self, **options):
        """"""
        if not self.is_setup:
            self.setup()

        if self.twisted:
            self.run_with_twisted(**options)
        elif self.gunicorn:
            self.run_with_gunicorn(**options)
        else:
            self.run_with_werkzeug(**options)
501023
public function run() : void
    {
        $config = $this->getConfigToManipulate();
        $setup  = $this->getHookSetup();

        $setup->configureHooks($config);
        Config\Util::writeToDisk($config);

        $this->io->write(
            [
                '<info>Configuration created successfully</info>',
                'Run <comment>\'vendor/bin/captainhook install\'</comment> to activate your hook configuration',
            ]
        );
    }
376814
def repl_update(self, config):
        """"""
        cfg = config.copy()
        cfg['version'] += 1
        try:
            result = self.run_command("replSetReconfig", cfg)
            if int(result.get('ok', 0)) != 1:
                return False
        except pymongo.errors.AutoReconnect:
            self.update_server_map(cfg)  # use new server_map
        self.waiting_member_state()
        self.waiting_config_state()
        return self.connection() and True
219726
public function run()
	{
		$this->say('Updating ' . $this->getJConfig()->extension . " to " . $this->getJConfig()->version);

		// Reusing the header config here
		$exclude = explode(",", trim($this->getJConfig()->header->exclude));

		$path      = realpath($this->getJConfig()->source);
		$fileTypes = explode(",", trim($this->getJConfig()->header->files));

		$changedFiles = 0;

		foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)) as $filename)
		{
			if (substr($filename, 0, 1) == '.')
			{
				continue;
			}

			$file = new \SplFileInfo($filename);

			if (!in_array($file->getExtension(), $fileTypes))
			{
				continue;
			}

			// Skip directories in exclude list
			if (isset($exclude) && count($exclude))
			{
				$relative = str_replace(realpath($path), "", $file->getPath());

				// It is possible to have multiple exclude directories
				foreach ($exclude as $e)
				{
					if (stripos($relative, $e) !== false)
					{
						$this->say("Excluding " . $filename);
						continue 2;
					}
				}
			}

			// Load the file
			$fileContents = file_get_contents($file->getRealPath());

			if (preg_match('#__DEPLOY_VERSION__#', $fileContents))
			{
				$fileContents = preg_replace('#__DEPLOY_VERSION__#', $this->getJConfig()->version, $fileContents);

				$this->say('Updating file: ' . $file->getRealPath());

				file_put_contents($file->getRealPath(), $fileContents);

				$changedFiles++;
			}
		}

		$this->say('Updated ' . $changedFiles . ' files');

		return true;
	}
1301259
protected function prepareExecute()
    {
        if (class_exists(ComposerInformation::class)) {
            $this->version = ComposerInformation::getInstalledVersion('windwalker/core');
        }

        if ($this->getRootCommand()->getOption('n')) {
            IOFactory::getIO()->setInput(new NullInput());
        }
    }
1104055
public function preRun()
    {
        $root_path = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..').DIRECTORY_SEPARATOR;
        
    	$this->options = array (
			'db_driver'	=> 'mysql',
            'db_host' => 'localhost',
            'db_name' => null,
            'db_pass' => '',
            'db_user' => 'tao',
            'install_sent'	=> '1',
            'module_host'	=> 'tao.local',
            'module_lang'	=> 'en-US', 
            'module_mode'	=> 'debug',
            'module_name'	=> 'mytao',
            'module_namespace' => '', 
            'module_url'	=> '',
            'submit'	=> 'Install',
            'user_email'	=> '', 
            'user_firstname'	=> '',
            'user_lastname'	=> '',
            'user_login'	=> '',
            'user_pass'	=> '', 
            'import_local' => true,
            'instance_name' => null,
            'extensions' => null, 
            'timezone'   => date_default_timezone_get(),
            'file_path' => $root_path . 'data' . DIRECTORY_SEPARATOR,
            'operated_by_name' => null,
            'operated_by_email' => null,
            'extra_persistences' => []
		);
    	
    	$this->options = array_merge($this->options, $this->parameters);
    	
    	// Feature #1789: default db_name is module_name if not specified.
        $this->options['db_name'] = (empty($this->options['db_name']) ? $this->options['module_name'] : $this->options['db_name']);
        
        // If no instance_name given, it takes the value of module_name.
        $this->options['instance_name'] = (empty($this->options['instance_name']) ? $this->options['module_name'] : $this->options['instance_name']);
        
    	// user password treatment
    	$this->options["user_pass1"] = $this->options['user_pass'];
    	// module namespace generation
    	if (empty ($this->options["module_namespace"])){
    		$this->options['module_namespace'] = 'http://'.$this->options['module_host'].'/'.$this->options['module_name'].'.rdf';
    	}
    	
    	if (empty ($this->options['module_url'])){
    		$this->options['module_url'] = 'http://' . $this->options['module_host'];
    	}
    	
        $this->logDebug('Install was started with the given parameters: ' . PHP_EOL . var_export($this->options, true));
    }
257124
def update(self, argv):
        """"""

        if len(argv) == 0: 
            error("Command requires an index name", 2)
        name = argv[0]

        if name not in self.service.indexes:
            error("Index '%s' does not exist" % name, 2)
        index = self.service.indexes[name]

        # Read index metadata and construct command line parser rules that 
        # correspond to each editable field.

        # Request editable fields
        fields = self.service.indexes.itemmeta().fields.optional

        # Build parser rules
        rules = dict([(field, {'flags': ["--%s" % field]}) for field in fields])

        # Parse the argument vector
        opts = cmdline(argv, rules)

        # Execute the edit request
        index.update(**opts.kwargs)
946902
protected function overrideLangJS(): void
    {
        // Bind the Laravel JS Localization command into the app IOC.
        $this->app->singleton('localization.js', function ($app) {
            $app = $this->app;
            $laravelMajorVersion = (int) $app::VERSION;

            $files = $app['files'];

            if ($laravelMajorVersion === 4) {
                $langs = $app['path.base'].'/app/lang';
            } elseif ($laravelMajorVersion === 5) {
                $langs = $app['path.base'].'/resources/lang';
            }
            $messages = $app['config']->get('localization-js.messages');
            $generator = new LangJsGenerator($files, $langs, $messages);

            return new LangJsCommand($generator);
        });

        // Bind the Laravel JS Localization command into Laravel Artisan.
        $this->commands('localization.js');
    }
194871
public function run()
    {
        \Artify\Artify\Models\Role::create([
            'slug'        => 'admin',
            'name'        => 'Administrator',
            'permissions' => [
                'view-post'       => true,
                'update-post'     => true,
                'delete-post'     => true,
                'create-post'     => true,
                'approve-post'    => true,
                'create-tag'      => true,
                'update-tag'      => true,
                'delete-tag'      => true,
                'view-tag'        => true,
                'view-comment'    => true,
                'update-comment'  => true,
                'delete-comment'  => true,
                'create-comment'  => true,
                'approve-comment' => true,
                'view-reply'      => true,
                'update-reply'    => true,
                'delete-reply'    => true,
                'create-reply'    => true,
                'approve-reply'   => true,
                'upgrade-user'    => true,
                'downgrade-user'  => true,
            ],
        ]);
        \Artify\Artify\Models\Role::create([
            'slug'        => 'moderator',
            'name'        => 'Moderator',
            'permissions' => [
                'create-post'     => true,
                'view-post'       => true,
                'delete-post'     => true,
                'update-post'     => true,
                'approve-post'    => false,
                'create-tag'      => true,
                'update-tag'      => true,
                'view-tag'        => true,
                'delete-tag'      => true,
                'create-comment'  => true,
                'update-comment'  => true,
                'delete-comment'  => true,
                'view-comment'    => true,
                'approve-comment' => true,
                'create-reply'    => true,
                'update-reply'    => true,
                'delete-reply'    => true,
                'view-reply'      => true,
                'approve-reply'   => true,
                'upgrade-user'    => false,
                'downgrade-user'  => false,
            ],
        ]);
        \Artify\Artify\Models\Role::create([
            'name'        => 'Normal User',
            'slug'        => 'user',
            'permissions' => [
                'create-post'     => false,
                'view-post'       => true,
                'update-post'     => false,
                'delete-post'     => false,
                'approve-post'    => false,
                'create-tag'      => false,
                'view-tag'        => false,
                'update-tag'      => false,
                'delete-tag'      => false,
                'create-comment'  => true,
                'update-comment'  => true,
                'view-comment'    => true,
                'delete-comment'  => true,
                'approve-comment' => false,
                'create-reply'    => true,
                'update-reply'    => true,
                'view-reply'      => true,
                'delete-reply'    => true,
                'approve-reply'   => false,
                'upgrade-user'    => false,
                'downgrade-user'  => false,
            ],
        ]);
    }
1156648
def run_pre_install_commands(prompt)
      if pre_install_commands
        prompt_for_permission if prompt
        pre_install_commands.each { |command| Executable.execute_command('bash', ['-ec', command], true) }
      end
    end