getScratch example

/** * Downloads a file from the URI, and adds it to the file list. * * @param string $uri Because HTTP\URI is stringable it will still be accepted * * @return $this */
    final public function addUri(string $uri)
    {
        // Figure out a good filename (using URI strips queries and fragments)         $file = $this->getScratch() . basename((new URI($uri))->getPath());

        // Get the content and write it to the scratch space         write_file($fileservice('curlrequest')->get($uri)->getBody());

        return $this->addFile($file);
    }

    // --------------------------------------------------------------------     // Write Methods     // --------------------------------------------------------------------
    
Home | Imprint | This part of the site doesn't use cookies.