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'); }
* @author Nicolas Lœuillet <*****@*****.**> * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ define('POCHE', '1.7.2'); require 'check_setup.php'; require_once 'inc/poche/global.inc.php'; # Set error reporting level if (defined('ERROR_REPORTING')) { error_reporting(ERROR_REPORTING); } # Start session Session::$sessionName = 'poche'; Session::init(); # Start Poche $poche = new Poche(); $notInstalledMessage = $poche->getNotInstalledMessage(); # Parse GET & REFERER vars $referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; $view = Tools::checkVar('view', 'home'); $action = Tools::checkVar('action'); $id = Tools::checkVar('id'); $_SESSION['sort'] = Tools::checkVar('sort', 'id'); $url = new Url(isset($_GET['url']) ? $_GET['url'] : ''); # vars to _always_ send to templates $tpl_vars = array('referer' => $referer, 'view' => $view, 'poche_url' => Tools::getPocheUrl(), 'title' => _('wallabag, a read it later open source system'), 'token' => Session::getToken(), 'theme' => $poche->getTheme()); if (!empty($notInstalledMessage)) { if (!Poche::$canRenderTemplates || !Poche::$configFileAvailable) { # We cannot use Twig to display the error message echo '<h1>Errors</h1><ol>'; foreach ($notInstalledMessage as $message) {
<?php /** * wallabag, self hostable application allowing you to not miss any content anymore * * @category wallabag * @author Nicolas Lœuillet <*****@*****.**> * @copyright 2013 * @license http://opensource.org/licenses/MIT see COPYING file */ define('POCHE', '1.9.0'); require 'check_essentials.php'; require 'check_setup.php'; require_once 'inc/poche/global.inc.php'; // Start session Session::$sessionName = 'wallabag'; Session::init(); // Let's rock ! $wallabag = new Poche(); $wallabag->run();
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; }