src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/class_writer.php
private function openFile( $dir, $name )
    {
        $filename = $dir . DIRECTORY_SEPARATOR . strtolower( $this->prefix ) . strtolower( $name ) . '.php';
        // We do not want to overwrite files
        if ( file_exists( $filename ) && ( $this->overwrite === false || is_writable( $filename ) === false ) )
        {
            throw new ezcBaseFileIoException( $filename, ezcBaseFileException::WRITE, "File already exists or is not writeable. Use --overwrite to ignore existance." );
        }
        $file = @fopen( $filename, 'w' );
        if ( $file === false )
        {
            throw new ezcBaseFilePermissionException( $file, ezcBaseFileException::WRITE );
        }
        fwrite( $file, "<?php\n" );
        fwrite( $file, "// Autogenerated class file\n" );
        fwrite( $file, "\n" );
        return $file;
    }
private function openFile( $dir, $name )
    {
        $filename = $dir . DIRECTORY_SEPARATOR . strtolower( $this->prefix ) . strtolower( $name ) . '.php';
        // We do not want to overwrite files
        if ( file_exists( $filename ) && ( $this->overwrite === false || is_writable( $filename ) === false ) )
        {
            throw new ezcBaseFileIoException( $filename, ezcBaseFileException::WRITE, "File already exists or is not writeable. Use --overwrite to ignore existance." );
        }
        $file = @fopen( $filename, 'w' );
        if ( $file === false )
        {
            throw new ezcBaseFilePermissionException( $file, ezcBaseFileException::WRITE );
        }
        fwrite( $file, "<?php\n" );
        fwrite( $file, "// Autogenerated class file\n" );
        fwrite( $file, "\n" );
        return $file;
    }
private function openFile ( $ dir , $ name ) { $ filename = $ dir . DIRECTORY_SEPARATOR . strtolower ( $ this -> prefix ) . strtolower ( $ name ) . '.php' ; // We do not want to overwrite files if ( file_exists ( $ filename ) && ( $ this -> overwrite === false || is_writable ( $ filename ) === false ) ) { throw new ezcBaseFileIoException ( $ filename , ezcBaseFileException :: WRITE , "File already exists or is not writeable. Use --overwrite to ignore existance." ) ; } $ file = @ fopen ( $ filename , 'w' ) ; if ( $ file === false ) { throw new ezcBaseFilePermissionException ( $ file , ezcBaseFileException :: WRITE ) ; } fwrite ( $ file , "<?php\n" ) ; fwrite ( $ file , "// Autogenerated class file\n" ) ; fwrite ( $ file , "\n" ) ; return $ file ; }
Open a file for writing a PersistentObject definition to.
This method opens a file for writing a PersistentObject definition to
and writes the basic PHP open tag to it.

@param string $dir  The diretory to open the file in.
@param string $name The table name.
@return resource(file) The file resource used for writing.

@throws ezcBaseFileIoException
if the file to write to already exists.
@throws ezcBaseFilePermissionException
if the file could not be opened for writing.
Open a file for writing a PersistentObject definition to . This method opens a file for writing a PersistentObject definition to and writes the basic PHP open tag to it .