Gets all the commands directly from the API
@param array $param
@return array
762891
public function list_commands($param = []){
    //Prepping, processing and validating the create user parameters
    $param = $this->process_parameters($param);
    //Setting the last action performed
    $this->last_action = "list-commands";

    //Defining  the $url_part and the command to be executed
    $url_part = "list-commands";
    if (isset($param['short'])){//short parameter is set
      $url_part .= "&short";
    }

    if (isset($param['nameonly'])){//nameonly parameter is set
      $url_part .= "&nameonly";
    }
    //Concatenating the closing single quote
    $url_part .="'";
    //Concatenating the header url and $url_part to create the full url to be executed
    $url_part = $this->get_header_url() . $url_part;

    //test
    $uid = $this->hostname;
    if ( !empty($param) ){
      $uid .= md5(json_encode($param));
    }

    if ( $this->cache_has($uid, 'list_commands') ){
      $result_call = $this->cache_get($uid, 'list_commands');
    }
    else {
      $result_call = $this->call_shell_exec($url_part);
      $this->cache_set($uid, 'list_commands', $result_call);
    }
    return $result_call;
  }
504392
public function getAvailableCommands(): array
    {
        if ($this->availableCommands === null) {
            $this->availableCommands = [];

            foreach (static::getCommandControllerMethodArguments($this->objectManager) as $className => $methods) {
                foreach (array_keys($methods) as $methodName) {
                    $this->availableCommands[] = new Command($className, substr($methodName, 0, -7));
                }
            }
        }

        return $this->availableCommands;
    }
94332
private function resolveCommands()
    {
        $commands = [];
        foreach ($this->getParameter('commands') as $cmd) {
            $commands[] = is_array($cmd) ? (new ProcessBuilder($cmd))->getProcess() : new Process($cmd);
        }

        return $commands;
    }
44818
public function getConfirmBoxMsg($param) {
        $param_arr = json_decode($param, true);
        $msg_array = array();
        foreach ($this->xmlContent as $msg) {
            if (($msg->getAttribute('uicomponent') == 'confirm' || $msg->getAttribute('uicomponent') == 'alert') &&
                    $msg->getAttribute('targetcontroller') == $param_arr['targetcontroller'] &&
                    $msg->getAttribute('targetaction') == $param_arr['targetaction'] &&
                    in_array($msg->getAttribute('operation'), $param_arr['operation'])
            ) {
                array_push($msg_array, array('confirmmsg' => array('value' => $msg->getAttribute('value'), 'operation' => $msg->getAttribute('operation'))));
            }
        }

        return $msg_array;
    }
523642
public function getCommandline(): array
    {
        $args = $this->getArguments();
        if ($this->executable !== null && $this->executable !== '') {
            array_unshift($args, $this->executable);
        }

        return $args;
    }
431423
private function initCommand($param)
    {
        if (!preg_match('/^[a-z]+:[a-z]+$/', $param)) {
            $this->options['command'] = $param;

            return;
        }
        
        $part = explode(':', $param);

        $this->options['command'] = $part[0];

        $this->options['action'] = $part[1];
    }
218967
public function getCardProvidersList($param)
    {
        $this->flushState();
        $uri = $this->getUriProvider().'/cards';
        $hasError = false;
        return $this->request( $uri ,$param,!$hasError);
    }
252448
public function getParam($param)
    {
        $value = $this->getGravParam($param);
        if ($value === null) {
            $value = $this->getQueryParam($param);
        }

        return $value;
    }
428705
public function getHandler(...$params): array
    {
        list($path, $method) = $params;
        // list($path, $info) = $router;

        return $this->match($path, $method);
    }
1018668
protected function call($command, $params = [])
    {
        $parameters['command'] = $command;

        foreach($params as $key => $value) {
            $parameters[$key] = $value;
        }

        $command = $this->getApplication()->find($command);

        return $command->run(new ArrayInput($parameters), $this->output);
    }
591343
protected function getQueryParam($param, $url) {
    $keys = [];
    $parse = parse_url($url);
    parse_str($parse['query'], $keys);

    if (isset($keys[$param])) {
      return $keys[$param];
    }

    return FALSE;
  }
1023975
protected function getCommands()
    {
        $commands = [];

        foreach ($this->getApplication()->all() as $name => $command) {
            if (in_array($name, $this->commandWhitelist)) {
                $commands[] = $command;
            }
        }

        foreach (config('tinker.commands', []) as $command) {
            $commands[] = $this->getApplication()->resolve($command);
        }

        return $commands;
    }
730270
public function getConfigVariableList(array $param)
    {

        if (!$param || !is_array($param)) {
            return null;
        }

        $list = [];

        foreach ($param as $key) {
            $list[$key] = $this->setting[$key];
        }

        return $list;
    }
148775
protected function getCommands()
    {
        $commands = [];

        $routes = $this->map->getRoutes();
        ksort($routes);

        $text = '';
        foreach ($routes as $route) {
            $name    = $route->name;
            $summary = $this->getCommandSummary($route);
            $text .= "    {$name}" . PHP_EOL;
            $text .= "        {$summary}" . PHP_EOL;
        }

        return "<<bold>>COMMANDS<<reset>>" . PHP_EOL
             . "    " . trim($text) . PHP_EOL . PHP_EOL;
    }
867274
protected function _getCommands($controllerName)
    {
        $commands = [];

        foreach (get_class_methods($controllerName) as $method) {
            if (preg_match('#^(.*)Command$#', $method, $match) === 1 && $match[1] !== 'help') {
                $commands[] = $match[1];
            }
        }

        return $commands;
    }
683337
public static function text($param = array())
    {

        $defParam = array(
            'amount' => 128,
            'what' => 'bytes',
            'start' => 'yes',
            'lang' => 'en'
        );

        if (is_integer($param)) {
            $param = array('amount' => $param);
        }

        $param = array_merge($defParam, $param);

        $json = Utils::getJSON('http://json-lipsum.appspot.com/?' . http_build_query($param));

        if (isset($json->lipsum) && strpos('--', $json->lipsum)) {
            return implode(' -- ', $json->lipsum);
        } elseif (isset($json->lipsum)) {
            return $json->lipsum;
        } else {
            return 'Error Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
        }

    }
652022
public function call($param = null)
    {
        // get the class within the correct namespace
        // initiate object
        $object = $this->prepareObject(new $this->class());

        $return    = new \SplFixedArray(2);
        $return[1] = $object;

        if (!empty($this->method)) {
            if (!empty($param) && !empty($this->param)) {
                $return[0] = $object->{$this->method}(array_merge((array)$this->param, (array)$param));

                return $return;
            }
            $return[0] = $object->{$this->method}();

            return $return;
        }

        return $return;
    }