本文整理汇总了PHP中Notifications::setup方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifications::setup方法的具体用法?PHP Notifications::setup怎么用?PHP Notifications::setup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifications
的用法示例。
在下文中一共展示了Notifications::setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_body
/**
* dynamically generate the page
*
* @see skins/index.php
*/
function send_body()
{
global $context, $action;
// check that the user is an admin, but only if there is at least one user record
$query = "SELECT count(*) FROM " . SQL::table_name('users');
if (!Surfer::is_associate() && SQL::query($query) !== FALSE) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
echo '<p>' . i18n::s('You are not allowed to perform this operation.') . "</p>\n";
return;
}
// log the current surfer as an associate if not yet the case
if (!Surfer::is_associate()) {
$fields = array();
$fields['id'] = 1;
$fields['nick_name'] = 'admin';
$fields['email'] = '';
$fields['capability'] = 'A';
Surfer::set($fields);
echo '<p>' . i18n::s('You have associate privilege') . '</p>';
}
// check every table of the database
if ($action == 'build') {
// maybe we will have to switch the server off
$temporary_off = FALSE;
// ensure nobody else will access the database during the operation
if (file_exists('../parameters/switch.on')) {
if (Safe::rename($context['path_to_root'] . 'parameters/switch.on', $context['path_to_root'] . 'parameters/switch.off')) {
echo BR . i18n::s('The server has been switched off.');
$temporary_off = TRUE;
}
// let concurrent on-going transactions finish properly
Safe::sleep(3);
// first installation
} elseif (!file_exists('../parameters/switch.off')) {
echo '<p>' . i18n::s('Review provided information and go to the bottom of the page to move forward.') . "</a></p>\n";
}
// ensure utf8 character set for this database
$query = "ALTER DATABASE `" . $context['database'] . "` DEFAULT CHARACTER SET utf8";
SQL::query($query);
// create tables for users
echo Users::setup();
// create tables for activities
echo Activities::setup();
// create tables for notifications
include_once '../users/notifications.php';
echo Notifications::setup();
// create tables for messages
echo Mailer::setup();
// create tables for visits
include_once '../users/visits.php';
echo Visits::setup();
// create tables for sections
echo Sections::setup();
// create tables for articles
echo Articles::setup();
// create tables for images
include_once '../images/images.php';
echo Images::setup();
// create tables for tables
include_once '../tables/tables.php';
echo Tables::setup();
// create tables for files
echo Files::setup();
// create tables for links
include_once '../links/links.php';
echo Links::setup();
// create tables for locations
include_once '../locations/locations.php';
echo Locations::setup();
// create tables for comments
include_once '../comments/comments.php';
echo Comments::setup();
// create tables for categories
echo Categories::setup();
// create tables for members
include_once '../shared/members.php';
echo Members::setup();
// create tables for dates
include_once '../dates/dates.php';
echo Dates::setup();
// create tables for servers
include_once '../servers/servers.php';
echo Servers::setup();
// create tables for versions
include_once '../versions/versions.php';
echo Versions::setup();
// create tables for enrolments
include_once '../shared/enrolments.php';
echo Enrolments::setup();
// create tables for values
include_once '../shared/values.php';
echo Values::setup();
// create tables for the cache
echo Cache::setup();
// create tables for the php documentation
//.........这里部分代码省略.........