phpDocumentor PluginSonots
[ class tree: PluginSonots ] [ index: PluginSonots ] [ all elements ]

Class: sonots

Source Location: /sonots/sonots.class.php

Class sonots

Method Summary
static void   array_asort_key()   sort array in the given key sequence maintaining key association
static array   array_slice()   Extract a slice of the array
static void   array_sort_key()   sort array in the given key sequence
static string   array_to_string()   Convert an array to a string.
static array   compact_list()   Compact List Levels
static object cloned   create_clone()   Create a clone of object
static string   display_list()   Display ul list
static string   display_password_form()   PukiWiki typical password form
static array   &ereg_grep()   Grep an array by ereg expression
static array   exec_existpages()   Execute (convert_html) all pages
static boolean   exec_page()   Execute (convert_html) this page
static array   file_head()   Reads heads of file into an array
static int   file_put_contents()   Write a string to a file (PHP5 has this function)
static string   get_basename()   Get the basename of a path
static string   get_convert_html()   Get result html of convert_html
static string   get_dirname()   Get the dirname of a path
static array   &get_existfiles()   Get list of files in a directory
static array   get_existpages()   get existing pages with prefix restriction
static int   get_filecreatetime()   Get page created time
static string   get_fullname()   Get absolute path
static string   get_interwiki_url()   Resolve InterWiki name
static array   &get_members()   Get specific members from array of class objects
static string   get_page_uri()   get uri of a page
static array   get_readings()   get readings of pages
static array   get_tree()   Get tree states of pages
static string   glue_str()   reverse parse_str
static string   glue_url()   reverse parse_url
static array   grep_array()   Grep array
static void   grep_by()   Grep out array of objects by speific members
static void   init_members()   Initialize members of array of class objects
static void   init_myerror()   Error Handling in PHP4. init error states
static boolean   is_admin()   PukiWiki admin login with session
static boolean   is_edit_auth()   Check if a page is configured to require authentication
static boolean   is_edit_restrict()   Check if a page is restricted to edit or not
static boolean   is_human()   Human recognition using PukiWiki Auth methods
static boolean   is_interwiki()   Check if string is InterWiki syntax or not
static boolean   is_newpage()   Check if page is newpage
static boolean   is_page_newer()   Check if the page timestamp is newer than the file timestamp
static boolean   is_read_auth()   Check if a page is configured to require the read-authentication
static array   make_heading()   Get heading strings from a wiki source line
static void   make_inline()   Convert only inline plugins unlike make_link()
static string   make_pageanamelink_icon()   make page aname link showing anchor icon (symbol)
static string   make_pageanchor()   make page anchor
static string   make_pageeditlink_icon()   make page edit link showing edit icon
static string   make_pagelink_nopg()   make_pagelink without passage
static string   make_toplink()   make a link to pukiwiki top url
static void   map_members()   Applies the callback to the members of the given array objects
static boolean   move()   Move a file (rename does not overwrite if $newname exists on Win, but move does)
static string   mycatch()   Error Handling in PHP4. catch an error message
static void   mythrow()   Error Handling in PHP4. throw an error message
static array   parse_options()   PukiWiki simple option parser
static void   pkwk_output_noskin()   Output contents without skin
static string   realurl()   Get absolute URL
static void   remove_multilineplugin_lines()   Remove inside of multiline plugin arguments.
static boolean   r_mkdir()   mkdir recursively (mkdir of PHP5 has recursive flag)
static array   r_strpos()   Find positions of occurrence of a string
static void   set_members()   Set array into members of array of class objects
static void   sort_filenames()   Special sort function for filenames (/ has a special meaning)
static array   string_to_array()   Restore a string to an array.
static array   trim_array()   trim elements of array
static string   &unhtmlspecialchars()   Undo htmlspecialchars
static string   urldecode()   Urldecode only given specific chars
static string   urlencode()   Urlencode only given specific chars

[ Top ]
Methods
static method array_asort_key  [line 2022]

  static void array_asort_key( array &$array, array &$sorted  )

sort array in the given key sequence maintaining key association

