papaya CMS PHP Cross Reference Content Management Systems

Source: /index.php - 63 lines - 2559 bytes - Summary - Text - Print

Description: This script is responsible for generating all frontend output of papaya CMS, including file delivery (if not static or themes). It also handles basic system errors like lack of the papaya library, static error document and maintenance mode.

   1  <?php
   2  /**
   3  * This script is responsible for generating all frontend output of papaya CMS, including
   4  * file delivery (if not static or themes). It also handles basic system errors like lack
   5  * of the papaya library, static error document and maintenance mode.
   6  *
   7  * @copyright 2002-2008 by papaya Software GmbH - All rights reserved.
   8  * @link http://www.papaya-cms.com/
   9  * @license   GNU General Public Licence (GPL) 2 http://www.gnu.org/copyleft/gpl.html
  10  *
  11  * You can redistribute and/or modify this script under the terms of the GNU General Public
  12  * License (GPL) version 2, provided that the copyright and license notes, including these
  13  * lines, remain unmodified. papaya is distributed in the hope that it will be useful, but
  14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15  * FOR A PARTICULAR PURPOSE.
  16  *
  17  * @package Papaya
  18  * @subpackage Frontend
  19  * @version $Id: index.php 39085 2014-01-29 13:54:30Z weinert $
  20  */
  21  
  22  /**
  23  * Including the basic configuration file
  24  */
  25  if (file_exists('../papaya.php')) {
  26    include_once('../papaya.php');
  27  } else {
  28    include_once('./conf.inc.php');
  29  }
  30  
  31  if (defined('PAPAYA_DBG_DEVMODE') && PAPAYA_DBG_DEVMODE) {
  32    $PAPAYA_FOUND_LIBRARY = include_once (PAPAYA_INCLUDE_PATH.'system/papaya_page.php');
  33  } else {
  34    $PAPAYA_FOUND_LIBRARY = @include_once (PAPAYA_INCLUDE_PATH.'system/papaya_page.php');
  35  }
  36  if ((!$PAPAYA_FOUND_LIBRARY) || (defined('PAPAYA_MAINTENANCE_MODE') && PAPAYA_MAINTENANCE_MODE)) {
  37    if (php_sapi_name() == 'cgi' || php_sapi_name() == 'fast-cgi') {
  38      @header('Status: 503 Service Unavailable');
  39    } else {
  40      @header('HTTP/1.1 503 Service Unavailable');
  41    }
  42    if (defined('PAPAYA_MAINTENANCE_MODE') && PAPAYA_MAINTENANCE_MODE &&
  43        defined('PAPAYA_ERRORDOCUMENT_MAINTENANCE') &&
  44        file_exists(PAPAYA_ERRORDOCUMENT_MAINTENANCE) &&
  45        is_file(PAPAYA_ERRORDOCUMENT_MAINTENANCE) &&
  46        is_readable(PAPAYA_ERRORDOCUMENT_MAINTENANCE)) {
  47      header('Content-type: text/html; charset=utf-8;');
  48      readfile(PAPAYA_ERRORDOCUMENT_MAINTENANCE);
  49    } elseif (defined('PAPAYA_ERRORDOCUMENT_503') && file_exists(PAPAYA_ERRORDOCUMENT_503) &&
  50      is_file(PAPAYA_ERRORDOCUMENT_503) && is_readable(PAPAYA_ERRORDOCUMENT_503)) {
  51      header('Content-type: text/html; charset=utf-8;');
  52      readfile(PAPAYA_ERRORDOCUMENT_503);
  53    } else {
  54      echo 'Service Unavailable';
  55    }
  56  } else {
  57    if ((!defined('PAPAYA_WEBSITE_REVISION')) && is_readable('revision.inc.php')) {
  58      include_once ('./revision.inc.php');
  59    }
  60    $PAPAYA_PAGE = new papaya_page();
  61    $PAPAYA_PAGE->execute();
  62    $PAPAYA_PAGE->get();
  63  }

title

Description

title

Description

title

Description

title

title

Body