public function readFileContents($fileName = null)
    {
        //====================================================================//
        // Safety Checks
        if (empty($fileName)) {
            return Splash::log()->err("ErrFileFileMissing");
        }
        //====================================================================//
        // Check if file exists
        if (!is_file($fileName)) {
            return Splash::log()->err("ErrFileNoExists", $fileName);
        }
        //====================================================================//
        // Check if file is readable
        if (!is_readable($fileName)) {
            return Splash::log()->err("ErrFileReadable", $fileName);
        }
        Splash::log()->deb("MsgFileRead", $fileName);
        //====================================================================//
        // Read File Contents
        return base64_encode((string) file_get_contents($fileName));
    }
public function readFileContents($fileName = null)
    {
        //====================================================================//
        // Safety Checks
        if (empty($fileName)) {
            return Splash::log()->err("ErrFileFileMissing");
        }
        //====================================================================//
        // Check if file exists
        if (!is_file($fileName)) {
            return Splash::log()->err("ErrFileNoExists", $fileName);
        }
        //====================================================================//
        // Check if file is readable
        if (!is_readable($fileName)) {
            return Splash::log()->err("ErrFileReadable", $fileName);
        }
        Splash::log()->deb("MsgFileRead", $fileName);
        //====================================================================//
        // Read File Contents
        return base64_encode((string) file_get_contents($fileName));
    }
public function readFileContents ( $ fileName = null ) { //====================================================================// // Safety Checks if ( empty ( $ fileName ) ) { return Splash :: log ( ) -> err ( "ErrFileFileMissing" ) ; } //====================================================================// // Check if file exists if ( ! is_file ( $ fileName ) ) { return Splash :: log ( ) -> err ( "ErrFileNoExists" , $ fileName ) ; } //====================================================================// // Check if file is readable if ( ! is_readable ( $ fileName ) ) { return Splash :: log ( ) -> err ( "ErrFileReadable" , $ fileName ) ; } Splash :: log ( ) -> deb ( "MsgFileRead" , $ fileName ) ; //====================================================================// // Read File Contents return base64_encode ( ( string ) file_get_contents ( $ fileName ) ) ; }
Read a file contents from local filesystem & encode it to base64 format

@param string $fileName Full path local FileName

@return false|string Base64 encoded raw file
Read a file contents from local filesystem & encode it to base64 format