Commit d64f2ad4 by pupi1985

PHPDoc update in db/admin, db/cache, db/install and db/metas

parent f90cc369
......@@ -29,9 +29,9 @@ require_once QA_INCLUDE_DIR . 'db/maxima.php';
/**
* Create (or replace) the item ($type, $cacheid) in the database cache table with $content
* @param $type
* @param $cacheid
* @param $content
* @param string $type
* @param string $cacheid
* @param string $content
* @return mixed
*/
function qa_db_cache_set($type, $cacheid, $content)
......@@ -53,8 +53,8 @@ function qa_db_cache_set($type, $cacheid, $content)
/**
* Retrieve the item ($type, $cacheid) from the database cache table
* @param $type
* @param $cacheid
* @param string $type
* @param string $cacheid
* @return mixed|null
*/
function qa_db_cache_get($type, $cacheid)
......
......@@ -29,6 +29,7 @@ define('QA_DB_VERSION_CURRENT', 67);
/**
* Return the column type for user ids after verifying it is one of the legal options
* @return string
*/
function qa_db_user_column_type_verify()
{
......@@ -59,6 +60,7 @@ function qa_db_user_column_type_verify()
/**
* Return an array of table definitions. For each element of the array, the key is the table name (without prefix)
* and the value is an array of column definitions, [column name] => [definition]. The column name is omitted for indexes.
* @return array
*/
function qa_db_table_definitions()
{
......@@ -539,7 +541,7 @@ function qa_db_table_definitions()
/**
* Return array with all values from $array as keys
* @param $array
* @param array $array
* @return array
*/
function qa_array_to_keys($array)
......@@ -550,7 +552,7 @@ function qa_array_to_keys($array)
/**
* Return a list of tables missing from the database, [table name] => [column/index definitions]
* @param $definitions
* @param array $definitions
* @return array
*/
function qa_db_missing_tables($definitions)
......@@ -569,8 +571,8 @@ function qa_db_missing_tables($definitions)
/**
* Return a list of columns missing from $table in the database, given the full definition set in $definition
* @param $table
* @param $definition
* @param string $table
* @param array $definition
* @return array
*/
function qa_db_missing_columns($table, $definition)
......@@ -589,6 +591,7 @@ function qa_db_missing_columns($table, $definition)
/**
* Return the current version of the Q2A database, to determine need for DB upgrades
* @return int|null
*/
function qa_db_get_db_version()
{
......@@ -607,7 +610,7 @@ function qa_db_get_db_version()
/**
* Set the current version in the database
* @param $version
* @param int $version
*/
function qa_db_set_db_version($version)
{
......@@ -619,6 +622,7 @@ function qa_db_set_db_version($version)
/**
* Return a string describing what is wrong with the database, or false if everything is just fine
* @return false|string
*/
function qa_db_check_tables()
{
......@@ -703,8 +707,8 @@ function qa_db_install_tables()
/**
* Return the SQL command to create a table with $rawname and $definition obtained from qa_db_table_definitions()
* @param $rawname
* @param $definition
* @param string $rawname
* @param array $definition
* @return string
*/
function qa_db_create_table_sql($rawname, $definition)
......@@ -720,6 +724,7 @@ function qa_db_create_table_sql($rawname, $definition)
/**
* Return the SQL to create the default entries in the userfields table (before 1.3 these were hard-coded in PHP)
* @return string
*/
function qa_db_default_userfields_sql()
{
......@@ -1629,9 +1634,9 @@ function qa_db_upgrade_tables()
/**
* Reset the definitions of $columns in $table according to the $definitions array
* @param $definitions
* @param $table
* @param $columns
* @param array $definitions
* @param string $table
* @param array $columns
*/
function qa_db_upgrade_table_columns($definitions, $table, $columns)
{
......@@ -1646,7 +1651,7 @@ function qa_db_upgrade_table_columns($definitions, $table, $columns)
/**
* Perform upgrade $query and output progress to the browser
* @param $query
* @param string $query
*/
function qa_db_upgrade_query($query)
{
......@@ -1657,7 +1662,7 @@ function qa_db_upgrade_query($query)
/**
* Output $text to the browser (after converting to HTML) and do all we can to get it displayed
* @param $text
* @param string $text
*/
function qa_db_upgrade_progress($text)
{
......
......@@ -27,9 +27,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Set the metadata for user $userid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $userid
* @param $key
* @param $value
* @param mixed $userid
* @param string $key
* @param string $value
*/
function qa_db_usermeta_set($userid, $key, $value)
{
......@@ -39,8 +39,8 @@ function qa_db_usermeta_set($userid, $key, $value)
/**
* Clear the metadata for user $userid with $key ($key can also be an array of keys)
* @param $userid
* @param $key
* @param mixed $userid
* @param string $key
*/
function qa_db_usermeta_clear($userid, $key)
{
......@@ -51,8 +51,8 @@ function qa_db_usermeta_clear($userid, $key)
/**
* Return the metadata value for user $userid with $key ($key can also be an array of keys in which case this
* returns an array of metadata key => value).
* @param $userid
* @param $key
* @param mixed $userid
* @param string $key
* @return array|mixed|null
*/
function qa_db_usermeta_get($userid, $key)
......@@ -63,9 +63,9 @@ function qa_db_usermeta_get($userid, $key)
/**
* Set the metadata for post $postid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $postid
* @param $key
* @param $value
* @param int $postid
* @param string $key
* @param string $value
*/
function qa_db_postmeta_set($postid, $key, $value)
{
......@@ -75,8 +75,8 @@ function qa_db_postmeta_set($postid, $key, $value)
/**
* Clear the metadata for post $postid with $key ($key can also be an array of keys)
* @param $postid
* @param $key
* @param int $postid
* @param string $key
*/
function qa_db_postmeta_clear($postid, $key)
{
......@@ -87,8 +87,8 @@ function qa_db_postmeta_clear($postid, $key)
/**
* Return the metadata value for post $postid with $key ($key can also be an array of keys in which case this
* returns an array of metadata key => value).
* @param $postid
* @param $key
* @param int $postid
* @param string $key
* @return array|mixed|null
*/
function qa_db_postmeta_get($postid, $key)
......@@ -99,9 +99,9 @@ function qa_db_postmeta_get($postid, $key)
/**
* Set the metadata for category $categoryid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $categoryid
* @param $key
* @param $value
* @param int $categoryid
* @param string $key
* @param string $value
*/
function qa_db_categorymeta_set($categoryid, $key, $value)
{
......@@ -111,8 +111,8 @@ function qa_db_categorymeta_set($categoryid, $key, $value)
/**
* Clear the metadata for category $categoryid with $key ($key can also be an array of keys)
* @param $categoryid
* @param $key
* @param int $categoryid
* @param string $key
*/
function qa_db_categorymeta_clear($categoryid, $key)
{
......@@ -123,8 +123,8 @@ function qa_db_categorymeta_clear($categoryid, $key)
/**
* Return the metadata value for category $categoryid with $key ($key can also be an array of keys in which
* case this returns an array of metadata key => value).
* @param $categoryid
* @param $key
* @param int $categoryid
* @param string $key
* @return array|mixed|null
*/
function qa_db_categorymeta_get($categoryid, $key)
......@@ -135,9 +135,9 @@ function qa_db_categorymeta_get($categoryid, $key)
/**
* Set the metadata for tag $tag with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $tag
* @param $key
* @param $value
* @param string $tag
* @param string $key
* @param string $value
*/
function qa_db_tagmeta_set($tag, $key, $value)
{
......@@ -147,8 +147,8 @@ function qa_db_tagmeta_set($tag, $key, $value)
/**
* Clear the metadata for tag $tag with $key ($key can also be an array of keys)
* @param $tag
* @param $key
* @param string $tag
* @param string $key
*/
function qa_db_tagmeta_clear($tag, $key)
{
......@@ -159,9 +159,9 @@ function qa_db_tagmeta_clear($tag, $key)
/**
* Return the metadata value for tag $tag with $key ($key can also be an array of keys in which case this
* returns an array of metadata key => value).
* @param $tag
* @param $key
* @return array|mixed|null
* @param string $tag
* @param string $key
* @return mixed
*/
function qa_db_tagmeta_get($tag, $key)
{
......@@ -171,11 +171,11 @@ function qa_db_tagmeta_get($tag, $key)
/**
* Internal general function to set metadata
* @param $metatable
* @param $idcolumn
* @param $idvalue
* @param $title
* @param $content
* @param string $metatable
* @param string $idcolumn
* @param string $idvalue
* @param string $title
* @param string $content
*/
function qa_db_meta_set($metatable, $idcolumn, $idvalue, $title, $content)
{
......@@ -189,10 +189,10 @@ function qa_db_meta_set($metatable, $idcolumn, $idvalue, $title, $content)
/**
* Internal general function to clear metadata
* @param $metatable
* @param $idcolumn
* @param $idvalue
* @param $title
* @param string $metatable
* @param string $idcolumn
* @param string $idvalue
* @param string|array $title
*/
function qa_db_meta_clear($metatable, $idcolumn, $idvalue, $title)
{
......@@ -214,11 +214,11 @@ function qa_db_meta_clear($metatable, $idcolumn, $idvalue, $title)
/**
* Internal general function to return metadata
* @param $metatable
* @param $idcolumn
* @param $idvalue
* @param $title
* @return array|mixed|null
* @param string $metatable
* @param string $idcolumn
* @param string $idvalue
* @param string|array $title
* @return mixed
*/
function qa_db_meta_get($metatable, $idcolumn, $idvalue, $title)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment