Witam
Mam stronę napisaną w php (na zasadzie frameworka czyli wiele plików.php połączonych ze sobą), która poprawnie działa w XAMPP 1.7.7 (php wersja 5.3.8).
Pragnę zainstalować na swoim PC, najnowszy XAMPP 1.8.0, który ma wersję php 5.4.4.
(i oto moja obietnica dla wtajemniczonych z poprzedniego tematu - to już jest ostatnia wersja XAMPPa na jaką chce zamienić i jak pojawi się nowsza wersja to już nie będę zamieniał na nowszego XAMPP i od nowa prosił o pomoc)
Napotykam w sowiej stronie następujące błędy:
1) Strona główna mojej strony zawiera 2 (strzelam krytyczne) błędy:
http://i48.tinypic.com/349c45x.png2) posiadam w projekcie tylko stronę główną oraz stronę logowania w której występują następujące błędy:
http://i45.tinypic.com/287jl8m.pngProszę bardzo o pomoc w rozwiązaniu tych błędów.
Oto plik controller_base.php:
(błędy w 13 i 17 linii)
<?php
Abstract Class Controller_Base {
protected $registry;
function __construct($registry, $models, $addons, $layout, $controller) {
$this->registry = $registry;
$this->session = $registry->session;
$this->error = $registry->error;
$this->text = $registry->text;
$this->router = $registry->router;
$this->template = $registry->template;
$this->db = $registry->db;
foreach($models as $model){
$this->model->$model = $registry->model->$model;
}
if($addons)
foreach($addons as $addon){
$this->addon->$addon = $registry->addon->$addon;
}
$this->template->layout = $layout;
$this->here = $controller;
}
abstract function index($args=null,$post=null);
function addon($addon){
return 'http://'.server_addr.site_addr.'core/addons/'.$addon;
}
}
?>
plik: router.php:
(błędy w 118 i 131 linii)
<?php
Class Router {
private $registry;
private $path;
function __construct($registry) {
$this->registry = $registry;
}
function setPath($path) {
$path .= DIRSEP;
throw new Exception ('Invalid controller path: `' . $path . '`');
}
$this->path = $path;
}
private function getController(&$file, &$controller, &$action, &$args) {
$route = (empty($_GET['route'])) ?
'' : $_GET['route']; if (empty($route)) { $route = 'home'; }
// Get separate parts
$route = trim($route, '/\\'); // Find right controller
$cmd_path = $this->path;
foreach ($parts as $part) {
$fullpath = $cmd_path . $part;
// Is there a dir with this path?
$cmd_path .= $part . DIRSEP;
continue;
}
// Find the file
$controller = $part;
break;
}
}
if (empty($controller)) { $controller = 'home'; };
// Get action
if (empty($action)) { $action = 'index'; }
$file = $cmd_path . $controller . iext;
$args = $parts;
}
function delegate() {
// Analyze route
$this->getController($file, $controller, $action, $args);
// File available?
$controller_name=$controller;
die ('404 - Controller File Not Found'); }
// Include the file
include ($file);
// Initiate the class
$class = 'Controller_' . $controller;
/// LANGUAGE
if($controller=="admin")
$name='pl';
else
$name=$_SESSION['language'];
if($name=="") $name="eng";
$mfile=site_path . 'views' . DIRSEP . 'texts' . DIRSEP . $name . iext;
die ('404 - Texts File Not Found: '.$mfile); }
include($mfile);
$text_name='Text_'.$name;
$text = new $text_name($this->registry);
$this->registry->text = $text;
////////////
if($addons)
foreach($addons as $addon){
$mfile=core_path . 'addons' . DIRSEP .$addon . iext;
die ('404 - Addon File Not Found'); }
include($mfile);
$addon_name='Addon_' . $addon;
$addon2 = new $addon_name($this->registry);
$this->registry->addon->$addon = $addon2;
}
foreach($models as $name){
$mfile=site_path . 'models' . DIRSEP . $name . iext;
die ('404 - Model File Not Found'); }
include($mfile);
$model_name='Model_' . $name;
$model = new $model_name($this->registry);
$this->registry->model->$name = $model;
}
$controller = new $class($this->registry, $models, $addons, $layout, $controller);
// Action available?
if (is_callable
(array($controller, $action)) == false) {
$this->redirect('home/deadend/'.$controller_name.'/'.$action);
die ('404 - Controller Action Not Found'); }
// Run action
if(is_callable
(array($controller, 'BeforeFilter')) == true) $controller->BeforeFilter($action,$controller_name,$args,$_POST);
$controller->$action($args,$_POST);
}
function redirect($route){
header("Location: ".site_addr
.$route); }
}
?>
Proszę o pomoc co dokładnie znaczą te komunikat i co trzeba w takim wypadku podjąć za kroki... (nie chodzi mi o wyłożenie wszystkiego na tacy - tylko chociaż pomoc w nakierowaniu mnie na właściwy trop próby poprawy)
-Opcja wyłączenia błędów:
error_reporting ('E_ALL ^E_DEPRECATED ^E_NOTICE');
Odpada, ponieważ mój projekt musi być OK. Ale jak ją włączę to nie ma niepożądanych efektów na stronie.
Ten post edytował r3pilc3 29.07.2012, 11:40:15