[cmdCss description]
@return [type] [description]
160509
private function cmdCss()
    {
        echo "\n - CSS -\n";

        if ($css = $this->config->get('css')) {
            if (!$this->subCmd) {
                foreach ($css as $k => $v) {
                    echo "\n - $k:\n";
                    $this->minify($v->filename, $v->add, $this->yuicompressor, $this->config->baseDir);
                }
                return;
            }

            if (isset($css->{$this->subCmd})) {
                echo "\n - ".$this->subCmd."\n";
                $this->minify($css->{$this->subCmd}->filename,
                  $css->{$this->subCmd}->add,
                  $this->yuicompressor,
                  $this->config->baseDir);
            } else {
                echo "\n Err: Not found!\n";
                return;
            }
        }
    }
13703
protected function cmdListKeys()
    {
        /**
         * @see simplecomplex_cache_cli()
         */
        $container = Dependency::container();
        // Validate input. ---------------------------------------------
        $store = '';
        if (empty($this->command->arguments['store'])) {
            $this->command->inputErrors[] = !isset($this->command->arguments['store']) ? 'Missing \'store\' argument.' :
                'Empty \'store\' argument.';
        } else {
            $store = $this->command->arguments['store'];
            if (!CacheKey::validate($store)) {
                $this->command->inputErrors[] = 'Invalid \'store\' argument.';
            }
        }
        $expired = 0;
        if (!empty($this->command->arguments['expired'])) {
            if (!ctype_digit('' . $this->command->arguments['expired'])) {
                $this->command->inputErrors[] = 'Invalid \'expired\' argument, must be 0|1|2.';
            } else {
                $expired = (int) $this->command->arguments['expired'];
                switch ($expired) {
                    case 0:
                    case 1:
                    case 2:
                        break;
                    default:
                        $this->command->inputErrors[] = 'Invalid \'expired\' argument, must be 0|1|2.';
                }
            }
        }
        $limit = 0;
        if (!empty($this->command->arguments['limit'])) {
            if (!ctype_digit('' . $this->command->arguments['limit'])) {
                $this->command->inputErrors[] = 'Invalid \'limit\' argument, must be digit(s).';
            } else {
                $limit = (int) $this->command->arguments['limit'];
                if ($limit < 0) {
                    if ($limit == -1) {
                        $limit = 0;
                    } else {
                        $this->command->inputErrors[] = 'Invalid \'limit\' argument, cannot be less than.';
                    }
                }
            }
        }
        $end_of_life = '';
        if (!empty($this->command->arguments['end-of-life'])) {
            $end_of_life = $this->command->arguments['end-of-life'];
        }

        $get = !empty($this->command->options['get']);
        if ($get && $end_of_life) {
            $this->command->inputErrors[] = 'Option \'get\' is not compatible with non-empty argument end-of-life.';
        }

        if ($this->command->inputErrors) {
            foreach ($this->command->inputErrors as $msg) {
                $this->environment->echoMessage(
                    $this->environment->format($msg, 'hangingIndent'),
                    'notice'
                );
            }
            // This command's help text.
            $this->environment->echoMessage("\n" . $this->command);
            exit;
        }
        // Check if the command is doable.------------------------------
        // Does that store exist?
        if ($container->has('cache-broker')) {
            /** @var CacheBroker $cache_broker */
            $cache_broker_class = get_class($container->get('cache-broker'));
        } else {
            $cache_broker_class = static::CLASS_CACHE_BROKER;
        }
        $cache_class = constant($cache_broker_class . '::CACHE_CLASSES')[CacheBroker::CACHE_BASE];
        if (!method_exists($cache_class, 'listInstances')) {
            $this->environment->echoMessage('Cannot retrieve list of cache store instances via class['
                . $cache_class . '], has no static method listInstances().', 'error');
            exit;
        }
        $stores = forward_static_call($cache_class . '::listInstances');
        $cache_store = null;
        foreach ($stores as $instance) {
            if ($instance->name == $store) {
                /** @var ManageableCacheInterface $cache_store */
                $cache_store = $instance;
                break;
            }
        }
        if (!$cache_store) {
            $this->environment->echoMessage('');
            $this->environment->echoMessage('That cache store doesn\'t exist, store[' . $store . '].', 'warning');
            exit;
        }

        // Check that cache store class has listKeys() method
        // isn't an interface requirement.
        if (!method_exists($cache_store, 'listKeys')) {
            $this->environment->echoMessage('Cache store[' . $store . '] class[' . get_class($cache_store)
                . '] has no method listKeys().', 'error');
            exit;
        }

        /**
         * @see FileCache::listKeys()
         */
        $cache_keys = $cache_store->listKeys($expired, $limit, $end_of_life);
        if (!$end_of_life) {
            if ($get) {
                return join(',', $cache_keys);
            }
            $this->environment->echoMessage(join("\n", $cache_keys));
        }
        else {
            $buffer = '';
            foreach ($cache_keys as $key => $end_time) {
                $buffer .= $key . ': ' . $end_time . "\n";
            }
            $this->environment->echoMessage(rtrim($buffer));
        }
        exit;
    }
