/sources/global.php

Description
Includes
include ($FILE_BASE.'/info.php') (line 431)
include ($FILE_BASE.'/'.filter_naughty((array_key_exists('COMPUTERNAME',$_ENV)?$_ENV['COMPUTERNAME']:$_SERVER['SERVER_NAME'])).'.php') (line 428)
include ($FILE_BASE.'/info-override.php') (line 432)
require_once ($FILE_BASE.'/sources_custom/critical_errors.php') (line 424)
require_once ($FILE_BASE.'/sources/critical_errors.php') (line 424)
Constants
FILE_BINARY = false (line 449)
FILE_TEXT = false (line 446)
HIPHOP_PHP = '1' (line 375)
Functions
file_get_contents (line 391)

Get the contents of a file.

  • return: The file contents (false: error).
~LONG_TEXT file_get_contents (SHORT_TEXT $filename, [integer $type = 0])
  • SHORT_TEXT $filename: The file name.
  • integer $type: Either FILE_TEXT or FILE_BINARY.
filter_naughty (line 318)

Get the parameter put into it, with no changes. If it detects that the parameter is naughty (i.e malicious, and probably from a hacker), it will log the hack-attack and output an error message.

This function is designed to be called on parameters that will be embedded in a path, and defines malicious as trying to reach a parent directory using '..'. All file paths in ocPortal should be absolute

  • return: Same as input string
string filter_naughty (string $in)
  • string $in: String to test
filter_naughty_harsh (line 337)

This function is similar to filter_naughty, except it requires the parameter to be strictly alphanumeric. It is intended for use on text that will be put into an eval.

  • return: Same as input string
string filter_naughty_harsh (string $in, [boolean $preg = false])
  • string $in: String to test
  • boolean $preg: Whether to just filter out the naughtyness
get_custom_file_base (line 298)

Get the file base for your installation of ocPortal. For a shared install only, this is different to the base-url.

  • return: The file base, without a trailing slash
PATH get_custom_file_base ()
get_file_base (line 287)

Get the file base for your installation of ocPortal

  • return: The file base, without a trailing slash
PATH get_file_base ()
object_factory (line 272)

Make an object of the given class

  • return: The object (NULL: no such class)
?object object_factory (string $class, [boolean $null_ok = false])
  • string $class: The class name
  • boolean $null_ok: Whether to return NULL if there is no such class
require_code (line 63)

This function is a very important one when coding. It allows you to include a source code file (from root/sources/ or root/sources_custom/) through the proper channels.

You should remember this function, and not substitute anything else for it, as that will likely make your code unstable. It is key to source code modularity in ocPortal.

void require_code (string $codename, [boolean $light_exit = false])
  • string $codename: The codename for the source module to load (or a full relative path, ending with .php; if custom checking is needed, this must be the custom version)
  • boolean $light_exit: Whether to cleanly fail when a source file is missing
require_code_no_override (line 256)

Require code, but without looking for sources_custom overrides

void require_code_no_override (string $codename)
  • string $codename: The codename for the source module to load

Documentation generated on Sun, 02 Jan 2011 23:15:39 +0000 by phpDocumentor 1.4.3