• Resolved André Brückner

    (@tichypress)


    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 5 replies - 1 through 5 (of 5 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é

    Plugin Author Pierre Lannoy

    (@pierrelannoy)

    Hi @tichypress

    Now that the checkbox (about WPE) to connect to wp.org has been removed, I can finally reconnect. Sorry for the inconvenience and if it happens again, feel free to go through Github: there’s none of that bullshit about WP vs WPE.

    Your issue is due to your PHP version. I can assure you this error tells you: you don’t meet plugin requirements. Mainly, you’re not using PHP 8.X…

    Do you have this error in your site, or only when you use wp-cli?

    Thread Starter André Brückner

    (@tichypress)

    Hi Pierre,

    your pointing out what’s wrong here: the website is running on PHP 8.1, BUT wp-cli runs 7.4 – I had overseen this diff.

    Thanks for your help!

    André

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WP-CLI Parse error with APCu Manager’ is closed to new replies.