Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezpaymentlogger.php
Go to the documentation of this file.
1 <?php
15 class eZPaymentLogger
16 {
17 public function __construct( $fileName, $mode )
18 {
19 $this->file = fopen( $fileName, $mode );
20 }
21
22 static function CreateNew($fileName)
23 {
24 return new eZPaymentLogger( $fileName, "wt" );
25 }
26
27 static function CreateForAdd($fileName)
28 {
29 return new eZPaymentLogger( $fileName, "a+t" );
30 }
31
32 function writeString( $string, $label='' )
33 {
34 if( $this->file )
35 {
36 if ( is_object( $string ) || is_array( $string ) )
37 $string = eZDebug::dumpVariable( $string );
38
39 if( $label == '' )
40 fputs( $this->file, $string."\r\n" );
41 else
42 fputs( $this->file, $label . ': ' . $string."\r\n" );
43 }
44 }
45
46 function writeTimedString( $string, $label='' )
47 {
48 if( $this->file )
49 {
50 $time = $this->getTime();
51
52 if ( is_object( $string ) || is_array( $string ) )
53 $string = eZDebug::dumpVariable( $string );
54
55 if( $label == '' )
56 fputs( $this->file, $time. ' '. $string. "\n" );
57 else
58 fputs( $this->file, $time. ' '. $label. ': '. $string. "\n" );
59 }
60 }
61
62 static function getTime()
63 {
64 $time = date( "d-m-Y H-i" );
65 return $time;
66 }
67
68 public $file;
69 }
70 ?>
eZDebug\dumpVariable
static dumpVariable( $var)
Definition: ezdebug.php:629
eZPaymentLogger
Definition: ezpaymentlogger.php:16
eZPaymentLogger\writeString
writeString( $string, $label='')
Definition: ezpaymentlogger.php:32
eZPaymentLogger\CreateNew
static CreateNew($fileName)
Definition: ezpaymentlogger.php:22
eZPaymentLogger\getTime
static getTime()
Definition: ezpaymentlogger.php:62
eZPaymentLogger\$file
$file
Definition: ezpaymentlogger.php:68
eZPaymentLogger\CreateForAdd
static CreateForAdd($fileName)
Definition: ezpaymentlogger.php:27
eZPaymentLogger\__construct
__construct( $fileName, $mode)
Definition: ezpaymentlogger.php:17
eZPaymentLogger\writeTimedString
writeTimedString( $string, $label='')
Definition: ezpaymentlogger.php:46
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.