File/app/lib/pl.php

Description

Pika Library of handy PHP functions.

PL provides following functionality: user authentication via cookies (HTTP Basic), appliction settings management, benchmarking, XHTML output validation, time/date conversion functions for standardized error reporting, HTML templating w/auto-menuing

Functions
pl_array_lookup (line 38)

Safely retrive an array element by key without generating a warning on missing keys

string pl_array_lookup ($element_name $element_name, $array_data $array_data)
  • $element_name $element_name: string
  • $array_data $array_data: array
pl_array_to_csv (line 59)
void pl_array_to_csv (mixed $a)
pl_array_to_php (line 88)

Produce the PHP code to initialize an array.

string pl_array_to_php ($array_name $array_name, $array_data $array_data)
  • $array_name $array_name: string
  • $array_data $array_data: array
pl_array_to_php_sub (line 105)

Subroutine used by pl_array_to_php()

string pl_array_to_php_sub ($array_data $array_data)
  • $array_data $array_data: array
pl_auth_http_login (line 171)

Verify that the user is authenticated via HTTP; exit and prompt for login if she is not.

array pl_auth_http_login ()
pl_auth_http_logout (line 149)

Remove HTTP authentication and display HTML notification.

int pl_auth_http_logout ()
pl_bench (line 251)

Will gather and display benchmarking, HTML validation, file size info, when enabled.

string pl_bench ($cmd $cmd)
  • $cmd $cmd: string
pl_benchmark (line 335)

Calculate the script execution time.

float pl_benchmark ()
pl_calc_age (line 362)

Calculate a person's age in years.

int pl_calc_age ($dob $dob, [$current_date $current_date = null])
  • $dob $dob: date
  • $current_date $current_date: date
pl_clean_file_name (line 388)

Removes naughty characters ('..' and '/') from a user-supplied file name.

string pl_clean_file_name ($str $str)
  • $str $str: string
pl_clean_form_input (line 403)

Used by pl_grab_[post/get]() functions to cleanse incoming user-submitted form data.

string pl_clean_form_input ($str $form_str, [$mode $mode = 'nomode'])
  • $str $form_str: string
  • $mode $mode: string
pl_clean_html (line 552)

Prevents Javascript insertion attacks in a string.

string pl_clean_html ($str $str)
  • $str $str: string
pl_clean_html_array (line 563)

Prevents Javascript insertion attacks in an array of strings.

array pl_clean_html_array ($a $a)
  • $a $a: array
pl_date_add (line 584)

Add the specified interval of time to a date.

date pl_date_add ($interval $interval, $number $number, $date $date)
  • $interval $interval: string
  • $number $number: int
  • $date $date: date
pl_date_mogrify (line 647)

Converts user-submitted dates to the ISO date format.

date pl_date_mogrify ($date $date_str)
  • $date $date_str: string
pl_date_unmogrify (line 763)
void pl_date_unmogrify (mixed $date)
pl_error_fatal (line 783)
void pl_error_fatal ([mixed $errno = null], [mixed $errstr = null], [mixed $errfile = null], [mixed $errline = null])
pl_error_handler (line 799)
void pl_error_handler (mixed $errno, mixed $errstr, mixed $errfile, mixed $errline)
pl_error_non_fatal (line 824)
void pl_error_non_fatal ([mixed $errno = null], [mixed $errstr = null], [mixed $errfile = null], [mixed $errline = null])
pl_grab_get (line 854)

Returns the value of a GET variable without tripping a PHP warning if the variable isn't set.

unknown pl_grab_get (string $var_name, [string $default_value = null], [string $filter_mode = 'nomode'])
  • string $var_name
  • string $default_value
  • string $filter_mode
pl_grab_post (line 875)

Returns the value of a POST variable without tripping a PHP warning if the variable isn't set.

unknown pl_grab_post (string $var_name, [string $default_value = null], [string $filter_mode = 'nomode'])
  • string $var_name
  • string $default_value
  • string $filter_mode
