-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathConnParamBool.php
39 lines (34 loc) · 1.17 KB
/
ConnParamBool.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once 'Generic.php';
/**
* Converter: generic, mysql_func([resource]) -> ((bool)mysqli_func(resource)).
*
* @category Functions
*
* @author Andrey Hristov <andrey@php.net>, Ulf Wendel <ulf.wendel@phpdoc.de>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
*
* @version CVS: $Id:$, Release: @package_version@
*
* @link http://www.mysql.com
* @since Class available since Release 1.0
*/
class MySQLConverterTool_Function_ConnParamBool extends MySQLConverterTool_Function_Generic
{
public function handle(array $params = array())
{
if (count($params) > 1) {
return array(self::PARSE_ERROR_WRONG_PARAMS, null);
}
@list($conn) = $this->extractParamValues($params);
if (is_null($conn)) {
$conn = $this->ston_name;
}
return array(null, '((is_null($___mysqli_res = '.$this->new_name.'('.$conn.'))) ? false : $___mysqli_res)');
}
public function getConversionHint()
{
return 'Generic class for all functions that look like mysql_foo([<link_identifier>]) -> ((bool)mysqli_bar(<link_identifier>))';
}
}