Commit b8301202 authored by kstingel's avatar kstingel

[FIX] started adding missing PHPDoc blocks, may still need some editing if details

parent 776be33c
......@@ -13,6 +13,9 @@ if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
if (isset($_REQUEST['searchprefs'])) {
check_ticket('admin-inc-search');
}
/**
* @return array
*/
function activated_features()
{
global $prefs;
......
......@@ -21,6 +21,10 @@ $map = array(
$s = new XML_RPC_Server($map);
/**
* @param $params
* @return XML_RPC_Response
*/
function sendStructurePage($params)
{
global $tikilib, $userlib, $commlib, $prefs;
......@@ -59,6 +63,10 @@ function sendStructurePage($params)
}
/* Validates the user and returns user information */
/**
* @param $params
* @return XML_RPC_Response
*/
function sendPage($params)
{
// Get the page and store it in received_pages
......@@ -99,6 +107,10 @@ function sendPage($params)
return new XML_RPC_Response(new XML_RPC_Value(1, "boolean"));
}
/**
* @param $params
* @return XML_RPC_Response
*/
function sendArticle($params)
{
// Get the page and store it in received_pages
......
......@@ -141,9 +141,18 @@ if ( $dbversion_tiki == '1.10' ) {
$dbversion_tiki = '2.0';
}
/**
*
*/
class TikiDb_LegacyErrorHandler implements TikiDb_ErrorHandler
{
function handle( TikiDb $db, $query, $values, $result ) // {{{
/**
* @param TikiDb $db
* @param $query
* @param $values
* @param $result
*/
function handle( TikiDb $db, $query, $values, $result ) // {{{
{
global $smarty, $prefs;
......@@ -162,7 +171,11 @@ class TikiDb_LegacyErrorHandler implements TikiDb_ErrorHandler
}
if (function_exists('xdebug_get_function_stack')) {
function mydumpstack($stack)
/**
* @param $stack
* @return string
*/
function mydumpstack($stack)
{
$o='';
foreach ($stack as $line) {
......@@ -193,7 +206,10 @@ class TikiDb_LegacyErrorHandler implements TikiDb_ErrorHandler
$this->log($msg.' - '.$q);
die;
} // }}}
function log($msg)
/**
* @param $msg
*/
function log($msg)
{
global $user, $tikilib;
$query = 'insert into `tiki_actionlog` (`objectType`,`action`,`object`,`user`,`ip`,`lastModif`, `comment`, `client`) values (?,?,?,?,?,?,?,?)';
......@@ -229,6 +245,9 @@ if ( isset( $shadow_host, $shadow_user, $shadow_pass, $shadow_dbs ) ) {
unset($host_map, $db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $shadow_user, $shadow_pass, $shadow_host, $shadow_dbs);
/**
* @param $db
*/
function init_connection( $db )
{
global $db_table_prefix, $common_users_table_prefix, $db_tiki;
......
......@@ -21,7 +21,11 @@ $dirtoscan = 'templates';
/* defines functions scandir and file_out_contents if running PHP<5 */
if (!function_exists('scandir')) {
function scandir($dir)
/**
* @param $dir
* @return array
*/
function scandir($dir)
{
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
......@@ -34,7 +38,12 @@ if (!function_exists('scandir')) {
}
if (!function_exists('file_put_contents')) {
function file_put_contents($filename, $data)
/**
* @param $filename
* @param $data
* @return bool|int
*/
function file_put_contents($filename, $data)
{
$f = @fopen($filename, 'w');
if (!$f) {
......
......@@ -39,6 +39,11 @@ $count_r = 0;
// $access->display_error('', 'no tpl');
//}
/**
* @param $original
* @param $template_base
* @return mixed
*/
function replace_with_self_links($original, $template_base)
{
global $count_r;
......@@ -77,6 +82,10 @@ function replace_with_self_links($original, $template_base)
return $replaced;
}
/**
* @param $var
* @return string
*/
function process_value ($var)
{
if (strpos($var, '{$') === 0) {
......
......@@ -25,11 +25,17 @@
// YOUR PHP!
//
/**
*
*/
class ggg_trace
{
var $fp;
function ggg_trace($nameStr = 'ggg-trace.out')
/**
* @param string $nameStr
*/
function ggg_trace($nameStr = 'ggg-trace.out')
{
register_shutdown_function(array(&$this, '_ggg_trace')); // the & is important
$this->fp = fopen($nameStr, 'a');
......@@ -40,17 +46,27 @@ class ggg_trace
// print date("Ymd G:i:s<br>",time()); // e.g. 20031231 17:00:20
}
function out($outStr = '')
/**
* @param string $outStr
*/
function out($outStr = '')
{
fwrite($this->fp, "$outStr");
}
function outln($outStr = '')
/**
* @param string $outStr
*/
function outln($outStr = '')
{
fwrite($this->fp, "$outStr\n");
}
function outvar($var, $indent = 0)
/**
* @param $var
* @param int $indent
*/
function outvar($var, $indent = 0)
{
if ($indent > 8) {
fwrite($this->fp, "Too many levels of recursion! \n");
......
......@@ -81,6 +81,10 @@ foreach ($data as $values) {
fclose($ourFileHandle);
/**
* @param $fields
* @return array
*/
function collect_raw_data($fields)
{
$data = array();
......@@ -128,6 +132,9 @@ function collect_raw_data($fields)
return $data;
}
/**
* @param $data
*/
function remove_fake_descriptions(& $data)
{
foreach ($data as & $row) {
......@@ -137,6 +144,10 @@ function remove_fake_descriptions(& $data)
}
}
/**
* @param $data
* @param $prefs
*/
function set_default_values(& $data, $prefs)
{
foreach ($data as & $row) {
......@@ -148,6 +159,11 @@ function set_default_values(& $data, $prefs)
}
}
/**
* @param $data
* @param $field
* @return array
*/
function index_data($data, $field)
{
$index = array();
......@@ -165,6 +181,9 @@ function index_data($data, $field)
return $index;
}
/**
* @param $data
*/
function collect_locations(& $data)
{
global $prefslib; require_once 'lib/prefslib.php';
......@@ -178,6 +197,11 @@ function collect_locations(& $data)
}
}
/**
* @param $data
* @param $index
* @param $stopWords
*/
function update_search_flag(& $data, $index, $stopWords)
{
foreach ($data as & $row) {
......
......@@ -22,6 +22,9 @@ if ($tiki_p_admin != 'y') {
$logfile = 'temp/tiki_parsed.txt';
$logfilehtml = 'temp/tiki_parsed.html';
/**
* @param $dir
*/
function collect($dir)
{
global $dirs;
......@@ -57,6 +60,14 @@ function collect($dir)
}
}
/**
* @param $fd
* @param $fx
* @param $outstring
* @param string $style
* @param string $mod
* @param bool $br
*/
function echoline($fd, $fx, $outstring, $style = '', $mod = '', $br = true)
{
if ($br) {
......
......@@ -70,6 +70,10 @@ foreach ($data as $values) {
fputcsv(STDOUT, array_values($values));
}
/**
* @param $fields
* @return array
*/
function collect_raw_data($fields)
{
$data = array();
......@@ -117,6 +121,9 @@ function collect_raw_data($fields)
return $data;
}
/**
* @param $data
*/
function remove_fake_descriptions(& $data)
{
foreach ($data as & $row) {
......@@ -126,6 +133,10 @@ function remove_fake_descriptions(& $data)
}
}
/**
* @param $data
* @param $prefs
*/
function set_default_values(& $data, $prefs)
{
foreach ($data as & $row) {
......@@ -137,6 +148,11 @@ function set_default_values(& $data, $prefs)
}
}
/**
* @param $data
* @param $field
* @return array
*/
function index_data($data, $field)
{
$index = array();
......@@ -154,6 +170,9 @@ function index_data($data, $field)
return $index;
}
/**
* @param $data
*/
function collect_locations(& $data)
{
global $prefslib; require_once 'lib/prefslib.php';
......@@ -167,6 +186,11 @@ function collect_locations(& $data)
}
}
/**
* @param $data
* @param $index
* @param $stopWords
*/
function update_search_flag(& $data, $index, $stopWords)
{
foreach ($data as & $row) {
......
......@@ -219,6 +219,11 @@ if ($isPre) {
// Helper functions
/**
* @param $file
* @param $root
* @param $version
*/
function write_secdb($file, $root, $version)
{
$file_exists = @file_exists($file);
......@@ -245,6 +250,12 @@ function write_secdb($file, $root, $version)
}
}
/**
* @param $root
* @param $dir
* @param $version
* @param $queries
*/
function md5_check_dir($root, $dir, $version, &$queries)
{
$d = dir($dir);
......@@ -280,6 +291,10 @@ function md5_check_dir($root, $dir, $version, &$queries)
$d->close();
}
/**
* @param $releaseVersion
* @param $svnRelativePath
*/
function build_packages($releaseVersion, $svnRelativePath)
{
global $options;
......@@ -297,6 +312,12 @@ function build_packages($releaseVersion, $svnRelativePath)
passthru("ls ~/tikipack/$releaseVersion");
}
/**
* @param $dir
* @param $entries
* @param $regexp_pattern
* @return bool
*/
function get_files_list($dir, &$entries, $regexp_pattern)
{
$d = dir($dir);
......@@ -317,6 +338,11 @@ function get_files_list($dir, &$entries, $regexp_pattern)
return true;
}
/**
* @param $alreadyDone
* @param $toDo
* @param $message
*/
function display_progress_percentage($alreadyDone, $toDo, $message)
{
$onePercent = ceil($toDo / 100);
......@@ -326,6 +352,9 @@ function display_progress_percentage($alreadyDone, $toDo, $message)
}
}
/**
* @param $error_msg
*/
function check_smarty_syntax(&$error_msg)
{
global $tikidomain, $prefs, $smarty;
......@@ -351,6 +380,10 @@ function check_smarty_syntax(&$error_msg)
$smarty->compileAllTemplates('.tpl', true);
}
/**
* @param $error_msg
* @return bool
*/
function check_smarty_syntax2(&$error_msg)
{
global $tikidomain, $prefs, $smarty;
......@@ -425,12 +458,26 @@ function check_smarty_syntax2(&$error_msg)
return true;
}
/**
* @param $errno
* @param $errstr
* @param string $errfile
* @param int $errline
* @param array $errcontext
*/
function check_smarty_syntax_error_handler($errno, $errstr, $errfile = '', $errline = 0, $errcontext = array())
{
// throw new Exception($errstr);
error($errstr);
}
/**
* @param $dir
* @param $error_msg
* @param $hide_php_warnings
* @param int $retry
* @return bool
*/
function check_php_syntax(&$dir, &$error_msg, $hide_php_warnings, $retry = 10)
{
global $phpCommand;
......@@ -477,6 +524,9 @@ function check_php_syntax(&$dir, &$error_msg, $hide_php_warnings, $retry = 10)
return true;
}
/**
* @return array|bool
*/
function get_options()
{
if ($_SERVER['argc'] <= 1) {
......@@ -559,6 +609,12 @@ function get_options()
return $options;
}
/**
* @param $msg
* @param bool $increment_step
* @param bool $commit_msg
* @return bool
*/
function important_step($msg, $increment_step = true, $commit_msg = false)
{
global $options;
......@@ -622,6 +678,10 @@ function important_step($msg, $increment_step = true, $commit_msg = false)
return $do_step;
}
/**
* @param $newVersion
* @return array|bool
*/
function update_changelog_file($newVersion)
{
if (! is_readable(CHANGELOG) || ! is_writable(CHANGELOG) || ! ($handle = @fopen(CHANGELOG, "r"))) {
......@@ -719,6 +779,10 @@ EOS;
return file_put_contents(CHANGELOG, $newChangelog . $newChangelogEnd) ? $return : false;
}
/**
* @param $newVersion
* @return array|bool
*/
function update_copyright_file($newVersion)
{
if (! is_readable(COPYRIGHTS) || ! is_writable(COPYRIGHTS)) {
......@@ -804,6 +868,9 @@ EOS;
return file_put_contents(COPYRIGHTS, $copyrights) ? $return : false;
}
/**
* @return array|bool
*/
function parse_copyrights()
{
if (! $copyrights = @file(COPYRIGHTS)) {
......@@ -828,6 +895,14 @@ function parse_copyrights()
return $return;
}
/**
* @param $path
* @param $contributors
* @param $minRevision
* @param $maxRevision
* @param int $step
* @return mixed
*/
function get_contributors_data($path, &$contributors, $minRevision, $maxRevision, $step = 15000)
{
global $nbCommiters;
......@@ -885,6 +960,9 @@ function get_contributors_data($path, &$contributors, $minRevision, $maxRevision
return $contributors;
}
/**
* @param $contributors
*/
function get_contributors_sf_data(&$contributors)
{
global $options;
......@@ -919,6 +997,11 @@ function get_contributors_sf_data(&$contributors)
}
}
/**
* @param $releaseVersion
* @param $mainVersion
* @return bool
*/
function update_readme_file($releaseVersion, $mainVersion)
{
if (! is_readable(README) || ! is_writable(README)) {
......
......@@ -14,6 +14,10 @@ require_once("lib/tikilib.php");
require_once("lib/categories/categlib.php");
require_once("lib/structures/structlib.php");
/**
* @param $s
* @return mixed
*/
function tra($s)
{
return $s;
......
......@@ -9,6 +9,11 @@ $version = $_SERVER['argv'][1];
rewriteSecdb('tiki-' . $version . '/db/tiki-secdb_'.$version.'_mysql.sql', 'tiki-' . $version, $version);
/**
* @param $file
* @param $root
* @param $version
*/
function rewriteSecdb($file, $root, $version)
{
$file_exists = @file_exists($file);
......@@ -30,6 +35,12 @@ function rewriteSecdb($file, $root, $version)
}
}
/**
* @param $root
* @param $dir
* @param $version
* @param $queries
*/
function md5CheckDir($root, $dir, $version, &$queries)
{
$d = dir($dir);
......
......@@ -82,6 +82,10 @@ $major = (count($ver) >= 1) ? $ver[0]:'?';
$minor = (count($ver) >= 2) ? $ver[1]: '?';
$revision = (count($ver) >= 3) ? $ver[2]: '?';
/**
* @param $filename
* @return bool|string
*/
function get_content($filename)
{
static $last, $content;
......@@ -95,6 +99,10 @@ function get_content($filename)
return $content;
}
/**
* @param $featureNameIndex
* @return string
*/
function feature_pattern(&$featureNameIndex) // {{{
{
global $major, $minor, $revision;
......@@ -110,6 +118,10 @@ function feature_pattern(&$featureNameIndex) // {{{
}
} // }}}