Welcome Guest, Not a member yet? Register   Sign In
not working __autoload on windows.
#1

[eluser]mak.gnu[/eluser]
Hie,
I had added a function in a config, it works fine in the linux machine but I'm not able to run the my app in the windows machine. here is my function which is not working in windows
Code:
346 :function __autoload($className)
347 :{
348 :    $class = mb_strtolower($className);
349 :    
350 :    if(file_exists(getcwd()."/system/application/controllers/$className.php"))
351 :    {
352 :        require_once(getcwd()."/system/application/controllers/$className.php");
353 :    }
354 :    elseif (file_exists(getcwd()."/system/plugins/dompdf/include/$class.cls.php"))
355 :    {
356 :        require_once(getcwd()."/system/plugins/dompdf/include/$class.cls.php");
357 :    }
358 :}

and this is error I'm getting.
Code:
Fatal error: Cannot redeclare __autoload() (previously declared in C:\xampp\htdocs\food\application\config\config.php:346) in C:\xampp\htdocs\food\application\config\config.php on line 358

its giving me error on starting and on ending of the function.
#2

[eluser]drewbee[/eluser]
You have the function declared twice, bellows the error message.
#3

[eluser]mak.gnu[/eluser]
@drewbee thanks for replying but this a only place where I have declare the function. and you can see error page is same and the line of error is 346 and 358.
#4

[eluser]drewbee[/eluser]
Well, per the error message, it will be pretty hard to convince me you don't have it declared somewhere else.

What about in one of your controllers, or in the dompdf/includes files?

Edit:
I did some quick searching on DOMPdf, and it appears to use __autoload as well. Check the file dompdf_config.inc.php

and

this thread:
http://ellislab.com/forums/viewthread/112970/#570814




Theme © iAndrew 2016 - Forum software by © MyBB