3

I am using Codeigniter as my PHP framework. When I run the factual API I get results but there are PHP warnings.

Severity: Warning 

Message: include(/home/bwilson/public_html/factual/CI_DB.php): failed to open stream: No such file or directory 

Filename: factual/Factual.php 

Line Number: 217 

Severity: Warning 

Message: include(): Failed opening '/home/bwilson/public_html/factual/CI_DB.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') 

Filename: factual/Factual.php 

Line Number: 217 

I a look at line 217 in the factual.php file and it reads:

include dirname(__FILE__)."/".$className . ".php"; 

What is the referring to? I have tested this without running the Factual API and the controllers load find. It is only when I start using the Factual API.

This is the reply I received from Factual:

The driver employs an SPL Autoload function to include files for unloaded classes dynamically.

Here, the class CI_DB -- a Codeigniter class, not Factual -- is being called without being loaded first. This triggers our autoload feature in a final attempt to load the file.

In short: this is not a Factual driver issue; to solve, ensure the file containing the CI_DB class is loaded properly.

amalloy
  • 75,856
  • 7
  • 133
  • 187
Brandon Wilson
  • 4,099
  • 7
  • 51
  • 82

3 Answers3

1

It's just trying to find CI_DB.php in the same folder as factual.php.

Make sure that file actually exists where it's trying to find it. Pay attention to what case the filename is.

If the file does indeed exist where its supposed to, check its permissions.

simshaun
  • 20,601
  • 1
  • 51
  • 69
  • I don't have a file name `CI_DB.php` anywhere in my Codeigniter directory. I downloaded a fresh copy of Codeigniter to see if there is a file located in the copy, and there isn't. Not sure what this file is and what it is referencing. – Brandon Wilson May 03 '12 at 17:10
  • Look in `system/database/DB.php`, line 129. You may want to do a var_dump on CI_DB after that to make sure it is being set. – simshaun May 03 '12 at 20:21
0

After looking for into the error returns unsupported modules. I just disabled the error reporting in the index.php file by setting error reporting to production. In the mean time I am okay with it as long as my results are the same.

Thank you everyone that contributed.

Brandon Wilson
  • 4,099
  • 7
  • 51
  • 82
-1

Do you use?:

require_once BASEPATH . "/{$className}.php";
Robert
  • 24,191
  • 8
  • 59
  • 72
csotelo
  • 1,443
  • 2
  • 27
  • 42