本文整理汇总了PHP中var_Dump函数的典型用法代码示例。如果您正苦于以下问题:PHP var_Dump函数的具体用法?PHP var_Dump怎么用?PHP var_Dump使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了var_Dump函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportPdfAction
public function exportPdfAction()
{
/*$this->loadLayout()->_setActiveMenu('Iways/Assistant/Overview')
->_title('Iways Assistant / ' . $this->__('Overview'));
$modules = $this->helper->getLoadedModules('Iways', 'local');
if ($extend = Mage::getStoreConfig('Iways_Assistant/General/Extend')) {
foreach (explode(",", $extend) as $module)
$modules = array_merge($modules,
$this->helper->getLoadedModules(trim($module)));
}
$block = $this->getLayout()
->createBlock('Iways_Assistant/adminhtml_assistant_overview',
'',
array('modules' => $modules))
->setTemplate('iways_assistant/overview.phtml');
$this->_addContent($block);
$this->renderLayout();*/
var_Dump("TEST!");
die;
$fileName = 'orders.csv';
$grid = $this->getLayout()->createBlock('adminhtml/sales_order_grid');
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
}
示例2: test
function test()
{
$database = model::factory('database');
$r = $database->safe_query('select * from user where user_id in :user_id', array('user_id' => array(329, 339)));
var_Dump($r);
var_dump($r->fetchAll());
}
示例3: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Starting to fetch github-Usernames');
$data = parse_ini_file(__DIR__ . '/../../../.env');
$pdo = new \PDO('mysql:dbname=' . $data['DB_DBNAME'] . ';host=' . $data['DB_HOSTNAME'], $data['DB_USERNAME'], $data['DB_PASSWORD']);
$select = $pdo->prepare('SELECT * FROM `users` WHERE `githubName` = ""');
$update = $pdo->prepare('UPDATE `users` SET `githubName`= :githubName WHERE githubUid = :githubUid');
$select->execute();
$result = $select->fetchAll();
foreach ($result as $row) {
$output->writeln(sprintf('Fetching username for user %s (%s)', $row['githubUid'], $row['name']));
$ch = curl_init('https://api.github.com/users?per_page=1&since=' . ($row['githubUid'] - 1));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('User-Agent: PHPMentoring-App'));
$info = curl_exec($ch);
// get curl response
curl_close($ch);
var_Dump($info);
$info = json_decode($info, true);
var_Dump($info);
if (!isset($info[0])) {
throw new \Exception('Transport Error occured');
}
$update->execute(array(':githubUid' => $row['githubUid'], ':githubName' => $info[0]['login']));
}
$output->writeln('Finished');
}
示例4: dump
function dump()
{
if ($this->curfunc) {
var_Dump($this->curfunc);
}
echo "Profiling period: " . ($this->profstart - $this->api->start_time) . ' .. ' . (time() + microtime() - $this->api->start_time) . '<br/>';
echo "Profiled (ms): <b>" . round(1000 * (time() + microtime() - $this->profstart - $this->timetable['Profiling']['total']), 2) . '</b><br/>';
uasort($this->timetable, function ($l, $r) {
$l = $l['total'];
///$l['calls'];
$r = $r['total'];
///$r['calls'];
if ($l > $r) {
return -1;
}
if ($l < $r) {
return 1;
}
});
$x = 0;
foreach ($this->timetable as $activity => $detail) {
if ($activity == 'Profiling') {
$activity = '<font color="gray">' . $activity . '</font>';
$detail['calls'] = $this->calls * 2;
}
$x += $detail['total'];
echo '+' . number_format($detail['total'] * 1000, 2) . ' ' . $activity . ' x ' . $detail['calls'] . '<br/>';
}
}
示例5: createFatalRedirectRequest
function createFatalRedirectRequest(ezcMvcRequest $request, ezcMvcResult $result, Exception $response)
{
var_Dump($request);
$req = clone $request;
$req->uri = '/FATAL';
return $req;
}
示例6: tesdt
function tesdt()
{
$tab = array('sdaf' => 'dsafad');
$tab[] = 'safas';
$tab[] = $tab;
$tab['wtf'] = new KontoBankMillenium();
var_Dump($tab);
}
示例7: __invoke
public function __invoke($str, $find)
{
var_Dump($this->view->basePath());
if (!is_string($str)) {
return 'must be string';
}
if (strpos($str, $find) === false) {
return 'not found';
}
return 'found';
}
示例8: testMain
public function testMain()
{
$b = Browser::create()->get('http://localhost')->get('http://localhost')->get('http://localhost')->get('http://localhost')->get('http://localhost')->get('http://localhost');
// 結果
foreach ($b->getResults() as $r) {
echo $r->header();
echo strip_tags($r->body());
}
// クッキー
var_Dump($b->getCookie());
}
示例9: page_callback
function page_callback()
{
$r = $this->op->recall('result', null);
$this->op->forget('result');
$this->opauth = new \Opauth($this->config, false);
$response = $_SESSION['opauth'];
// Controller_Opauth or it's descendand (which you can tweak)
// will determine, what should be done upon successful initialization.
// See documentation of
if ($this->api->auth->opauth) {
$res = $this->op->callback($response, $this->opauth);
if (is_array($res) && isset($res['force_callback']) && $res['force_callback']) {
$r = $res;
} else {
$r = $r ?: $res;
}
} else {
$r = $r ?: 'dump';
}
if ($r === 'dump') {
echo '<h2>default_action is not specified fo OPauth Controller. Dumping...</h2>';
echo "<pre>";
var_Dump($response);
exit;
}
if (is_array($r) && isset($r['error'])) {
echo '<h2>Unable to authenticate</h2>';
echo "<p>" . htmlspecialchars($r['error']) . "</p>";
exit;
}
if ($r === 'close') {
echo '<script>window.opener.location.reload(true);window.close()</script>';
exit;
}
if (is_array($r) && isset($r['redirect_me'])) {
if ($r['redirect_me']['0'] == '/' && strlen($r['redirect_me']) != 1) {
header('Location: ' . $r['redirect_me']);
exit;
}
$this->api->redirect($r['redirect_me']);
}
if (is_array($r) && isset($r['redirect'])) {
echo '<script>window.opener.location="' . $this->api->url($r['redirect']) . '";window.close()</script>';
exit;
}
if (is_array($r) && isset($r['custom_script'])) {
echo $r['custom_script'];
exit;
}
$this->add('View_Info')->set('Authentication is successful, but no action is defined');
}
示例10: testMain
public function testMain()
{
// セットアップ
Nora::Configure(TEST_DIR, 'dev', ['config' => 'config/test']);
Nora::getService('logger')->err('エラーだよ');
$this->assertEquals(spl_object_hash(Nora::getService('logger')), spl_object_hash(Nora::getService('logger')));
// 既存クラスをサービスにする
Nora::setService('mysql', ['class' => 'PDO', 'params' => ['dsn' => 'mysql:dbname=test;host=127.0.0.1']]);
// サービスを読み込む
Nora::setService('hoge', ['callback' => function ($db) {
return $db;
}, 'params' => ['db' => '@mysql']]);
var_Dump(Nora::getService('hoge')->prepare('SHOW TABLES;')->fetch());
}
示例11: var_dump
function &getDB($bNew = false, $bPersistent = false)
{
// Get the database object
$oDB =& DB::connect(CONST_Database_DSN . ($bNew ? '?new_link=true' : ''), $bPersistent);
if (PEAR::IsError($oDB)) {
var_dump(CONST_Database_DSN);
var_Dump($oDB);
fail($oDB->getMessage());
}
$oDB->setFetchMode(DB_FETCHMODE_ASSOC);
$oDB->query("SET DateStyle TO 'sql,european'");
$oDB->query("SET client_encoding TO 'utf-8'");
return $oDB;
}
示例12: find
public function find($data, $find)
{
$dom = new DOMDocument();
@$dom->loadHTML($data);
$xpath = new DOMXPath($dom);
$elements = $xpath->evaluate($find);
var_Dump($elements);
die;
return $elements;
$urls = array();
foreach ($elements as $e) {
$url = $e->nodeValue;
$urls[] = $url;
}
return array_unique($urls);
}
示例13: test
function test()
{
echo "<pre>";
for ($x = 0; $x < 10; $x++) {
$n = rand(1, 100000);
echo "here";
$a = rand(1, 10000);
$b = rand(1, 10000);
$c = $a + 1;
$d = $b + 1;
echo "== {$n} {$a}, {$b}, {$c}, {$d} ==\n";
$c = $this->add('Controller_Roses');
$res = $c->solve($n, $a, $b, $c, $d);
var_dump($res);
var_Dump($c->distance);
}
}
示例14: page_index
function page_index($p) {
$tabs=$p->add('Tabs');
$p=$tabs->addTab('Jobs');
$crud=$p->add('CRUD');
$crud->setModel('Job_Admin',null,array('id','category','type','company','position','location',
'is_public','is_activated','expires_at','email'));
if($crud->grid){
$crud->grid->addPaginator();
$crud->grid->getColumn('type')->makeSortable();
$crud->grid->getColumn('location')->makeSortable();
$crud->grid->dq->field('description');
$crud->grid->addColumn('button','extend');
if($_GET['extend']){
$new_expires=$crud->grid->getModel()->loadData($_GET['extend'])
->extend()->get('expires_at');
$new_expires=date($this->api->getConfig('locale/date','d/m/Y'),
strtotime($new_expires));
$crud->grid->js(null,$crud->grid->js()->univ()->successMessage('Extended job #'.
$_GET['extend'].' till '.$new_expires))->reload()->execute();
}
$crud->grid->addQuickSearch(array('company','position','location','description'));
$action_form=$crud->add('Form',null,null,array('form_empty'));
$ids=$action_form->addField('hidden','ids');
$crud->grid->addSelectable($ids);
$d=$action_form->addSubmit('Delete Selected');
$d=$action_form->addSubmit('Extend Selected');
$action_form->onSubmit(function($f) use ($crud,$d){
$ids=json_decode($f->get('ids'));
//$m=$crud->grid->getModel()->dsql(null,false)->where('id in',$ids)->do_delete();
var_Dump($d->isClicked());
exit;
return $f->js(null,$crud->grid->js()->reload())
->univ()->successMessage('Success');
});
}
$p=$tabs->addTab('Categories')->add('CRUD')->setModel('Category');
}
示例15: run
/**
* Run a module controller method
* Output from module is buffered and returned.
**/
public static function run($module)
{
$method = 'index';
if (($pos = strrpos($module, '/')) != FALSE) {
$method = substr($module, $pos + 1);
$module = substr($module, 0, $pos);
}
if ($module == 'tasks/reviews') {
$class = self::load($module);
var_Dump(get_class_methods($class));
}
if ($class = self::load($module)) {
if (method_exists($class, $method)) {
ob_start();
$args = func_get_args();
$output = call_user_func_array(array($class, $method), array_slice($args, 1));
$buffer = ob_get_clean();
return $output !== NULL ? $output : $buffer;
}
}
log_message('error', "Module controller failed to run: {$module}/{$method}");
}