protected function checkAndExtractModelFile()
    {
        if (!is_readable($file = $this->argument('modelfile'))) {
            throw new \InvalidArgumentException('Could not find the model.');
        } // if

        $archive = new \ZipArchive();

        if (!$archive->open(realpath($file))) {
            throw new \InvalidArgumentException('Could not open the model.');
        } // if

        $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;

        if (!$archive->extractTo($dir)) {
            throw new \InvalidArgumentException('Could not extract the model.');
        } // if

        return $dir;
    }
protected function checkAndExtractModelFile()
    {
        if (!is_readable($file = $this->argument('modelfile'))) {
            throw new \InvalidArgumentException('Could not find the model.');
        } // if

        $archive = new \ZipArchive();

        if (!$archive->open(realpath($file))) {
            throw new \InvalidArgumentException('Could not open the model.');
        } // if

        $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;

        if (!$archive->extractTo($dir)) {
            throw new \InvalidArgumentException('Could not extract the model.');
        } // if

        return $dir;
    }
protected function checkAndExtractModelFile ( ) { if ( ! is_readable ( $ file = $ this -> argument ( 'modelfile' ) ) ) { throw new \ InvalidArgumentException ( 'Could not find the model.' ) ; } // if $ archive = new \ ZipArchive ( ) ; if ( ! $ archive -> open ( realpath ( $ file ) ) ) { throw new \ InvalidArgumentException ( 'Could not open the model.' ) ; } // if $ dir = sys_get_temp_dir ( ) . DIRECTORY_SEPARATOR . uniqid ( ) . DIRECTORY_SEPARATOR ; if ( ! $ archive -> extractTo ( $ dir ) ) { throw new \ InvalidArgumentException ( 'Could not extract the model.' ) ; } // if return $ dir ; }
Checks and extract the model file. If the file can be found and extracted,the extracted path will be returned.
@return string
Checks and extract the model file . If the file can be found and extracted the extracted path will be returned .