Double defined constants
To fix the specific error here you can check if a constant is already defined before defining it:
if ( ! defined( 'DIR_FS_CATALOG' ) )
define( 'DIR_FS_CATALOG', 'something...' );
I'd personally start with a search in the codebase for the constant DIR_FS_CATALOG
, then replace the double definition with this.
Hiding PHP notices inline, case-by-case
PHP provides the @
error control operator, which you can use to ignore specific functions that cause notices or warnings.
Using this you can ignore/disable notices and warnings on a case-by-case basis in your code, which can be useful for situations where an error or notice is intentional, planned, or just downright annoying and not possible to solve at the source. Place an @
before the function or var that's causing a notice and it will be ignored.
Here's an example:
// Intentional file error
$missing_file = @file( 'non_existent_file' );
More on this can be found in PHP's Error Control Operators docs.