tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Procedural File: misc_functions.inc.php

Source Location: /core/misc_functions.inc.php

Page Details

Contains miscellaneous functions that don't deserve separate file.

Filesource:  Source Code for this file
Functions
get_array_element_value  [line 54]

any get_array_element_value( &$arr, string $key, array $arr  )

Used when needed to access array returned by function e.g. $some_obj->some_method()[0] (which is illegal)

Parameters:
array   $arr: 
string   $key: 
   &$arr: 


[ Top ]
get_cli_param  [line 106]

any get_cli_param( &$params, string $key, [boolean $just_presence = false], array $params  )

get_cli_param is intended to be used to capture parameter given via command line (shell (unix, linux, *x), DOS prompt (windows)).

It is useful for CLI scripts. When $just_presence is true it checks just for the presence of the parameter and function returns boolean.

Parameters:
array   $params:  argv normally
string   $key: 
boolean   $just_presence: 
   &$params: 

API Tags:
Return:  parameter value or boolean


[ Top ]
get_cli_params_as_array  [line 141]

array get_cli_params_as_array( array $argv  )

Parses CLI parameters (normally $argv) and returns them in simple asociative array containing $key => $value pairs where $key is left part and $value right part.

For example row "--install-path=/var/www/sites/test" will be transformed into $key = 'install-path', $value = '/var/www/sites/test'

Parameters:
array   $argv: 


[ Top ]
get_original_non_escaped_value  [line 164]

mixed get_original_non_escaped_value( mixed $value  )

circumvent dependencies on magic_quotes settings.

It is assumed that magic_quotes_runtime is turned off, either in php.ini, either at runtime (note that it is turned off in TANGRA_MAIN_DIR/tangra.inc.php).

Parameters:
mixed   $value: 


[ Top ]
require_once_php4_lib  [line 192]

void require_once_php4_lib( string $path  )

This function is used to require_once php4 libraries.

If global constant SYSTEM_ERROR_REPORTING_PHP4_LIBS is defined (usually with value 2047 (E_ALL)) it will use that level of error reporting. If not defined will use 2047.

This function is needed because if current error_reporting is E_STRICT you are likely to get a lot of STRICT warnings/errors (especially about PHP4 style references).

Parameters:
string   $path:  Path to the required file


[ Top ]
tangra_if_not_int_throw_e  [line 89]

void tangra_if_not_int_throw_e( any $var  )

Checks if give $var is integer or integer literal and throws exception if not

Parameters:
any   $var: 

Information Tags:
Throws:  Tangra_Exception

[ Top ]
tangra_is_int  [line 68]

boolean tangra_is_int( any $var  )

Checks if give $var is integer or integer literal

Parameters:
any   $var: 


[ Top ]
tangra_normalize_path  [line 33]

string tangra_normalize_path( string $path  )

adds '/' at the end of $path. All paths in Tangra are expected to have trailing slash

Parameters:
string   $path: 


[ Top ]
tangra_normalize_slashes  [line 21]

string tangra_normalize_slashes( string $path  )

Converts backslashes (windows path style) to slashes

Parameters:
string   $path: 


[ Top ]