mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
PHPDoc updates
This commit is contained in:
@@ -20,10 +20,12 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
|
|
||||||
class eCLI
|
class eCLI
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provided a list of command line arguments, parse them in a unix manner.
|
* Provided a list of command line arguments, parse them in a unix manner.
|
||||||
* If no args are provided, will default to $_SERVER['argv']
|
* If no args are provided, will default to $_SERVER['argv']
|
||||||
*
|
*
|
||||||
|
* @param string $argv
|
||||||
* @return array arg values
|
* @return array arg values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -90,4 +92,3 @@ class eCLI
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
@@ -74,6 +74,8 @@ class e_db_mysql
|
|||||||
protected $mySQLdefaultdb;
|
protected $mySQLdefaultdb;
|
||||||
protected $mySQLport = 3306;
|
protected $mySQLport = 3306;
|
||||||
public $mySQLPrefix;
|
public $mySQLPrefix;
|
||||||
|
|
||||||
|
/** @var PDO */
|
||||||
protected $mySQLaccess;
|
protected $mySQLaccess;
|
||||||
public $mySQLresult;
|
public $mySQLresult;
|
||||||
public $mySQLrows;
|
public $mySQLrows;
|
||||||
@@ -408,6 +410,7 @@ class e_db_mysql
|
|||||||
{
|
{
|
||||||
if (E107_DEBUG_LEVEL > 0)
|
if (E107_DEBUG_LEVEL > 0)
|
||||||
{
|
{
|
||||||
|
/** @var e107_db_debug $db_debug */
|
||||||
global $db_debug;
|
global $db_debug;
|
||||||
$db_debug->Mark_Time($sMarker);
|
$db_debug->Mark_Time($sMarker);
|
||||||
}
|
}
|
||||||
@@ -452,7 +455,7 @@ class e_db_mysql
|
|||||||
* @param string $query['PREPARE'] PDO Format query.
|
* @param string $query['PREPARE'] PDO Format query.
|
||||||
*@param array $query['BIND'] eg. array['my_field'] = array('value'=>'whatever', 'type'=>'str');
|
*@param array $query['BIND'] eg. array['my_field'] = array('value'=>'whatever', 'type'=>'str');
|
||||||
* @param unknown $rli
|
* @param unknown $rli
|
||||||
* @return boolean | resource - as mysql_query() function.
|
* @return boolean|PDOStatement | resource - as mysql_query() function.
|
||||||
* FALSE indicates an error
|
* FALSE indicates an error
|
||||||
* For SELECT, SHOW, DESCRIBE, EXPLAIN and others returning a result set, returns a resource
|
* For SELECT, SHOW, DESCRIBE, EXPLAIN and others returning a result set, returns a resource
|
||||||
* TRUE indicates success in other cases
|
* TRUE indicates success in other cases
|
||||||
@@ -487,6 +490,7 @@ class e_db_mysql
|
|||||||
|
|
||||||
if(is_array($query) && !empty($query['PREPARE']) && !empty($query['BIND']))
|
if(is_array($query) && !empty($query['PREPARE']) && !empty($query['BIND']))
|
||||||
{
|
{
|
||||||
|
/** @var PDOStatement $prep */
|
||||||
$prep = $this->mySQLaccess->prepare($query['PREPARE']);
|
$prep = $this->mySQLaccess->prepare($query['PREPARE']);
|
||||||
foreach($query['BIND'] as $k=>$v)
|
foreach($query['BIND'] as $k=>$v)
|
||||||
{
|
{
|
||||||
@@ -513,6 +517,7 @@ class e_db_mysql
|
|||||||
|
|
||||||
if(preg_match('#^(CREATE TABLE|DROP TABLE|ALTER TABLE|RENAME TABLE|CREATE DATABASE|CREATE INDEX)#',$query, $matches))
|
if(preg_match('#^(CREATE TABLE|DROP TABLE|ALTER TABLE|RENAME TABLE|CREATE DATABASE|CREATE INDEX)#',$query, $matches))
|
||||||
{
|
{
|
||||||
|
/** @var PDO $rli */
|
||||||
$sQryRes = is_null($rli) ? $this->mySQLaccess->exec($query) : $rli->exec($query);
|
$sQryRes = is_null($rli) ? $this->mySQLaccess->exec($query) : $rli->exec($query);
|
||||||
|
|
||||||
if($sQryRes !==false)
|
if($sQryRes !==false)
|
||||||
@@ -523,6 +528,7 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/** @var PDO $rli */
|
||||||
$sQryRes = is_null($rli) ? $this->mySQLaccess->query($query) : $rli->query($query);
|
$sQryRes = is_null($rli) ? $this->mySQLaccess->query($query) : $rli->query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,7 +585,7 @@ class e_db_mysql
|
|||||||
|
|
||||||
if (E107_DEBUG_LEVEL)
|
if (E107_DEBUG_LEVEL)
|
||||||
{
|
{
|
||||||
|
/** @var $db_debug e107_db_debug */
|
||||||
global $db_debug;
|
global $db_debug;
|
||||||
$aTrace = debug_backtrace();
|
$aTrace = debug_backtrace();
|
||||||
$pTable = $this->mySQLcurTable;
|
$pTable = $this->mySQLcurTable;
|
||||||
@@ -608,10 +614,12 @@ class e_db_mysql
|
|||||||
|
|
||||||
if($this->pdo == true && $buglink instanceof PDO)
|
if($this->pdo == true && $buglink instanceof PDO)
|
||||||
{
|
{
|
||||||
|
|
||||||
$db_debug->Mark_Query($query, 'PDO', $sQryRes, $aTrace, $mytime, $pTable);
|
$db_debug->Mark_Query($query, 'PDO', $sQryRes, $aTrace, $mytime, $pTable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$db_debug->Mark_Query($query, $buglink, $sQryRes, $aTrace, $mytime, $pTable);
|
$db_debug->Mark_Query($query, $buglink, $sQryRes, $aTrace, $mytime, $pTable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -841,10 +849,12 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int Last insert ID or false on error. When using '_DUPLICATE_KEY_UPDATE' return ID, true on update, 0 on no change and false on error.
|
|
||||||
* @param string $tableName - Name of table to access, without any language or general DB prefix
|
* @param string $tableName - Name of table to access, without any language or general DB prefix
|
||||||
* @param string/array $arg
|
* @param $arg
|
||||||
* @param string $debug
|
* @param bool $debug
|
||||||
|
* @param string $log_type
|
||||||
|
* @param string $log_remark
|
||||||
|
* @return int Last insert ID or false on error. When using '_DUPLICATE_KEY_UPDATE' return ID, true on update, 0 on no change and false on error.
|
||||||
* @desc Insert a row into the table<br />
|
* @desc Insert a row into the table<br />
|
||||||
* <br />
|
* <br />
|
||||||
* Example:<br />
|
* Example:<br />
|
||||||
@@ -1055,7 +1065,9 @@ class e_db_mysql
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows = $this->mySQLrows = ($this->pdo) ? $this->mySQLresult->rowCount() : mysql_num_rows($this->mySQLresult);
|
/** @var PDOStatement $resource */
|
||||||
|
$resource = $this->mySQLresult;
|
||||||
|
$rows = $this->mySQLrows = ($this->pdo) ? $resource->rowCount() : mysql_num_rows($this->mySQLresult);
|
||||||
$this->dbError('db_Rows');
|
$this->dbError('db_Rows');
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
@@ -1075,10 +1087,12 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int Last insert ID or false on error
|
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @param array $arg
|
* @param array $arg
|
||||||
* @param string $debug
|
* @param bool $debug
|
||||||
|
* @param string $log_type
|
||||||
|
* @param string $log_remark
|
||||||
|
* @return int Last insert ID or false on error
|
||||||
* @desc Insert/REplace a row into the table<br />
|
* @desc Insert/REplace a row into the table<br />
|
||||||
* <br />
|
* <br />
|
||||||
* Example:<br />
|
* Example:<br />
|
||||||
@@ -1550,9 +1564,12 @@ class e_db_mysql
|
|||||||
|
|
||||||
|
|
||||||
$b = microtime();
|
$b = microtime();
|
||||||
|
|
||||||
if($this->mySQLresult)
|
if($this->mySQLresult)
|
||||||
{
|
{
|
||||||
$row = ($this->pdo) ? $this->mySQLresult->fetch($type) : @mysql_fetch_array($this->mySQLresult,$type);
|
/** @var PDOStatement $resource */
|
||||||
|
$resource = $this->mySQLresult;
|
||||||
|
$row = ($this->pdo) ? $resource->fetch($type) : @mysql_fetch_array($this->mySQLresult,$type);
|
||||||
e107::getSingleton('e107_traffic')->Bump('db_Fetch', $b);
|
e107::getSingleton('e107_traffic')->Bump('db_Fetch', $b);
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
@@ -1574,10 +1591,13 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int number of affected rows or false on error
|
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @param string $fields
|
* @param string $fields
|
||||||
* @param string $arg
|
* @param string $arg
|
||||||
|
* @param bool $debug
|
||||||
|
* @param string $log_type
|
||||||
|
* @param string $log_remark
|
||||||
|
* @return int number of affected rows or false on error
|
||||||
* @desc Count the number of rows in a select<br />
|
* @desc Count the number of rows in a select<br />
|
||||||
* <br />
|
* <br />
|
||||||
* Example:<br />
|
* Example:<br />
|
||||||
@@ -1786,7 +1806,9 @@ class e_db_mysql
|
|||||||
{ // Successful query which may return a row count (because it operated on a number of rows without returning a result set)
|
{ // Successful query which may return a row count (because it operated on a number of rows without returning a result set)
|
||||||
if(preg_match('#^(DELETE|INSERT|REPLACE|UPDATE)#',$query, $matches))
|
if(preg_match('#^(DELETE|INSERT|REPLACE|UPDATE)#',$query, $matches))
|
||||||
{ // Need to check mysql_affected_rows() - to return number of rows actually updated
|
{ // Need to check mysql_affected_rows() - to return number of rows actually updated
|
||||||
$tmp = ($this->pdo) ? $this->mySQLresult->rowCount() : mysql_affected_rows($this->mySQLaccess);
|
/** @var PDOStatement $resource */
|
||||||
|
$resource = $this->mySQLresult;
|
||||||
|
$tmp = ($this->pdo) ? $resource->rowCount() : mysql_affected_rows($this->mySQLaccess);
|
||||||
$this->dbError('db_Select_gen');
|
$this->dbError('db_Select_gen');
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
@@ -2259,7 +2281,9 @@ class e_db_mysql
|
|||||||
{
|
{
|
||||||
if($this->pdo)
|
if($this->pdo)
|
||||||
{
|
{
|
||||||
return $this->mySQLresult->columnCount();
|
/** @var PDOStatement $resource */
|
||||||
|
$resource = $this->mySQLresult;
|
||||||
|
return $resource->columnCount();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -858,7 +858,7 @@ class e_news_tree extends e_front_tree_model
|
|||||||
|
|
||||||
if(!empty($items))
|
if(!empty($items))
|
||||||
{
|
{
|
||||||
|
/** @var e_tree_model $news */
|
||||||
foreach ($items as $news)
|
foreach ($items as $news)
|
||||||
{
|
{
|
||||||
$d = $news->toArray();
|
$d = $news->toArray();
|
||||||
@@ -1038,7 +1038,7 @@ class e_news_category_tree extends e_front_tree_model
|
|||||||
* Load active categories only (containing active news items)
|
* Load active categories only (containing active news items)
|
||||||
*
|
*
|
||||||
* @param boolean $force
|
* @param boolean $force
|
||||||
* @return e_news_category_tree
|
* @return e_tree_model|e_news_category_tree
|
||||||
*/
|
*/
|
||||||
public function loadActive($force = false)
|
public function loadActive($force = false)
|
||||||
{
|
{
|
||||||
@@ -1100,7 +1100,7 @@ class e_news_category_tree extends e_front_tree_model
|
|||||||
$bullet = defined('BULLET') ? THEME_ABS.'images/'.BULLET : THEME_ABS.'images/bullet2.gif';
|
$bullet = defined('BULLET') ? THEME_ABS.'images/'.BULLET : THEME_ABS.'images/bullet2.gif';
|
||||||
$obj = new e_vars(array('bullet' => $bullet));
|
$obj = new e_vars(array('bullet' => $bullet));
|
||||||
|
|
||||||
|
/** @var e_tree_model $cat */
|
||||||
foreach ($this->getTree() as $cat)
|
foreach ($this->getTree() as $cat)
|
||||||
{
|
{
|
||||||
$obj->active = '';
|
$obj->active = '';
|
||||||
|
Reference in New Issue
Block a user