Sterx
htaccess с модреврайт
индексная страница main.php
rjl tt
Код:
<?php
ini_set('display_errors', 'On');
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
define("engineRoot", "/home/u4941/domain.com/www/paw/");
require_once(engineRoot . "loader.php");
$application = new bmApplication(null, null, null);
?>
код loader.php
Код:
<?php
ini_set('memory_limit', '-1');
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
function __autoload($class) {
$filename = $class . ".php";
if (file_exists(engineRoot . "classes/" . $filename)) {
require_once(engineRoot . "classes/" . $filename);
} elseif (file_exists("./userClasses/" . $filename)) {
require_once("./userClasses/" . $filename);
}
if (array_key_exists("application", $GLOBALS)) {
$locale = $GLOBALS["application"]->dynamicLocale ? array_key_exists('application_locale', $_REQUEST) ? $_REQUEST['application_locale'] : $GLOBALS["application"]->locale : $GLOBALS["application"]->locale;
if (file_exists(engineRoot . "locales/" . $locale . "/" . $filename)) {
require_once(engineRoot . "locales/" . $locale . "/" . $filename);
} elseif (file_exists("./userLocales/" . $locale . "/" . $filename)) {
require_once("./userLocales/" . $locale . "/" . $filename);
}
}
if (!array_key_exists("loadedClasses", $GLOBALS)) {
$GLOBALS["loadedClasses"] = array();
$GLOBALS["loadedClasses"][] = $class;
} else {
$count = count($GLOBALS["loadedClasses"]);
for ($i = 0; $i < $count; ++$i) {
$parentClass = $GLOBALS["loadedClasses"][$i];
}
if ($i == $count) {
$GLOBALS["loadedClasses"][] = $class;
} else {
array_splice($GLOBALS["loadedClasses"], $i, 0, array($class));
}
}
}
?>
как грузится индекс и из чего собирается непонятно.
кроме того мод реврайтом прописаны рулесы:
Код:
RewriteRule ^news/([0-9]+)?$ /main.php?application.switchForm=fNews&application.fNews.newsId=$1 [L]
как и куда ковырять такой движок?
Sterx
мне понять как и чего цепляется.
инклюд лоадера в майне, а дальше - в лоадере функция и все, вызова ее нигде нет
samedi
Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class).
In PHP 5, this is no longer necessary. You may define an __autoload function which is automatically called in case you are trying to use a class which hasn't been defined yet. By calling this function the scripting engine is given a last chance to load the class before PHP fails with an error.
http://ru2.php.net/autoload