PHP API Extension

Example)

  1.  $japanese  array('orange'=>'mikan''apple'=>'ringo');
  2.  $price array('orange'=> 100'apple'50);
  3.  asort($priceSORT_NUMERIC)// array('apple'=> 50, 'orange'= 100);
  4.  array_asort_key($favor$price)// array('orange'=>'ringo', 'apple'=>'apple');

Parameters:
array   &$array:  array to be sorted
array   &$sorted:  array having keys in sorting sequence. keys of $array and $sorted must be all common, i.e., count($array) == count(array_intersect_key($array, $sorted))

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method array_slice  [line 2172]

  static array array_slice( array $array, int $offset, [mixed $length = null], [boolean $preserve_keys = false]  )

Extract a slice of the array

PHP Compat

$length == null means up to end of array. Now, sonots::array_slice($array, $offset, null, true) is possible.

  1.  array_slice($array$offsetnull (or or -0)) returns array(),
thus, there was no way to slice up to end of array with preserving keys.

Parameters:
array   $array:  The input array.
int   $offset:  If offset is non-negative, the sequence will start at that offset in the array. If offset is negative, the sequence will start that far from the end of the array.
mixed   $length:  If length is given and is positive, then the sequence will have that many elements in it. If length is given and is negative then the sequence will stop that many elements from the end of the array. If it is omitted or NULL (add), then the sequence will have everything from offset up until the end of the array .
boolean   $preserve_keys:  Note that array_slice() will reorder and reset the array indices by default. You can change this behaviour by setting preserve_keys to true.

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-07 11:14:46 sonots $
Since:  v 1.7

[ Top ]
static method array_sort_key  [line 2053]

  static void array_sort_key( array &$array, array &$sorted  )

sort array in the given key sequence

PHP API Extension

Example)

  1.  $fruits  array(=> 'orange'=> 'apple');
  2.  $price   array(=> 100=> 50);
  3.  asort($priceSORT_NUMERIC)// array(1 => 50, 0 => 100)
  4.  array_sort_key($fruits$price)// array(0 => 'apple', 1 => 'orange')

Parameters:
array   &$array:  array to be sorted
array   &$sorted:  array having keys in sorting sequence. keys of $array and $sorted must be all common, i.e., count($array) == count(array_intersect_key($array, $sorted))

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method array_to_string  [line 1673]

  static string array_to_string( array $array, [string $hashsep = ':'], [string $elemsep = ','], [string $openarray = '('], [string $closearray = ')'], [boolean $encode = true]  )

Convert an array to a string.

PHP API Extension

Example

  1.  $arr array('A''B''indC' => 'C'array('D''E')'indF'=>'F');
  2.  echo array_to_string($arr);
Output:
  1.  A,B,indC:C,(D,E),indF:F

Parameters:
array   $array: 
string   $hashsep:  A character to be used as a hash key and val seperator
string   $elemsep:  A character to be used as a elememt separator
string   $openarray:  A character to be used as an open bracket of an array
string   $closearray:  A character to be used as a close bracket of an array
boolean   $encode:  Performe encode for key/val or not Note: encoding is usually necessary especially when you want to use delimiter characters in keys and values

API Tags:
See:  sonots::string_to_array()
Access:  public

Information Tags:
Version:  $Id: v 1.3 2008-07-15 11:14:46 sonots $

[ Top ]
static method compact_list  [line 47]

  static array compact_list( array $levels  )

Compact List Levels

PukiWiki API Extension

Example)

  1.   $levels array(1,3,1,1,3,2,3);
  2.   print_r(sonots::compact_list($levels));
  3.   // array(1,2,1,1,2,2,3)
  4.  
  5.   $levels array(1,3,1,1,3,3,3);
  6.   print_r(sonot::compact_list($levels));
  7.   // array(1,2,1,1,2,2,2) // not array(1,2,1,1,2,3,3)

Parameters:
array   $levels:  array of levels (positive numbers)

API Tags:
Return:  compacted levels (keys, sequences are preserved)
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method create_clone  [line 2251]

  static object cloned create_clone( object $object  )

