Created
March 28, 2017 19:00
-
-
Save brianium/daaf5228fe30cb16b65d3fa79e5faa3d to your computer and use it in GitHub Desktop.
Provides the minimum interface required for Phinx's use of PDO within adapters.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class PdoLikeObject - its like PDO, but not! | |
*/ | |
class PdoLikeObject | |
{ | |
/** | |
* Return the given value after it has been quoted by WordPress' esc_sql function | |
* | |
* @param string $value | |
* @return array|string | |
*/ | |
public function quote($value) | |
{ | |
return esc_sql($value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Phinx seems to pass the PDO connection around just for the purpose of quoting values. We fake the connection object out by stubbing this in as the
connection
property inside theWpdbAdapter