execute

@see Command
6138
protected function execute(InputInterface $input, OutputInterface $output)
    {
        parent::execute($input, $output);

        $session = $this->mustBeModelManagerSession($this->getSession());

        $this->updateOutput(
            $output,
            (new StructureGenerator(
                $session,
                $this->schema,
                $this->relation,
                $this->getPathFile($input->getArgument('config-name'), $this->relation, null, 'AutoStructure', $input->getOption('psr4')),
                $this->getNamespace($input->getArgument('config-name'), 'AutoStructure')
            ))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions())))
        );

        $pathFile = $this->getPathFile($input->getArgument('config-name'), $this->relation, 'Model', '', $input->getOption('psr4'));
        if (!file_exists($pathFile) || $input->getOption('force')) {
            $this->updateOutput(
                $output,
                (new ModelGenerator(
                    $session,
                    $this->schema,
                    $this->relation,
                    $pathFile,
                    $this->getNamespace($input->getArgument('config-name'))
                ))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions())))
            );
        } elseif ($output->isVerbose()) {
            $this->writelnSkipFile($output, $pathFile, 'model');
        }

        $pathFile = $this->getPathFile($input->getArgument('config-name'), $this->relation, '', '', $input->getOption('psr4'));
        if (!file_exists($pathFile) || $input->getOption('force')) {
            $this->updateOutput(
                $output,
                (new EntityGenerator(
                    $session,
                    $this->schema,
                    $this->relation,
                    $pathFile,
                    $this->getNamespace($input->getArgument('config-name')),
                    $this->flexible_container
                ))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions())))
            );
        } elseif ($output->isVerbose()) {
            $this->writelnSkipFile($output, $pathFile, 'entity');
        }
    }
403581
public function execute() {
        global $CFG;
        require_once($CFG->dirroot . '/repository/lib.php');

        $fs = get_file_storage();
        // Find all generated thumbnails and group them in array by itemid (itemid == repository instance id).
        $allfiles = array_merge(
            $fs->get_area_files(SYSCONTEXTID, 'repository_filesystem', 'thumb'),
            $fs->get_area_files(SYSCONTEXTID, 'repository_filesystem', 'icon')
        );
        $filesbyitem = array();
        foreach ($allfiles as $file) {
            if (!isset($filesbyitem[$file->get_itemid()])) {
                $filesbyitem[$file->get_itemid()] = array();
            }
            $filesbyitem[$file->get_itemid()][] = $file;
        }
        // Find all instances of repository_filesystem.
        $instances = \repository::get_instances(array('type' => 'filesystem'));
        // Loop through all itemids of generated thumbnails.
        foreach ($filesbyitem as $itemid => $files) {
            if (!isset($instances[$itemid]) || !($instances[$itemid] instanceof repository_filesystem)) {
                // Instance was deleted.
                $fs->delete_area_files(SYSCONTEXTID, 'repository_filesystem', 'thumb', $itemid);
                $fs->delete_area_files(SYSCONTEXTID, 'repository_filesystem', 'icon', $itemid);
                mtrace(" instance $itemid does not exist: deleted all thumbnails");
            } else {
                // Instance has some generated thumbnails, check that they are not outdated.
                $instances[$itemid]->remove_obsolete_thumbnails($files);
            }
        }
    }
1187834
def execute_command(self, request, command, frame):
        """"""
        return Response(frame.console.eval(command), mimetype="text/html")
543241
function run()
    {
        if (strpos($this->cmd, ':') !== false) {
            $tmp = explode(':', $this->cmd);
            $this->cmd = $tmp[0];
            $this->subCmd = $tmp[1];
        } else {
            $this->subCmd = false;
        }

            //Select
        switch ($this->cmd) {
            case 'css':
                $this->cmdCss();
                break;

            case 'js':
                $this->cmdJs();
                break;
            
            case 'all':
                $this->cmdAll();
                break;

            case 'jss':
                $this->cmdJss();
                break;

            default:
                echo "\n\n  Command \"optimize:".$this->cmd."\" not exists!";
                exit(Main::help());
            break;
        }
            return;
    }