990609
public function adminIndex()
    {
        $config = [
            'title'       => trans('HCMenu::menu.page_title'),
            'listURL'     => route('admin.api.routes.menu'),
            'newFormUrl'  => route('admin.api.form-manager', ['menu-new']),
            'editFormUrl' => route('admin.api.form-manager', ['menu-edit']),
            'imagesUrl'   => route('resource.get', ['/']),
            'headers'     => $this->getAdminListHeader(),
        ];

        if( auth()->user()->can('interactivesolutions_honeycomb_menu_routes_menu_create') )
            $config['actions'][] = 'new';

        if( auth()->user()->can('interactivesolutions_honeycomb_menu_routes_menu_update') ) {
            $config['actions'][] = 'update';
            $config['actions'][] = 'restore';
        }

        if( auth()->user()->can('interactivesolutions_honeycomb_menu_routes_menu_delete') )
            $config['actions'][] = 'delete';

        $config['actions'][] = 'search';
        $config['filters'] = $this->getFilters();

        return hcview('HCCoreUI::admin.content.list', ['config' => $config]);
    }
744598
public function getCustomCSSPrefix()
    {
        if ($parent = $this->getParent()) {
            return sprintf('%s %s', $parent->CSSID, $this->CSSID);
        }
        
        return $this->CSSID;
    }
254571
public function commands()
    {
        $shellList = $this->getShellList();
        $flatten = Hash::flatten($shellList);
        $duplicates = array_intersect($flatten, array_unique(array_diff_key($flatten, array_unique($flatten))));
        $duplicates = Hash::expand($duplicates);

        $options = [];
        foreach ($shellList as $type => $commands) {
            foreach ($commands as $shell) {
                $prefix = '';
                if (!in_array(strtolower($type), ['app', 'core']) &&
                    isset($duplicates[$type]) &&
                    in_array($shell, $duplicates[$type])
                ) {
                    $prefix = $type . '.';
                }

                $options[] = $prefix . $shell;
            }
        }

        return $options;
    }
1084642
private function getCommandName()
    {
        $className   = implode('', array_slice(explode('\\', get_class($this)), -1));
        $commandName = str_replace('command', '', strtolower($className));

        return $commandName;
    }
1328145
protected function _command() {
        $class = '\Gcs\Framework\Core\Terminal\Terminal' . ucfirst($this->_argv[0]);

        if (isset($this->_argv[1])) {
            $method = $this->_argv[1];
        }
        else if ($this->_argv[0] == 'help') {
            $method = 'help';
        }
        else {
            $method = '';
        }

        if (method_exists($class, $method)) {
            $instance = new $class($this->_argv);
            $instance->$method($this->_argv);
        }
        else {
            if (isset($this->_argv[1])) {
                echo '[ERROR] unrecognized command "' . $this->_argv[0] . ' ' . $this->_argv[1] . '"';
            }
            else {
                echo '[ERROR] unrecognized command "' . $this->_argv[0] . '"\n';
            }
        }
    }
1284071
public static function commands(){
       $results = [];
       foreach(static::$commands as $name => $cmd){
          $results[] = [
            'name'        => $name,
            'params'      => preg_replace('/:(\w+)/','[$1]',implode(' ',$cmd[0])),
            'description' => $cmd[2],
          ];
       }
       return $results;
    }
1372808
protected function getDefaultCommands()
    {
        $commands = parent::getDefaultCommands();

        $commands[] = new Command\App\AppAdd();
        $commands[] = new Command\App\AppRemove();
        $commands[] = new Command\Environment\EnvironmentAdd();
        $commands[] = new Command\Environment\EnvironmentRemove();
        $commands[] = new Command\Environment\EnvironmentEnable();
        $commands[] = new Command\Environment\EnvironmentDisable();
        $commands[] = new Command\Environment\EnvironmentDeploy();
        $commands[] = new Command\Environment\EnvironmentShell();
        $commands[] = new Command\Environment\EnvironmentScale();
        $commands[] = new Command\Environment\EnvironmentProxyEnable();
        $commands[] = new Command\Environment\EnvironmentTest();
        $commands[] = new Command\Environment\EnvironmentRebuild();
        $commands[] = new Command\Environment\EnvironmentDomains();
        $commands[] = new Command\Environment\EnvironmentDrush();
        $commands[] = new Command\Environment\EnvironmentRun();
        $commands[] = new Command\Environment\EnvironmentUpdate();
        $commands[] = new Command\Status();
        $commands[] = new Command\Queue();

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

        return $commands;
    }
