本文整理汇总了PHP中dumper函数的典型用法代码示例。如果您正苦于以下问题:PHP dumper函数的具体用法?PHP dumper怎么用?PHP dumper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dumper函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_nsid
function _get_nsid($flickr_user, $more = array())
{
# TO DO: put this all in a function somewhere and
# call/queue it when a user signs up...
# As db_main:Users
$user = users_get_by_id($flickr_user['user_id']);
if (!$user) {
return;
}
$method = 'flickr.people.getInfo';
$args = array('user_id' => $flickr_user['nsid']);
$ret = flickr_api_call($method, $args);
if (!$ret['ok']) {
dumper($args);
dumper($ret);
return;
}
$rsp = $ret['rsp']['person'];
$path_alias = $rsp['path_alias'];
$username = $rsp['username']['_content'];
echo "[{$user['id']}] path alias: {$path_alias} screen name: {$username}\n";
if ($path_alias != $flickr_user['path_alias']) {
$update = array('path_alias' => $path_alias);
$rsp = flickr_users_update_user($flickr_user, $update);
echo "[{$user['id']}] update path alias: {$rsp['ok']}\n";
# just let this fail silently if there's a duplicate
flickr_users_path_aliases_create($user, $path_alias);
}
if ($username != $user['username']) {
$update = array('username' => $username);
$rsp = users_update_user($user, $update);
echo "[{$user['id']}] update username: {$rsp['ok']}\n";
}
}
示例2: dump
function dump()
{
$s = $this->smarty;
unset($this->smarty);
dumper($this);
$this->smarty = $s;
}
示例3: sender
public function sender($to, $subject, $message, $html = false, $reply_to = false, $name = false)
{
$to = trim($to);
$debug = $this->debug;
if ($reply_to == '') {
$reply_to = false;
}
if ($name == '') {
$name = false;
}
if (!$reply_to) {
$reply_to = 'noreply@bangbot.net';
}
$this->load->library('Amazon_ses');
$this->amazon_ses->debug($debug);
$this->amazon_ses->to($to);
$this->amazon_ses->subject($subject);
if ($name) {
$this->amazon_ses->from($reply_to, $name);
} else {
$this->amazon_ses->from($reply_to);
}
if ($html) {
$this->amazon_ses->message($html);
}
$this->amazon_ses->message_alt($message);
// $this->amazon_ses->message($message);
if ($debug) {
$ret = PHP_EOL . 'reply_to: ' . $reply_to . PHP_EOL;
$ret .= 'name: ' . $name . PHP_EOL;
$ret .= 'to: ' . $to . PHP_EOL;
$ret .= 'subject: ' . $subject . PHP_EOL;
$ret .= 'message: ' . $message . PHP_EOL;
$ret .= 'html: ' . $html . PHP_EOL;
$ret .= 'SES debug: ' . $this->amazon_ses->send();
dumper($ret);
} else {
// log the despatch
// $param['to'] = $to;
// $param['subject'] = $to;
// $param['reply_to'] = $to;
// $param['name'] = $to;
// $param['message'] = $to;
// $param['html'] = $to;
// $this->db->insert('email_log', $param);
$ret = $this->amazon_ses->send();
}
return $ret;
}
示例4: index
/**
* default method
*/
public function index()
{
if (isset($_SESSION['__sessiondata']['loggedin'])) {
$this->initDB();
try {
$stmt = $this->DB->prepare("SELECT id, service, username, image, active, created FROM socialaccounts WHERE user_id = :userid AND service = 'twitter'");
$stmt->execute(array(':userid' => $_SESSION['__sessiondata']['user_id']));
$this->services = $stmt->fetchAll();
} catch (Exception $e) {
dumper($e->getMessage());
return FALSE;
}
}
//dumper($_SERVER);
}
示例5: cmd_option
public function cmd_option($args = null)
{
$cnt = null === $args ? 0 : count($args);
$opts = $this->option();
if ($opts == null) {
logger("Crap, something when wrong!\n");
return -1;
}
switch ($cnt) {
case 1:
case 2:
case 3:
default:
dumper($opts);
break;
case 4:
$opt = $this->option($args[2], $args[3]);
logger(sprintf("%30s => %s\n", $args[2], $opt[$args[2]]));
break;
}
return 0;
}
示例6: cmd_admin
/**
* Break these into get, update and insert to avoid confusion?
*/
public function cmd_admin($args = null)
{
global $mongo;
$update = false;
$admin = $this->_mysql_admin;
$col = $mongo->get_collection('mysql', $admin, $admin['host']);
$adm = $col->findOne();
dumper($adm);
$this->_mysql_admin = $adm;
if ($args == null || count($args) < 3) {
return $adm;
}
$admin = array();
// If we have extra args we are going to update the config DB
foreach ($args as $a) {
if ($a === 'mwp' || $a === 'mysql' || $a === 'admin') {
continue;
}
$f = explode('=', $a);
$admin[$f[0]] = $f[1];
$update = true;
}
if (!array_key_exists('host', $admin)) {
$admin['host'] = 'localhsot';
}
$newadm = null;
// If $args count is > 2 we are updating something
if (count($args) > 2) {
print "Is being changed to ...\n\n";
$newadm = $col->findAndModify(array('_id' => $adm['_id']), array('$set' => $admin), null, array('new' => true));
$this->_mysql_admin = $newadm;
dumper($newadm);
}
return $newadm;
}
示例7: secret
public function secret()
{
$db['username'] = $this->db->username;
$db['password'] = $this->db->password;
$db['database'] = $this->db->database;
$db['hostname'] = $this->db->hostname;
echo "DB:";
dumper($db);
}
示例8: delegateMessage
public function delegateMessage()
{
$GLOBALS['renderingTime'] = FALSE;
$GLOBALS['renderPiwik'] = FALSE;
$this->renderDefault = FALSE;
if (isset($_SESSION['__sessiondata']['loggedin']) && $_SESSION['__sessiondata']['loggedin']) {
//dumper($_SESSION);
if (isset($this->postdata)) {
dumper($this->postdata);
if (isset($this->postdata['twitterUser'])) {
$inQuery = implode(',', array_fill(0, count($this->postdata['twitterUser']), '?'));
$this->initDB();
try {
$stmt = $this->DB->prepare("SELECT token, token_secret FROM socialaccounts WHERE user_id = ? AND service = 'twitter' AND username IN({$inQuery})");
$stmt->bindValue(1, $_SESSION['__sessiondata']['user_id']);
foreach ($this->postdata['twitterUser'] as $k => $id) {
$stmt->bindValue($k + 2, $id);
}
$stmt->execute();
$row = $stmt->fetchAll();
} catch (Exception $e) {
dumper($e->getMessage());
return FALSE;
}
try {
$this->twitter = new Services_Twitter();
foreach ($row as $r) {
$oauth = new HTTP_OAuth_Consumer(CONSUMER_KEY, CONSUMER_SECRET, $r['token'], $r['token_secret']);
$this->twitter->setOAuth($oauth);
$msg = $this->twitter->statuses->update($this->postdata['message']);
dumper($msg);
}
} catch (Services_Twitter_Exception $e) {
dumper($e->getMessage());
}
}
}
}
}
示例9: loadlib
include "include/init.php";
loadlib("flickr_api");
loadlib("flickr_users");
if (!$GLOBALS['cfg']['user']['id']) {
error_404();
}
$flickr_user = flickr_users_get_by_user_id($GLOBALS['cfg']['user']['id']);
$method = 'flickr.activity.recentActivity';
$args = array('auth_token' => $flickr_user['auth_token']);
$rsp = flickr_api_call($method, $args);
# dumper($rsp);
# exit;
$items = $rsp['rsp']['items']['item'];
foreach ($items as $item) {
$subject = $item['type'];
$title = $item['title']['_content'];
$owner = $item['ownername'];
foreach ($item['activity']['event'] as $event) {
$action = $event['type'];
$actor = $event['username'];
$when = date("c", $event['dateadded']);
dumper($event);
$e = sprintf("%s %s-ed %s's %s at %s", $actor, $action, $owner, $subject, $when);
echo "{$e} <br />";
if ($action == 'comment') {
echo "<q>{$event['_content']}</q><br />";
}
}
}
$GLOBALS['smarty']->display("page_recent_activity.txt");
exit;
示例10: array
<?php
require 'HTML_To_Markdown.php';
$config['db'] = 'db_name';
$config['user'] = 'username';
$config['pass'] = 'password';
$config['host'] = '127.0.0.1';
$config['prefix'] = 'wp';
$config['old_wp_url'] = array('http://robotys.net', 'http://localhost/robotys');
// $config['old_wp_content_dir'] = 'http://robotys.net/wp-content/uploads';
// connect to database
$conn = new mysqli($config['host'], $config['user'], $config['pass'], $config['db']);
// $conn = new mysqli('127.0.0.1', 'root', 'root', 'robotys');
// check connection
if ($conn->connect_error) {
dumper('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
}
// dumper($conn);
$sql = 'SELECT post_title, post_name, post_date_gmt, post_status, post_content FROM `' . $config['prefix'] . '_posts` WHERE post_status = "publish" AND post_content != ""';
$rs = $conn->query($sql);
if ($rs === false) {
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
} else {
$rows_returned = $rs->num_rows;
// dumper($rs->fetch_assoc());
while ($row = $rs->fetch_assoc()) {
// process the posts
$date = date('Y-m-d', strtotime($row['post_date_gmt']));
$filename = $row['post_name'] . '.md';
if ($row['post_status'] == 'publish') {
$filename = $date . '-' . $filename;
示例11: dumper
<?php
#
# $Id$
#
include '../include/init.php';
echo "<h1>http://google.com (should 304)</h1>";
dumper(http_get("http://google.com"));
echo "<h1>http://www.google.com (should 200)</h1>";
dumper(http_get("http://www.google.com"));
示例12: test
public static function test()
{
dumper('test ok');
}
示例13: dirname
<?php
$root = dirname(dirname(__FILE__));
ini_set("include_path", "{$root}/www:{$root}/www/include");
set_time_limit(0);
#
include "include/init.php";
loadlib("flickr_backups");
# log_add_handler('debug', 'error_log');
if (!$GLOBALS['cfg']['enable_feature_backups']) {
echo "backups are currently disabled\n";
exit;
}
foreach (flickr_backups_users() as $user) {
$rsp = flickr_backups_get_photos($user);
dumper($rsp);
}
示例14: testing
public function testing()
{
// $this->load->model('Purchase');
// $purchase = $this->Purchase->get_details('49f463320a796a9a443157780d29d585');
// dumper($purchase['item_download_link']);
require 'application/libraries/Mixpanel/Mixpanel.php';
// dumper(scandir('./application/libraries/Mixpanel'));
// $this->load->library('Mixpanel/Mixpanel.php', 'a50829b5f6db182b5dafa61c12baa58b');
// get the Mixpanel class instance, replace with your
// project token
$mp = Mixpanel::getInstance("a50829b5f6db182b5dafa61c12baa58b");
// track an event
// $mp->identify('robotys@2gmail.com');
dumper($mp->track("testing library", array("label" => "dev-test")));
}
示例15: dumper
<?php
## пример использования dumper()
require_once "dumper.php";
dumper(&$GLOBALS);