/** * Create a new template either with a file-based Twig template, or a Twig string. * @global type $wpdb * @param string|false $templateName * @param string|false $templateString */ public function __construct($templateName = false, $templateString = false) { $this->templateName = $templateName; $this->templateString = $templateString; $this->transientNotices = 'notices'; $notices = isset($_SESSION[$this->transientNotices]) ? $_SESSION[$this->transientNotices] : array(); $this->data = array('tabulate_version' => Config::version(), 'notices' => $notices, 'baseurl' => Config::baseUrl(), 'debug' => Config::debug(), 'site_title' => Config::siteTitle()); $this->loader = new \Twig_Loader_Filesystem([__DIR__ . '/../templates']); }
public function __construct($template) { $this->template = $template; $config = new Config(); $this->data['app_title'] = App::name() . ' ' . App::version(); $this->data['app_version'] = App::version(); $this->data['mode'] = $config->mode(); $this->data['baseurl'] = $config->baseUrl(); $this->data['baseurl_full'] = $config->baseUrl(true); $this->data['site_title'] = $config->siteTitle(); $this->data['alerts'] = isset($_SESSION['alerts']) ? $_SESSION['alerts'] : array(); $_SESSION['alerts'] = array(); $user = new User(); if (isset($_SESSION['userid'])) { $user->load($_SESSION['userid']); } $this->data['user'] = $user; }
public static function doInit() { $dataRootDir = join(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data', '']); $htmlRootDir = join(DIRECTORY_SEPARATOR, [__DIR__, '..', 'public']); self::$title = 'graph.anime.plus'; self::$mail = '*****@*****.**'; self::$cronInterval = 5; self::$usersPerCronRun = 10; self::$usersPerCronRunMore = 20; self::$userQueuePath = $dataRootDir . 'queue-users.lst'; self::$userQueueMinWait = 12 * 60 * 60; self::$userQueueMaxAttempts = 2; self::$mediaPerCronRun = 40; self::$mediaPerCronRunMore = 5; self::$mediaQueuePath = $dataRootDir . 'queue-media.lst'; self::$mediaQueueMinWait = 7 * 24 * 60 * 60; self::$mediaQueueMaxAttempts = 2; self::$downloaderUserAgent = ''; self::$downloaderProxy = null; self::$downloaderCookieFilePath = $dataRootDir . 'cookies.dat'; self::$downloaderMaxParallelJobs = 2; self::$downloaderMaxTimeout = 10000; self::$downloaderUseMultiHandles = false; self::$mirrorEnabled = false; self::$mirrorPath = $dataRootDir . 'mirror'; self::$mirrorPurgeFailures = true; self::$cacheEnabled = true; self::$cachePath = $dataRootDir . 'cache'; self::$cacheTimeToLive = 24 * 60 * 60; self::$dbPath = $dataRootDir . 'db'; self::$dbCount = 64; self::$transactionCommitFrequency = 20; self::$maxDbBindings = 50; self::$maxProcessingAttempts = 1; self::$bannedUsersListPath = $dataRootDir . 'banned-users.lst'; self::$bannedGenresListPath = $dataRootDir . 'banned-genres.lst'; self::$bannedCreatorsListPath = $dataRootDir . 'banned-creators.lst'; self::$bannedGenresForRecsListPath = $dataRootDir . 'recs-banned-genres.lst'; self::$bannedFranchiseCouplingListPath = $dataRootDir . 'banned-franchise-coupling.lst'; self::$staticRecommendationListPath = $dataRootDir . 'static-recommendations.lst'; self::$achievementsDefinitionsDirectory = $dataRootDir . 'achievement'; self::$maxLogSize = 1024 * 1024; self::$keepOldLogs = false; self::$logsPath = $dataRootDir . 'logs'; self::$globalsCachePath = $dataRootDir . 'globals-cache.json'; self::$userQueueSizesPath = $dataRootDir . 'queue-sizes.json'; self::$mediaDirectory = $htmlRootDir . DIRECTORY_SEPARATOR . 'media'; self::$imageDirectory = $htmlRootDir . DIRECTORY_SEPARATOR . 'image'; self::$mediaUrl = '/media/'; self::$imageUrl = '/image/'; self::$baseUrl = isset($_SERVER['HTTP_HOST']) ? 'http://' . $_SERVER['HTTP_HOST'] . '/' : 'http://graph.anime.plus/'; self::$googleAnalyticsEnabled = true; self::$adminPassword = ''; self::$maintenanceMessage = null; self::$noticeMessage = '<a href="http://myanimelist.net/clubs.php?cid=67199" target="_blank">JOIN OUR CLUB SENPAI!</a>'; self::$sendReferrer = true; self::$enforcedDomain = null; }
public static function doInit() { $dataRootDir = join(DIRECTORY_SEPARATOR, [__DIR__, '..', 'data', '']); $htmlRootDir = join(DIRECTORY_SEPARATOR, [__DIR__, '..', 'public_html']); self::$version = '4.2.0'; self::$mail = '*****@*****.**'; self::$cronInterval = 5; //minutes self::$usersPerCronRun = 5; self::$enqueueEnabled = true; self::$userQueuePath = $dataRootDir . 'queue-users.lst'; self::$userQueueMinWait = 24 * 60 * 60; //seconds self::$userQueueMaxAttempts = 20; self::$mediaPerCronRun = 5; self::$mediaQueuePath = $dataRootDir . 'queue-media.lst'; self::$mediaQueueMinWait = 7 * 24 * 60 * 60; //seconds self::$mediaQueueMaxAttempts = 2; self::$downloaderUserAgent = 'MALgraph v' . self::$version; self::$downloaderProxy = null; self::$downloaderCookieFilePath = $dataRootDir . 'cookies.dat'; self::$downloaderMaxParallelJobs = 10; self::$downloaderMaxTimeout = 10000; self::$downloaderUseMultiHandles = true; self::$mirrorEnabled = false; self::$mirrorPath = $dataRootDir . 'mirror'; self::$mirrorPurgeFailures = true; self::$cacheEnabled = true; self::$cachePath = $dataRootDir . 'cache'; self::$cacheTimeToLive = 24 * 60 * 60; self::$dbPath = $dataRootDir . 'db'; self::$dbCount = 64; self::$transactionCommitFrequency = 20; self::$maxDbBindings = 50; self::$maxProcessingAttempts = 1; self::$bannedUsersListPath = $dataRootDir . 'banned-users.lst'; self::$bannedGenresListPath = $dataRootDir . 'banned-genres.lst'; self::$bannedCreatorsListPath = $dataRootDir . 'banned-creators.lst'; self::$bannedGenresForRecsListPath = $dataRootDir . 'recs-banned-genres.lst'; self::$bannedFranchiseCouplingListPath = $dataRootDir . 'banned-franchise-coupling.lst'; self::$staticRecommendationListPath = $dataRootDir . 'static-recommendations.lst'; self::$achievementsDefinitionsDirectory = $dataRootDir . 'achievements'; self::$maxLogSize = 1024 * 1024 * 12; self::$keepOldLogs = false; self::$logsPath = $dataRootDir . 'logs'; self::$globalsCachePath = $dataRootDir . 'globals-cache.json'; self::$userQueueSizesPath = $dataRootDir . 'queue-sizes.json'; self::$mediaDirectory = $htmlRootDir . DIRECTORY_SEPARATOR . 'media'; self::$mediaUrl = '/media/'; self::$baseUrl = isset($_SERVER['HTTP_HOST']) ? 'http://' . $_SERVER['HTTP_HOST'] . '/' : 'http://mal.oko.im/'; self::$googleAnalyticsEnabled = true; self::$adminPassword = '******'; self::$maintenanceMessage = null; self::$noticeMessage = null; self::$sendReferrer = true; self::$enforcedDomain = null; }