Skip to content

Commit

Permalink
at first set file loaded, than load file.
Browse files Browse the repository at this point in the history
i had trouble with "Cannot redeclare class DboSource". The Problem is that the file is loaded and may the included file also requires that class. In this case the __load function recalls and reload the same file because the loaded flag isnt set.


try include *\cake\libs\model\datasources\dbo_source.php
try include *\cake\libs\model\datasources\dbo_source.php
finsed include *\cake\libs\model\datasources\dbo_source.php
PHP Fatal error:  Cannot redeclare class DboSource in *\cake\libs\model\datasources\dbo_source.php
  • Loading branch information
timglabisch committed Jul 23, 2012
1 parent 57106b1 commit 3f1edf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/configure.php
Expand Up @@ -1064,8 +1064,8 @@ function __load($file) {
}
if (file_exists($file)) {
if (!$this->return) {
require($file);
$this->__loaded[$file] = true;
require($file);
}
return true;
}
Expand Down

0 comments on commit 3f1edf7

Please sign in to comment.