pl_grab_var (line 891)
void pl_grab_var (mixed $name, [mixed $method = null], [mixed $default_value = null], [mixed $format = 'text'])
pl_html_address (line 963)
void pl_html_address (mixed $data)
pl_html_checkbox (line 994)
void pl_html_checkbox (mixed $name, mixed $val)
pl_html_login_form (line 1023)

Enter description here...

This is in a standalone function

unknown pl_html_login_form (unknown $username, unknown $status)
  • unknown $username
  • unknown $status
pl_html_menu (line 1032)
void pl_html_menu (mixed $a, mixed $field_name, mixed $field_value, [mixed $add_blank = '1'], [mixed $ti = '1'])
pl_html_multiselect (line 1113)
void pl_html_multiselect (mixed $a, mixed $field_name, mixed $field_values, [mixed $ti = '1'])
pl_html_text (line 1183)
void pl_html_text (mixed $text)
pl_html_text_array (line 1223)
void pl_html_text_array (mixed $a)
pl_html_validate (line 1236)
void pl_html_validate (mixed $buffer)
pl_menu_get (line 1276)

Enter description here...

unknown pl_menu_get (menu_name $menu_name, [key $key = null], label 2, order 3)
  • label 2: = null unknown
  • order 3: = null unknown
  • menu_name $menu_name: unknown
  • key $key: = null unknown
pl_menu_list (line 1330)
void pl_menu_list ()
pl_menu_set (line 1349)
void pl_menu_set (mixed $menu_name, mixed $menu_array)
pl_menu_set_temp (line 1368)
void pl_menu_set_temp (mixed $menu_name, mixed $menu_array)
pl_mysql_init (line 1384)
void pl_mysql_init ()
pl_mysql_next_id (line 1409)
void pl_mysql_next_id (mixed $sequence)
pl_prepare_dir (line 1445)
void pl_prepare_dir (mixed $fs_dir_path)
pl_session_freeze (line 1522)
void pl_session_freeze ()
pl_session_freeze_q (line 1535)
void pl_session_freeze_q (mixed $sql)
pl_session_set_default (line 1541)
void pl_session_set_default (mixed $name, mixed $value)
pl_session_thaw (line 1550)
void pl_session_thaw (mixed $session_data)
pl_settings_get (line 1572)
void pl_settings_get (mixed $setting_name)
pl_settings_get_all (line 1589)
void pl_settings_get_all ()
pl_settings_init (line 1596)
void pl_settings_init ([mixed $x = null])
pl_settings_restore (line 1614)
void pl_settings_restore ()
pl_settings_save (line 1625)
void pl_settings_save ()
pl_settings_set (line 1655)
void pl_settings_set (mixed $setting_name, mixed $value)
pl_simple_url (line 1662)
void pl_simple_url ([mixed $request_uri = null], [mixed $script_filename = null])
pl_template (line 1768)

A basic templating function, replaces template tags with values from $template_data array

string pl_template (template_file $template_file, [template_data $template_data = array()], [mixed $subtpl_label = null])
  • template_file $template_file: string
  • template_data $template_data: array
pl_template_sub (line 1966)
void pl_template_sub (mixed $str, mixed $template_data)
pl_text_address (line 2254)
void pl_text_address (mixed $data)
pl_text_last_name (line 2286)
void pl_text_last_name (mixed $data, [mixed $prefix = ''])
pl_text_name (line 2331)
void pl_text_name (mixed $data, [mixed $prefix = ''])
pl_text_phone (line 2361)
void pl_text_phone (mixed $data)
pl_time_current_string (line 2384)
void pl_time_current_string ()
pl_time_mogrify (line 2407)
void pl_time_mogrify (mixed $time)
pl_time_unmogrify (line 2428)
void pl_time_unmogrify (mixed $time)
pl_tmp_path (line 2441)
void pl_tmp_path ()

Documentation generated on Tue, 19 Oct 2004 17:16:06 -0400 by phpDocumentor 1.3.0RC3