public function getFileLocation($file)
    {
        // get the file info
        if (filter_var($file, FILTER_VALIDATE_URL)) { 

            // the file is a URL, download it and set the local file path
            $localFile = '/tmp/moltinfile_' . rand(100000, 900000);
            file_put_contents($localFile, file_get_contents($file));
        } else {

            // the file is stored locally, set it
            $localFile = $file;
        }

        // be sure it exists
        if (!file_exists($localFile)) {
            throw new FileNotFoundException();
        }

        return $localFile;
    }
public function getFileLocation($file)
    {
        // get the file info
        if (filter_var($file, FILTER_VALIDATE_URL)) { 

            // the file is a URL, download it and set the local file path
            $localFile = '/tmp/moltinfile_' . rand(100000, 900000);
            file_put_contents($localFile, file_get_contents($file));
        } else {

            // the file is stored locally, set it
            $localFile = $file;
        }

        // be sure it exists
        if (!file_exists($localFile)) {
            throw new FileNotFoundException();
        }

        return $localFile;
    }
public function getFileLocation ( $ file ) { // get the file info if ( filter_var ( $ file , FILTER_VALIDATE_URL ) ) { // the file is a URL, download it and set the local file path $ localFile = '/tmp/moltinfile_' . rand ( 100000 , 900000 ) ; file_put_contents ( $ localFile , file_get_contents ( $ file ) ) ; } else { // the file is stored locally, set it $ localFile = $ file ; } // be sure it exists if ( ! file_exists ( $ localFile ) ) { throw new FileNotFoundException ( ) ; } return $ localFile ; }
Get the file location given the value passed by the method call
Will retrieve a remote file if the passed location is a URL

@param string $file the local path or URL of the file
@return string the local file path
@throws Moltin\Exceptions\FileNotFoundException
Get the file location given the value passed by the method call Will retrieve a remote file if the passed location is a URL