本文整理汇总了PHP中D::stack方法的典型用法代码示例。如果您正苦于以下问题:PHP D::stack方法的具体用法?PHP D::stack怎么用?PHP D::stack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D
的用法示例。
在下文中一共展示了D::stack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
function query($sql, $returnType=null) {
if($this->prepared == false) {
$this->prepare($sql);
}
//echo "\n SQL call = " . $sql . "\n";
$this->queries[] = $sql;
// $this->result = $this->connection->query($sql);
D::log("\n" . $sql, 'SQL call');
$this->result = mysql_query($sql, $this->connection);
$this->prepared = false;
if(!$this->result) {
D::stack();
D::log(mysql_error($this->connection), 'SQL Errors');
return false;
}
$returnArray = array();
/* @todo
get rid of this switch and use an array of functions instead.
*/
if(!isset($returnType)) {
return true;
}
switch ($returnType) {
case 'object':
if(!is_resource($this->result)) {
D::stackTrace();
}
while($row = mysql_fetch_object($this->result)) {
$returnArray[] = $row;
}
return $returnArray;
break;
case 'assoc':
while($row = mysql_fetch_assoc($this->result)) {
$returnArray[] = $row;
}
return $returnArray;
break;
case 'driver':
return $this->result;
break;
case 'raw':
return $this->result;
break;
default:
return true;
}
}
示例2: _buildPull
function _buildPull($pull, $pullRel, $tableName, $lfName=null, $rfName=null) {
$select = $join = array();
//JOIN CODE:
if(is_array($tableName)) {
$tableName = join('$', ($tableName));
}
if(is_array($lfName)) {
//D::log($pull, '$pull aka $k');
//D::log($lfName, 'lfName');
D::stack('is_array($lfName)');
}
$join[$this->tableName . ' AS ' . $pull] = array(
$tableName . '.' . $lfName => $pull . '.' . $rfName
);
//SELECT CODE:
foreach(array_keys($this->fields) as $field) {
//$select[$pull . '.' . $field] = str_replace('$', '.', $pull) . '.' . $field;
$select[str_replace('$', '.', $pull) . '.' . $field] = $pull . '.' . $field;
}
// D::log($select, 'built select');
return array(
'join' => $join,
'select' => $select
);
}
示例3: warn
static function warn($warning='Warning') {
//D::show('WHAT');
if(self::$config['warnings']) {
if(!extension_loaded('xdebug')) {
D::show(D::stack(), $warning);
}
trigger_error($warning);
}
}