phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryPhpVm

Source Location: /modules/core/classes/GalleryPhpVm.class

Class GalleryPhpVm

Class Overview

An abstraction layer over PHP. For now, this serves as a way to allow our test classes to interpose themselves between the code and the PHP VM so that we can simulate different VMs. For example, this lets us return arbitrary values for calls like function_exists(). Every call here is a straight pass-through. New functions can be added at any time.

Located in /modules/core/classes/GalleryPhpVm.class [line 41]



		
		
		
		

Methods

[ Top ]
Method Summary
bool   class_exists()   Checks if the class has been defined
a   crc32()   Calculates the crc32 polynomial of a string
void   date()   Format a local time/date
bool   defined()   Checks whether the given constant exists and is defined.
void   exit_()   Output a message and terminate the current script
boolean   extension_loaded()   Return true if the given extension is loaded.
boolean   function_exists()   Return true if the given function has been defined.
array   getAllHeaders()   Fetch all HTTP request headers
string   gethostbyname()   Returns the IP address of the Internet host specified by hostname.
integer   get_magic_quotes_gpc()   Gets the current configuration setting of magic quotes gpc
void   gzencode()   Create a gzip compressed string
string   gzinflate()   Inflate a deflated string
void   header()   Send a raw HTTP header
boolean   headers_sent()   Checks if or where headers have been sent
string   iconv()   iconv -- Convert string to requested character encoding
string   ini_get()   Get configuration parameter
string   ini_set()   Set configuration parameter
boolean   mail()   Send mail
string   mb_convert_encoding()   mb_convert_encoding -- Convert character encoding
string   md5()   Return the 32-byte md5 hash of the given string
void   nl_langinfo()   Query language and locale information
void   rand()   Generate random integer
string   recode_string()   recode_string -- Recode a string according to a recode request
void   setlocale()   Set locale information. Passing multiple locales isn't avialable until PHP 4.3.0 so it's not supported here (yet).
int   time()   Return current Unix timestamp

[ Top ]
Methods
class_exists  [line 275]

  bool class_exists( string $class_name  )

Checks if the class has been defined

Parameters:
string   $class_name: 

API Tags:
Return:  true if $class_name is a defined class, false otherwise.


[ Top ]
crc32  [line 113]

  a crc32( string $string  )

Calculates the crc32 polynomial of a string

Parameters:
string   $string:  the value to be checksummed

API Tags:
Return:  signed integer checksum


[ Top ]
date  [line 322]

  void date( string $format, [mixed $timestamp = null]  )

Format a local time/date

Parameters:
string   $format:  the string format

API Tags:
See:  http://us.php.net/manual/en/function.date.php


[ Top ]
defined  [line 311]

  bool defined( string $name  )

Checks whether the given constant exists and is defined.

Parameters:
string   $name:  the name of the constant

API Tags:
Return:  returns TRUE if the named constant has been defined, FALSE otherwise


[ Top ]
exit_  [line 210]

  void exit_( [mixed $status = null]  )

Output a message and terminate the current script

Parameters:
mixed   $status:  (optional)


Redefined in descendants as:

[ Top ]
extension_loaded  [line 58]

  boolean extension_loaded( string $name  )

Return true if the given extension is loaded.

Parameters:
string   $name: 


Redefined in descendants as:

[ Top ]
function_exists  [line 49]

  boolean function_exists( string $functionName  )

Return true if the given function has been defined.

Parameters:
string   $functionName: 


Redefined in descendants as:

[ Top ]
getAllHeaders  [line 237]

  array getAllHeaders( )

Fetch all HTTP request headers



[ Top ]
gethostbyname  [line 301]

  string gethostbyname( string $hostname  )

Returns the IP address of the Internet host specified by hostname.

Parameters:
string   $hostname: 

API Tags:
Return:  ip address


[ Top ]
get_magic_quotes_gpc  [line 171]

  integer get_magic_quotes_gpc( )

Gets the current configuration setting of magic quotes gpc


API Tags:
Return:  0 for off, 1 for on


Redefined in descendants as:

