src/League/Monga/Filesystem.php
public function extract($name, $destination = null)
    {
        $file = $this->findOne($name);

        if (! $file || ! $file->write($destination)) {
            return false;
        }

        return (bool) $this->collection->remove(['_id' => $file->file['_id']]);
    }
public function extract($name, $destination = null)
    {
        $file = $this->findOne($name);

        if (! $file || ! $file->write($destination)) {
            return false;
        }

        return (bool) $this->collection->remove(['_id' => $file->file['_id']]);
    }
public function extract ( $ name , $ destination = null ) { $ file = $ this -> findOne ( $ name ) ; if ( ! $ file || ! $ file -> write ( $ destination ) ) { return false ; } return ( bool ) $ this -> collection -> remove ( [ '_id' => $ file -> file [ '_id' ] ] ) ; }
Extracts a file from the database,
writes it to disc, and removes it from
the database.

@param string $name        file name
@param string $destination new location, optional

@return boolean success boolean
Extracts a file from the database writes it to disc and removes it from the database .