本文整理汇总了PHP中warning函数的典型用法代码示例。如果您正苦于以下问题:PHP warning函数的具体用法?PHP warning怎么用?PHP warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了warning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(StringObject $string, $offset, $brackets = '{}')
{
$this->string = $string;
$this->offset = $offset;
$this->match = null;
$this->length = 0;
list($opener, $closer) = str_split($brackets, 1);
if (strpos($string->raw, $opener, $this->offset) === false) {
return;
}
if (substr_count($string->raw, $opener) !== substr_count($string->raw, $closer)) {
$sample = substr($string->raw, $this->offset, 25);
warning("Unmatched token near '{$sample}'.");
return;
}
$patt = $opener === '{' ? Regex::$patt->block : Regex::$patt->parens;
if (preg_match($patt, $string->raw, $m, PREG_OFFSET_CAPTURE, $this->offset)) {
$this->match = $m;
$this->matchLength = strlen($m[0][0]);
$this->matchStart = $m[0][1];
$this->matchEnd = $this->matchStart + $this->matchLength;
$this->length = $this->matchEnd - $this->offset;
} else {
warning("Could not match '{$opener}'. Exiting.");
}
}
开发者ID:MrHidalgo,项目名称:css-crush,代码行数:26,代码来源:BalancedMatch.php
示例2: requireUser
function requireUser($b = true)
{
if ($b && !isLoggedIn()) {
warning('You need to login to view this page.');
redirect($GLOBALS['sLoginPage'] . '?ref=' . str_replace('?logout=true', '', $_SERVER['REQUEST_URI']));
}
}
开发者ID:prymribb,项目名称:starter,代码行数:7,代码来源:user.php
示例3: __construct
/**
* Use Facebook::configure() to initialize the facebook instance.
*
* @param string $appId
* @param string $appSecret
* @param array $options
*/
function __construct($appId, $appSecret, $permissions = array(), $options = array())
{
$this->appId = $appId;
$this->appSecret = $appSecret;
if (is_array($permissions)) {
$permissions = implode(',', $permissions);
}
$this->requiredPermissions = $permissions;
$state = $this->getPersistentData('state');
if (!empty($state)) {
$this->state = $state;
}
$accessToken = $this->getPersistentData('access_token');
if (!empty($accessToken)) {
$this->accessToken = $accessToken;
}
if (isset($options['ignore_session_state'])) {
// Option to prevent the "No session started" warning.
$ignoreSessionState = $options['ignore_session_state'];
unset($options['ignore_session_state']);
} else {
$ignoreSessionState = false;
}
if ($ignoreSessionState == false && session_id() == false) {
warning('No session started');
}
foreach ($options as $property => $value) {
$this->{$property} = $value;
}
$this->logger = new Logger(array('identifier' => 'Facebook', 'singular' => 'request', 'plural' => 'requests', 'renderer' => 'Sledgehammer\\Facebook::renderLog', 'columns' => array('Method', 'Request', 'Duration')));
}
开发者ID:sledgehammer,项目名称:facebook,代码行数:38,代码来源:Facebook.php
示例4: percentile_actions
/** Possible actions for a caller: delete */
function percentile_actions($percentile_id)
{
$CI =& get_instance();
$edit_link = anchor('percentile/edit/' . $percentile_id, img_edit());
$delete_link = anchor('percentile/delete/' . $percentile_id, img_delete(), warning(lang('sure_delete_percentile')));
return implode(' ', array($edit_link, $delete_link));
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:8,代码来源:percentile_helper.php
示例5: participation_actions
/** Possible actions for a participation: prioritize and delete */
function participation_actions($participation_id)
{
$CI =& get_instance();
$pp = $CI->participationModel->get_participation_by_id($participation_id);
$not_cancelled = $pp->cancelled == 0;
$is_confirmed = $pp->confirmed == 1 && $not_cancelled;
$not_completed = $is_confirmed && $pp->noshow == 0 && $pp->completed == 0;
$is_noshow = $pp->noshow == 1;
$is_completed = $pp->completed == 1;
$after_now = input_datetime($pp->appointment) > input_datetime('now');
$get_link = participation_get_link($pp);
$cancel_link = $not_completed && $not_cancelled ? anchor('participation/cancel/' . $pp->id, img_cancel(lang('cancelled'))) : img_cancel(lang('cancelled'), TRUE);
$reschedule_link = $not_completed ? anchor('participation/reschedule/' . $pp->id, img_calendar()) : img_calendar(TRUE);
$noshow_link = $is_confirmed && !$is_noshow && !$after_now ? anchor('participation/no_show/' . $pp->id, img_noshow()) : img_noshow(TRUE);
$completed_link = $is_confirmed && !$after_now ? anchor('participation/completed/' . $pp->id, img_accept(lang('completed'))) : img_accept(lang('completed'), TRUE);
$delete_link = anchor('participation/delete/' . $pp->id, img_p_delete(), warning(lang('sure_delete_part')));
$comment_link = anchor('participation/edit_comment/' . $pp->id, img_comment());
switch (current_role()) {
case UserRole::Admin:
$actions = array($get_link, $cancel_link, $reschedule_link, $noshow_link, $completed_link, $comment_link, $delete_link);
break;
case UserRole::Leader:
$actions = array($get_link, $cancel_link, $reschedule_link, $noshow_link, $completed_link, $comment_link);
break;
default:
$actions = array($get_link, $cancel_link, $reschedule_link, $comment_link);
break;
}
return implode(' ', $actions);
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:31,代码来源:participation_helper.php
示例6: resolveDocRoot
protected static function resolveDocRoot($doc_root = null)
{
// Get document_root reference
// $_SERVER['DOCUMENT_ROOT'] is unreliable in certain CGI/Apache/IIS setups
if (!$doc_root) {
$script_filename = $_SERVER['SCRIPT_FILENAME'];
$script_name = $_SERVER['SCRIPT_NAME'];
if ($script_filename && $script_name) {
$len_diff = strlen($script_filename) - strlen($script_name);
// We're comparing the two strings so normalize OS directory separators
$script_filename = str_replace('\\', '/', $script_filename);
$script_name = str_replace('\\', '/', $script_name);
// Check $script_filename ends with $script_name
if (substr($script_filename, $len_diff) === $script_name) {
$path = substr($script_filename, 0, $len_diff);
$doc_root = realpath($path);
}
}
if (!$doc_root) {
$doc_root = realpath($_SERVER['DOCUMENT_ROOT']);
}
if (!$doc_root) {
warning("Could not get a valid DOCUMENT_ROOT reference.");
}
}
return Util::normalizePath($doc_root);
}
开发者ID:MrHidalgo,项目名称:css-crush,代码行数:27,代码来源:Crush.php
示例7: __constructor
public function __constructor()
{
if (func_get_args()) {
$this->parent = func_get_arg(0);
} else {
$this->parent = new client();
}
//record a "menu interface" in object client
//$this->_namespace = \get_constant('\platform\config\interfac3::_namespace');
//$this->{$this->_namespace} = empty_object();
//load template
$this->_template_namespace = \get_constant('\\platform\\config\\template::_namespace');
$this->{$this->_template_namespace} = new template($this);
//load components
$this->load_components();
//get array of allowed interfaces, depends on role (mode)
$access_list = '\\platform\\config\\interfac3::_a_' . $_SESSION['mode'];
if (is_defined($access_list)) {
$allowed_interfaces = \get_constant($access_list);
} else {
\error('interfac3', 'e001');
}
foreach ($allowed_interfaces as $interface) {
//record a sub object for "menu interface" in object client
//$this->{$this->_namespace}->{$interface} = empty_object();
//if interface exists, generate interface
if (is_defined('\\platform\\config\\interfac3::_i_' . $interface)) {
new interfac3($this, $interface);
} else {
\warning('interfac3', 'e002', $interface);
}
}
}
开发者ID:guillaum3f,项目名称:codie,代码行数:33,代码来源:environment.class.php
示例8: language_actions
/** Possible actions for a language: prioritize and delete */
function language_actions($language_id)
{
$CI =& get_instance();
$c = $CI->languageModel->get_language_by_id($language_id);
$d_link = anchor('language/delete/' . $c->id, img_delete(), warning(lang('sure_delete_language')));
return $d_link;
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:8,代码来源:language_c_helper.php
示例9: testsurvey_actions
/** Possible actions for a testsurvey: edit, view scores, delete */
function testsurvey_actions($testsurvey_id)
{
$inspect_link = anchor('testsurvey/get/' . $testsurvey_id, img_zoom('testsurvey'));
$find_link = anchor('testsurvey/find/' . $testsurvey_id, img_email(lang('testinvite')));
$edit_link = anchor('testsurvey/edit/' . $testsurvey_id, img_edit());
$delete_link = anchor('testsurvey/delete/' . $testsurvey_id, img_delete(), warning(lang('sure_delete_testsurvey')));
return implode(' ', array($inspect_link, $find_link, $edit_link, $delete_link));
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:9,代码来源:testsurvey_helper.php
示例10: create
/**
* @param string $model (required)
* @param array $values
* @param array $options array(
* 'repository' => (string) "default"
* )
*
* @return SimpleRecord
*/
public static function create($model = null, $values = [], $options = [])
{
if (count(func_get_args()) < 2) {
warning('SimpleRecord::create() requires minimal 1 parameter', 'SimpleRecord::create($model, $values = [], $options = []');
}
$options['model'] = $model;
return parent::create($values, $options);
}
开发者ID:sledgehammer,项目名称:orm,代码行数:17,代码来源:SimpleRecord.php
示例11: testcat_actions
/** Possible actions for a testcat: edit, show scores and delete */
function testcat_actions($testcat_id)
{
$CI =& get_instance();
$scores = $CI->scoreModel->get_scores_by_testcat($testcat_id);
$edit_link = anchor('testcat/edit/' . $testcat_id, img_edit());
$score_link = count($scores) > 0 ? anchor('score/testcat/' . $testcat_id, img_scores()) : img_scores(TRUE);
$delete_link = anchor('testcat/delete/' . $testcat_id, img_delete(), warning(lang('sure_delete_testcat')));
return implode(' ', array($edit_link, $score_link, $delete_link));
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:10,代码来源:testcat_helper.php
示例12: user_actions
/** Possible actions for a user: edit, view participants, call, archive, delete */
function user_actions($user_id)
{
$CI =& get_instance();
$u = $CI->userModel->get_user_by_id($user_id);
$edit_link = anchor('user/edit/' . $u->id, img_edit());
$act_link = is_activated($u) ? anchor('user/deactivate/' . $u->id, img_active(TRUE)) : anchor('user/activate/' . $u->id, img_active(FALSE));
$delete_link = is_admin($u) ? img_delete(TRUE) : anchor('user/delete/' . $u->id, img_delete(), warning(lang('sure_delete_user')));
return implode(' ', array($edit_link, $act_link, $delete_link));
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:10,代码来源:user_helper.php
示例13: beforesave_not_empty
/**
*
* @param mixed $value
* @param array $column
* @param string $msg_prefix
* @return boolean
*/
function beforesave_not_empty($value, array $column, $msg_prefix) {
if (!$value) {
warning($msg_prefix."The field ".$column[0]." must be not empty!");
return false;
}
return true;
}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:16,代码来源:DbTableAdmin_Test.php
示例14: save
function save($filename, $contents)
{
if (!is_writeable($filename)) {
warning("{$filename} not writeable!");
return;
}
$fp = fopen($filename, "w");
fwrite($fp, $contents);
fclose($fp);
}
开发者ID:BackupTheBerlios,项目名称:sotf-svn,代码行数:10,代码来源:sotf_Utils.class.php
示例15: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @param ProductRepository $products
* @param SupplierRepository $suppliers
* @param VatRateRepository $vat_rates
* @return Response
*/
public function edit($id, ProductRepository $products, SupplierRepository $suppliers, VatRateRepository $vat_rates)
{
try {
$product = $products->findById($id);
return view('products.edit')->with('model', $product)->with('suppliers', $suppliers->all())->with('vat_rates', $vat_rates->all());
} catch (ModelNotFoundException $e) {
flash() - warning(trans('products.not_found'));
return redirect()->route('product.index');
}
}
开发者ID:manishkiozen,项目名称:Cms,代码行数:19,代码来源:ProductController.php
示例16: difineTypeMessage
function difineTypeMessage($messageType = MESSAGE_TYPE_ERRO, $message)
{
if ($messageType == MESSAGE_TYPE_ERRO) {
return error($message);
} elseif ($messageType == MESSAGE_TYPE_WARNING) {
return warning($message);
} else {
return success($message);
}
}
开发者ID:Calcio,项目名称:CursoPHPBasico,代码行数:10,代码来源:showMessage.php
示例17: validateObjects
public function validateObjects()
{
$validStates = array('new', 'retrieved', 'saved', 'deleted');
foreach ($this->objects as $model => $objects) {
foreach ($objects as $index => $object) {
if (in_array($object['state'], $validStates) == false) {
warning('Invalid state "' . $object['state'] . '" for ' . $model . ' ' . $index);
}
}
}
}
开发者ID:sledgehammer,项目名称:orm,代码行数:11,代码来源:RepositoryTester.php
示例18: restrict
function restrict($logged_out = false)
{
if ($logged_out && is_logged_in()) {
echo warning('Maaf, sepertinya Anda sudah login...', 'home');
die;
}
if (!$logged_out && !is_logged_in()) {
$info = 'Session Anda habis. Silakan login ulang.';
echo '<script type="text/javascript">launch_info("' . $info . '")</script>';
die;
}
}
开发者ID:FaddliLWibowo,项目名称:CloudIdol,代码行数:12,代码来源:app_helper.php
示例19: comment_actions
/** Possible actions for a comment: prioritize and delete */
function comment_actions($comment_id)
{
$CI =& get_instance();
$c = $CI->commentModel->get_comment_by_id($comment_id);
$p = $CI->participantModel->get_participant_by_id($c->participant_id);
$prio_link = anchor('comment/prioritize/' . $comment_id . ($c->priority ? '/0' : ''), img_star(!$c->priority));
$handled_link = anchor('comment/mark_handled/' . $comment_id . ($c->handled ? '/0' : ''), img_accept(lang('mark_handled'), !$c->handled));
$edit_link = anchor('comment/edit/' . $comment_id, img_edit());
$p_link = anchor('participant/edit/' . $c->participant_id, img_edit_participant($p));
$d_link = anchor('comment/delete/' . $comment_id, img_delete(), warning(lang('sure_delete_comment')));
return implode(' ', array($prio_link, $handled_link, $edit_link, $p_link, $d_link));
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:13,代码来源:comment_helper.php
示例20: dj_setcookie
/**
* Wrapper around PHP setcookie function to automatically set some
* DOMjudge specific defaults and check the return value.
* - cookies are defined in a common path for all web interfaces
*/
function dj_setcookie($name, $value = null, $expire = 0, $path = null, $domain = null, $secure = false, $httponly = false)
{
if (!isset($path)) {
// KLUDGE: We want to find the DOMjudge base path, but this
// information is not directly available as configuration, so
// we extract it from the executed PHP script.
$path = preg_replace('/(jury|public|team)\\/?$/', '', dirname($_SERVER['PHP_SELF']));
}
$ret = setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
if ($ret !== true) {
warning("Cookie '{$name}' not set properly.");
}
logmsg(LOG_DEBUG, "Cookie set: {$name}={$value}, expire={$expire}, path={$path}");
return $ret;
}
开发者ID:rohit-takhar,项目名称:domjudge,代码行数:20,代码来源:lib.wrappers.php
注:本文中的warning函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论