[ Top ]
gzencode  [line 285]

  void gzencode( string $data, [int $level = null], [int $encodingMode = null]  )

Create a gzip compressed string

Parameters:
string   $data:  The data to encode
int   $level:  The level of compression
int   $encodingMode:  The encoding mode. Can be FORCE_GZIP (default) or FORCE_DEFLATE.


[ Top ]
gzinflate  [line 262]

  string gzinflate( string $data, [int $length = null]  )

Inflate a deflated string

Parameters:
string   $data:  data compresed by gzdeflate
int   $length:  (optional) maximum length to decode

API Tags:
Return:  uncompressed data


Redefined in descendants as:

[ Top ]
header  [line 146]

  void header( string $string, [boolean $replace = null]  )

Send a raw HTTP header

PHP 4.1 compatible header() function. The second optional parameter http_response_code was introduced in PHP 4.3.0 and is therefore not supported in Gallery.

Parameters:
string   $string: 
boolean   $replace:  (optional)


Redefined in descendants as:

[ Top ]
headers_sent  [line 162]

  boolean headers_sent( )

Checks if or where headers have been sent

PHP 4.1 compatible headers_sent() function. The optional parameters were introduced in PHP 4.3.0 and are therefore not supported in Gallery.


API Tags:
Return:  whether headers are already sent


Redefined in descendants as:

[ Top ]
iconv  [line 70]

  string iconv( string $inCharset, string $outCharset, string $string  )

iconv -- Convert string to requested character encoding

Parameters:
string   $inCharset:  source character set
string   $outCharset:  target character set
string   $string:  data

API Tags:
Return:  result


[ Top ]
ini_get  [line 181]

  string ini_get( string $varname  )

Get configuration parameter

Parameters:
string   $varname: 


Redefined in descendants as:

[ Top ]
ini_set  [line 192]

  string ini_set( string $varname, string $newvalue  )

Set configuration parameter

Parameters:
string   $varname: 
string   $newvalue: 


Redefined in descendants as:

[ Top ]
mail  [line 251]

  boolean mail( string $to, string $subject, string $message, [string $additionalHeaders = null], [string $additionalParameters = null]  )

Send mail

Parameters:
string   $to: 
string   $subject: 
string   $message: 
string   $additionalHeaders:  addition headers (optional)
string   $additionalParameters:  additional parameters (optional)

API Tags:
Return:  true if the mail was successfully accepted for delivery


Redefined in descendants as:

[ Top ]
mb_convert_encoding  [line 82]

  string mb_convert_encoding( string $string, string $outCharset, string $inCharset  )

mb_convert_encoding -- Convert character encoding

Parameters:
string   $string:  data
string   $outCharset:  target character set
string   $inCharset:  source character set

API Tags:
Return:  result


[ Top ]
md5  [line 103]

  string md5( string $string  )

Return the 32-byte md5 hash of the given string

Parameters:
string   $string:  string to be hashed

API Tags:
Return:  hashed string value


Redefined in descendants as:

[ Top ]
nl_langinfo  [line 122]

  void nl_langinfo( int $item  )

Query language and locale information

Parameters:
int   $item: 


Redefined in descendants as:

[ Top ]
rand  [line 224]

  void rand( [int $min = null], [int $max = null]  )

Generate random integer

Parameters:
int   $min:  (optional)
int   $max:  (optional)


Redefined in descendants as:

[ Top ]
recode_string  [line 93]

  string recode_string( string $request, string $string  )

recode_string -- Recode a string according to a recode request

Parameters:
string   $request:  source..target character set
string   $string:  data

API Tags:
Return:  result


[ Top ]
setlocale  [line 133]

  void setlocale( mixed $category, string $locale  )

Set locale information. Passing multiple locales isn't avialable until PHP 4.3.0 so it's not supported here (yet).

Parameters:
mixed   $category: 
string   $locale: 


Redefined in descendants as:

[ Top ]
time  [line 201]

  int time( )

Return current Unix timestamp



Redefined in descendants as:

[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:01:58 -0700 by phpDocumentor 1.3.0RC6