本文整理汇总了PHP中D::log方法的典型用法代码示例。如果您正苦于以下问题:PHP D::log方法的具体用法?PHP D::log怎么用?PHP D::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D
的用法示例。
在下文中一共展示了D::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
public function dispatch()
{
if (isset($this->_response)) {
return;
}
$response = null;
$output = '';
if (is_array($this->data)) {
$response = array();
foreach ($this->data as $d) {
$response[] = $this->rpc($d);
}
} else {
$response = $this->rpc($this->data);
}
if ($this->isForm && $this->isUpload) {
$json = json_encode($response);
$json = preg_replace("/"/", '\\"', $json);
$output .= '<html><body><textarea>';
$output .= $json;
$output .= '</textarea></body></html>';
} else {
$output = json_encode($response);
}
$this->_response = $output;
D::log("Response: " . $output);
return $output;
}
示例2: 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($sql, 'Sql call');
$this->result = mysql_query($sql, $this->connection);
$this->prepared = false;
if(!$this->result) {
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.
*/
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 'raw':
return $this->result;
break;
default:
return true;
}
}
示例3: set
function set($name) {
//@todo rename this to just set
$newPlace = 'app/themes/' . $name;
D::log(LOC . '/' . $newPlace, 'new Place');
if(is_dir(LOC . '/' . $newPlace)) {
if(substr(URL, -1) == '?') {
T::$url = $this->themeUrl = substr(URL, 0, -1) . $newPlace;
} else {
T::$url = $this->themeUrl = URL . $newPlace;
}
T::$loc = LOC . '/' . $newPlace;
//$this->libs->Config->set('site', 'theme', $newPlace);
return true;
} else {
D::error('Theme doesn\'t exist');
}
}
示例4: set
function set($name) {
//@todo rename this to just set
$newPlace = 'themes/' . $name;
D::log($name, 'Theme Set');
// D::log(URL, 'URL');
if(is_dir(APP_FOLDER . '/' . $newPlace)) {
if(defined('URL')) {
if(substr(URL, -1) == '?') {
T::$url = $this->themeUrl = substr(URL, 0, -1) . APP_NAME . '/' . $newPlace . '/';
} else {
T::$url = $this->themeUrl = URL . APP_NAME . '/' . $newPlace . '/';
}
}
T::$loc = $this->themeLoc = APP_FOLDER . '/' . $newPlace;
//$this->libs->Config->set('site', 'theme', $newPlace);
return true;
} else {
D::error('Theme doesn\'t exist');
}
}
示例5: query
function query($sql, $returnType) {
if($this->prepared == false) {
$this->prepare($sql);
}
//echo "\n SQL call = " . $sql . "\n";
$this->queries[] = $sql;
$this->result = $this->connection->query($sql);
//D::log($this->connection->error, 'db error');
D::log($sql, 'Sql call');
if(!empty($this->connection->error)) {
D::report('There is something wrong with the sql.', $this->connection->error);
}
$this->prepared = false;
//return $this->result->fetch_all(MYSQLI_ASSOC);
$return = array();
switch ($returnType){
case 'object':
while($value = $this->result->fetch_object()) {
$return[] = $value;
}
//D::log($return);
return $return;
case 'assoc':
while($value = $this->result->fetch_assoc()) {
$return[] = $value;
}
return $return;
case 'raw':
return $this->result;
default:
return true;
}
}
示例6: properJsonDecode
function properJsonDecode($json) {
//maybe if we check something on the left we can validate that the value on the right is actaully a value and not part of a string.
$return = json_decode(D::log(preg_replace('@"(\w*)"\s*:\s*(-?\d{9,})\s*([,|\}])@', '"$1":"$2"$3', $json), 'raw json') );
switch(json_last_error()) {
case JSON_ERROR_DEPTH:
$echo = ' - Maximum stack depth exceeded';
break;
case JSON_ERROR_CTRL_CHAR:
$echo = ' - Unexpected control character found';
break;
case JSON_ERROR_SYNTAX:
$echo = ' - Syntax error, malformed JSON';
break;
case JSON_ERROR_NONE:
$echo = ' - No errors';
break;
}
D::growl($echo, 'json error');
return $return;
}
示例7: save
function save() {
D::log('saving session');
// if($this->checkCookie()) {
D::log($this->_data, 'data');
foreach($this->_changed as $key) {
$this->libs->Query->update($this->libs->Config->get('Session', 'dataTableName'))->where(array('name' => $key, 'session' => $this->_id))->set(array('value' => serialize($this->_data[$key])))->go();
}
foreach($this->_new as $key) {
$this->libs->Query->insert(array('name' => $key, 'value' => serialize($this->_data[$key]), 'session' => $this->_id))->into($this->libs->Config->get('Session', 'dataTableName'))->go();
}
if(!empty($this->_flashRemove)) {
$this->libs->Query->delete()->where(array('name' => $this->_flashRemove, 'session' => $this->_id, 'flash' => 1))->from($this->libs->Config->get('Session', 'dataTableName'))->go();
}
// }
}
示例8: match
function match($pattern, $subject)
{
$matches = array();
D::log($subject, 'subject');
if (preg_match($pattern, $subject, $matches)) {
return $matches;
}
return null;
}
示例9: f
public function f($funcName, $args=array()) {
D::log(self::getCurrentDb(), 'current db');
return self::callFuncOnDb(self::getCurrentDb(), $funcName, $args);
}
示例10: ini_set
ini_set('always_populate_raw_post_data', 1);
$configFile = 'common/config.inc';
include_once "./alib/alib.inc";
global $debug, $config;
addIncludePath('./alib');
addIncludePath('./common');
addIncludePath('./php', TRUE);
include_once '../alib/iuser.inc';
include_once './common/functions.inc';
include_once './common/login.inc';
include_once './common/smartObjectDefs.inc';
// Connect to the db:
if (!is_object($db)) {
$db = new idb($config->mainDB);
}
D::log('db');
D::v($db);
$login = new $config->loginModule();
if ($login->loggedIn || $config->allowNonLoggedIn) {
global $user, $broker;
$broker = new broker();
} elseif (stristr($_SERVER['REQUEST_URI'], 'api')) {
$api = new publicAPI();
} else {
$template = new template($config->loginTemplate);
$template->set('title', $config->defaultTitle);
$template->set('appName', $config->appName);
$template->set('extLocation', $config->extLocation);
$template->set('self', $config->self);
if ($login->error && $login->error != 'Not logged in and not trying to log in.') {
$template->set('badLogin', TRUE);
示例11: array
<?php
echo B::xhtml5(array('head' => B::head(array('title' => 'SweetFramework Project Test')), 'body' => B::body(array('header' => B::header(array('title' => 'Dashboard', 'nav' => T::get('site/nav'))), 'content' => array(B::section(array('content' => array(B::h3(array('text' => 'Projects')), B::ul(array('items' => D::log(array_map(function ($v) {
return V::get('project/brief', array('project' => $v));
}, $projects), 'projects')))))), B::section(array('content' => array(B::h3(array('text' => 'Users')), B::ul(array('items' => D::log(array_map(function ($v) {
return V::get('users/brief', array('user' => $v));
}, M::Users()->limit(10)->all()), 'projects'))))))), 'footer' => B::footer(array('text' => 'Copyright ajcates ' . date('Y')))))));
示例12: stack
static function stack($label='Label') {
return D::log(
"\n" . join(
"\n",
array_reverse(array_map(
function($v) {
//)
return ' ' . $v['function'] . '();' . "\n →" . substr(substr(@$v['file'], strlen(realpath(LOC))), 1, -4) . ' | line:' . @$v['line'];
},
debug_backtrace()
))
),
$label . ' - Stack Trace'
);
}
示例13: _build
function _build() {
//puts all the stuff together in a magic happy fashion.
$sqlString = '';
switch ($this->_mode) {
case 'select':
//adds in our select values
D::log('hello');
$sqlString = 'SELECT ' . $this->_buildSelect() . "\n" . ' FROM ' . join(', ', (array)Query::$_fromValue) . $this->_buildJoins() . "\n" . $this->_buildWhereString($this->_whereValue) . $this->_buildOrderBy() . $this->_buildLimit();
break;
case 'update':
$sqlString = 'UPDATE ' . f_first(Query::$_fromValue) . "\n" . ' SET ' . $this->_buildSet($this->_setValue) . $this->_buildWhereString($this->_whereValue);
break;
case 'insert':
/*
f_reduce(
function($a, $b) {
return array_merge(array_keys((array)$b), array_keys((array)$a));
},
$this->_insert
);
*/
if(!is_array(f_first($this->_insert) )) {
$this->_insert = array($this->_insert);
}
$cols = array_map(function($v) { return Query::nullEscape($v, '`');}, array_keys(array_reduce($this->_insert, 'array_merge_recursive', array())));
$sqlString = 'INSERT INTO ' . f_first((array) Query::$_fromValue) . ' (' . join(', ', $cols) . ') VALUES ' . join(', ', f_map(
function($v) use($cols) {
return '(' . join(',', f_map(
function ($i) use ($v) {
$i = substr($i, 1, -1);
if(isset($v[$i])) {
return Query::nullEscape($v[$i]);
} else {
return 'null';
}
},
$cols
)) . ')';
},
D::log($this->_insert, 'raw incert')
));
break;
case 'delete':
$sqlString = 'DELETE FROM ' . join(', ', Query::$_fromValue) . $this->_buildWhereString($this->_whereValue);
break;
}
$this->sql = $sqlString;
D::log($this->sql, 'SQL Build');
return $this->sql;
}
示例14: _buildFind
function _buildFind($find=null) {
if(isset($find)) {
foreach($find as $k => $arg) {
if(is_int($k) && is_array($arg)) {
unset($find[$k]);
$find = array_merge($find, $this->_buildFind($arg));
} else if(is_string($k) && array_key_exists($k, $this->fields)) {
unset($find[$k]);
$find[$this->tableName . '.' . $k] = $arg;
} else if(is_numeric($arg)) {
unset($find[$k]);
$find[$this->tableName . '.' . $this->pk] = $arg;
}
}
}
D::log($find, 'FINDERS FEE');
return $find;
}
示例15: regexArray
function regexArray($regexs)
{
$matches = array();
D::log($_SERVER['QUERY_STRING']);
foreach ($regexs as $regex => $func) {
preg_match_all($regex, $_SERVER['QUERY_STRING'], $matches);
if (f_first($matches)) {
return f_push(array($func), f_map('f_first', f_rest($matches)));
}
}
return false;
}