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'; ...@@ -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 * Create (or replace) the item ($type, $cacheid) in the database cache table with $content
* @param $type * @param string $type
* @param $cacheid * @param string $cacheid
* @param $content * @param string $content
* @return mixed * @return mixed
*/ */
function qa_db_cache_set($type, $cacheid, $content) function qa_db_cache_set($type, $cacheid, $content)
...@@ -53,8 +53,8 @@ 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 * Retrieve the item ($type, $cacheid) from the database cache table
* @param $type * @param string $type
* @param $cacheid * @param string $cacheid
* @return mixed|null * @return mixed|null
*/ */
function qa_db_cache_get($type, $cacheid) function qa_db_cache_get($type, $cacheid)
......
...@@ -29,6 +29,7 @@ define('QA_DB_VERSION_CURRENT', 67); ...@@ -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 the column type for user ids after verifying it is one of the legal options
* @return string
*/ */
function qa_db_user_column_type_verify() function qa_db_user_column_type_verify()
{ {
...@@ -59,6 +60,7 @@ 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) * 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. * 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() function qa_db_table_definitions()
{ {
...@@ -539,7 +541,7 @@ function qa_db_table_definitions() ...@@ -539,7 +541,7 @@ function qa_db_table_definitions()
/** /**
* Return array with all values from $array as keys * Return array with all values from $array as keys
* @param $array * @param array $array
* @return array * @return array
*/ */
function qa_array_to_keys($array) function qa_array_to_keys($array)
...@@ -550,7 +552,7 @@ 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] * Return a list of tables missing from the database, [table name] => [column/index definitions]
* @param $definitions * @param array $definitions
* @return array * @return array
*/ */
function qa_db_missing_tables($definitions) function qa_db_missing_tables($definitions)
...@@ -569,8 +571,8 @@ 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 * Return a list of columns missing from $table in the database, given the full definition set in $definition
* @param $table * @param string $table
* @param $definition * @param array $definition
* @return array * @return array
*/ */
function qa_db_missing_columns($table, $definition) function qa_db_missing_columns($table, $definition)
...@@ -589,6 +591,7 @@ 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 the current version of the Q2A database, to determine need for DB upgrades
* @return int|null
*/ */
function qa_db_get_db_version() function qa_db_get_db_version()
{ {
...@@ -607,7 +610,7 @@ function qa_db_get_db_version() ...@@ -607,7 +610,7 @@ function qa_db_get_db_version()
/** /**
* Set the current version in the database * Set the current version in the database
* @param $version * @param int $version
*/ */
function qa_db_set_db_version($version) function qa_db_set_db_version($version)
{ {
...@@ -619,6 +622,7 @@ 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 a string describing what is wrong with the database, or false if everything is just fine
* @return false|string
*/ */
function qa_db_check_tables() function qa_db_check_tables()
{ {
...@@ -703,8 +707,8 @@ function qa_db_install_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() * Return the SQL command to create a table with $rawname and $definition obtained from qa_db_table_definitions()
* @param $rawname * @param string $rawname
* @param $definition * @param array $definition
* @return string * @return string
*/ */
function qa_db_create_table_sql($rawname, $definition) function qa_db_create_table_sql($rawname, $definition)
...@@ -720,6 +724,7 @@ 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 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() function qa_db_default_userfields_sql()
{ {
...@@ -1629,9 +1634,9 @@ function qa_db_upgrade_tables() ...@@ -1629,9 +1634,9 @@ function qa_db_upgrade_tables()
/** /**
* Reset the definitions of $columns in $table according to the $definitions array * Reset the definitions of $columns in $table according to the $definitions array
* @param $definitions * @param array $definitions
* @param $table * @param string $table
* @param $columns * @param array $columns
*/ */
function qa_db_upgrade_table_columns($definitions, $table, $columns) function qa_db_upgrade_table_columns($definitions, $table, $columns)
{ {
...@@ -1646,7 +1651,7 @@ 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 * Perform upgrade $query and output progress to the browser
* @param $query * @param string $query
*/ */
function qa_db_upgrade_query($query) function qa_db_upgrade_query($query)
{ {
...@@ -1657,7 +1662,7 @@ 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 * 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) function qa_db_upgrade_progress($text)
{ {
......
...@@ -27,9 +27,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly ...@@ -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. * Set the metadata for user $userid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $userid * @param mixed $userid
* @param $key * @param string $key
* @param $value * @param string $value
*/ */
function qa_db_usermeta_set($userid, $key, $value) function qa_db_usermeta_set($userid, $key, $value)
{ {
...@@ -39,8 +39,8 @@ 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) * Clear the metadata for user $userid with $key ($key can also be an array of keys)
* @param $userid * @param mixed $userid
* @param $key * @param string $key
*/ */
function qa_db_usermeta_clear($userid, $key) function qa_db_usermeta_clear($userid, $key)
{ {
...@@ -51,8 +51,8 @@ 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 * 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). * returns an array of metadata key => value).
* @param $userid * @param mixed $userid
* @param $key * @param string $key
* @return array|mixed|null * @return array|mixed|null
*/ */
function qa_db_usermeta_get($userid, $key) function qa_db_usermeta_get($userid, $key)
...@@ -63,9 +63,9 @@ 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. * Set the metadata for post $postid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $postid * @param int $postid
* @param $key * @param string $key
* @param $value * @param string $value
*/ */
function qa_db_postmeta_set($postid, $key, $value) function qa_db_postmeta_set($postid, $key, $value)
{ {
...@@ -75,8 +75,8 @@ 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) * Clear the metadata for post $postid with $key ($key can also be an array of keys)
* @param $postid * @param int $postid
* @param $key * @param string $key
*/ */
function qa_db_postmeta_clear($postid, $key) function qa_db_postmeta_clear($postid, $key)
{ {
...@@ -87,8 +87,8 @@ 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 * 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). * returns an array of metadata key => value).
* @param $postid * @param int $postid
* @param $key * @param string $key
* @return array|mixed|null * @return array|mixed|null
*/ */
function qa_db_postmeta_get($postid, $key) function qa_db_postmeta_get($postid, $key)
...@@ -99,9 +99,9 @@ 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. * Set the metadata for category $categoryid with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $categoryid * @param int $categoryid
* @param $key * @param string $key
* @param $value * @param string $value
*/ */
function qa_db_categorymeta_set($categoryid, $key, $value) function qa_db_categorymeta_set($categoryid, $key, $value)
{ {
...@@ -111,8 +111,8 @@ 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) * Clear the metadata for category $categoryid with $key ($key can also be an array of keys)
* @param $categoryid * @param int $categoryid
* @param $key * @param string $key
*/ */
function qa_db_categorymeta_clear($categoryid, $key) function qa_db_categorymeta_clear($categoryid, $key)
{ {
...@@ -123,8 +123,8 @@ 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 * 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). * case this returns an array of metadata key => value).
* @param $categoryid * @param int $categoryid
* @param $key * @param string $key
* @return array|mixed|null * @return array|mixed|null
*/ */
function qa_db_categorymeta_get($categoryid, $key) function qa_db_categorymeta_get($categoryid, $key)
...@@ -135,9 +135,9 @@ 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. * Set the metadata for tag $tag with $key to $value. Keys beginning qa_ are reserved for the Q2A core.
* @param $tag * @param string $tag
* @param $key * @param string $key
* @param $value * @param string $value
*/ */
function qa_db_tagmeta_set($tag, $key, $value) function qa_db_tagmeta_set($tag, $key, $value)
{ {
...@@ -147,8 +147,8 @@ 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) * Clear the metadata for tag $tag with $key ($key can also be an array of keys)
* @param $tag * @param string $tag
* @param $key * @param string $key
*/ */
function qa_db_tagmeta_clear($tag, $key) function qa_db_tagmeta_clear($tag, $key)
{ {
...@@ -159,9 +159,9 @@ 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 * 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). * returns an array of metadata key => value).
* @param $tag * @param string $tag
* @param $key * @param string $key
* @return array|mixed|null * @return mixed
*/ */
function qa_db_tagmeta_get($tag, $key) function qa_db_tagmeta_get($tag, $key)
{ {
...@@ -171,11 +171,11 @@ function qa_db_tagmeta_get($tag, $key) ...@@ -171,11 +171,11 @@ function qa_db_tagmeta_get($tag, $key)
/** /**
* Internal general function to set metadata * Internal general function to set metadata
* @param $metatable * @param string $metatable
* @param $idcolumn * @param string $idcolumn
* @param $idvalue * @param string $idvalue
* @param $title * @param string $title
* @param $content * @param string $content
*/ */
function qa_db_meta_set($metatable, $idcolumn, $idvalue, $title, $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) ...@@ -189,10 +189,10 @@ function qa_db_meta_set($metatable, $idcolumn, $idvalue, $title, $content)
/** /**
* Internal general function to clear metadata * Internal general function to clear metadata
* @param $metatable * @param string $metatable
* @param $idcolumn * @param string $idcolumn
* @param $idvalue * @param string $idvalue
* @param $title * @param string|array $title
*/ */
function qa_db_meta_clear($metatable, $idcolumn, $idvalue, $title) function qa_db_meta_clear($metatable, $idcolumn, $idvalue, $title)
{ {
...@@ -214,11 +214,11 @@ 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 * Internal general function to return metadata
* @param $metatable * @param string $metatable
* @param $idcolumn * @param string $idcolumn
* @param $idvalue * @param string $idvalue
* @param $title * @param string|array $title
* @return array|mixed|null * @return mixed
*/ */
function qa_db_meta_get($metatable, $idcolumn, $idvalue, $title) 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