本文整理汇总了PHP中pr函数的典型用法代码示例。如果您正苦于以下问题:PHP pr函数的具体用法?PHP pr怎么用?PHP pr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_article_asc
public function get_article_asc()
{
$query = "SELECT * FROM Aset ORDER BY Aset_ID ASC LIMIT 2";
pr($query);
// $result = $this->fetch($query,0);
// return $result;
}
开发者ID:Gunadarma-Codecamp,项目名称:peer-portal,代码行数:7,代码来源:frontend.php
示例2: beforeFilter
/**
* beforeFilter
*
* @param \Cake\Event\Event $event Event instance
* @return void
*/
public function beforeFilter(Event $event)
{
pr("AppPlusPlus component beforeFilter()");
// no special action neeeded
if ($this->_controller->request->is('api')) {
return;
}
// Disallow access to actions that don't make sense after being logged in.
$allowed = ['Accounts' => ['login', 'lost_password', 'register']];
// return for now, until we integrate user model into plugin or require
// it in the application.
if (empty($this->_controller->Auth->user('id'))) {
return;
}
//if (!$this->_controller->AuthUser->id()) {
if (!$this->_controller->Auth->user('id')) {
return;
}
// disallow access to actions that don't make sense after the user has
// already logged in.
foreach ($allowed as $controller => $actions) {
if ($this->name === $controller && in_array($this->request->action, $actions)) {
$this->Flash->message('The page you tried to access is not relevant if you are already logged in. Redirected to main page.', 'info');
return $this->redirect($this->_controller->Auth->config('loginRedirect'));
}
}
}
开发者ID:alt3,项目名称:cakephp-app-configurator,代码行数:33,代码来源:AppPlusPlusComponent.php
示例3: createAction
public function createAction()
{
/**
$authentication = new AuthenticationService(Application $app);
$authentication->setController($controller);
$authentication->setEntityClass('\Application\Model\Entity\Client');
$auth = $this->get('service_locator')->locate('auth', $this);
excel = $this->get('service_locator')->locate('excel', $options);
$auth->get('token');
*/
$formBulder = $this->get('form.factory');
$client = new Client();
$ClientForm = $formBulder->createBuilder(new ClientType(), $client)->getForm();
$clientUser = new ClientUser();
$UserClientForm = $formBulder->createBuilder(new ClientUserType($this->get('doctrine.entity_manager')), $clientUser)->getForm();
$ClientForm->handleRequest($this->request);
$UserClientForm->handleRequest($this->request);
if ($this->request->isMethod('post')) {
pr($client);
pr($clientUser);
exit;
}
return $this->render('Application::Client::create', array('form_client' => $ClientForm->createView(), 'form_client_user' => $UserClientForm->createView()));
}
开发者ID:Luyanda86,项目名称:silex-playground,代码行数:28,代码来源:ClientsController+-+Copy+[2].php
示例4: __construct
public function __construct()
{
//session_start();
session_start();
$this->_db = DB::getInstance();
//$this->_sessionName = Config::get('session/session_name');
//$this->_cookieName = Config::get('remember/cookie_name');
$this->url = $this->parseUrl();
pr($this->parsedUrl);
//$this->constructCAV();
/*
require_once APP_PATH.DS.'controllers'.DS.$this->controller.'.php';
$this->controller = new $this->controller;
if (method_exists($this->controller, $this->method)
&& is_callable(array($this->controller, $this->method)))
{
call_user_func_array(array($this->controller,$this->method),array($this->param));
} else {
die_err(500,'err_50928');
}
*
*/
}
开发者ID:nanofelix,项目名称:sample-app2,代码行数:25,代码来源:App.php
示例5: processQueueCallback
/**
* ->processQueueCallback(function (\Dja\Db\Model\Metadata $metadata, \Doctrine\DBAL\Schema\Table $table, array $sql, \Doctrine\DBAL\Connection $db) {})
* @param callable|\Closure $callBack
*/
public function processQueueCallback(\Closure $callBack)
{
$callbackQueue = [];
while (count($this->generateQueue)) {
$modelName = array_shift($this->generateQueue);
try {
/** @var Metadata $metadata */
$metadata = $modelName::metadata();
$tblName = $metadata->getDbTableName();
if ($this->db->getSchemaManager()->tablesExist($tblName)) {
continue;
}
if (isset($this->generated[$tblName])) {
continue;
}
$table = $this->metadataToTable($metadata);
$this->generated[$tblName] = 1;
$sql = $this->dp->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES);
array_unshift($callbackQueue, [$metadata, $table, $sql]);
$fks = $table->getForeignKeys();
if (count($fks)) {
$sql = [];
foreach ($fks as $fk) {
$sql[] = $this->dp->getCreateForeignKeySQL($fk, $table);
}
array_push($callbackQueue, [$metadata, $table, $sql]);
}
} catch (\Exception $e) {
pr($e->__toString());
}
}
foreach ($callbackQueue as $args) {
$callBack($args[0], $args[1], $args[2], $this->db);
}
}
开发者ID:buldezir,项目名称:dja_orm,代码行数:39,代码来源:Creation.php
示例6: testQuickSort
public function testQuickSort()
{
$is = $this->Sort->quickSort($this->examples[0]);
$expected = array(1, 2, 3, 4, 6, 11, 16, 50, 58, 66, 69, 99);
pr($is);
$this->assertEquals($is, $expected);
}
开发者ID:dereuromark,项目名称:cakephp-math,代码行数:7,代码来源:SortLibTest.php
示例7: lvFeeCC
public function lvFeeCC()
{
global $db;
$objResto = new MasterRestaurantModel();
$q = "SELECT name, cc_fee FROM {$objResto->table_name} ORDER BY cc_fee DESC ";
$arrQuery = $db->query($q, 2);
pr($arrQuery);
$t = time();
?>
<h2>
List view Restaurant (Fee Credit Card)
</h2>
<div class="table-responsive">
<table id="table_lvCC_<?php
echo $t;
?>
" class="table table-bordered table-striped table-hover crud-table"
style="background-color: white;">
<tbody>
<tr>
<th id="h_id_name_<?php
echo $t;
?>
">Restaurant</th>
<th id="h_id_discount_<?php
echo $t;
?>
">Fee</th>
</tr>
<?php
foreach ($arrQuery as $key => $val) {
?>
<tr id="lv_<?php
echo $val->name . $t;
?>
">
<td id="restaurant_<?php
echo $val->name . $t;
?>
"> <?php
echo $val->name;
?>
</td>
<td id="disc_<?php
echo $val->name . $t;
?>
"> <?php
echo $val->cc_fee;
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:60,代码来源:Fee.php
示例8: login
public function login($__user = null, $password = null, $remember = false)
{
if (!$__user && !$password && $this->exists()) {
Session::put($this->_sessionName, $this->data()->id);
} else {
$user = $this->find($__user);
}
if ($user) {
if ($this->data()->password === Hash::make($password, $this->data()->salt)) {
Session::put($this->_sessionName, $this->data()->id);
$remember = true;
if ($remember) {
//echo 'remember!';
$hash = Hash::unique();
$hashCheck = $this->_db->get('user_sessions', array('user_id', '=', $this->data()->id));
if (!$hashCheck->count()) {
$this->_db->insert('user_sessions', array('user_id' => $this->data()->id, 'hash' => $hash));
} else {
$hash = $hashCheck->first()->hash;
}
Cookie::put($this->_cookieName, $hash, Config::get('remember.cookie_expiry'));
}
return true;
} else {
pr('NO PASS');
}
}
return false;
}
开发者ID:nanofelix,项目名称:sample-app,代码行数:29,代码来源:user.php
示例9: listAttachments
/**
*
* @param <type> $attachments
* @return string html block of attachments
*/
public function listAttachments($attachments = array())
{
if (empty($attachments) || !is_array($attachments)) {
return false;
}
$return = array();
foreach ($attachments as $attachment) {
switch ($attachment['type']) {
case 'jpeg':
case 'gif':
$data = $this->__imageAttachment($attachment);
break;
case 'msword':
case 'pdf':
$data = $this->__fileAttachment($attachment);
break;
default:
pr($attachment);
exit;
break;
}
$return[] = $this->__addAttachment($attachment, $data);
}
if (!empty($return)) {
return sprintf('<ul class="attachments"><li>%s</li></ul>', implode('</li><li>', $return));
}
return false;
}
开发者ID:nani8124,项目名称:infinitas,代码行数:33,代码来源:EmailAttachmentsHelper.php
示例10: sendMail
public function sendMail()
{
$mailer = new Email();
$mailer->transport('smtp');
$email_to = '[email protected]';
$replyToEmail = "[email protected]";
$replyToEmailName = 'Info';
$fromEmail = "[email protected]";
$fromEmailName = "Xuan";
$emailSubject = "Demo mail";
//$view_link = Router::url('/', true);
$params_name = 'XuanNguyen';
$view_link = Router::url(['language' => $this->language, 'controller' => 'frontend', 'action' => 'view_email', 'confirmation', $params_name], true);
$sentMailSatus = array();
if (!empty($email_to)) {
//emailFormat text, html or both.
$mailer->template('content', 'template')->emailFormat('html')->subject($emailSubject)->viewVars(['data' => ['language' => $this->language, 'mail_template' => 'confirmation', 'email_vars' => ['view_link' => $view_link, 'name' => $params_name]]])->from([$fromEmail => $fromEmailName])->replyTo([$replyToEmail => $replyToEmailName])->to($email_to);
if ($mailer->send()) {
$sentMailSatus = 1;
} else {
$sentMailSatus = 0;
}
}
pr($sentMailSatus);
exit;
}
开发者ID:hongtien510,项目名称:cakephp-routing,代码行数:26,代码来源:TemplateCodeController.php
示例11: mailqueue_callback
function mailqueue_callback($args)
{
if (!$args) {
echo "NOT ARGS IN CALLBACK:";
pr($args);
die;
//return false;
}
global $container_options;
$log = array();
$log['args'] = $args;
$contanier = new Mail_Queue_Container_db($container_options);
$obj = $contanier->getMailById($args['id']);
if (!$obj) {
echo "NOT OBJ IN CALLBACK:";
pr($obj);
die;
//return false;
}
$log['mailObject'] = (array) $obj;
$headers = $obj->headers;
$subject = $obj->headers['Subject'];
$body = $obj->body;
$mail_headers = '';
foreach ($headers as $key => $value) {
$mail_headers .= "{$key}:{$value}\n";
}
$mail = $mail_headers . "\n" . $body;
$decoder = new Mail_mimeDecode($mail);
if (!$decoder) {
echo "NOT DECODER IN CALLBACK";
pr($decoder);
die;
//return false;
}
$decoded = $decoder->decode(array('include_bodies' => TRUE, 'decode_bodies' => TRUE, 'decode_headers' => TRUE));
$body = $decoded->body;
$esmtp_id = $args['queued_as'];
if (isset($args['greeting'])) {
$greeting = $args['greeting'];
$greets = explode(' ', $greeting);
$server = $greets[0];
} else {
$server = 'localhost';
}
$log['serverResponse'] = compact('server', 'esmtp_id');
$res = sq("update mail_queue set log = '" . serialize($log) . "' where id = " . $args['id']);
if (!$res) {
echo "NOT RES IN CALLBACK";
pr($res);
die;
//return false;
}
if (CRON) {
echo "Email ID " . $args['id'] . "\n";
echo "Log:\n\n";
print_r($log);
echo "\n\n";
}
}
开发者ID:santikrass,项目名称:poliversal,代码行数:60,代码来源:sendQueue.php
示例12: testEvent
/**
* test if things are working
*/
public final function testEvent()
{
echo '<h1>your event is working</h1>';
echo '<p>The following events are available for use in the Infinitas core</p>';
pr($this->availableEvents());
exit;
}
开发者ID:nani8124,项目名称:infinitas,代码行数:10,代码来源:AppEvents.php
示例13: create
function create()
{
$dir = new Folder(APP);
$files = $dir->findRecursive('.*');
$data_array = array();
foreach ($files as $file) {
$file_parts = pathinfo($file);
if (isset($file_parts['extension']) && ($file_parts['extension'] == "php" || $file_parts['extension'] == "ctp")) {
$data = file_get_contents($file);
$pattern = "~(__\\('|__\\(\")(.*?)(\\'\\)|\",|\\',|\"\\)|\" \\)|\\' \\))~";
preg_match_all($pattern, $data, $matches);
$data_array = array_filter(array_merge($data_array, $matches[2]));
}
}
$data_array = array_unique($data_array);
pr($data_array);
$filename = 'adefault.po';
$file = new File(APP . "/Locale" . DS . $filename);
foreach ($data_array as $string) {
$file->write('msgid "' . $string . '"' . "\n");
$file->write('msgstr "' . $string . '"' . "\n\n");
echo $string;
}
$file->close();
die;
}
开发者ID:purgesoftwares,项目名称:tours,代码行数:26,代码来源:TranslationsController.php
示例14: upgrade
/**
* upgrade method
*
* Using reflection API retrieve list of methods, that have `@since` comment
* set to value no lower than requested version and call these methods.
*
* @param int $target_ver Target version, to upgrade to
*
* @return bool Success
*/
public function upgrade($target_ver = NULL)
{
if (NULL === $target_ver) {
$target_ver = AI1EC_DB_VERSION;
}
$target_ver = (int) $target_ver;
$curr_class = get_class($this);
$reflection = new ReflectionClass($this);
$method_list = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
$since_regex = '#@since\\s+(\\d+)[^\\d]#sx';
foreach ($method_list as $method) {
if ($method->getDeclaringClass()->getName() !== $curr_class || ($name = $method->getName()) === __FUNCTION__) {
continue;
}
$doc_comment = $method->getDocComment();
if (!preg_match($since_regex, $doc_comment, $matches)) {
continue;
}
$since = (int) $matches[1];
try {
if ($since <= $target_ver && !$this->{$name}()) {
return false;
}
} catch (Ai1ec_Database_Schema_Exception $exception) {
pr((string) $exception);
return false;
}
}
return true;
}
开发者ID:briancompton,项目名称:knightsplaza,代码行数:40,代码来源:class-ai1ec-database-schema.php
示例15: index
public function index()
{
$data = $this->testimonial_model->get_testimonial();
pr($data['data']);
echo "<br>";
echo $data['nav'];
}
开发者ID:unregister,项目名称:tutupgelas,代码行数:7,代码来源:testimonial.php
示例16: addProduct
function addProduct()
{
$category = _p('category');
$name = _p('name');
$description = _p('description');
$meta_desc = _p('meta_descriptoion');
$meta_key = _p('meta_keywords');
$model = _p('model');
$sku = _p('sku');
$upc = _p('upc');
$ean = _p('ean');
$jan = _p('jan');
$isbn = _p('isbn');
$mpn = _p('mpn');
$weight = _p('weight');
$weight_class = _p('weight_class');
$length = _p('length');
$width = _p('width');
$height = _p('height');
$length_class = _p('length_class');
$location = _p('location');
$price = _p('price');
$quantity = _p('quantity');
$minimum = _p('minimum');
$substract = _p('substract');
$shipping = _p('shipping');
$status = _p('status');
$date_added = date('Y-m-d H:i:s');
$pathUpload = "";
$image = uploadFile('gambar', $pathUpload, 'image');
$query_product = "INSERT INTO ck_product (`model`, `sku`, `upc`, `ean`, `jan`, `isbn`, `mpn`, `location`, `quantity`, `image`, `shipping`, `price`, `weight`, `weight_class_id`, `length`, `width`, `height`, `length_class_id`, `subtract`, `minimum`, `sort_order`, `status`, `date_added`) VALUES ('{$model}', '{$sku}', '{$upc}', '{$ean}', '{$jan}', '{$isbn}', '{$mpn}', '{$location}', {$quantity}, '{$image}', '{$shipping}', {$price}, {$weight}, '{$weight_class}', {$length}, {$width}, {$height}, '{$length_class}', '{$substract}', {$minimum}, '', {$status}, '{$date_added}' )";
echo "<br />" . $query_product;
echo "<br />";
pr($image);
}
开发者ID:TrinataBhayanaka,项目名称:codekir-cms,代码行数:35,代码来源:productHelper.php
示例17: printGet
/**
* Handy function that will print the GET params
* if there are any
*/
function printGet()
{
if (count($_GET) > 0) {
echo "<h2>Query: ?" . $_SERVER['QUERY_STRING'] . "</h2>";
pr($_GET);
}
}
开发者ID:Yotta2,项目名称:S75-Sections,代码行数:11,代码来源:handy.php
示例18: userListByDepartment
public function userListByDepartment()
{
pr($this->request->data);
$dptId = $this->request->data['dept'];
$userList = $this->BrokerEmployee->find('all', array('conditions' => array('BrokerEmployee.agency_dept_id' => $dptId), 'fields' => array('BrokerEmployee.id, BrokerEmployee.name')));
return new CakeResponse(array('type' => 'application/json', 'body' => json_encode($userList)));
}
开发者ID:julkar9,项目名称:gss,代码行数:7,代码来源:UsersController.php
示例19: send
/**
*
*/
protected function send()
{
if (!attrib('to') || !attrib('body')) {
pr(<<<'EOD'
------------------------------------------------------------
arguments:
--to send to email address
--subject email subject
--body email content message
example:
php send --to [email protected] --subject "hello" --body "hi"
php send --to [email protected] --body "$(cat message.txt)"
------------------------------------------------------------
EOD
);
exit;
}
$getFrom = function () {
$fromEmail = conf('gmail.email');
$fromName = conf('gmail.name');
return "{$fromName} <{$fromEmail}>";
};
$to = attrib('to');
$subject = attrib('subject', 'not-subject');
$body = attrib('body');
$result = \GmailManager::sendMessage($getFrom(), $to, $subject, $body);
if ($result) {
pr('Send success');
} else {
pr('Send fail !');
}
}
开发者ID:glennfriend,项目名称:gmail-import-use-api,代码行数:36,代码来源:Send.php
示例20: callback
/**
* Receives auth response and does validation
*/
public function callback()
{
$response = null;
/**
* Fetch auth response, based on transport configuration for callback
*/
switch (Configure::read('Opauth.callback_transport')) {
case 'session':
if (!session_id()) {
session_start();
}
if (isset($_SESSION['opauth'])) {
$response = $_SESSION['opauth'];
unset($_SESSION['opauth']);
}
break;
case 'post':
$response = unserialize(base64_decode($_POST['opauth']));
break;
case 'get':
$response = unserialize(base64_decode($_GET['opauth']));
break;
default:
echo '<strong style="color: red;">Error: </strong>Unsupported callback_transport.' . "<br>\n";
break;
}
/**
* Check if it's an error callback
*/
if (isset($response) && is_array($response) && array_key_exists('error', $response)) {
// Error
$response['validated'] = false;
} else {
$this->_loadOpauth();
if (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])) {
$response['error'] = array('provider' => $response['auth']['provider'], 'code' => 'invalid_auth_missing_components', 'message' => 'Invalid auth response: Missing key auth response components.');
$response['validated'] = false;
} elseif (!$this->Opauth->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)) {
$response['error'] = array('provider' => $response['auth']['provider'], 'code' => 'invalid_auth_failed_validation', 'message' => 'Invalid auth response: ' . $reason);
$response['validated'] = false;
} else {
$response['validated'] = true;
}
}
pr('here it is');
/**
* Redirect user to /opauth-complete
* with validated response data available as POST data
* retrievable at $this->data at your app's controller
*/
$completeUrl = Configure::read('Opauth._cakephp_plugin_complete_url');
if (empty($completeUrl)) {
$completeUrl = Router::url('/opauth-complete');
}
$CakeRequest = new CakeRequest('/opauth-complete');
$CakeRequest->data = $response;
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch($CakeRequest, new CakeResponse());
exit;
}
开发者ID:riddhisoni1324,项目名称:cakephp_fxchng,代码行数:63,代码来源:OpauthAppController.php
注:本文中的pr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论