802155
public function all() {
    $commands = [
      'tests:composer:validate',
      'tests:php:lint',
      'tests:phpcs:sniff:all',
      'tests:yaml:lint:all',
      'tests:twig:lint:all',
    ];
    // To enable this command, set validate.acsf to TRUE in blt.yml.
    if ($this->getConfigValue('validate.acsf') == TRUE) {
      $commands[] = 'tests:acsf:validate';
    }

    $status_code = $this->invokeCommands($commands);
    return $status_code;
  }
485262
public function getCommandLine()
	{
		return sprintf(
			'put %d %d %d %d',
			$this->_priority,
			$this->_delay,
			$this->_ttr,
			$this->getDataLength()
		);
	}
706744
private function getCommand()
    {
        $php = array(PHP_BINARY);
        $args = array_slice($_SERVER['argv'], 1);

        if (!$this->persistent) {
            // Use command-line options
            array_push($php, '-n', '-c', $this->tmpIni);
        }

        if (defined('STDOUT') && Process::supportsColor(STDOUT)) {
            $args = Process::addColorOption($args, $this->colorOption);
        }

        $args = array_merge($php, array($this->script), $args);

        $cmd = Process::escape(array_shift($args), true, true);
        foreach ($args as $arg) {
            $cmd .= ' '.Process::escape($arg);
        }

        return $cmd;
    }
992133
public function getShellList()
    {
        $skipFiles = ['app'];
        $hiddenCommands = ['command_list', 'completion'];
        $plugins = Plugin::loaded();
        $shellList = array_fill_keys($plugins, null) + ['CORE' => null, 'app' => null];

        $appPath = App::path('Shell');
        $shellList = $this->_findShells($shellList, $appPath[0], 'app', $skipFiles);

        $appPath = App::path('Command');
        $shellList = $this->_findShells($shellList, $appPath[0], 'app', $skipFiles);

        $skipCore = array_merge($skipFiles, $hiddenCommands, $shellList['app']);
        $corePath = dirname(__DIR__);
        $shellList = $this->_findShells($shellList, $corePath, 'CORE', $skipCore);

        $corePath = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Command';
        $shellList = $this->_findShells($shellList, $corePath, 'CORE', $skipCore);

        foreach ($plugins as $plugin) {
            $pluginPath = Plugin::classPath($plugin) . 'Shell';
            $shellList = $this->_findShells($shellList, $pluginPath, $plugin, []);
        }

        return array_filter($shellList);
    }
