Pogledajte određenu poruku
Staro 03. 10. 2014.   #1
stanke
član
Certified
 
Datum učlanjenja: 06.09.2012
Poruke: 64
Hvala: 0
342 "Hvala" u 10 poruka
stanke is on a distinguished roadstanke is on a distinguished roadstanke is on a distinguished roadstanke is on a distinguished road
Default autoload kalsa

Na localhost-u mi radi al kad uplodujem projekat na server ne moze da nadje klase dobijam gresku:

Fatal error: Class 'Core' not found in /home/a4899216/public_html/index.php on line 9

kod je sledeci u iindex stranici


<?php
//load classes
require_once 'inc/autoload.php';
//instatiate Core class
$core = new Core();
$core->run();

?>

autoload.php se nalazi u folderu inc i sadrzi sledeci kod za automtsko lodovanje klasa koje se nalaze u folder classes

<?php
function __autoload($class_name)
{
try
{
$class_file = 'classes/'. strtolower($class_name).'.php';
if(is_file($class_file))
{
require_once $class_file;
}
else
{
throw new Exception("Unable to load class $class_name in file $class_file.");
}
}
catch (Exception $e)
{
$e->getMessage();
}
}
?>
stanke je offline   Odgovorite uz citat