Wrapper.php
private function validateCommand($commandString)
    {
        $cmdParts = explode(" ", $commandString);

        if (count($cmdParts) < 2) {
            throw new InvalidArgumentException("This command isn't properly structured : '" . $commandString . "'");
        }

        $binaryPath = $cmdParts[0];
        $binaryPathParts = explode('/', $binaryPath);
        $binary = $binaryPathParts[count($binaryPathParts)-1];

        if (!in_array($binary, $this->_acceptedBinaries)) {
            throw new InvalidArgumentException("This command isn't part of the ImageMagick command line tools : '" . $binary . "'");
        }

        return true;
    }
private function validateCommand($commandString)
    {
        $cmdParts = explode(" ", $commandString);

        if (count($cmdParts) < 2) {
            throw new InvalidArgumentException("This command isn't properly structured : '" . $commandString . "'");
        }

        $binaryPath = $cmdParts[0];
        $binaryPathParts = explode('/', $binaryPath);
        $binary = $binaryPathParts[count($binaryPathParts)-1];

        if (!in_array($binary, $this->_acceptedBinaries)) {
            throw new InvalidArgumentException("This command isn't part of the ImageMagick command line tools : '" . $binary . "'");
        }

        return true;
    }
private function validateCommand ( $ commandString ) { $ cmdParts = explode ( " " , $ commandString ) ; if ( count ( $ cmdParts ) < 2 ) { throw new InvalidArgumentException ( "This command isn't properly structured : '" . $ commandString . "'" ) ; } $ binaryPath = $ cmdParts [ 0 ] ; $ binaryPathParts = explode ( '/' , $ binaryPath ) ; $ binary = $ binaryPathParts [ count ( $ binaryPathParts ) - 1 ] ; if ( ! in_array ( $ binary , $ this -> _acceptedBinaries ) ) { throw new InvalidArgumentException ( "This command isn't part of the ImageMagick command line tools : '" . $ binary . "'" ) ; } return true ; }
Validates that the command launches a Imagemagick command line tool executable

@param string $commandString

@throws InvalidArgumentException
@return boolean
Validates that the command launches a Imagemagick command line tool executable