public function execute(IDS_Report $data) 
    {

        /*
         * In case the data has been modified before it might  be necessary 
         * to convert it to string since we can't store array or object 
         * into a file
         */
        $data = $this->prepareData($data);

        if (is_string($data)) {

            if (file_exists($this->logfile)) {
                $data = trim($data);

                if (!empty($data)) {
                    if (is_writable($this->logfile)) {

                        $handle = fopen($this->logfile, 'a');
                        fwrite($handle, trim($data) . "\n");
                        fclose($handle);

                    } else {
                        throw new Exception(
                            'Please make sure that ' . $this->logfile . 
                                ' is writeable.'
                        );
                    }
                }
            } else {
                throw new Exception(
                    'Given file does not exist. Please make sure the
                    logfile is present in the given directory.'
                );
            }
        } else {
            throw new Exception(
                'Please make sure that data returned by
                IDS_Log_File::prepareData() is a string.'
            );
        }

        return true;
    }
public function execute(IDS_Report $data) 
    {

        /*
         * In case the data has been modified before it might  be necessary 
         * to convert it to string since we can't store array or object 
         * into a file
         */
        $data = $this->prepareData($data);

        if (is_string($data)) {

            if (file_exists($this->logfile)) {
                $data = trim($data);

                if (!empty($data)) {
                    if (is_writable($this->logfile)) {

                        $handle = fopen($this->logfile, 'a');
                        fwrite($handle, trim($data) . "\n");
                        fclose($handle);

                    } else {
                        throw new Exception(
                            'Please make sure that ' . $this->logfile . 
                                ' is writeable.'
                        );
                    }
                }
            } else {
                throw new Exception(
                    'Given file does not exist. Please make sure the
                    logfile is present in the given directory.'
                );
            }
        } else {
            throw new Exception(
                'Please make sure that data returned by
                IDS_Log_File::prepareData() is a string.'
            );
        }

        return true;
    }
public function execute ( IDS_Report $ data ) { /*
         * In case the data has been modified before it might  be necessary 
         * to convert it to string since we can't store array or object 
         * into a file
         */ $ data = $ this -> prepareData ( $ data ) ; if ( is_string ( $ data ) ) { if ( file_exists ( $ this -> logfile ) ) { $ data = trim ( $ data ) ; if ( ! empty ( $ data ) ) { if ( is_writable ( $ this -> logfile ) ) { $ handle = fopen ( $ this -> logfile , 'a' ) ; fwrite ( $ handle , trim ( $ data ) . "\n" ) ; fclose ( $ handle ) ; } else { throw new Exception ( 'Please make sure that ' . $ this -> logfile . ' is writeable.' ) ; } } } else { throw new Exception ( 'Given file does not exist. Please make sure the
                    logfile is present in the given directory.' ) ; } } else { throw new Exception ( 'Please make sure that data returned by
                IDS_Log_File::prepareData() is a string.' ) ; } return true ; }
Stores given data into a file

@param  object $data IDS_Report

@throws Exception if the logfile isn't writeable
@return boolean
Stores given data into a file