apereo / phpCAS

Apereo PHP CAS Client
https://apereo.github.io/phpCAS/
Apache License 2.0
796 stars 398 forks source link

Failed to include "CAS/Client.php" #63

Closed acharrex closed 11 years ago

acharrex commented 11 years ago

After updating my phpCAS from the version 1.3.1 to 1.3.2, the following error is printed on a Windows environment:

Warning: include(CAS/Client.php): failed to open stream: No such file or directory

This problem is due to the deletion of the "set_include_path" in the file "CAS/CAS/Autoload.php" (related to the tickets #51 and #52).

jfritschi commented 11 years ago

This sound really strange. The include statement is preceded by a fopen() call to validate the existence of the file? The include statement should only be called if the file does exist.

Are you using an IIS or what is the webserver you are using?

I have created a new branch to work on this issue. Can you please give this autoloader a try. Either check out the branch or just download the file and dump it into a recent phpCAS version manually.

This is just a wild guess but should give us at least a better error message to debug this remotely.

skotos commented 11 years ago

I've had the same issue as well. I have been working in a framework that has it's own autoloader. I think I solved it by the following...

--- CAS/CAS/Autoload.php    2013-01-24 16:11:26.000000000 +1100
+++ git-repos/my/protected/vendors/CAS-1.3.2/CAS/Autoload.php   2013-02-06 15:21:38.000000000 +1100
@@ -72,7 +72,7 @@
 // set up __autoload
 if (function_exists('spl_autoload_register')) {
     if (!(spl_autoload_functions()) || !in_array('CAS_autoload', spl_autoload_functions())) {
-        spl_autoload_register('CAS_autoload');
+        spl_autoload_register('CAS_autoload',true,true);
         if (function_exists('__autoload') && !in_array('__autoload', spl_autoload_functions())) {
             // __autoload() was being used, but now would be ignored, add
             // it to the autoload stack

This prepends the phpCAS autoloader in front of the autoloader that the framework uses. I still have other issues cassifying my app, but I believe they are unrelated.

jfritschi commented 11 years ago

@skotos Do you thing this prepend addresses a phpcas bug or a bug of your framework. I do not think a reverse order of autoloaders should make much of a difference?

jfritschi commented 11 years ago

No more feedback for 3 month. I assume this issue is fixed.

prafful-garg commented 9 years ago

This has not been fixed, my autoloader does not seems to be working, please help