/p2gLib.php

Description

PHP2Go Web Development Framework

Copyright (c) 2002-2007 Marcos Pont

LICENSE:

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Includes
require_once ('p2gCompatv5+.php') (line 535)
require_once ('p2gCompatv4.php') (line 537)
Functions
classForPath (line 85)

Imports and returns the class name given a class dot path

Examples:

  • php2go.base.Document => imports Document class and returns "Document"
  • php2go.auth.AuthDb => imports AuthDb class and returns "AuthDb"

  • return: Class name
string classForPath (string $path)
  • string $path: Dot path
consumeArray (line 367)

Read a key from an array, and remove it

mixed consumeArray ( &$array, string $key, [mixed $fallback = NULL], array $array)
  • array $array: Input array
  • string $key: Key
  • mixed $fallback: Fallback return value
  • &$array
dbErrorHandler (line 267)

Default handler for database errors

void dbErrorHandler (string $dbms, string $function, int $errorCode, string $errorMessage, [mixed $p1 = FALSE], [mixed $p2 = FALSE],  &$connection, ADOConnection $connection)
  • string $dbms: Driver name
  • string $function: DB function
  • int $errorCode: Error code
  • string $errorMessage: Error message
  • mixed $p1: First parameter of the database command
  • mixed $p2: Second parameter of the database command
  • ADOConnection $connection: Active database connection
  • &$connection
destroyPHP2GoObjects (line 176)

Calls registered destructors and shutdown functions

This function is automatically called when the script shuts down. It is registered as a shutdown function by the framework's initialization routine.

void destroyPHP2GoObjects ()
dumpArray (line 387)

Returns or prints a human readable version of an array

string dumpArray (array $arr, [bool $return = TRUE], [int $stringLimit = 200], [bool $deep = FALSE], [ $i = 0])
  • array $arr: Input array
  • bool $return: Return or print
  • int $stringLimit: Maxlength for strings
  • bool $deep: Recurse into inner arrays or objects
  • $i
dumpVariable (line 353)

Dumps a variable, using pre tags

void dumpVariable (mixed $var)
  • mixed $var: Variable value
exportVariable (line 430)

Returns the human readable representation of a variable

string exportVariable (mixed $var, [bool $formatted = FALSE])
  • mixed $var: Variable
  • bool $formatted: Whether to use pre tags
findArrayPath (line 462)

Find a path in a multidimensional array

Examples:

  1.  $arr array(
  2.    'connection' => array(
  3.      'host' => 'localhost',
  4.      'port' => 80
  5.    )
  6.  );
  7.  $value findArrayPath($arr'connection.host''.');
  8.  $value findArrayPath($arr'connection/host''/');

mixed findArrayPath (array $arr, string $path, [string $separator = '.'], [mixed $fallback = NULL])
  • array $arr: Input array
  • string $path: Path
  • string $separator: Path separator
  • mixed $fallback: Fallback value
getPhp2GoOffset (line 113)

Calculates the offset between current folder and PHP2Go root

string getPhp2GoOffset ()
highlightPHP (line 494)

Highlight PHP code

string highlightPHP (string $code, [int $type = T_BYVAR])
  • string $code: Code string or file name
  • int $type: Type (T_BYFILE or T_BYVAR)
import (line 38)

Imports a class or file, given its "dot path"

bool import (string $modulePath, [string $extension = 'class.php'], [bool $isClass = TRUE])
  • string $modulePath: Dot path of a file or class
  • string $extension: Class or file extension
  • bool $isClass: Indicates the path points to a class
importFile (line 51)

Imports a file given its path

bool importFile (string $filePath)
  • string $filePath: File path
includeFile (line 63)

Includes a file given its path

mixed includeFile (string $filePath, [bool $return = FALSE])
  • string $filePath: File path
  • bool $return: Return the result of the include call
jsrsDispatch (line 159)

Configures a list of JSRS handlers

  1.  jsrsDispatch("handlerA handlerB handlerC handlerD");

void jsrsDispatch (string $handlersList)
  • string $handlersList: Space separated list of handlers
php2GoAssertionHandler (line 236)

Custom handler for assertion errors

void php2GoAssertionHandler (string $fileName, int $lineNumber, string $expressionCode)
  • string $fileName: File path
  • int $lineNumber: Line number
  • string $expressionCode: Failed expression
php2GoErrorHandler (line 210)

Framework's custom error handler

void php2GoErrorHandler (int $errorCode, string $errorMessage, string $fileName, int $lineNumber, array $vars)
  • int $errorCode: Error code
  • string $errorMessage: Error message
  • string $fileName: File path
  • int $lineNumber: Line number
  • array $vars: Local variables
println (line 343)

Utility function to print a value and a line break

void println (string $str, [string $nl = '<br />'])
  • string $str: Input string
  • string $nl: New line string
resolveBooleanChoice (line 509)

Resolves strings representing a boolean choice: T or F

T => TRUE, F => FALSE, other values => NULL.

bool|NULL resolveBooleanChoice ([string $value = NULL])
  • string $value: Input value
resolveI18nEntry (line 528)

Resolves language entries

Used by the forms API to allow internationalization in some special attributes of the XML specification.

  • return: Translated string
string resolveI18nEntry (string $value)
  • string $value: Input string
setupError (line 293)

Displays a setup error

void setupError (string $msg)
  • string $msg: Error message
__ (line 311)

Shortcut function to retrieve the value of a language entry

string|NULL __ ()
__autoload (line 99)

Autoload interceptor

void __autoload (string $className)
  • string $className: Class name
__v (line 330)

Used by template engine to print variable values

This function is only used when PHP version is lower than 5. In PHP5, objects will automatically have their __toString method called when used in a print statement.

void __v ( &$val, mixed $val)
  • mixed $val: Variable value
  • &$val

Documentation generated on Sun, 07 Oct 2007 19:28:11 -0300 by phpDocumentor 1.3.2