DirPHP crystalpage.sourceforge.net / code / index.php

*** PHP FILE DISPLAY STARTS HERE ***

<?php

/**
  +----------------------------------------------------------------------+
  | Crystalpage 3.0 - Content Management System                          |
  +----------------------------------------------------------------------+
  | Copyright (c) 2006 Karim Agha                                        |
  +----------------------------------------------------------------------+
  |  This script is part of the Crystalpage project.                     |
  |  The Crystalpage project is free software; you can redistribute      |
  |  it and/or modify it under the terms of the GNU General Public       |
  |  License as published by|the Free Software Foundation; either        |
  |  version 2 of the License, or (at your option) any later version.    |
  +----------------------------------------------------------------------+
  | @package Crystalpage CMS 3.0                                         |
  | @version 3.0 Alpha                                                   |
  | @author Crystalpage development team                                 |
  +----------------------------------------------------------------------+
  */
if(!defined('CRYSTALPAGE_')) {
    die (
"<b>You cannot access this file directly!</b>");
}

/* $_CP varialble, the variable that holds all the various crystalpage values */
$_CP = array();
/* included files */
/* the config.php caused errors whe not using chdir() */
chdir('cpLib/pear/');
require_once(
"Config.php");
require_once(
'XML/Parser.php');
require_once(
'XML/Util.php');
//require_once("Log.php");
chdir('../../');


/* include the required files, these files are critical ones,
  if one of them fails to load the operations of the system is halted, that's why the are required not included.
  The init.php file is the central location for including the depencies.
  */
require_once("cpLib/pear/adodb/adodb.inc.php");
require_once(
"cpLib/class.Extension.php");
require_once(
"cpLib/class.StartupExtension.php");
require_once(
"cpLib/class.Log.php");
require_once(
"cpLib/class.config.php");
require_once(
"cpLib/class.user.php");
require_once(
"cpLib/class.panels.php");
require_once(
"cpLib/class.block.php");
require_once(
"cpLib/class.layoutParser.php");
require_once(
"cpLib/class.TagHandler.php");
require_once(
"cpLib/class.ExtTagHandler.php");
require_once(
"cpLib/class.messaging.php");
require_once(
"prado/framework/prado.php");
require_once(
"cpLib/interface.RequestHandler.php");
require_once(
"cpLib/class.FileRequestHandler.php");
require_once(
"cpLib/class.HttpResponse.php");
require_once(
"cpLib/class.DatabaseProvider.php");
require_once(
"cpLib/class.TagParser.php");
/* End of included files */
$HttpResponse = new HttpResponse();
ob_start( array(&$HttpResponse,"OBHandler"));
ob_start();


$_CP['config'] = parse_ini_file("systemConfig/mainConfig.ini.php",true);
$_CP['Log'] = &Log::factory('file'$_CP['config']['Paths']['LogsDir'].date("d-m-Y").".log"'TEST');


/* Creating a database connection before doing anything, this is nessesary because some startup
modules might need database connectivity */
$_DB DatabaseProvider::GetDatabaseInstance();
$_CP['dbPrefix'] = $_CP['config']['Database']['Prefix'];
/* This array holds the loaded extensions and their data */

$_CP['loadedExt'] = array();
$_CP['extManager'] = new StartupExtension();
$_CP['extManager']->CheckAndInstall();
/* Loading the DBConfig table into an array $_CFG */

$c = new CPConfig();
$c->FillConfigArray();
$_CFG $c->ConfigArray;

/* Searching the Extension Directory for startup extensions that will be executed now */
if ($dir_handle opendir('extensions/')) {


    
$files scandir('extensions/');

    for(
$i=2;$i count($files); $i++) {
        if(
is_dir('extensions/'.$files[$i]) && 'extensions/'.$files[$i] != "." && 'extensions/'.$files[$i] != "..") {
            
$files_in_dir scandir('extensions/'.$files[$i]);
            if(
in_array("ext.xml",$files_in_dir))
            {
                
$extCH = new Config;
                
/* check in the ext.xml if the extension type is startup */
                
$root =&$extCH->parseConfig('extensions/'.$files[$i].'/ext.xml''XML');
                
$settings $root->toArray();
                if(
strtolower($settings['root']['Extension']['Type']) == 'startup')
                {
                    
$_CP['extManager']->ExecuteExtension(($settings['root']['Extension']['ShortName']));
                }

            }
        }
    }
}
/* creating i18n function, without class to help get the string faster without the need to write function and
class prefix, this is the only exception where OO is not used. 
function _($string) {
    global $_CFG;
    $string = trim(strtolower($string));
    $language = $_CFG['system_language'];
    require_once("i18n/lang.$language.php");

    if(!empty($cp_Lang[$string])) {
        return $cp_Lang[$string];
    } else {
        return $string;
    }

}
/* end of _function this function shall be used as follows: _("Text to translate");*/

/* Initialize user class and look for a logged user, if found continue to the mainPanel, if not
show the loginPanel and die() */
$_USER = new UserBE();

//$_PANELS = new Panels();
/*
if($_USER->Authenticated != true) {

$_PANELS->ShowPanel('loginPanel');
die();
} else {
echo "dupa";
$_PANELS->ShowPanel('mainPanel');
}*/

//$lp = new layoutParser();
//$result = $lp->setInputFile('xml.xml');
//$result = $lp->parse();
//print_r($lp->contentPlaceholders);
$tp = new TagParser();
$result $tp->setInputFile('layouts/night-city/index.html');
$result $tp->parse();

ob_end_flush();
?>
1

*** PHP FILE DISPLAY ENDS HERE ***

DirPHP - version 1.0 - Created & Maintained by Stuart Montgomery
Written in Object Oriented PHP <http://scripts.ensitehosting.com/>