本文整理汇总了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);
示例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;
}
}