function open_fp($option = 'r')
    {

        if (empty($option) || !is_string($option)) return false;

        switch (true) {
            case (strpos($option, 'r') !== false) :
                $mode = LOCK_SH;
                break;
            case (strpos($option, 'a') !== false || strpos($option, 'w') !== false) :
                $mode = LOCK_EX;
                break;
            default :
                $mode = LOCK_EX;
                break;
        }
        $this->readable = true;

        if (($this->fp = fopen($this->file, $option)) !== false) {
            $this->lock($mode);
            // sets the fopen option based on it reduces
            // reopening of a file
            $this->_option = (string)$option;

            return true;
        }

        return false;
    }
function open_fp($option = 'r')
    {

        if (empty($option) || !is_string($option)) return false;

        switch (true) {
            case (strpos($option, 'r') !== false) :
                $mode = LOCK_SH;
                break;
            case (strpos($option, 'a') !== false || strpos($option, 'w') !== false) :
                $mode = LOCK_EX;
                break;
            default :
                $mode = LOCK_EX;
                break;
        }
        $this->readable = true;

        if (($this->fp = fopen($this->file, $option)) !== false) {
            $this->lock($mode);
            // sets the fopen option based on it reduces
            // reopening of a file
            $this->_option = (string)$option;

            return true;
        }

        return false;
    }
function open_fp ( $ option = 'r' ) { if ( empty ( $ option ) || ! is_string ( $ option ) ) return false ; switch ( true ) { case ( strpos ( $ option , 'r' ) !== false ) : $ mode = LOCK_SH ; break ; case ( strpos ( $ option , 'a' ) !== false || strpos ( $ option , 'w' ) !== false ) : $ mode = LOCK_EX ; break ; default : $ mode = LOCK_EX ; break ; } $ this -> readable = true ; if ( ( $ this -> fp = fopen ( $ this -> file , $ option ) ) !== false ) { $ this -> lock ( $ mode ) ; // sets the fopen option based on it reduces // reopening of a file $ this -> _option = ( string ) $ option ; return true ; } return false ; }
opens a filepointer

@param $option string

@return bool
opens a filepointer