One way to get around that error is to always declare your classes like this:
if(!class_exists('ClassName')) { class ClassName { // ... } }
Of course, this doesn't solve your underlying issue of having the same class being imported multiple times. Check your application's logic and determine where it is being required.
Difference Between require and require_once
require 'file1.php'; require 'file1.php'; // versus... require_once 'file1.php'; require_once 'file1.php';
In the first set, file1.php will be executed twice. In the second it will only be executed once. It really is as simple as that.
If both give you an error, then there may be an error in the file you are attempting to include. Remember that code inside included or required files executes in the same scope as the point that it was included.
require_oncetorequire? because that would certainly cause the error you see if you try to require a file that declares a class more than once. you don't need to query anything, just use require_once, that's what it's for. If it's not included it will include it, or complain, otherwise it'll do nothing.find . | xargs grep -E "(include|require)" | grep "Logger"and check that you didn't miss anything.