當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Flux::getAthenaServerByName方法代碼示例

本文整理匯總了PHP中Flux::getAthenaServerByName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flux::getAthenaServerByName方法的具體用法?PHP Flux::getAthenaServerByName怎麽用?PHP Flux::getAthenaServerByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Flux的用法示例。


在下文中一共展示了Flux::getAthenaServerByName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: flux_get_default_bmp_data

{
    $data = flux_get_default_bmp_data();
    header("Content-Type: image/bmp");
    header('Content-Length: ' . strlen($data));
    echo $data;
    exit;
}
// 1. Force displaying of empty emblem.
if (Flux::config('ForceEmptyEmblem')) {
    flux_display_empty_emblem();
}
// 2. Attempt to pull emblem from database.
$serverName = $params->get('login');
$athenaServerName = $params->get('charmap');
$guildID = $params->get('id');
$athenaServer = Flux::getAthenaServerByName($serverName, $athenaServerName);
if (!$athenaServer || !$guildID) {
    // 2-1. Uh oh, incorrect request paramters :(
    flux_display_empty_emblem();
} else {
    // 2-2. Caching enabled?
    if ($interval = Flux::config('EmblemCacheInterval')) {
        $interval *= 60;
        $dirname = FLUX_DATA_DIR . "/tmp/emblems/{$serverName}/{$athenaServerName}";
        $filename = "{$dirname}/{$guildID}.png";
        if (!is_dir($dirname)) {
            mkdir($dirname, 0777, true);
        } elseif (file_exists($filename) && time() - filemtime($filename) < $interval) {
            header("Content-Type: image/png");
            header('Content-Length: ' . filesize($filename));
            readfile($filename);
開發者ID:rahuldev345,項目名稱:fluxcp,代碼行數:31,代碼來源:emblem.php

示例2: getAthenaServer

 /**
  * Get a Flux_Athena instance by its name based on current server settings.
  * 
  * @param string $name
  * @access public
  */
 public function getAthenaServer($name = null)
 {
     if (is_null($name) && $this->athenaServerName) {
         return $this->getAthenaServer($this->athenaServerName);
     }
     if ($this->loginAthenaGroup && ($server = Flux::getAthenaServerByName($this->serverName, $name))) {
         return $server;
     } else {
         return false;
     }
 }
開發者ID:Cavalero,項目名稱:fluxcp-renewal,代碼行數:17,代碼來源:SessionData.php


注:本文中的Flux::getAthenaServerByName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。