1054930
def _execute_command(self, command, *args):
        """"""
        try:
            command(*args)
        except libvirt.libvirtError as error:
            raise RuntimeError("Unable to execute command. %s" % error)
1257998
public function executeCommands()
    {
        $commands = $this->getCommands();
        foreach ($commands as $command) {
            call_user_func_array([$this->getAdapter(), $command['name']], $command['arguments']);
        }
    }
816321
public function exec()
    {
        $name = $this->argument('file');
        $process = Database::export($name);
        //
        $this->show($process);
    }
1311479
public void execRun(String command) throws IOException, PHPException {
	    writeCommand("R" + command);
	    phpConsoleLogger.write(command);
		String readLine = readLine();
        phpConsoleLogger.read(readLine);
		
	}
339401
function execute(cmd) {
  var result = promise.defer();
  exec(cmd, function(err, stdout) {
    if (err) {
      result.reject(err);
    } else {
      result.fulfill(stdout);
    }
  });
  return result.promise;
}
1308962
public function exec()
    {
        $http = $this->argument('http');
        //
        $process = Router::post($http);
        //
        $this->show($process);
    }
1061247
def view_execute(self, id, **kwargs):
        ""
        api_path = "/api/v2/views/{id}/execute.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1304085
public function exec()
    {
        $name = $this->argument('name');
        //
        $process = Migrations::add($name);
        //
        $this->show($process, $name);
    }
275216
def execute_cmd(self, userid, cmdStr):
        """"""
        LOG.debug("executing cmd: %s", cmdStr)
        return self._smtclient.execute_cmd(userid, cmdStr)
501467
def execute(*)
      file, line, = caller.first.split(":")
      colors = SSHKit::Color.new($stderr)
      $stderr.puts colors.colorize("Warning: `execute' should be wrapped in an `on' scope in #{file}:#{line}.", :red)
      $stderr.puts
      $stderr.puts "  task :example do"
      $stderr.puts colors.colorize("    on roles(:app) do", :yellow)
      $stderr.puts "      execute 'whoami'"
      $stderr.puts colors.colorize("    end", :yellow)
      $stderr.puts "  end"
      $stderr.puts
      raise NoMethodError, "undefined method `execute' for main:Object"
    end
871573
def execute_command(command):
    """"""

    command = shlex.split(command)
    try:
        process = subprocess.Popen(
            command,
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
    except FileNotFoundError:
        raise RuntimeError("Command not found: {}".format(repr(command)))
    process.wait()
    # TODO: may use another codec to decode
    if process.returncode > 0:
        stderr = process.stderr.read().decode("utf-8")
        raise ValueError("Error executing command: {}".format(repr(stderr)))
    return process.stdout.read().decode("utf-8")
740008
public function execute()
	{
		putenv('LINES=' . $this->terminal->getHeight());
		putenv('COLUMNS=' . $this->terminal->getWidth());

		$this->configureIO();

		try
		{
			$this->dispatchEvent(ApplicationEvents::BEFORE_EXECUTE);

			// Perform application routines.
			$exitCode = $this->doExecute();

			$this->dispatchEvent(ApplicationEvents::AFTER_EXECUTE);
		}
		catch (\Throwable $throwable)
		{
			if (!$this->shouldCatchThrowables())
			{
				throw $throwable;
			}

			$event = new ApplicationErrorEvent($throwable, $this, $this->runningCommand);

			$this->dispatchEvent(ConsoleEvents::APPLICATION_ERROR, $event);

			$exitCode = $event->getExitCode();

			if (is_numeric($exitCode))
			{
				$exitCode = (int) $exitCode;

				if ($exitCode === 0)
				{
					$exitCode = 1;
				}
			}
			else
			{
				$exitCode = 1;
			}
		}
		finally
		{
			if ($this->shouldAutoExit() && isset($exitCode))
			{
				$exitCode = $exitCode > 255 ? 255 : $exitCode;
				$this->close($exitCode);
			}
		}
	}
503361
function execute(command, callback){
  exec(command, function(error, stdout, stderr){ callback(error, stdout); });
}