当前位置: 首页>>代码示例>>PHP>>正文


PHP var_Dump函数代码示例

本文整理汇总了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());
 }
开发者ID:TheB3Rt0z,项目名称:assistance,代码行数:28,代码来源:GridPlusController.php

示例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());
 }
开发者ID:tinyMrChaos,项目名称:hephaestus,代码行数:7,代码来源:dev.php

示例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');
 }
开发者ID:dw250100785,项目名称:webapp,代码行数:29,代码来源:AddMissingGithubUsernamesCommand.php

示例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/>';
     }
 }
开发者ID:xavoctechnocratspvtltd,项目名称:svc,代码行数:29,代码来源:Profiler.php

示例5: createFatalRedirectRequest

 function createFatalRedirectRequest(ezcMvcRequest $request, ezcMvcResult $result, Exception $response)
 {
     var_Dump($request);
     $req = clone $request;
     $req->uri = '/FATAL';
     return $req;
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:7,代码来源:config.php

示例6: tesdt

function tesdt()
{
    $tab = array('sdaf' => 'dsafad');
    $tab[] = 'safas';
    $tab[] = $tab;
    $tab['wtf'] = new KontoBankMillenium();
    var_Dump($tab);
}
开发者ID:sparrow41,项目名称:training,代码行数:8,代码来源:start.php

示例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';
 }
开发者ID:Patinger,项目名称:Browsergame,代码行数:11,代码来源:Findstring.php

示例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());
 }
开发者ID:hossy78,项目名称:nora,代码行数:11,代码来源:BrowserTest.php

示例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');
 }
开发者ID:romaninsh,项目名称:opauth,代码行数:51,代码来源:index.php

示例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());
 }
开发者ID:hossy78,项目名称:nora,代码行数:14,代码来源:NoraTest.php

示例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;
}
开发者ID:acand01x,项目名称:Nominatim,代码行数:14,代码来源:db.php

示例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);
 }
开发者ID:nike-17,项目名称:SiteRunner,代码行数:16,代码来源:Xpath.php

示例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);
     }
 }
开发者ID:romaninsh,项目名称:roses,代码行数:17,代码来源:RoseTester.php

示例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');
    }
开发者ID:romaninsh,项目名称:jobeet,代码行数:40,代码来源:Admin.php

示例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}");
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:26,代码来源:Modules.php


注:本文中的var_Dump函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。