require_once INCLUDES . '/poche/Poche.class.php'; require_once INCLUDES . '/poche/Database.class.php'; require_once INCLUDES . '/3rdparty/simple_html_dom.php'; require_once INCLUDES . '/3rdparty/paginator.php'; require_once INCLUDES . '/3rdparty/Session.class.php'; require_once INCLUDES . '/3rdparty/libraries/feedwriter/FeedItem.php'; require_once INCLUDES . '/3rdparty/libraries/feedwriter/FeedWriter.php'; require_once INCLUDES . '/3rdparty/FlattrItem.class.php'; require_once INCLUDES . '/3rdparty/htmlpurifier/HTMLPurifier.auto.php'; # epub library require_once INCLUDES . '/3rdparty/libraries/PHPePub/Logger.php'; require_once INCLUDES . '/3rdparty/libraries/PHPePub/EPub.php'; require_once INCLUDES . '/3rdparty/libraries/PHPePub/EPubChapterSplitter.php'; # Composer its autoloader for automatically loading Twig if (!file_exists(ROOT . '/vendor/autoload.php')) { Poche::$canRenderTemplates = false; } else { require_once ROOT . '/vendor/autoload.php'; } # system configuration; database credentials et caetera if (!file_exists(INCLUDES . '/poche/config.inc.php')) { Poche::$configFileAvailable = false; } else { require_once INCLUDES . '/poche/config.inc.php'; require_once INCLUDES . '/poche/config.inc.default.php'; } if (Poche::$configFileAvailable && DOWNLOAD_PICTURES) { require_once INCLUDES . '/poche/pochePictures.php'; } if (!ini_get('date.timezone') || !@date_default_timezone_set(ini_get('date.timezone'))) { date_default_timezone_set('UTC');
public function themeIsInstalled() { $passTheme = TRUE; # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet if (!self::$canRenderTemplates) { $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. You can also download <a href="http://wllbg.org/vendor">vendor.zip</a> and extract it in your wallabag folder.'; $passTheme = FALSE; } if (!is_writable(CACHE)) { $this->notInstalledMessage[] = 'You don\'t have write access on cache directory.'; self::$canRenderTemplates = false; $passTheme = FALSE; } # Check if the selected theme and its requirements are present $theme = $this->getTheme(); if ($theme != '' && !is_dir(THEME . '/' . $theme)) { $this->notInstalledMessage[] = 'The currently selected theme (' . $theme . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $theme . ')'; self::$canRenderTemplates = false; $passTheme = FALSE; } $themeInfo = $this->getThemeInfo($theme); if (isset($themeInfo['requirements']) && is_array($themeInfo['requirements'])) { foreach ($themeInfo['requirements'] as $requiredTheme) { if (!is_dir(THEME . '/' . $requiredTheme)) { $this->notInstalledMessage[] = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $theme . ')'; self::$canRenderTemplates = false; $passTheme = FALSE; } } } if (!$passTheme) { return FALSE; } return true; }