protected function getCommands($filename, $type)
    {
        $commands = $this->config->get('availableCommands');

        if (!$type || !isset($commands[$type])) {
            return array();
        }

        $command = array();

        foreach ((array)$this->config->get('enabledCommands') as $commandType) {
            if (isset($commands[$type][$commandType])) {
                $command[] = sprintf(
                    $commands[$type][$commandType],
                    rtrim($this->config->get('binDirectory'), '/'),
                    escapeshellarg($filename),
                    $this->config->get('optimisingQuality')
                );
            }
        }

        return $command;
    }
protected function getCommands($filename, $type)
    {
        $commands = $this->config->get('availableCommands');

        if (!$type || !isset($commands[$type])) {
            return array();
        }

        $command = array();

        foreach ((array)$this->config->get('enabledCommands') as $commandType) {
            if (isset($commands[$type][$commandType])) {
                $command[] = sprintf(
                    $commands[$type][$commandType],
                    rtrim($this->config->get('binDirectory'), '/'),
                    escapeshellarg($filename),
                    $this->config->get('optimisingQuality')
                );
            }
        }

        return $command;
    }
protected function getCommands ( $ filename , $ type ) { $ commands = $ this -> config -> get ( 'availableCommands' ) ; if ( ! $ type || ! isset ( $ commands [ $ type ] ) ) { return array ( ) ; } $ command = array ( ) ; foreach ( ( array ) $ this -> config -> get ( 'enabledCommands' ) as $ commandType ) { if ( isset ( $ commands [ $ type ] [ $ commandType ] ) ) { $ command [ ] = sprintf ( $ commands [ $ type ] [ $ commandType ] , rtrim ( $ this -> config -> get ( 'binDirectory' ) , '/' ) , escapeshellarg ( $ filename ) , $ this -> config -> get ( 'optimisingQuality' ) ) ; } } return $ command ; }
Gets all enabled commands for the file and type of image
@param $filename
@param $type
@return array
Gets all enabled commands for the file and type of image