Example #1
0
 public function __construct($filename = null)
 {
     $this->filename = $filename;
     if ($this->filename != null && File::Exists($this->filename)) {
         list($this->width, $this->height) = @getimagesize($this->filename);
         $this->setOriginalBinary(@File::ReadBinary($this->filename));
     }
 }
 public static function DownloadBossIcon($CreatureID)
 {
     $StorageDir = str_replace('/', DS, getcwd()) . DS . 'Uploads' . DS . 'Core' . DS . 'NPC' . DS . 'Cache' . DS;
     $CreatureName = 'creature' . $CreatureID . '.jpg';
     $DownloadStatus = true;
     if (!File::Exists($StorageDir . $CreatureName)) {
         $DownloadStatus = File::Download('http://media.blizzard.com/wow/renders/npcs/portrait/' . $CreatureName, $StorageDir . $CreatureName);
     }
     return $DownloadStatus;
 }
Example #3
0
<?php

use Swagger\Swagger;
Route::any(Config::get('swagger.doc-route') . '/{page?}', function ($page = 'api-docs.json') {
    $filePath = Config::get('swagger.doc-dir') . "/{$page}";
    if (File::extension($filePath) === "") {
        $filePath .= ".json";
    }
    if (!File::Exists($filePath)) {
        App::abort(404, "Cannot find {$filePath}");
    }
    $content = File::get($filePath);
    return Response::make($content, 200, array('Content-Type' => 'application/json'));
});
Route::get('api-docs', function () {
    if (Config::get('swagger.generateAlways')) {
        $appDir = base_path() . "/" . Config::get('swagger.app-dir');
        $docDir = Config::get('swagger.doc-dir');
        if (!File::exists($docDir) || is_writable($docDir)) {
            // delete all existing documentation
            if (File::exists($docDir)) {
                File::deleteDirectory($docDir);
            }
            File::makeDirectory($docDir);
            $defaultBasePath = Config::get('swagger.default-base-path');
            $defaultApiVersion = Config::get('swagger.default-api-version');
            $defaultSwaggerVersion = Config::get('swagger.default-swagger-version');
            $excludeDirs = Config::get('swagger.excludes');
            $swagger = new Swagger($appDir, $excludeDirs);
            $resourceList = $swagger->getResourceList(array('output' => 'array', 'apiVersion' => $defaultApiVersion, 'swaggerVersion' => $defaultSwaggerVersion));
            $resourceOptions = array('output' => 'json', 'defaultSwaggerVersion' => $resourceList['swaggerVersion'], 'defaultBasePath' => $defaultBasePath);
Example #4
0
     Zones::DownloadMap($ZoneInfo, $ChosenLang);
     $Smarty->assign('LanguageStyle', $ChosenLang);
     $Smarty->assign('ZoneInfo', $ZoneInfo);
     $Smarty->assign('Page', Page::Info('zone', array('bodycss' => 'zone-' . $ZoneInfo['link_name'], 'pagetitle' => $ZoneInfo['name'] . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
     $Smarty->display('pages/zone_info');
 } else {
     $BossesArray = array();
     foreach ($ZoneInfo['bosses'] as $Boss) {
         $BossesArray[] = $Boss['boss_link'];
     }
     $BossInfo = $ZoneInfo['bosses'][Text::MASearch($ZoneInfo['bosses'], 'boss_link', $_REQUEST['lastcategory'])];
     if (in_array($_REQUEST['lastcategory'], $BossesArray)) {
         if (Text::IsNull($_REQUEST['datatype'])) {
             $StorageDir = str_replace('/', DS, getcwd()) . DS . 'Uploads' . DS . 'Core' . DS . 'NPC' . DS . 'ModelViewer' . DS;
             $ItemName = 'creature' . $BossInfo['entry'] . '.jpg';
             if (!File::Exists($StorageDir . $ItemName)) {
                 File::Download('http://media.blizzard.com/wow/renders/npcs/rotate/creature' . $BossInfo['entry'] . '.jpg', $StorageDir . $ItemName);
             }
             $NPCInfo = Zones::GetNPCInfo($BossInfo['entry']);
             $Smarty->assign('NPC', $NPCInfo);
             $Smarty->assign('ZoneInfo', $ZoneInfo);
             $Smarty->assign('BossInfo', $BossInfo);
             $Smarty->assign('Page', Page::Info('zone', array('bodycss' => 'zone-' . $ZoneInfo['link_name'] . ' boss-' . $_REQUEST['lastcategory'], 'pagetitle' => $BossInfo['name'] . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
             $Smarty->display('pages/npc_info');
         } else {
             $NPCInfo = Zones::GetNPCInfo($BossInfo['entry']);
             switch (str_replace('.frag', '', $_REQUEST['datatype'])) {
                 case 'loot':
                     $BossLoot = array();
                     $BossLoot['dungortenman'] = Zones::GetBossLoot($NPCInfo['lootid']);
                     $LootAmount = count($BossLoot['dungortenman']);
 public static function CreateConfigurationFile($Data, $Global)
 {
     $Configuration = '<?php' . PHP_EOL;
     $Configuration .= 'global ' . $Global . ';' . PHP_EOL . PHP_EOL;
     foreach ($Data as $Key => $Value) {
         if ($Key == "Database") {
             $Configuration .= PHP_EOL . '// Main Database Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "AuthDB") {
             $Configuration .= PHP_EOL . '// Auth Database Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "CharDB") {
             $Configuration .= PHP_EOL . '// Characters Database Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "WorldDB") {
             $Configuration .= PHP_EOL . '// World Database Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "soap") {
             $Configuration .= PHP_EOL . '// SOAP Client Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "Globals") {
             $Configuration .= PHP_EOL . '// Site Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 if ($IVal === false) {
                     $Configuration .= '' . $Global . '[\'' . $IKey . '\'] = false;' . PHP_EOL;
                 } elseif ($IVal === true) {
                     $Configuration .= '' . $Global . '[\'' . $IKey . '\'] = true;' . PHP_EOL;
                 } else {
                     $Configuration .= '' . $Global . '[\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
                 }
             }
         } elseif ($Key == "Social") {
             $Configuration .= PHP_EOL . '// Social Media Links' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "GoogleAnalytics") {
             $Configuration .= PHP_EOL . '// Google Analytics Configuration' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         } elseif ($Key == "Facebook") {
             $Configuration .= PHP_EOL . '// Facebook Settings' . PHP_EOL;
             foreach ($Value as $IKey => $IVal) {
                 $Configuration .= '' . $Global . '[\'' . $Key . '\'][\'' . $IKey . '\'] = \'' . $IVal . '\';' . PHP_EOL;
             }
         }
     }
     $Configuration .= PHP_EOL . "?>";
     $ConfigurationFile = getcwd() . DS . 'Core' . DS . 'Configuration' . DS . 'Configuration.php';
     if (File::Exists($ConfigurationFile)) {
         unlink($ConfigurationFile);
         file_put_contents($ConfigurationFile, $Configuration);
     } else {
         file_put_contents($ConfigurationFile, $Configuration);
     }
 }
Example #6
0
                $FCCore["Social"]["Twitter"]			=	"FreedomHead";
                $FCCore["Social"]["Vkontakte"]			=	"FreedomHead";
                $FCCore["Social"]["Skype"]				=	"FreedomHead";
                $FCCore["Social"]["Youtube"]			=	"FreedomHead";

                // Google Analytics
                $FCCore["GoogleAnalytics"]["Account"]	=	"";
                $FCCore["GoogleAnalytics"]["Domain"]	=	"";

                // Facebook Settings
                $FCCore["Facebook"]["admins"]			=	"";
                $FCCore["Facebook"]["pageid"]			=	"";
            ?>
        ';
        $ConfigFolder = getcwd() . DS . 'Core' . DS . 'Configuration' . DS . 'Configuration.php.undone';
        if (File::Exists($ConfigFolder)) {
            unlink($ConfigFolder);
            //file_put_contents($ConfigFolder, $ConfigurationFile);
        } else {
            //file_put_contents($ConfigFolder, $ConfigurationFile);
        }
        echo '1';
        break;
    default:
        ob_start();
        phpinfo(INFO_MODULES);
        $info = ob_get_contents();
        ob_end_clean();
        $info = stristr($info, 'Client API version');
        preg_match('/[1-9].[0-9].[1-9][0-9]/', $info, $match);
        $MySQLVersion = $match[0];