src/FS/File/PHP/Encoder.php
public function decodeFile( $fileName, $overwrite = FALSE )
	{
		if( file_exists( $fileName ) )
		{
			if( $this->isEncoded( $fileName ) )
			{
				$file	= new FS_File_Editor( $fileName );
				$php	= $file->readString();
				$code	= $this->encode( $php );
				$dirname	= dirname( $fileName );
				$basename	= basename( $fileName );
				$target	= $dirname."/".substr( $basename, strlen( $this->filePrefix) , -strlen( $this->fileSuffix ) );
				if( $fileName == $target && !$overwrite )
					throw new RuntimeException( 'File cannot be overwritten, use Parameter "overwrite".' );
				$file->writeString( $code );
				return TRUE;
			}
		}
		return FALSE;	
	}
public function decodeFile( $fileName, $overwrite = FALSE )
	{
		if( file_exists( $fileName ) )
		{
			if( $this->isEncoded( $fileName ) )
			{
				$file	= new FS_File_Editor( $fileName );
				$php	= $file->readString();
				$code	= $this->encode( $php );
				$dirname	= dirname( $fileName );
				$basename	= basename( $fileName );
				$target	= $dirname."/".substr( $basename, strlen( $this->filePrefix) , -strlen( $this->fileSuffix ) );
				if( $fileName == $target && !$overwrite )
					throw new RuntimeException( 'File cannot be overwritten, use Parameter "overwrite".' );
				$file->writeString( $code );
				return TRUE;
			}
		}
		return FALSE;	
	}
public function decodeFile ( $ fileName , $ overwrite = FALSE ) { if ( file_exists ( $ fileName ) ) { if ( $ this -> isEncoded ( $ fileName ) ) { $ file = new FS_File_Editor ( $ fileName ) ; $ php = $ file -> readString ( ) ; $ code = $ this -> encode ( $ php ) ; $ dirname = dirname ( $ fileName ) ; $ basename = basename ( $ fileName ) ; $ target = $ dirname . "/" . substr ( $ basename , strlen ( $ this -> filePrefix ) , - strlen ( $ this -> fileSuffix ) ) ; if ( $ fileName == $ target && ! $ overwrite ) throw new RuntimeException ( 'File cannot be overwritten, use Parameter "overwrite".' ) ; $ file -> writeString ( $ code ) ; return TRUE ; } } return FALSE ; }
Decodes an encoded PHP File.
@access		public
@return		void
Decodes an encoded PHP File .