Skip to:
Content
Pages
Categories
Search
Top
Bottom

WP_CLI\CommandWithDBObject

  • @fliohmy

    Participant

    Hello BuddyPress people,

    I’m just here to see if I can get a project going that I didn’t build myself, so please forgive my ignorance when it comes to BuddyPress and its inner workings.

    When I install buddypress via composer, it creates a “cli” folder next to the various “bp_*” folders in plugins/buddypress/.

    In buddypress/cli is a file called command.php. This file extends WP_CLI\CommandWithDBObject which no longer is part of WP_CLI, which in turn throws a fatal error.

    To be fair, I have no idea if this /cli/ folder is actually part of BuddyPress or some hack the previous developer added, because the folder is not there when I clone BuddyPress via git.

    If this is indeed the previous developer playing tricks on me then I apoligze for taking up your time.

    All the best,
    Fredrik

Viewing 6 replies - 1 through 6 (of 6 total)
  • @espellcaste

    Moderator

    This file extends WP_CLI\CommandWithDBObject which no longer is part of WP_CLI, which in turn throws a fatal error.

    This is news to me. I’ll look into it.

    And your previous developer is not playing tricks. The CLI is bundled with BuddyPress when we release a new version We develop it separately here: https://github.com/buddypress/wp-cli-buddypress

    @espellcaste

    Moderator

    I see it is still bundled: https://github.com/wp-cli/entity-command/blob/main/src/WP_CLI/CommandWithDBObject.php

    I also think if that were true, our unit tests would fail. It is more likely you do not have wp-cli installed in your project.

    Could you confirm going over these docs?

    @fliohmy

    Participant

    Thanks for your quick reply,

    In the entity-command docs it says “This package is included with WP-CLI itself, no additional installation necessary.”

    It is however, not installed.

    When I check the wp_cli composer.json, wp-cli/entity-command is listed under require-dev. That could perhaps explain why entity-command (and therefore CommandWithDBObject) is not installed in a non-dev environment.

    I suppose including entity-command manually would solve my issue, and I should probably ask the wp_cli people about what is going on as well.

    Cheers,
    Fredrik

    @fliohmy

    Participant

    wp_cli support suggested I move from “wp-cli/wp-cli” to “wp-cli/wp-cli-bundle” which includes all files.

    @espellcaste

    Moderator

    Awesome! is this public? Could you share your wp_cli support link here? Just in case someone runs into this in the future.

    @fliohmy

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