• Hi Pierre,

    with active APCu Manager I cannot use wp commands, I always get:

    >Parse error: syntax error, unexpected ‘|’, expecting variable (T_VARIABLE) in ../wp-content/plugins/apcu-manager/includes/libraries/decalog-sdk/EventsLogger.php on line 76

    With deactivated APCu, but still activated Decalog plugin, the error changes to:

    >Parse error: syntax error, unexpected ‘|’, expecting variable (T_VARIABLE) in ../wp-content/plugins/decalog/includes/api/class-logger.php on line 60

    Everything is up to date, PHP is 8.1 – any idea what to do about this?

    Regards, André

Viewing 3 replies - 1 through 3 (of 3 total)
  • Arnaud

    (@charlyaes32)

    Solution is here (maybe):
    Go on your ftp on : /wp-content/plugins/apcu-manager/includes/libraries/decalog-sdk/EventsLogger.php and edit line 76 like this:

    public function emergency( $message, array $context = [] ): void { // Vérifier si $message est un string ou un objet Stringable if ( !is_string( $message ) && !( $message instanceof Stringable ) ) { throw new InvalidArgumentException( 'Le paramètre $message doit être une cha?ne de caractères ou un objet Stringable.' ); } if ( !is_array( $context ) ) { $context = [ 'code' => 30973 ]; $this->debug( 'Wrong method argument: $context must be an array.', $context ); } foreach ( $this->loggers as $logger ) { $logger->emergency( (string) $message, array_key_exists( 'code', $context ) ? (int) $context['code'] : 0 ); } }
    Thread Starter André Brückner

    (@tichypress)

    Hi Arnaud,

    thanks for your reply! Yes, in a way it solves the problem.

    There were 8 more occurences in EventsLogger.php I had to “prepare”. Then the error moved to plugins/decalog/includes/api/class-logger.php with again several occurences (every message type). But with your solution, I could in a way fix them all.

    So, for the moment I can run wp commands without error.

    Thanks again! André

    Thread Starter André Brückner

    (@tichypress)

    Hi Arnaud,

    I hoped the issue would be solved with the update of APCu Manager to a new version, but as far as I can read the diff 4.0.0 > 4.1.0, this is not the case. Can you confirm? Is it planned to change APCu Manager in near future to solve the issue? Or is there anything I can do to make my environment compatible?

    Regards, André

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.