Skip to content

Internalize like_escape() and esc_sql() functions to avoid $wpdb dependency #65

@andrewalcantara

Description

@andrewalcantara

Received a Fatal Error when running the following command:

$ wp db search "hello" --path=/Users/andrew/wp/

Fatal error: Call to undefined function like_escape() in /Users/andrew/wp-cli/db-command/src/DB_Command.php on line 1081

Scenarios:

  1. When running the command inside the db-command directory, that is when the error appear.
  2. When running the command in my home directory, the error does not appear.

My environment:

$ wp --info
PHP binary:	/usr/bin/php
PHP version:	5.6.30
php.ini used:	
WP-CLI root dir:	phar://wp-cli.phar
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/andrew/wp-cli/db-command
WP-CLI packages dir:	
WP-CLI global config:	
WP-CLI project config:	/Users/andrew/wp-cli/db-command/wp-cli.yml
WP-CLI version:	1.4.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions