本文整理汇总了PHP中Framework::warning_output方法的典型用法代码示例。如果您正苦于以下问题:PHP Framework::warning_output方法的具体用法?PHP Framework::warning_output怎么用?PHP Framework::warning_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework::warning_output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confusaErrorHandler
function confusaErrorHandler($errno, $errstr, $errfile, $errline)
{
$msg = "";
$display_errors = ini_get('display_errors') == true || ini_get('display_errors') == "stdout";
switch ($errno) {
case E_ERROR:
case E_USER_ERROR:
$msg = "PHP Fatal Error: {$errstr} in {$errfile} on line {$errline}";
if ($display_errors) {
Framework::error_output($msg);
}
break;
case E_WARNING:
case E_USER_WARNING:
$msg = "PHP Warning: {$errstr} in {$errfile} on line {$errline}";
if ($display_errors) {
Framework::warning_output($msg);
}
break;
case E_NOTICE:
case E_USER_NOTICE:
$msg = "PHP Notice: {$errstr} in {$errfile} on line {$errline}";
if ($display_errors) {
Framework::message_output($msg);
}
break;
case E_STRICT:
$msg = "PHP Strict: {$errstr} in {$errfile} on line {$errline}";
break;
default:
$msg = "PHP Unknown: {$errstr} in {$errfile} on line {$errline}";
if ($display_errors) {
Framework::message_output($msg);
}
break;
}
/* if logging is turned on, log the errors to the respective PHP log */
if (ini_get('log_errors') && error_reporting() & $errno) {
error_log($msg);
}
return true;
}
示例2: triggerAdminIssues
/**
* triggerAdminIssues() - post error-messages
*
* Function will report issues in the form of errors to the screen when an
* admin looks at the portal and something is amiss. This includes:
*
* - missing privacy notice for the NREN
* - missing about_nren text
* - incomplete or missing attribute-map
*
* @param void
* @return void
* @access private
*/
private function triggerAdminIssues()
{
if (!isset($this->person)) {
return;
}
$nren = $this->person->getNREN();
if (!$nren) {
return;
}
$url_arg = "?mode=admin&show=text&anticsrf=" . Framework::getAntiCSRF();
if (!$nren->hasHelpText()) {
Framework::warning_output("Missing NREN help-text. <a href=\"stylist.php" . $url_arg . "#edit_help\">Configure</a>");
}
if (!$nren->hasAboutText()) {
Framework::warning_output("Missing About-NREN text. <a href=\"stylist.php" . $url_arg . "#edit_about\">Configure</a>");
}
if (!$nren->hasPrivacyNotice()) {
Framework::warning_output("Missing privacy-notice. <a href=\"stylist.php" . $url_arg . "#edit_pn\">Configure</a>");
}
}
示例3: decorateTemplate
/**
* Decorate a given template with the tags from the dictiornary in the
* right language. This is nothing more than repeated consulation of a
* LUT. The dictionary usually consists of two components: A definition file
* including all the tags plus their translation in one language, usually
* English. The second file contains the tags again and a number of
* translations. We merge together the contents of both files and see what
* we can find regarding the currently set language.
*
* Don't decorate the template if the passed dictionary is null or
* the definition file does not exists.
*
* @param $template The template that is to be decorated
* @param $dictionaryName The definition file prefix from which the texts
* are taken
*
* @return The decorated template
*/
public function decorateTemplate($template, $dictionaryName)
{
/* if the dictionary is null or does not exist, don't decorate the template */
if (empty($dictionaryName)) {
return $template;
}
$definitions = $this->getTranslationArray($dictionaryName);
if (empty($definitions)) {
return $template;
}
/* warn only *once* if dictionary entries are missing */
$warn_missing = FALSE;
foreach ($definitions as $tag => $entry) {
/* manual cast, because json_decode returns objects of stdClass */
$entry = (array) $entry;
if (isset($entry[$this->language])) {
$template->assign($tag, $entry[$this->language]);
} else {
$template->assign($tag, $entry[$this->defaultLanguage]);
if (!isset($entry[$this->defaultLanguage])) {
Logger::log_event(LOG_WARNING, "Missing tranlsation entry for {$tag} in " . __FILE__);
if ($warn_missing === FALSE) {
Framework::warning_output("Translation problem: The dictionary " . "for this page does not contain any entry for " . "certain texts! Some parts of the page may appear blank.");
$warn_missing = TRUE;
}
}
}
}
return $template;
}