本文整理汇总了PHP中vd函数的典型用法代码示例。如果您正苦于以下问题:PHP vd函数的具体用法?PHP vd怎么用?PHP vd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vd函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute($params)
{
//
// FUCK! Due limitations of STUPID Smarty I forced to use
// HTML_RESULT... DAMN!
//
$this->set_result_type(HTML_RESULT);
$this->set_result_tpl('bitpackage:debug/debug_sql.tpl');
// Init result
$result = '';
//
global $debugger;
$debugger->msg('SQL query: "' . $params . '"');
//
vd($params);
if (preg_match("/^select/i", trim($params))) {
global $gBitDb;
$qr = $gBitDb->mDb->query($params);
if (!$qr) {
$result = '<span class="dbgerror">' . $gBitDb->mDb->ErrorMsg() . '</span>';
} else {
// Check if result value an array or smth else
if (is_object($qr)) {
// Looks like 'SELECT...' return table to us...
// So our result will be 2 dimentional array
// with elements count and fields number for element
// as dimensions...
$first_time = true;
$result = '<table id="data">';
$result .= '<caption>SQL Results</caption>';
while ($res = $qr->fetchRow()) {
if ($first_time) {
// Form 1st element with field names
foreach ($res as $key => $val) {
$result .= '<td class="heading">' . $key . '</td>';
}
$first_time = false;
}
$result .= '<tr>';
// Repack one element into result array
$td_eo_class = true;
foreach ($res as $val) {
$result .= '<td class=' . ($td_eo_class ? "even" : "odd") . '>' . $val . '</td>';
$td_eo_class = !$td_eo_class;
}
//
$result .= '</tr>';
}
$result .= '</table>';
} else {
// Let PHP to dump result :)
$result = 'Query result: ' . print_r($qr, true);
}
}
} else {
$result = "Empty query to tiki DB";
}
//
return $result;
}
示例2: send
public function send($ids, $message)
{
$url = 'https://android.googleapis.com/gcm/send';
$fields = ['registration_ids' => $ids, 'data' => $message];
$headers = ['Authorization: key=' . Config::get('gcm.key.android'), 'Content-Type: application/json'];
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
// Execute post
$result = curl_exec($ch);
if ($result === false) {
return false;
}
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
vd($result);
vd(Config::get('gcm.key.android'));
return $status;
}
示例3: write
public function write($id, $data)
{
$key = $this->normalize($id);
vd($key);
$row = $this->db->firstOrCreate(['key' => $key])->setValue($data)->save();
return true;
}
示例4: getUser
public function getUser()
{
$dbTableUser = new Application_Model_DbTable_User();
$a = $this->self->select('id')->where('id == 33')->order('id ASC');
$a->fetchAll()->toArray();
vd($a);
}
示例5: init
public function init()
{
// Define some CLI options
$getopt = new Zend_Console_Getopt(array('withdata|w' => 'Load database with sample data', 'env|e-s' => 'Application environment for which to create database (defaults to development)', 'help|h' => 'Help -- usage message'));
try {
$getopt->parse();
} catch (Zend_Console_Getopt_Exception $e) {
// Bad options passed: report usage
echo $e->getUsageMessage();
return false;
}
// Initialize Zend_Application
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
// Initialize and retrieve DB resource
$bootstrap = $application->getBootstrap();
$bootstrap->bootstrap('db');
$dbAdapter = $bootstrap->getResource('db');
// let the user know whats going on (we are actually creating a
// database here)
if ('testing' != APPLICATION_ENV) {
echo 'Writing Database Guestbook in (control-c to cancel): ' . PHP_EOL;
for ($x = 5; $x > 0; $x--) {
echo $x . "\r";
sleep(1);
}
}
vd(1);
}
示例6: sendWelcomeEmail
public function sendWelcomeEmail(Request $request, $id)
{
$user = User::findOrFail($id);
$job = (new SendWelcomeEmail($user))->onQueue('emails');
$this->dispatch($job);
vd($user);
}
示例7: postAction
public function postAction()
{
$requestType = $this->getRequest()->getParam('requestType');
if ($params = $this->getRequest()->getParam('params')) {
foreach ($params as $key => $value) {
if (!$value) {
unset($params[$key]);
}
}
} else {
$params = array();
}
if ($options = $this->getRequest()->getParam('options')) {
foreach ($options as $key => $value) {
if (!$value) {
unset($options[$key]);
}
}
} else {
$options = array();
}
$time = microtime(true);
Mage::register('vd', 1);
$html = vd(Mage::helper('fitment/api')->request($requestType, $params, $options), true);
$time = round(microtime(true) - $time, 3);
$responseData = array('dump' => $html, 'time' => $time);
echo json_encode($responseData);
die;
}
示例8: action_index
public function action_index()
{
$entries = $this->size->find_all();
vd($entries);
$view = View::factory('admin/size-list');
$view->bind('entries', $entries);
$this->template->content = $view;
}
示例9: action_status
public function action_status()
{
$push = new PushConnection($this->config['gg']['number'], $this->config['gg']['login'], $this->config['gg']['password']);
vd($push);
$status = $push->setStatus('trwają testy, wkrótce zapraszam');
vd($status);
exit;
}
示例10: action_players
public function action_players()
{
$Player = new Model_Player();
$players = $Player->find_all(0, 0, array(array("status", '=', 1)), array("role"));
vd($players, 1);
$view = View::factory('panel/war_list');
$view->bind('wars', $wars);
$this->template->content = $view;
}
示例11: action_save
public function action_save()
{
$post = $this->request->post();
if (count($post)) {
vd($post);
$Oceny = new Model_Oceny();
$Oceny->add(array("points" => $post['points'], "steps" => json_encode($post['steps']), "created" => date("Y-m-d H:i:s")));
}
exit;
}
示例12: __call
public function __call($method, $arguments)
{
vd($method);
$function = [$this->cursor, $method];
$result = call_user_func_array($function, $arguments);
if ($result instanceof \MongoCursor) {
return $this;
}
return $result;
}
示例13: actionIndex
public function actionIndex()
{
$url = 'http://liverss.ru/';
//$url = 'https://news.yandex.ru/world.html';
//$url = 'https://news.yandex.ru/world.rss';
$rss = file_get_contents($url);
//$rss = simplexml_load_file($url); //Интерпретирует XML-файл в объект
vd($rss);
return $this->render('index', ['rss' => $rss]);
}
示例14: vdob
function vdob(&$v, $replace_n = false)
{
ob_start();
vd($v);
if ($replace_n) {
return str_replace("\n", '<br />', ob_get_clean());
} else {
return ob_get_clean();
}
}
示例15: register
public function register(Request $request)
{
vd($request);
die;
$filePath = '/img/avatar/' . uniqid() . $request->file['name'];
move_uploaded_file($request->file['tmp_name'], app()->basepath . '/public/' . $filePath);
$user = new User(['name' => $request->name, 'role' => $request->role, 'avatar' => $filePath]);
vd($user);
if ($user->save()) {
echo 'Hallo ' . $request->name;
} else {
echo 'Da lief was schief';
}
}