public function deleteFile($path = null, $md5 = null)
    {
        $fPath = (string) $path;
        //====================================================================//
        // Safety Checks
        if (empty(dirname($fPath))) {
            return Splash::log()->err("ErrFileDirMissing", __FUNCTION__);
        }
        if (empty(basename($fPath))) {
            return Splash::log()->err("ErrFileFileMissing", __FUNCTION__);
        }
        if (empty($md5)) {
            return Splash::log()->err("ErrFileMd5Missing", __FUNCTION__);
        }
        //====================================================================//
        // Check if folder exists
        if (!is_dir(dirname($fPath))) {
            Splash::log()->war("ErrFileDirNoExists", __FUNCTION__, dirname($fPath));
        }
        //====================================================================//
        // Check if file exists
        if (is_file($fPath) && (md5_file($fPath) === $md5)) {
            Splash::log()->deb("MsgFileExists", __FUNCTION__, basename($fPath));
            //====================================================================//
            // Delete File
            if (unlink($fPath)) {
                return Splash::log()->deb("MsgFileDeleted", __FUNCTION__, basename($fPath));
            }

            return Splash::log()->err("ErrFileDeleted", __FUNCTION__, basename($fPath));
        }

        return true;
    }
public function deleteFile($path = null, $md5 = null)
    {
        $fPath = (string) $path;
        //====================================================================//
        // Safety Checks
        if (empty(dirname($fPath))) {
            return Splash::log()->err("ErrFileDirMissing", __FUNCTION__);
        }
        if (empty(basename($fPath))) {
            return Splash::log()->err("ErrFileFileMissing", __FUNCTION__);
        }
        if (empty($md5)) {
            return Splash::log()->err("ErrFileMd5Missing", __FUNCTION__);
        }
        //====================================================================//
        // Check if folder exists
        if (!is_dir(dirname($fPath))) {
            Splash::log()->war("ErrFileDirNoExists", __FUNCTION__, dirname($fPath));
        }
        //====================================================================//
        // Check if file exists
        if (is_file($fPath) && (md5_file($fPath) === $md5)) {
            Splash::log()->deb("MsgFileExists", __FUNCTION__, basename($fPath));
            //====================================================================//
            // Delete File
            if (unlink($fPath)) {
                return Splash::log()->deb("MsgFileDeleted", __FUNCTION__, basename($fPath));
            }

            return Splash::log()->err("ErrFileDeleted", __FUNCTION__, basename($fPath));
        }

        return true;
    }
public function deleteFile ( $ path = null , $ md5 = null ) { $ fPath = ( string ) $ path ; //====================================================================// // Safety Checks if ( empty ( dirname ( $ fPath ) ) ) { return Splash :: log ( ) -> err ( "ErrFileDirMissing" , __FUNCTION__ ) ; } if ( empty ( basename ( $ fPath ) ) ) { return Splash :: log ( ) -> err ( "ErrFileFileMissing" , __FUNCTION__ ) ; } if ( empty ( $ md5 ) ) { return Splash :: log ( ) -> err ( "ErrFileMd5Missing" , __FUNCTION__ ) ; } //====================================================================// // Check if folder exists if ( ! is_dir ( dirname ( $ fPath ) ) ) { Splash :: log ( ) -> war ( "ErrFileDirNoExists" , __FUNCTION__ , dirname ( $ fPath ) ) ; } //====================================================================// // Check if file exists if ( is_file ( $ fPath ) && ( md5_file ( $ fPath ) === $ md5 ) ) { Splash :: log ( ) -> deb ( "MsgFileExists" , __FUNCTION__ , basename ( $ fPath ) ) ; //====================================================================// // Delete File if ( unlink ( $ fPath ) ) { return Splash :: log ( ) -> deb ( "MsgFileDeleted" , __FUNCTION__ , basename ( $ fPath ) ) ; } return Splash :: log ( ) -> err ( "ErrFileDeleted" , __FUNCTION__ , basename ( $ fPath ) ) ; } return true ; }
Delete a file exists or not

@param string $path Full Path to Local File
@param string $md5  Local File Checksum

@return bool

@remark      For all file access functions, File Checksumm is used to ensure
the server who send request was allowed by local server to read
the specified file.
Delete a file exists or not