本文整理汇总了PHP中server类的典型用法代码示例。如果您正苦于以下问题:PHP server类的具体用法?PHP server怎么用?PHP server使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: joinServer
function joinServer()
{
$server = new server($this->id);
if ($this->isServerJoinable($this->id)) {
echo '<a href="' . $server->getUrl() . '">Join server</a>';
}
}
示例2: server
/**
* server() returns an instance of Leafo\ScssPhp\Server, constructing it if
* necessary.
*
* If you provide an instance of Server as argument, it uses that instead.
*
* @return Server
*/
public static function server($instance = null)
{
if ($instance !== null) {
static::$scss_server = $instance;
} elseif (static::$scss_server === null) {
include __DIR__ . '/../vendor/autoload.php';
static::$scss_server = new Server(dirname(craft()->request->getScriptFile()), dirname(craft()->request->getScriptFile()) . '/writable/scss_cache');
static::$scss_server->showErrorsAsCSS();
}
return static::$scss_server;
}
示例3: server
/**
* server() returns an instance of Leafo\ScssPhp\Server, constructing it if
* necessary.
*
* If you provide an instance of Server as argument, it uses that instead.
*
* @return Server
*/
public static function server($instance = null)
{
if ($instance !== null) {
static::$scss_server = $instance;
} elseif (static::$scss_server === null) {
$sass_cache_dir = craft()->path->getStoragePath() . '/scss_cache';
IOHelper::ensureFolderExists($sass_cache_dir);
static::$scss_server = new Server(dirname(craft()->request->getScriptFile()), $sass_cache_dir);
static::$scss_server->showErrorsAsCSS();
}
return static::$scss_server;
}
示例4: prepare
public function prepare()
{
$this->template = "server";
$this->tab = 'server';
require_once 'classes/server.php';
$server = new server($this->request[0]);
$this->params['image'] = $server->get_map_image();
$this->params['info'] = $server->info;
$this->params['map_list'] = $server->get_map_list();
$this->params['rule_list'] = $server->get_rule_list();
$this->title = htmlspecialchars($this->params['info']['name']);
}
示例5: getdata
function getdata()
{
$newconnection = new server();
$newconnection->makeConnection();
$result = $newconnection->fireQuery();
$newconnection->closeConnection();
$arrayindex = 0;
while ($row = $result->fetch_assoc()) {
$this->result[$arrayindex] = array($row['id'], $row['username'], $row['first_name']);
$arrayindex += 1;
}
}
示例6: send
/**
* @param $phone
* @param $msg
* @return mixed
*/
public function send($phone, $msg)
{
try {
$provider = $this->_providerMap[$this->provider];
$this->_server = new $provider['class']($provider['url'], $provider['key']);
if ($this->_server->send($phone, $msg)) {
return ['code' => 1, 'msg' => '短信发送成功'];
}
} catch (Exception $e) {
return ['code' => 0, 'msg' => $e->getMessage()];
}
return ['code' => 0, 'msg' => '短信发送失败'];
}
示例7: revive
public static function revive($guid, $char_db)
{
$guid = (int) $guid;
$rid = server::getRealmId($char_db);
connect::connectToRealmDB($rid);
if (character::isOnline($guid) == TRUE) {
echo '<b class="red_text">Please log out your character before proceeding.';
} else {
if ($GLOBALS['service']['revive']['currency'] == 'vp') {
if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service']['unstuck']['price']) == FALSE) {
die('<b class="red_text">Not enough Vote Points!</b>');
} else {
account::deductVP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service']['revive']['price']);
}
}
if ($GLOBALS['service']['revive']['currency'] == 'dp') {
if (account::hasDP($_SESSION['cw_user'], $GLOBALS['service']['unstuck']['price']) == FALSE) {
die('<b class="red_text">Not enough ' . $GLOBALS['donation']['coins_name'] . '</b>');
} else {
account::deductDP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service']['revive']['price']);
}
}
mysql_query("DELETE FROM character_aura WHERE guid = '" . $guid . "' AND spell = '20584' OR guid = '" . $guid . "' AND spell = '8326'");
account::logThis("Performed a revive on " . character::getCharName($guid, $rid), 'Revive', $rid);
return TRUE;
}
}
示例8: current
/**
* Returns the current url with all bells and whistles
*
* @return string
*/
public static function current()
{
if (!is_null(static::$current)) {
return static::$current;
}
return static::$current = static::scheme() . '://' . server::get('HTTP_HOST') . server::get('REQUEST_URI');
}
示例9: content
public function content()
{
global $dbh, $postvar, $getvar, $instance;
if (!$dbh->config("delacc")) {
die('This feature has been disabled.');
} else {
if ($_POST) {
$user = $_SESSION['cuser'];
$pass = $postvar['password'];
$client = $dbh->client($user);
unset($where);
$where[] = array("is_paid", "=", "0", "AND");
$where[] = array("uid", "=", $user);
$balance_query = $dbh->select("invoices", $where, 0, "1", 1);
if ($dbh->num_rows($balance_query) != 0) {
main::errors("You can't close your account with an outstanding balance. Please contact an administrator for assistance or pay any unpaid invoices.");
}
if (crypto::passhash($pass, $client['salt']) == $client['password']) {
if (server::terminate($client['id'], "", 1)) {
main::errors("Your account has been cancelled successfully.");
session_destroy();
} else {
main::errors("Your account wasn't cancelled. Please try again or contact your system administrator.");
}
} else {
main::errors("The password entered is incorrect.");
}
}
echo style::replaceVar("tpl/client/delete-account.tpl");
}
}
示例10: __construct
function __construct()
{
s::start();
c::set('home.keepurl', true);
// auto-detect the url if it is not set
if (!c::get('url')) {
c::set('url', c::get('scheme') . server::get('http_host'));
}
// setup the thumb plugin
c::set('thumb.cache.root', c::get('root') . '/thumbs');
c::set('thumb.cache.url', c::get('url') . '/thumbs');
c::set('url', c::get('url') . '/' . c::get('panel.folder'));
// remove the panel folder name from the uri
c::set('subfolder', ltrim(c::get('subfolder') . '/' . c::get('panel.folder'), '/'));
// attach the uri after caching
$this->uri = new paneluri();
if (c::get('lang.support')) {
$path = $this->uri->path->toArray();
$first = array_shift($path);
if (!in_array($first, c::get('lang.available', array()))) {
$first = c::get('lang.default');
}
// set the current language
c::set('lang.current', $first);
$this->uri->path = new uriPath($path);
}
// get the first set of pages
$this->rootPages();
// get the additional site info from content/site.txt
$this->siteInfo();
}
示例11: raw
function raw($uri = false)
{
$raw = $uri ? $uri : ltrim(server::get('request_uri'), '/');
// strip subfolders from uri
if (c::get('subfolder')) {
$raw = ltrim(str_replace(c::get('subfolder') . '/', '/', $raw), '/');
}
return $raw;
}
示例12: raw
static function raw($uri = false)
{
$raw = $uri ? $uri : ltrim(server::get('request_uri'), '/');
// strip subfolders from uri
if (c::get('subfolder')) {
$raw = ltrim(preg_replace('!^' . preg_quote(c::get('subfolder')) . '\\/!i', '/', $raw), '/');
}
return $raw;
}
示例13: set_paid
public function set_paid($iid, $noemail = 0)
{
global $dbh, $postvar, $getvar, $instance;
$invoices_update = array("datepaid" => time(), "is_paid" => "1");
$response = $dbh->update("invoices", $invoices_update, array("id", "=", $iid));
$invoices_data = $dbh->select("invoices", array("id", "=", $iid), 0, "1");
server::unsuspend($invoices_data['uid'], $noemail);
return $response;
}
示例14: config
static function config()
{
parent::config();
// load the default panel config file
self::file(c::get('root.panel') . '/defaults/config/config.php');
$root = c::get('root.site') . '/' . c::get('panel.folder') . '/config';
self::file($root . '/config.php');
self::file($root . '/config.' . server::get('server_name') . '.php');
}
示例15: configure
public function configure()
{
// load all available config files
$root = $this->roots()->config();
$configs = array('main' => 'config.php', 'host' => 'config.' . server::get('SERVER_NAME') . '.php', 'addr' => 'config.' . server::get('SERVER_ADDR') . '.php');
$allowed = array_filter(dir::read($root), function ($file) {
return substr($file, 0, 7) === 'config.' and substr($file, -4) === '.php';
});
foreach ($configs as $config) {
$file = $root . DS . $config;
if (in_array($config, $allowed, true) and file_exists($file)) {
include_once $file;
}
}
// apply the options
$this->options = array_merge($this->options, c::$data);
// overwrite the autodetected url
if ($this->options['url']) {
$this->urls->index = $this->options['url'];
}
// connect the url class with its handlers
url::$home = $this->urls()->index();
url::$to = $this->option('url.to', function ($url = '') {
if (url::isAbsolute($url)) {
return $url;
}
$start = substr($url, 0, 1);
switch ($start) {
case '#':
return $url;
break;
case '.':
return page()->url() . '/' . $url;
break;
default:
// don't convert absolute urls
return url::makeAbsolute($url);
break;
}
});
// setup the thumbnail generator
thumb::$defaults['root'] = $this->roots->thumbs();
thumb::$defaults['url'] = $this->urls->thumbs();
thumb::$defaults['driver'] = $this->option('thumbs.driver');
thumb::$defaults['filename'] = $this->option('thumbs.filename');
// simple error handling
if ($this->options['debug'] === true) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
} else {
if ($this->options['debug'] === false) {
error_reporting(0);
ini_set('display_errors', 0);
}
}
}