Create a clone of object

PHP Compat

Parameters:
object   $object: 

API Tags:
Return:  object
See:  php_compat_clone
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method display_list  [line 1303]

  static string display_list( array $items, array $levels, [string $cssclass = '']  )

Display ul list

PHP API Extension

PukiWiki outputs ul lists as

  1.  <ul><li style="padding-left:16*2px;margin-left:16*2px">.
I do not like it. This codes output as
  1.  <ul><li style="list-type:none"><ul><li>.
This is also XHTML 1.1 valid. Furthermore, this codes print no return because some browsers create spaces by returns in ul list.

Parameters:
array   $items:  strings of items to be displayed
array   $levels:  list levels of items
string   $cssclass:  css class name

API Tags:
Return:  list html
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method display_password_form  [line 121]

  static string display_password_form( string $action, [string $message = ""], [boolean $use_session = true], [boolean $use_authlog = true]  )

PukiWiki typical password form

PukiWiki API Extension

Parameters:
string   $action:  action url (htmlspecialchars will be performed)
string   $message:  additional message (htmlspecialchars will be performed)
boolean   $use_session:  use session log to know he is admin
boolean   $use_authlog:  use Basic Auth log to know he is admin if he is admin, form does not show password textbox.

API Tags:
Return:  form html
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method ereg_grep  [line 1391]

  static array &ereg_grep( string $pattern, array $input, [int $flags = 0]  )

Grep an array by ereg expression

PHP API Extension

Parameters:
string   $pattern: 
array   $input: 
int   $flags: 

API Tags:
See:  preg_grep
Access:  public


[ Top ]
static method exec_existpages  [line 504]

  static array exec_existpages( [string $prefix = ''], [string $regexp = null]  )

Execute (convert_html) all pages

PukiWiki API Extension

Parameters:
string   $prefix:  restrict pages by prefix condition
string   $regexp:  execute only matched lines (preg_grep)

