add_recent [line 566]
void add_recent(
string $page, string $recentpage, [string $subject = ''], [int $limit = 0]
)
|
|
Add a page to a recent page such as RecentChanges, RecentDeleted
Parameters:
|
string |
$page: |
page to be added to log |
|
string |
$recentpage: |
log page |
|
string |
$subject: |
additional comment |
|
int |
$limit: |
number of limits to be logged |
API Tags:
autobasealias_write [line 799]
void autobasealias_write(
string $filename, array &$pages
)
|
|
Update AutoBaseAlias data
Parameters:
|
string |
$filename: |
log file, usually CACHE_DIR.PKWK_AUTOBASEALIAS_CACHE(autobasealias.dat) |
|
array |
&$pages: |
existpages |
API Tags:
autolink_pattern_write [line 832]
void autolink_pattern_write(
string $filename, array $autolink_pattern
)
|
|
Update autolink data
Parameters:
|
string |
$filename: |
log file, usually CACHE_DIR.PKWK_AUTOLINK_REGEX_CACHE(autolink.dat) |
|
array |
$autolink_pattern: |
autolink patten to be saved |
API Tags:
file_head [line 415]
array file_head(
string $file, [int $count = 1], [boolean $lock = TRUE], [int $buffer = 8192]
)
|
|
Read top N lines as an array
Parameters:
|
string |
$file: |
filename |
|
int |
$count: |
number of executed fgets, generally number of lines |
|
boolean |
$lock: |
use lock or not |
|
int |
$buffer: |
number of bytes to be read in one fgets |
API Tags:
| Return: | lines of contents |
| See: | file() Use PHP file() function if you want to get ALL lines |
| Usedby: | lastmodified_add() |
file_write [line 454]
void file_write(
string $dir, string $page, string $str, [boolean $notimestamp = FALSE]
)
|
|
Output to a file
Parameters:
|
string |
$dir: |
directory such as DATA_DIR, DIFF_DIR |
|
string |
$page: |
pagename |
|
string |
$str: |
contents to be written |
|
boolean |
$notimestamp: |
do not update timestamp |
API Tags:
generate_fixed_heading_anchor_id [line 397]
string generate_fixed_heading_anchor_id(
string $seed
)
|
|
Generate fixed heading anchor id randomly
Parameters:
|
string |
$seed: |
usually heading strings |
API Tags:
| Return: | A random alphabetic letter + 7 letters of random strings |
get_diff_lines [line 260]
array get_diff_lines(
string $diffdata
)
|
|
Get diff lines from diff format text such as
- minus
+ plus
Parameters:
API Tags:
| Return: | array($plus, $minus) <li> string $plus <li> string $minus |
| Usedby: | get_link_list() |
get_existfiles [line 1088]
array get_existfiles(
string $dir, string $ext
)
|
|
Get a list of encoded files (must specify a directory and a suffix)
Parameters:
|
string |
$dir: |
directory name |
|
string |
$ext: |
common file extension |
API Tags:
| Return: | file paths including $dir and $ext |
get_existpages [line 894]
array get_existpages(
[string $dir = DATA_DIR], [string $ext = '.txt']
)
|
|
Get a page list of this wiki
Parameters:
|
string |
$dir: |
directory name |
|
string |
$ext: |
common file extension |
API Tags:
get_filename [line 88]
string get_filename(
string $page
)
|
|
Get physical file name of the page
Parameters:
API Tags:
| Return: | encoded local path file name |
| Usedby: | is_page() |
get_filetime [line 77]
int get_filetime(
string $page
)
|
|
Get last-modified filetime of the page
Parameters:
API Tags:
get_link_list [line 214]
array get_link_list(
string $diffdata
)
|
|
Get newly added links from diff format text such as
- minus
+ plus
(simply plus is not enough because plus and minus could have same links yet)
Parameters:
API Tags:
get_pg_passage [line 858]
string get_pg_passage(
string $page, [boolean $sw = TRUE]
)
|
|
Get elapsed date of the page
Parameters:
|
string |
$page: |
pagename |
|
boolean |
$sw: |
add <small> tag or not |
API Tags:
get_readings [line 919]
array get_readings(
array &$pages
)
|
|
Get PageReading(pronounce-annotated) data in an array()
Parameters:
API Tags:
| Return: | associative array whose keys are pagenames and values are readings |
| Usedby: | page_list() - if $pagereading_enable is TRUE |
get_source [line 38]
array|string get_source(
[string $page = NULL], [boolean $lock = TRUE], [boolean $join = FALSE]
)
|
|
Get source(wiki text) data of the page
Parameters:
|
string |
$page: |
pagename |
|
boolean |
$lock: |
lock file on reading |
|
boolean |
$join: |
join lines (array) of source into a string |
API Tags:
| Return: | lines of source or joined source. Each line have "\n" at the end. |
get_this_time_links [line 306]
array get_this_time_links(
string $post, string $diff
)
|
|
Get newly added link this time
Parameters:
|
string |
$post: |
a posted wiki source text |
|
string |
$diff: |
a diff format text (diff between new and old source) |
API Tags:
header_lastmod [line 876]
void header_lastmod(
[string $page = NULL]
)
|
|
Send Last-Modified HTTP header
Parameters:
API Tags:
| Global: | boolean $lastmod: send Last-Modified HTTP header or not |
lastmodified_add [line 621]
void lastmodified_add(
[string $update = ''], [string $remove = '']
)
|
|
Update PKWK_MAXSHOW_CACHE(recent.dat) and $whatsnew(RecentChanges) (Light) Use without $autolink
Parameters:
|
string |
$update: |
updated page, added to log file |
|
string |
$remove: |
deleted page, removed from log file |
API Tags:
| Global: | int $maxshow: number of logs in $whatsnew |
| Global: | string $whatsnew: whatsnew pagename (RecentChanges) |
| Global: | boolean $autolink: autolink is effective or not |
| Global: | boolean $autobasealias: autobasealias is effective or not |
| Usedby: | file_write() |
| Uses: | put_lastmodified() |
| Uses: | pkwk_touch_file() |
| Uses: | file_head() |
Information Tags:
links_get_related [line 1109]
array links_get_related(
string $page
)
|
|
Get a list of related pages of the page
Parameters:
API Tags:
| Global: | array $vars: |
| Global: | array $related: If possible, merge related pages generated by make_link() |
| Uses: | links_get_related_db() |
make_str_rules [line 333]
string make_str_rules(
string $source
)
|
|
Modify original text with user-defined / system-defined rules
Parameters:
|
string |
$source: |
wiki source text |
API Tags:
| Return: | replaced text |
| Global: | string $str_rules: replace rules. |
| Global: | boolean $fixed_heading_anchor: |
| See: | rules.ini.php for $str_rules |
| Usedby: | page_write() |
page_write [line 115]
void page_write(
string $page, string $postdata, [boolean $notimestamp = FALSE]
)
|
|
Put a data(wiki text) into a physical file(diff, backup, text)
Parameters:
|
string |
$page: |
|
|
string |
$postdata: |
contents to be written |
|
boolean |
$notimestamp: |
do not update timestamp |
API Tags:
pkwk_chown [line 1134]
void pkwk_chown(
string $filename, [boolean $preserve_time = TRUE]
)
|
|
_If needed_, re-create the file to change/correct ownership into PHP's NOTE: Not works for Windows
Parameters:
|
string |
$filename: |
|
|
boolean |
$preserve_time: |
do not update timestamp |
API Tags:
Information Tags:
pkwk_touch_file [line 1205]
void pkwk_touch_file(
string $filename, [int $time = FALSE], [int $atime = FALSE]
)
|
|
touch() with trying pkwk_chown()
Parameters:
|
string |
$filename: |
|
|
int |
$time: |
mtime |
|
int |
$atime: |
atime |
API Tags:
Information Tags:
put_lastmodified [line 710]
Update RecentChanges
Update PKWK_AUTOLINK_REGEX_CACHE(autolink.dat) and PKWK_AUTOBASEALIS_CACHE(autobasealias.dat), too
API Tags:
| Global: | int $maxshow: number of logs in $whatsnew |
| Global: | string $whatsnew: whatsnew pagename (RecentChanges) |
| Global: | boolean $autolink: autolink is effective or not |
| Global: | boolean $autobasealias: atuobasealias is effective or not |
| Usedby: | lastmodified_add() |
| Uses: | get_existpages() |
| Uses: | auth::check_role |
replace_plugin_link2null [line 278]
array replace_plugin_link2null(
string $data
)
|
|
Get links in a wiki source text after replacing some plugins into null plugin
Used when TrackBack Ping and SPAM Check are processed
Parameters:
|
string |
$data: |
a wiki source text |
API Tags:
| Return: | array $links |
| Global: | array $exclude_link_plugin: plugins to be replaced into null plugin |
| Usedby: | get_this_time_links() |