本文整理汇总了PHP中server类的典型用法代码示例。如果您正苦于以下问题:PHP server类的具体用法?PHP server怎么用?PHP server使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了server类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: joinServer
function joinServer()
{
$server = new server($this->id);
if ($this->isServerJoinable($this->id)) {
echo '<a href="' . $server->getUrl() . '">Join server</a>';
}
}
开发者ID:marat1803,项目名称:tf2matchmaking,代码行数:7,代码来源:class.server.php
示例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;
}
开发者ID:webremote,项目名称:craft-sass,代码行数:19,代码来源:Sass_CompilerService.php
示例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;
}
开发者ID:imarc,项目名称:craft-sass,代码行数:20,代码来源:Sass_CompilerService.php
示例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']);
}
开发者ID:mwilchez,项目名称:master,代码行数:12,代码来源:server.view.php
示例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;
}
}
开发者ID:Apoooorv,项目名称:DBFProject,代码行数:12,代码来源:dbfclass.php
示例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' => '短信发送失败'];
}
开发者ID:q920980002,项目名称:mdx1.0,代码行数:18,代码来源:SmsServer.php
示例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;
}
}
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:27,代码来源:character.php
示例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');
}
开发者ID:chrishiam,项目名称:LVSL,代码行数:12,代码来源:url.php
示例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");
}
}
开发者ID:cozylife,项目名称:tht-reworked,代码行数:31,代码来源:delete.php
示例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();
}
开发者ID:04x10,项目名称:04x10.com,代码行数:31,代码来源:panel.php
示例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;
}
开发者ID:narrenfrei,项目名称:kirbycms,代码行数:9,代码来源:uri.php
示例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;
}
开发者ID:codecuts,项目名称:lanningsmith-website,代码行数:9,代码来源:uri.php
示例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;
}
开发者ID:cozylife,项目名称:tht-reworked,代码行数:9,代码来源:class_invoice.php
示例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');
}
开发者ID:nilshendriks,项目名称:kirbycms-panel,代码行数:9,代码来源:load.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);
}
}
}
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:56,代码来源:kirby.php
示例16: serverhasrestore
public function serverhasrestore($servertype)
{
global $dbh, $postvar, $getvar, $instance;
$restoreserver = server::createServer(0, $servertype);
if (method_exists($restoreserver, "restore")) {
return true;
} else {
return false;
}
}
开发者ID:cozylife,项目名称:tht-reworked,代码行数:10,代码来源:class_backup.php
示例17: index
public function index()
{
if (isset($this->index)) {
return $this->index;
}
if (r::cli()) {
return $this->index = '/';
} else {
return $this->index = url::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
}
}
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:11,代码来源:urls.php
示例18: index
public function index($text = null, $exception = null)
{
$this->auth();
if (is_null($text)) {
$text = l('pages.error.missing');
}
if (server::get('HTTP_MODAL')) {
return $this->modal('error', array('text' => $text, 'back' => url::last()));
} else {
return $this->screen('error/index', 'error', array('text' => $text, 'exception' => $exception));
}
}
开发者ID:irenehilber,项目名称:kirby-base,代码行数:12,代码来源:error.php
示例19: index
public function index()
{
if (isset($this->index)) {
return $this->index;
}
// this value is used by the Panel
$this->indexDetected = true;
if (r::cli()) {
return $this->index = '/';
} else {
return $this->index = url::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
}
}
开发者ID:parasutcom,项目名称:styleguide,代码行数:13,代码来源:urls.php
示例20: __construct
function __construct($uri = false)
{
// set the defaults
$this->path = new uriPath();
$this->params = new uriParams();
$this->query = new uriQuery(str::parse(server::get('query_string'), 'query'));
$this->extension = false;
$this->original = $_SERVER['REQUEST_URI'];
$this->raw = $this->raw($uri);
$this->url = url(ltrim($this->raw, '/'));
// crawl the uri and get all elements
$this->crawl();
}
开发者ID:ajmalafif,项目名称:bradshawsguide,代码行数:13,代码来源:uri.php
注:本文中的server类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论