1209388
public function getServices()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Services');
        }

        // We allowed?
        if (empty($this->settings['show']['services']) || !is_array($this->settings['services']) || count($this->settings['services']) == 0) {
            return [];
        }

        // Temporarily keep statuses here
        $statuses = [];

        $this->settings['services']['executables'] = (array) $this->settings['services']['executables'];
        $this->settings['services']['pidFiles'] = (array) $this->settings['services']['pidFiles'];

        // Convert paths of executables to PID files
        $pids = [];
        $do_process_search = false;
        if (count($this->settings['services']['executables']) > 0) {
            $potential_paths = @glob('/proc/*/cmdline');
            if (is_array($potential_paths)) {
                $num_paths = count($potential_paths);
                $do_process_search = true;
            }
        }

        // Should we go ahead and do the PID search based on executables?
        if ($do_process_search) {
            // Precache all process cmdlines
            for ($i = 0; $i < $num_paths; ++$i) {
                $cmdline_cache[$i] = explode("\x00", Common::getContents($potential_paths[$i]));
            }

            // Go through the list of executables to search for
            foreach ($this->settings['services']['executables'] as $service => $exec) {
                // Go through pid file list. for loops are faster than foreach
                for ($i = 0; $i < $num_paths; ++$i) {
                    $cmdline = $cmdline_cache[$i];
                    $match = false;
                    if (is_array($exec)) {
                        $match = true;
                        foreach ($exec as $argn => $argv) {
                            if (isset($cmdline[$argn]) && $cmdline[$argn] != $argv) {
                                $match = false;
                            }
                        }
                    } elseif ($cmdline[0] == $exec) {
                        $match = true;
                    }
                    // If this one matches, stop here and save it
                    if ($match) {
                        // Get pid out of path to cmdline file
                        $pids[$service] = substr($potential_paths[$i], 6 /*strlen('/proc/')*/,
                                                strpos($potential_paths[$i], '/', 7) - 6);
                        break;
                    }
                }
            }
        }

        // PID files
        foreach ($this->settings['services']['pidFiles'] as $service => $file) {
            $pid = Common::getContents($file, false);
            if ($pid != false && is_numeric($pid)) {
                $pids[$service] = $pid;
            }
        }

        // Deal with PIDs
        foreach ($pids as $service => $pid) {
            $path = '/proc/'.$pid.'/status';
            $status_contents = Common::getContents($path, false);
            if ($status_contents == false) {
                $statuses[$service] = array('state' => 'Down', 'threads' => 'N/A', 'pid' => $pid);
                continue;
            }

            // Attempt getting info out of it
            if (!preg_match_all('/^(\w+):\s+(\w+)/m', $status_contents, $status_matches, PREG_SET_ORDER)) {
                continue;
            }

            // Initially set these as pointless
            $state = false;
            $threads = false;
            $mem = false;

            // Go through
            for ($i = 0, $num = count($status_matches); $i < $num; ++$i) {

                // What have we here?
                switch ($status_matches[$i][1]) {

                    // State section
                    case 'State':
                        switch ($status_matches[$i][2]) {
                            case 'D': // blocked on disk IO
                            case 'S':
                                $state = 'Up (Sleeping)';
                            break;
                            case 'Z':
                                $state = 'Zombie';
                            break;
                            // running
                            case 'R':
                                $state = 'Up (Running)';
                            break;
                            // stopped
                            case 'T':
                                $state = 'Up (Stopped)';
                            break;
                        }
                    break;

                    // Mem usage
                    case 'VmRSS':
                        if (is_numeric($status_matches[$i][2])) {
                            $mem = $status_matches[$i][2] * 1024;
                        } // Measured in kilobytes; we want bytes
                    break;

                    // Thread count
                    case 'Threads':
                        if (is_numeric($status_matches[$i][2])) {
                            $threads = $status_matches[$i][2];
                        }

                        // Thread count should be last. Stop here to possibly save time assuming we have the other values
                        if ($state !== false && $mem !== false && $threads !== false) {
                            break;
                        }
                    break;
                }
            }

            // Save info
            $statuses[$service] = array(
                'state' => $state ? $state : '?',
                'threads' => $threads,
                'pid' => $pid,
                'memory_usage' => $mem,
            );
        }

        return $statuses;
    }
814431
private function formatCommand()
    {
        $cmdGroup = [];
        $noGroup = [];
        foreach ($this->console->getCommands() as $name => $class) {
            if ($class !== __CLASS__) {
                $class = new \ReflectionClass($class);
                $property = $class->getDefaultProperties();
                $property = isset($property['description']) ? $property['description'] : '';

                $hadGroup = strpos($name, ':');
                $group = substr($name, 0, $hadGroup);
                $name = Colour::colour($name, Colour::GREEN);
                $this->commandLength > strlen($name) || $this->commandLength = strlen($name) + 3;

                if ($hadGroup) {
                    $cmdGroup[$group][$name] = $property;
                } else {
                    $noGroup[$name] = $property;
                }
            }
        }
        return [$noGroup, $cmdGroup];
    }
898438
protected function _getCommand()
        {
            $command = $this->_bin;

            $command .= ($this->getCopies() > 1) ? " --copies " . $this->getCopies() : "";
            $command .= " --orientation " . $this->getOrientation();
            $command .= " --page-size " . $this->getPageSize();

            foreach($this->getMargins() as $position => $margin) {
                $command .= (false === is_null($margin)) ? sprintf(' --margin-%s %s', $position, $margin) : '';
            }

            $command .= ($this->getWindowStatus()) ? " --window-status ".$this->getWindowStatus()."" : "";
            $command .= ($this->getTOC()) ? " --toc" : "";
            $command .= ($this->getGrayscale()) ? " --grayscale" : "";
            $command .= (mb_strlen($this->getPassword()) > 0)
            ? " --password " . $this->getPassword() . ""
            : "";
            $command .= (mb_strlen($this->getUsername()) > 0)
            ? " --username " . $this->getUsername() . ""
            : "";
            $command .= (mb_strlen($this->getFooterHtml()) > 0)
            ? " --margin-bottom 20 --footer-html \"" . $this->getFooterHtml() . "\""
            : "";
            $command .= ($this->getTitle())
            ? ' --title "' . $this->getTitle() . '"'
            : '';

            $command .= ' "%input%"';
            $command .= " -";
            if ($this->getRunInVirtualX()) {
                $command = 'xvfb-run ' . $command;
            }
            return $command;
        }