c_output Class Reference

Generates output. More...

List of all members.

Public Member Functions

 cancel ($string)
 Cancels all pending operations.
 commit ()
 Commits (posts) all pending operations.
 execute ($procedure, $arguments)
 Generates execution of procedure.
 filesys ($object)
 Modifies filesystem object.
 init ()
 Initialization.
 log ($string)
 Generates a log message.
 put ($priority_class, $raw)
 Puts raw message to IRC server.

Public Attributes

 $commited
 $lines
 Holds lines of output.


Detailed Description

Generates output.

Version:
1
Author:
VooDooMan
Date:
2005

Definition at line 505 of file library_php_2.inc.php.


Member Function Documentation

c_output::cancel string  ) 
 

Cancels all pending operations.

Version:
1
Author:
VooDooMan
Date:
2005

Definition at line 669 of file library_php_2.inc.php.

00670     {
00671         $this->lines="";
00672     }

c_output::commit  ) 
 

Commits (posts) all pending operations.

Version:
1
Author:
VooDooMan
Date:
2005

Definition at line 680 of file library_php_2.inc.php.

00681     {
00682         if($this->commited) {
00683             echo "Warning: ".__CLASS__."::".__FUNCTION__."() You have already done commit - this can confuse bot!\n";
00684         }
00685         $this->commited=TRUE;
00686         echo "\n#####\n".$this->lines."#####\n"; // NB: we got \n at the end of $this->lines
00687         $this->lines="";
00688     }

c_output::execute procedure,
arguments
 

Generates execution of procedure.

Version:
1
Author:
VooDooMan
Date:
2005
Parameters:
procedure Name of procedure
arguments Array of strings as arguments
Bug:
Fails if procedure and/or arguments' elements contain CR or LF

Definition at line 559 of file library_php_2.inc.php.

00560     {
00561         $x="EXECUTE ".$procedure."(";
00562         $first=TRUE;
00563         foreach($arguments as $e) {
00564             if(!$first)
00565                 $x.=",";
00566             $first=FALSE;
00567             $x.="\"";
00568             $x.=addslashes($e);
00569             $x.="\"";
00570         }
00571         $x.=")";
00572         
00573         $this->lines.=$x."\n";
00574     }

c_output::filesys object  ) 
 

Modifies filesystem object.

Version:
1
Author:
VooDooMan
Date:
2005
Parameters:
object c_filesys_object object
Warning:
In notify messages string "hello\nworld\x07!" should be represented as "hello\\nworld\\x07!"
Bug:
Event modifying not supported yet

Definition at line 585 of file library_php_2.inc.php.

00586     {
00587         $r="FILESYS InternalName ".$object->internal_name;
00588         $this->lines.=$r."\n";
00589 
00590         $r="FILESYS SET type ".$object->type;
00591         $this->lines.=$r."\n";
00592 
00593         $r="FILESYS SET PublicName ".$object->public_name;
00594         $this->lines.=$r."\n";
00595 
00596         $r="FILESYS SET Time ".$object->time;
00597         $this->lines.=$r."\n";
00598 
00599         $r="FILESYS SET Published ".($object->published?"1":"0");
00600         $this->lines.=$r."\n";
00601 
00602         $r="FILESYS SET Complete ".($object->complete?"1":"0");
00603         $this->lines.=$r."\n";
00604 
00605         $r="FILESYS SET Expiration ".$object->expiration;
00606         $this->lines.=$r."\n";
00607 
00608         foreach($object->access as $e) {
00609             // begin of access rights
00610             $r="FILESYS ACCESS_BEGIN";
00611             $this->lines.=$r."\n";
00612 
00613             $r="FILESYS SET AllUsers ".($e->all_users?"1":"0");
00614             $this->lines.=$r."\n";
00615 
00616             $r="FILESYS SET UserName ".$e->user_name;
00617             $this->lines.=$r."\n";
00618 
00619             $r="FILESYS SET Owner ".($e->owner?"1":"0");
00620             $this->lines.=$r."\n";
00621 
00622             $r="FILESYS SET Read ".($e->read?"1":"0");
00623             $this->lines.=$r."\n";
00624 
00625             $r="FILESYS SET Delete ".($e->delete?"1":"0");
00626             $this->lines.=$r."\n";
00627 
00628             $r="FILESYS SET NotifyOwner ".($e->notify_owner?"1":"0");
00629             $this->lines.=$r."\n";
00630             
00631             $r="FILESYS SET NotifyUser ".($e->notify_user?"1":"0");
00632             $this->lines.=$r."\n";
00633 
00634             $r="FILESYS SET Secure ".($e->secure?"1":"0");
00635             $this->lines.=$r."\n";
00636 
00637             $r="FILESYS SET AllOnChannel ".$e->all_on_channel;
00638             $this->lines.=$r."\n";
00639 
00640             $r="FILESYS SET AlsoUnknown ".($e->also_unknown?"1":"0");
00641             $this->lines.=$r."\n";
00642 
00643             // warning: string "hello\nworld\x07!" should be represented as "hello\\nworld\\x07!"
00644             $r="FILESYS SET NotifyOwnerMessage ".$e->notify_owner_message;
00645             $this->lines.=$r."\n";
00646 
00647             // warning: string "hello\nworld\x07!" should be represented as "hello\\nworld\\x07!"
00648             $r="FILESYS SET NotifyUserMessage ".$e->notify_user_message;
00649             $this->lines.=$r."\n";
00650 
00651             // end of access rights
00652             $r="FILESYS ACCESS_END";
00653             $this->lines.=$r."\n";
00654         }
00655         
00656         // event modifying not supported yet
00657 
00658         // commit
00659         $r="FILESYS COMMIT";
00660         $this->lines.=$r."\n";
00661     }

c_output::init  ) 
 

Initialization.

Version:
1
Author:
VooDooMan
Date:
2005

Definition at line 516 of file library_php_2.inc.php.

00516                     {
00517         $this->lines="";
00518         $this->commited=FALSE;
00519     }

c_output::log string  ) 
 

Generates a log message.

Version:
1
Author:
VooDooMan
Date:
2005
Parameters:
string Log message
Bug:
Fails if string contains CR or LF

Definition at line 544 of file library_php_2.inc.php.

00545     {
00546         $x="LOG ".$string;
00547         $this->lines.=$x."\n";
00548     }

c_output::put priority_class,
raw
 

Puts raw message to IRC server.

Version:
1
Author:
VooDooMan
Date:
2005
Parameters:
priority_class Priority class (e.g. "LOW", "HIGH", "CRITICAL")
raw Raw message
Bug:
Fails if string contains CR or LF

Definition at line 530 of file library_php_2.inc.php.

00531     {
00532         $x="PUT ".$priority_class." ".$raw;
00533         $this->lines.=$x."\n";
00534     }


Member Data Documentation

c_output::$commited
 

Definition at line 508 of file library_php_2.inc.php.

c_output::$lines
 

Holds lines of output.

Definition at line 506 of file library_php_2.inc.php.


The documentation for this class was generated from the following file:
Generated on Wed Jun 15 01:58:39 2005 for Library for "php_2" scripting by  doxygen 1.4.3