API Tags:
Return:  executed pages
Access:  public
Uses:  sonots::get_existpages
Uses:  convert_html - (PukiWiki lib/convert_html.php)
Uses:  get_source - (PukiWiki lib/file.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method exec_page  [line 541]

  static boolean exec_page( string $page, [string $regexp = null]  )

Execute (convert_html) this page

PukiWiki API Extension

Parameters:
string   $page: 
string   $regexp:  execute only matched lines (preg_grep)

API Tags:
Return:  executed or not
Access:  public
Uses:  convert_html - (PukiWiki lib/convert_html.php)
Uses:  get_source - (PukiWiki lib/file.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method file_head  [line 1234]

  static array file_head( string $file, [int $count = 1], [boolean $lock = true], [int $buffer = 8192]  )

Reads heads of file into an array

PHP API Extension

Parameters:
string   $file:  filename
int   $count:  number of executed fgets, usually equivalent to number of lines
boolean   $lock:  use lock or not
int   $buffer:  number of bytes to be read in one fgets

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method file_put_contents  [line 2204]

  static int file_put_contents( string $filename, string $data, [int $flags = 0]  )

Write a string to a file (PHP5 has this function)

PHP Compat

Parameters:
string   $filename: 
string   $data: 
int   $flags: 

API Tags:
Return:  the amount of bytes that were written to the file, or FALSE if failure
See:  php_compat_file_put_contents (better)
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_basename  [line 1581]

  static string get_basename( string $path, [string $suffix = '']  )

Get the basename of a path

PHP API Extension

PHP's basename works as

  1.   'Page/' => 'Page''Page/a' => 'a''Page' => 'Page'
This function works as
  1.   'Page/' => '''Page/a' => 'a''Page' => 'Page'

Parameters:
string   $path: 
string   $suffix:  cut suffix of the basename

API Tags:
Return:  basename
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_convert_html  [line 93]

  static string get_convert_html( string $page, array $lines  )

Get result html of convert_html

PukiWiki API Extension

Parameters:
string   $page:  pagename
array   $lines:  contents to be converted

API Tags:
Return:  html
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_dirname  [line 1551]

  static string get_dirname( string $path  )

Get the dirname of a path

PHP API Extension

PHP's dirname works as

  1.   'Page/' => '.''Page/a' => 'Page''Page' => '.'
This function works as
  1.   'Page/' => 'Page''Page/a' => 'Page''Page' => ''

Parameters:
string   $path: 

API Tags:
Return:  dirname
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_existfiles  [line 1509]

  static array &get_existfiles( string $dir, [string $ext = ''], [bool $recursive = false]  )

Get list of files in a directory

PHP Extension

Parameters:
string   $dir:  Directory Name
string   $ext:  File Extension
bool   $recursive:  Traverse Recursively

API Tags:
Return:  array of filenames
Access:  public
Uses:  readdir()
Uses:  is_dir()
Uses:  opendir()

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_existpages  [line 382]

  static array get_existpages( [string $prefix = '']  )

get existing pages with prefix restriction

PukiWiki API Extension

Parameters:
string   $prefix: 

API Tags:
Access:  public
Usedby:  sonots::get_existpages() - (PukiWiki lib/file.php)
Uses:  sonots::get_existpages() - (PukiWiki lib/file.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_filecreatetime  [line 828]

  static int get_filecreatetime( string $page  )

Get page created time

PukiWiki API Extension

Parameters:
string   $page:  pagename

API Tags:
Return:  timestamp
See:  get_filetime($page)
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_fullname  [line 890]

  static string get_fullname( string $name, string $refer  )

Get absolute path

PukiWiki API Extension

This preserves last slash unlike lib/make_link.php@get_fullname

Example)

  1.   get_fullname('./a''b/c'=> 'b/c/a'
  2.   get_fullname('../a''b/c'=> 'b/a'
  3.   get_fullname('../a/''b/c'=> 'b/a'
  4.   sonots::get_fullname('../a/''b/c'=> 'b/a/'

Parameters:
string   $name:  path syntax
string   $refer:  current place

API Tags:
Return:  absolute path
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_interwiki_url  [line 315]

  static string get_interwiki_url( string $interwiki  )

Resolve InterWiki name

PukiWiki API Extension

Parameters:
string   $interwiki:  InterWiki string such as pukiwiki:PageName

API Tags:
Return:  url
Access:  public
Usedby:  sonots::get_interwiki_url() - (PukiWiki lib/func.php)
Uses:  sonots::is_interwiki() - (PukiWiki lib/func.php)
Uses:  sonots::get_interwiki_url() - (PukiWiki lib/func.php)
Uses:  is_url - (PukiWiki lib/func.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_members  [line 1463]

  static array &get_members( array &$objects, string $name  )

Get specific members from array of class objects

PHP API Extension

Parameters:
array   &$objects:  array of objects
string   $name:  member name

API Tags:
Return:  array of members, keys are preserved.
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_page_uri  [line 356]

  static string get_page_uri( string $page, [string $query = '']  )

get uri of a page

PukiWiki API Extension

Parameters:
string   $page: 
string   $query:  query word if needs

API Tags:
Return:  uri
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_readings  [line 940]

  static array get_readings( [mixed $pages = array()]  )

get readings of pages

PukiWiki API Extension

arguments $pages version of lib/file.php get_reading

Parameters:
mixed   $pages:  array of pages or a pagename if not given, get readings of all existing pages

API Tags:
Return:  readings
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method get_tree  [line 205]

  static array get_tree( array $pages  )

Get tree states of pages

PukiWiki API Extension

Parameters:
array   $pages: 

API Tags:
Return:  array whose keys are pagenames and values are boolean true if the page is a leaf in tree, false if not.
Access:  public
Uses:  sonots::sort_filenames

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method glue_str  [line 1833]

  static string glue_str( array $queries  )

reverse parse_str

PHP API Extension

Note: parse_str does rawurldecode and convert . into _ for keys

Parameters:
array   $queries:  outputs by parse_str

API Tags:
Return:  reversed parse_str
See:  parse_str()
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method glue_url  [line 1860]

  static string glue_url( array $parsed  )

reverse parse_url

PHP Extension

Parameters:
array   $parsed:  outputs by parse_url

API Tags:
Return:  reversed parse_url
See:  parse_url()
Access:  public
Usedby:  sonots::realurl()

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method grep_array  [line 1162]

  static array grep_array( string $pattern, array $array, string $func, [boolean $preserve_keys = true], [boolean $inverse = false]  )

Grep array

PHP API Extension

Parameters:
string   $pattern: 
array   $array: 
string   $func:  func name
  • preg : grep by preg
  • ereg : grep by ereg
  • mb_ereg : grep by mb_ereg
  • strpos : grep by string
  • mb_strpos: grep by multibyte string
  • prefix : grep by prefix match
  • mb_prefix: grep by multibyte prefix match
  • eq : grep by equality (identity, ===)
  • ge : grep by greater or equal to
  • le : grep by less or equal to
boolean   $preserve_keys: 
boolean   $inverse:  grep -v

API Tags:
See:  array_diff use array_diff to get inverse
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $
Todo:  refine more

[ Top ]
static method grep_by  [line 1124]

  static void grep_by( &$objs, string $meta, string $func, mixed $pattern, [boolean $inverse = FALSE], array $objs  )

Grep out array of objects by speific members

Parameters:
array   $objs: 
string   $meta:  name of meta information to be greped
string   $func:  func name
  • preg : grep by preg
  • ereg : grep by ereg
  • mb_ereg : grep by mb_ereg
  • prefix : remains if prefix matches (strpos)
  • mb_prefix: (mb_strpos)
  • eq : remains if equality holds
  • ge : remains if greater or equal to
  • le : remains if less or equal to
mixed   $pattern: 
boolean   $inverse:  grep -v
   &$objs: 

API Tags:
Access:  public


[ Top ]
static method init_members  [line 1423]

  static void init_members( array &$objects, string $name, mixed $value  )

Initialize members of array of class objects

PHP API Extension

Parameters:
array   &$objects:  array of objects
string   $name:  member name
mixed   $value:  initialization value

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-10 11:14:46 sonots $
Since:  1.10

[ Top ]
static method init_myerror  [line 2139]

  static void init_myerror( )

Error Handling in PHP4. init error states


API Tags:
Global:  string $php_errmsg: php_errmsg
See:  sonots::mycatch()
See:  sonots::mythrow()
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $
Since:  v 1.4

[ Top ]
static method is_admin  [line 622]

  static boolean is_admin( [string $pass = null], [boolean $use_session = false], [boolean $use_authlog = false]  )

PukiWiki admin login with session

PukiWiki API Extension

Parameters:
string   $pass:  Password. Use null when to get current session state.
boolean   $use_session:  Use Session log
boolean   $use_authlog:  Use Auth log. Username 'admin' is deemed to be Admin in PukiWiki Official. PukiWiki Plus! has role management, roles ROLE_ADM and ROLE_ADM_CONTENTS are deemed to be Admin.

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_edit_auth  [line 447]

  static boolean is_edit_auth( string $page, [string $user = '']  )

Check if a page is configured to require authentication

PukiWiki API Extension

Parameters:
string   $page: 
string   $user:  if want to check whether this user possibly can get permission

API Tags:
Global:  boolean $edit_auth: edit_auth
Global:  array $edit_auth_pages: edit_auth_pages
Global:  string $auth_method_type: auth_method_type
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_edit_restrict  [line 484]

  static boolean is_edit_restrict( string $page  )

Check if a page is restricted to edit or not

PukiWiki API Extension

Parameters:
string   $page: 

API Tags:
Access:  public
Uses:  is_freeze - (PukiWiki lib/func.php)
Uses:  sonots::is_edit_auth

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_human  [line 574]

  static boolean is_human( [boolean $is_human = false], [boolean $use_session = false], [int $use_rolelevel = 0]  )

Human recognition using PukiWiki Auth methods

PukiWiki API Extension

Parameters:
boolean   $is_human:  Tell this is a human (Use true to store into session)
boolean   $use_session:  Use Session log
int   $use_rolelevel:  accepts users whose role levels are stronger than this

API Tags:
Access:  public
Uses:  auth::check_role - (PukiWiki Plus! lib/auth.php) if available
Uses:  sonots::is_admin

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_interwiki  [line 296]

  static boolean is_interwiki( string $str  )

Check if string is InterWiki syntax or not

PukiWiki API Extension

Parameters:
string   $str: 

API Tags:
Access:  public
Usedby:  sonots::get_interwiki_url() - (PukiWiki lib/func.php)
Usedby:  sonots::is_interwiki() - (PukiWiki lib/func.php)
Uses:  is_url - (PukiWiki lib/func.php)
Uses:  sonots::is_interwiki() - (PukiWiki lib/func.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_newpage  [line 785]

  static boolean is_newpage( string $page  )

Check if page is newpage

PukiWiki API Extension

Parameters:
string   $page: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method is_page_newer  [line 803]

  static boolean is_page_newer( string $page, string $file, [bool $ignore_notimestamp = false]  )

Check if the page timestamp is newer than the file timestamp

PukiWiki API Extension

Parameters:
string   $page:  pagename
string   $file:  filename
bool   $ignore_notimestamp:  see true editted time

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.1 2008-07-16 11:14:46 sonots $

[ Top ]
static method is_read_auth  [line 409]

  static boolean is_read_auth( $page $page, [$user $user = '']  )

Check if a page is configured to require the read-authentication

PukiWiki API Extension

Parameters:
$page   $page:  pagename
$user   $user:  if want to check whether this user possibly can get permission

API Tags:
Global:  boolean $read_auth: read_auth
Global:  array $read_auth_pages: read_auth_pages
Global:  string $auth_method_type: auth_method_type
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method make_heading  [line 857]

  static array make_heading( string $line, [bool $strip = true]  )

Get heading strings from a wiki source line

PukiWiki API Extension

  1.  *** Heading Strings ((footnotes)) [id]
  2.    -> array("Heading Strings""id")

Parameters:
string   $line:  a wiki source line
bool   $strip:  cut footnotes

API Tags:
Return:  [0] heading string [1] a fixed-heading anchor
Access:  public
Uses:  make_heading

Information Tags:
Version:  $Id: v 1.1 2008-06-05 11:14:46 sonots $

[ Top ]
static method make_inline  [line 237]

  static void make_inline( $string $string, [$page $page = '']  )

Convert only inline plugins unlike make_link()

PukiWiki API Extension

This (Precisely, InlineConverter) does htmlspecialchars, too.

Parameters:
$string   $string:  string
$page   $page:  pagename, default is $vars['page']

API Tags:
See:  make_link (PukiWiki lib/make_link.php)
Access:  public
Uses:  InlineConverter - (PukiWiki lib/make_link.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method make_pageanamelink_icon  [line 691]

  static string make_pageanamelink_icon( string $page  )

make page aname link showing anchor icon (symbol)

PukiWiki API Extension

Parameters:
string   $page: 

API Tags:
Return:  html
See:  aname.inc.php (aname allows only fiexed_anchors such as x83dvkd8)
Access:  public

Information Tags:
Version:  $Id: v 1.1 2008-06-07 11:14:46 sonots $
Todo:  refine more

[ Top ]
static method make_pageanchor  [line 721]

  static string make_pageanchor( string $page  )

make page anchor

PukiWiki API Extension

Parameters:
string   $page: 

API Tags:
Return:  anchor (no starting #)
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method make_pageeditlink_icon  [line 670]

  static string make_pageeditlink_icon( string $page  )

make page edit link showing edit icon

PukiWiki API Extension

Parameters:
string   $page: 

API Tags:
Return:  html
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $
Todo:  refine more

[ Top ]
static method make_pagelink_nopg  [line 765]

  static string make_pagelink_nopg( string $page, [string $alias = ''], [string $anchor = ''], [string $refer = ''], [boolean $isautolink = false]  )

make_pagelink without passage

PukiWiki API Extension

Parameters:
string   $page:  pagename to be used to create link
string   $alias:  <a href="">alias</a>
string   $anchor:  anchor starting from #
string   $refer: 
boolean   $isautolink:  true changes looks of link

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method make_toplink  [line 740]

  static string make_toplink( [string $alias = ''], [string $anchor = '']  )

make a link to pukiwiki top url

PukiWiki API Extension

Parameters:
string   $alias:  <a href="">alias</a>
string   $anchor:  anchor starting from #

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-08-15 11:14:46 sonots $

[ Top ]
static method map_members  [line 1486]

  static void map_members( array &$objects, string $name, callback $callback  )

Applies the callback to the members of the given array objects

PHP API Extension

Parameters:
array   &$objects:  array of objects
string   $name:  member name
callback   $callback: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-10 11:14:46 sonots $
Since:  1.10

[ Top ]
static method move  [line 1367]

  static boolean move( string $oldname, string $newname  )

Move a file (rename does not overwrite if $newname exists on Win, but move does)

PHP API Extension

Parameters:
string   $oldname: 
string   $newname: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method mycatch  [line 2122]

  static string mycatch( )

Error Handling in PHP4. catch an error message


API Tags:
Return:  err_msg
Global:  string $php_errmsg: php_errmsg
See:  sonots::mythrow()
See:  sonots::init_myerror()
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method mythrow  [line 2104]

  static void mythrow( string $errmsg  )

Error Handling in PHP4. throw an error message

PHP5)

  1.  function a_function_throw_inside()
  2.  {
  3.    throw(new Exception('Throw Error'));
  4.  }
  5.  try {
  6.    a_function_throw_inside();
  7.    echo 'Never Executed';
  8.  catch (Exception $e{
  9.    echo $e->getMessage("\n";
  10.  }

This)

  1.  function a_function_throw_inside()
  2.  {
  3.    sonots::mythrow('Throw Error')return;
  4.  }
  5.  sonots::init_error()do // try
  6.    a_function_throw_inside();
  7.    if (sonots::mycatch()) break// burdensome, though
  8.    echo 'Never Executed';
  9.  while (false);
  10.  if (sonots::mycatch()) // catch
  11.    echo sonots::mycatch();
  12.  }

Parameters:
string   $errmsg: 

API Tags:
See:  sonots::mycatch()
See:  sonots::init_myerror()
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method parse_options  [line 169]

  static array parse_options( array $args, [array $conf_options = array()], [boolean $trim = false], [string $sep = '=']  )

PukiWiki simple option parser

PukiWiki API Extension

Example)

  1.   $args array('str=hoge','bool');
  2.   $options sonots::parse_options($args);
  3.   var_export($options);
  4.   // array('str'=>'hoge','bool'=>true);
  5.  
  6.   $conf_options array('str'=>'foobar','bool'=>false)// default
  7.   $args array('bool','unknown=hoge');
  8.   $options sonots::parse_options($args$conf_options);
  9.   var_export($options);
  10.   // array('str'=>'foobar','bool'=>true); // unknown is not set

Parameters:
array   $args: 
array   $conf_options: 
boolean   $trim:  trim option key/val
string   $sep:  key/val separator

API Tags:
Return:  options
Access:  public

Information Tags:
Version:  $Id: v 1.1 2008-06-05 11:14:46 sonots $

[ Top ]
static method pkwk_output_noskin  [line 336]

  static void pkwk_output_noskin( string $body, [string $content_type = 'text/html']  )

Output contents without skin

PukiWiki API Extension

Parameters:
string   $body:  html
string   $content_type:  e.g., 'text/html', 'text/css', 'text/javascript'

API Tags:
Return:  exit
Access:  public
Uses:  pkwk_common_headers - (PukiWiki lib/html.php)

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method realurl  [line 1913]

  static string realurl( string $base, string $url  )

Get absolute URL

PHP Extension

Parameters:
string   $base:  base url
string   $url:  relative url

API Tags:
Return:  absolute url
See:  realpath()
See:  parse_url()
Access:  public
Uses:  sonots::glue_url()

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method remove_multilineplugin_lines  [line 260]

  static void remove_multilineplugin_lines( &$lines, array $lines  )

Remove inside of multiline plugin arguments.

Keys are preserved.

PukiWiki API Extension

Parameters:
array   $lines: 
   &$lines: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method r_mkdir  [line 2232]

  static boolean r_mkdir( string $dir, [int $mode = 0755]  )

mkdir recursively (mkdir of PHP5 has recursive flag)

PHP Compat

Parameters:
string   $dir: 
int   $mode: 

API Tags:
Return:  success or failure
See:  php_compat_mkdir($dir, $mode, $recurstive, $context)
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method r_strpos  [line 1267]

  static array r_strpos( string $str, string $substr  )

Find positions of occurrence of a string

PHP API Extension

Parameters:
string   $str: 
string   $substr: 

API Tags:
Return:  positions
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method set_members  [line 1444]

  static void set_members( array &$objects, string $name, &$members, array $members  )

Set array into members of array of class objects

PHP API Extension

Parameters:
array   &$objects:  array of objects
string   $name:  member name
array   $members:  array of member variables, size and keys must be same with $objects.
   &$members: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method sort_filenames  [line 1993]

  static void sort_filenames( array &$filenames  )

Special sort function for filenames (/ has a special meaning)

PHP API Extension

This function makes sure that files under a directory are followed by the directory as

  1.   Foo
  2.   Foo/Bar
  3.   FooBar
not
  1.   Foo
  2.   FooBar
  3.   Foo/Bar
This function is especially useful when filenames include multi-byte words

Parameters:
array   &$filenames: 

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method string_to_array  [line 1724]

  static array string_to_array( string $string, [string $hashsep = ':'], [string $elemsep = ','], [string $openarray = '('], [string $closearray = ')'], [boolean $decode = true]  )

Restore a string to an array.

PHP API Extension

Example

  1.  $string 'A,B,indC:C,(0:D,1:E),indF:F'
  2.  $array string_to_array($string)
  3.  <code>
  4.  Output:
  5.  <code>
  6.  array('A''B''indC' => 'C'array('D''E')'indF'=>'F');

Parameters:
string   $string: 
string   $hashsep:  A character to be used as a hash key and val seperator
string   $elemsep:  A character to be used as a elememt separator
string   $openarray:  A character to be used as an open bracket of an array
string   $closearray:  A character to be used as a close bracket of an array
boolean   $decode:  Performe decode key/val

API Tags:
See:  sonots::array_to_string()
Access:  public

Information Tags:
Version:  $Id: v 1.3 2008-07-15 11:14:46 sonots $

[ Top ]
static method trim_array  [line 1801]

  static array trim_array( array $array, [boolean $recursive = false], [boolean $trimkey = false]  )

trim elements of array

PHP API Extension

Parameters:
array   $array: 
boolean   $recursive:  recursively
boolean   $trimkey:  trim key too

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method unhtmlspecialchars  [line 1888]

  static string &unhtmlspecialchars( string $string  )

Undo htmlspecialchars

PHP API Extension

Parameters:
string   $string: 

API Tags:
Return:  Undone htmlspecialchars
See:  htmlspecialchars()
Access:  public
Example:  example not found

Information Tags:
Version:  $Id: v 1.0 2008-06-05 11:14:46 sonots $

[ Top ]
static method urldecode  [line 1632]

  static string urldecode( string $string, [string $chars = null]  )

Urldecode only given specific chars

PHP API Extension

Parameters:
string   $string: 
string   $chars:  this string is splitted into chars. If null, urldecode is performed.

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-07-15 11:14:46 sonots $

[ Top ]
static method urlencode  [line 1607]

  static string urlencode( string $string, [string $chars = null]  )

Urlencode only given specific chars

PHP API Extension

Parameters:
string   $string: 
string   $chars:  this string is splitted into chars. If null, urlencode is performed.

API Tags:
Access:  public

Information Tags:
Version:  $Id: v 1.0 2008-07-15 11:14:46 sonots $

[ Top ]

Documentation generated on Sat, 16 Aug 2008 15:27:34 -0400 by phpDocumentor 1.3.2