These functions are present in every PHP version we support now.
Change-Id: I11add0fc9f6c3c3caff859db9c0475c4d2818577
protected function mysqlSetCharset( $charset ) {
$conn = $this->getBindingHandle();
- if ( method_exists( $conn, 'set_charset' ) ) {
- return $conn->set_charset( $charset );
- } else {
- return $this->query( 'SET NAMES ' . $charset, __METHOD__ );
- }
+ return $conn->set_charset( $charset );
}
/**
return;
}
// @todo Find and store type of xml snippet. metadata['metadataType'] = "rdf"
- if ( method_exists( $this->reader, 'readInnerXML' ) ) {
- $this->metadata[$metafield] = trim( $this->reader->readInnerXml() );
- } else {
- throw new MWException( "The PHP XMLReader extension does not come " .
- "with readInnerXML() method. Your libxml is probably out of " .
- "date (need 2.6.20 or later)." );
- }
+ $this->metadata[$metafield] = trim( $this->reader->readInnerXml() );
+
$this->reader->next();
}
*/
public static function getDummySession( $backend = null, $index = -1, $logger = null ) {
$rc = new \ReflectionClass( Session::class );
- if ( !method_exists( $rc, 'newInstanceWithoutConstructor' ) ) {
- \PHPUnit_Framework_Assert::markTestSkipped(
- 'ReflectionClass::newInstanceWithoutConstructor isn\'t available'
- );
- }
if ( $backend === null ) {
$backend = new DummySessionBackend;