Base.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. <?php
  2. namespace Qii\Driver;
  3. class Base
  4. {
  5. const VERSION = '1.2';
  6. public $_cache;
  7. public $language;
  8. protected $_query = array(
  9. "INSERT" => "INSERT INTO %s(%s) VALUES('%s')",
  10. "REPLACE" => "REPLACE %s (%s) VALUES('%s')",
  11. "SELECT" => "SELECT %s FROM %s",
  12. "UPDATE" => "UPDATE %s SET ",
  13. "DELETE" => "DELETE FROM %s %s",
  14. "WHERE" => " WHERE %s",
  15. "ORDER" => " ORDER BY %s %s",
  16. "GROUP" => " GROUP BY %s",
  17. "LIMIT" => " LIMIT %d, %d"
  18. );
  19. private $query;
  20. private $setArray = array();
  21. public $modelSQL = "";
  22. protected $fields;
  23. protected $where;
  24. protected $groupBy;
  25. protected $limit;
  26. protected $orderBy;
  27. public $load;
  28. /**
  29. * @var string $_response Response对象
  30. */
  31. protected $_response;
  32. //方法对应的别名
  33. protected $_modelAlias = array('selectRows' => 'selectAll', 'select' => 'selectRow', 'getOne' => 'selectOne', 'getRow' => 'selectRow', 'getAll' => 'selectAll', 'remove' => 'deleteRows');
  34. public function __construct()
  35. {
  36. $this->language = \Qii\Autoloader\Psr4::getInstance()->loadClass('Qii\Language\Loader');
  37. $this->load = \Qii\Autoloader\Psr4::getInstance()->loadClass('\Qii\Autoloader\Loader');
  38. $this->_response = new \Qii\Driver\Response();
  39. }
  40. /**
  41. * 获取数据库中所有的数据表
  42. * @return array
  43. */
  44. public function getAllDatabases()
  45. {
  46. $sql = "SHOW DATABASES";
  47. $rs = $this->setQuery($sql);
  48. $database = array();
  49. while($row = $rs->fetch())
  50. {
  51. $database[] = $row['Database'];
  52. }
  53. return $database;
  54. }
  55. /**
  56. * 数据库中是否包含指定库
  57. * @param string $database 数据库名
  58. * @return bool
  59. */
  60. public function hasDatabase($database)
  61. {
  62. if(!$database) return false;
  63. $sql = "SHOW DATABASES LIKE '". $database ."'";
  64. $rs = $this->setQuery($sql);
  65. while($row = $rs->fetch())
  66. {
  67. $val = array_values($row);
  68. if(in_array($database, $val))
  69. {
  70. return true;
  71. }
  72. }
  73. return false;
  74. }
  75. /**
  76. * 获取当前数据库中所有的表
  77. * @param null|string $database 数据库
  78. * @return array
  79. */
  80. public function getAllTables($database = null)
  81. {
  82. if($database)
  83. {
  84. $this->setQuery('USE '. $database);
  85. }
  86. $sql = "SHOW TABLES";
  87. $rs = $this->setQuery($sql);
  88. $tables = array();
  89. while($row = $rs->fetch())
  90. {
  91. if(is_array($row)) {
  92. foreach($row AS $val) {
  93. $tables[] = $val;
  94. }
  95. }
  96. }
  97. return $tables;
  98. }
  99. /**
  100. * 获取指定数据表的所有字段
  101. * @param string $table 表名
  102. * @param string $database 数据库名
  103. * @return array
  104. */
  105. public function getTableInfo($table, $database = null)
  106. {
  107. if(!$database) $database = $this->currentDB;
  108. $sql = "SELECT * from information_schema.COLUMNS where table_name = '".$table."' and table_schema = '".$database."'";
  109. $data = ['fields' => [], 'pri' => [], 'maxlen' => []];
  110. $rs = $this->setQuery($sql);
  111. while($row = $rs->fetch())
  112. {
  113. $data['fields'][] = $row['COLUMN_NAME'];
  114. if($row['COLUMN_KEY'] == 'PRI') $data['pri'][] = $row['COLUMN_NAME'];
  115. if(in_array($row['DATA_TYPE'], ['varchar', 'char']))
  116. {
  117. $data['maxlen'][$row['COLUMN_NAME']] = $row['CHARACTER_MAXIMUM_LENGTH'];
  118. }
  119. if(in_array($row['DATA_TYPE'], ['int', 'bigint', 'smallint', 'tinyint']))
  120. {
  121. preg_match('/[\d]{1,}/', $row['COLUMN_TYPE'], $matches);
  122. $data['int'][$row['COLUMN_NAME']] = $matches[0];
  123. }
  124. if(in_array($row['DATA_TYPE'], ['timestamp', 'datatime']))
  125. {
  126. $data['timestamp'][] = $row['COLUMN_NAME'];
  127. }
  128. }
  129. $data['sql'] = $this->getTableSQL($table, $database);
  130. return $data;
  131. }
  132. /**
  133. * 查询数据库中是否有指定的表
  134. * @param string $tableName 表名
  135. * @param null|string $database 数据库
  136. * @return bool
  137. */
  138. public function hasTable($tableName, $database = null)
  139. {
  140. if($database)
  141. {
  142. $this->setQuery('USE '. $database);
  143. }
  144. $sql = "SHOW TABLES LIKE '".$tableName."'";
  145. $rs = $this->setQuery($sql);
  146. $tables = array();
  147. while($row = $this->fetch($rs))
  148. {
  149. if(is_array($row)) {
  150. foreach($row AS $val) {
  151. if($val == $tableName) return true;
  152. }
  153. }
  154. }
  155. return false;
  156. }
  157. /**
  158. * 获取创建表的SQL语句
  159. * @param string $tableName 表名
  160. * @param null|string $database 数据库
  161. * @param int|null $autoIncr 自增长的值,null的话就不使用
  162. * @return string
  163. */
  164. public function getTableSQL($tableName, $database = null, $autoIncr = null)
  165. {
  166. if($database)
  167. {
  168. $this->setQuery('USE '. $database);
  169. }
  170. $row = $this->getRow("SHOW CREATE TABLE `".$tableName."`");
  171. if(!$row) {
  172. throw new \Exception('数据表不存在', __LINE__);
  173. }
  174. $sql = $row['Create Table'];
  175. if($autoIncr === null) {
  176. return $sql;
  177. }
  178. return preg_replace("/AUTO_INCREMENT=[\d]{1,}/", "AUTO_INCREMENT=". intval($autoIncr), $sql);
  179. }
  180. final public function getAlias($alias)
  181. {
  182. return isset($this->_modelAlias[$alias]) ? $this->_modelAlias[$alias] : null;
  183. }
  184. /**
  185. * 设置Cache
  186. *
  187. * @param String $cache
  188. * @param Array $policy
  189. */
  190. final public function setCache($cache, $policy)
  191. {
  192. \Qii\Autoloader\Import::requires(Qii_DIR . DS . 'Qii' . DS . 'Cache.php');
  193. $this->_cache = \Qii\Autoloader\Psr4::loadClass('\Qii\Cache', $cache)->initialization($policy);//载入cache类文件
  194. }
  195. /**
  196. * 缓存内容
  197. *
  198. * @param String $id
  199. * @param Array $value
  200. * @return Bool
  201. */
  202. final public function cache($id, $value)
  203. {
  204. return $this->_cache->set($id, $value);
  205. }
  206. /**
  207. * 获取缓存的类
  208. */
  209. final public function getCache()
  210. {
  211. return $this->_cache;
  212. }
  213. /**
  214. * 获取缓存内容
  215. *
  216. * @param String $id
  217. * @return Array
  218. */
  219. final public function getCacheData($id)
  220. {
  221. return $this->_cache->get($id);
  222. }
  223. /**
  224. * 获取表的名称
  225. * @param String $table
  226. * @return String
  227. */
  228. public function getTable($table)
  229. {
  230. return $table;
  231. }
  232. public function setLanguage()
  233. {
  234. $this->language = \Qii\Autoloader\Psr4::loadClass('Qii_Language_Loader');
  235. }
  236. /**
  237. *
  238. * Insert Object
  239. * @param String $table
  240. * @param Array|Object $dataArray
  241. */
  242. final function insertObject($table, $dataArray)
  243. {
  244. if (empty($table)) {
  245. return -1;
  246. }
  247. if (sizeof($dataArray) > 0 || (is_object($dataArray) && get_object_vars($dataArray)) > 0) {
  248. $keys = array();
  249. $values = array();
  250. foreach ($dataArray AS $key => $value) {
  251. $keys[] = $key;
  252. if(is_array($value))
  253. {
  254. throw new \Qii\Exceptions\InvalidFormat(_i('Invalid %s format', $key), __LINE__);
  255. }
  256. $values[] = $this->setQuote($value);
  257. }
  258. $this->modelSQL = $sql = "INSERT INTO `{$table}`(`" . join("`, `", $keys) . "`) VALUES('" . join("', '", $values) . "')";
  259. $this->setQuery($sql);
  260. $this->cleanData();
  261. $this->setError();
  262. return $this->lastInsertId();
  263. }
  264. return -2;
  265. }
  266. /**
  267. *
  268. * Replace Object
  269. * @param String $table
  270. * @param Array|Object $dataArray
  271. */
  272. final function replaceObject($table, $dataArray)
  273. {
  274. if (empty($table)) {
  275. return -1;
  276. }
  277. if (sizeof($dataArray) > 0 || get_object_vars($dataArray) > 0) {
  278. $keys = array();
  279. $values = array();
  280. foreach ($dataArray AS $key => $value) {
  281. $keys[] = $key;
  282. if(is_array($value))
  283. {
  284. throw new \Qii\Exceptions\InvalidFormat(_i('Invalid %s format', $key), __LINE__);
  285. }
  286. $values[] = $this->setQuote($value);
  287. }
  288. $this->modelSQL = $sql = "REPLACE INTO `{$table}`(`" . join("`, `", $keys) . "`) VALUES('" . join("', '", $values) . "')";
  289. $rs = $this->setQuery($sql);
  290. $this->cleanData();
  291. $this->setError();
  292. return $this->AffectedRows($rs);
  293. }
  294. return -2;
  295. }
  296. /**
  297. *
  298. * Update data
  299. * @param String $table
  300. * @param Array|Objct $dataArray
  301. * @param Array $keys
  302. */
  303. final function updateObject($table, $dataArray, $keys = array())
  304. {
  305. if (empty($table) || !is_array($keys)) {
  306. return -1;
  307. }
  308. if (sizeof($dataArray) > 0 || get_object_vars($dataArray) > 0) {
  309. $values = array();
  310. $where = array();
  311. foreach ($dataArray AS $key => $value) {
  312. if(is_array($value))
  313. {
  314. throw new \Qii\Exceptions\InvalidFormat(_i('Invalid %s format', $key), __LINE__);
  315. }
  316. $value = $this->setQuote($value);
  317. if (in_array($key, $keys)) {
  318. $where[] = "`{$key}` = '" . $value . "'";
  319. } else {
  320. $values[] = "`{$key}` = '" . $value . "'";
  321. }
  322. }
  323. //$keys为key => value的方式,就直接用keys
  324. if (empty($where) && count($keys) > 0) {
  325. foreach ($keys as $key => $value) {
  326. $value = $this->setQuote($value);
  327. $where[] = "`{$key}` = '" . $value . "'";
  328. }
  329. }
  330. $this->modelSQL = $sql = "UPDATE `{$table}` SET " . join(", ", $values) . (sizeof($where) > 0 ? " WHERE " . join(" AND ", $where) : '');
  331. $rs = $this->setQuery($sql);
  332. $this->cleanData();
  333. $this->setError();
  334. return $this->AffectedRows($rs);
  335. }
  336. return 0;
  337. }
  338. /**
  339. *
  340. * 删除数据
  341. * @param String $table
  342. * @param Array $keys
  343. */
  344. final function deleteObject($table, $keys = array())
  345. {
  346. if (empty($table)) {
  347. return -1;
  348. }
  349. $where = array();
  350. if (sizeof($keys) > 0 || get_object_vars($keys)) {
  351. foreach ($keys AS $k => $v) {
  352. $where[] = "`{$k}` = '" . $this->setQuote($v) . "'";
  353. }
  354. }
  355. $this->modelSQL = $sql = "DELETE FROM `{$table}`" . (sizeof($where) > 0 ? " WHERE " . join(" AND ", $where) : '');
  356. $rs = $this->query($sql);
  357. $this->cleanData();
  358. $this->setError();
  359. return $this->AffectedRows($rs);
  360. }
  361. /**
  362. * 需要清除的数据
  363. *
  364. * @return Array
  365. */
  366. final function cleanOptions()
  367. {
  368. return array('fields', 'where', 'groupBy', 'orderBy', 'limit', 'setArray');
  369. }
  370. /**
  371. * 清除数据
  372. *
  373. */
  374. final function cleanData()
  375. {
  376. $array = $this->cleanOptions();
  377. foreach ($array AS $k) {
  378. if (is_array($this->$k)) {
  379. $this->$k = array();
  380. } else {
  381. $this->$k = null;
  382. }
  383. }
  384. }
  385. /**
  386. *
  387. * 查询的字段
  388. * @param String $fileds
  389. */
  390. final function fields($fileds = "*")
  391. {
  392. $this->fields = null;
  393. if (empty($fileds)) $fileds = "*";
  394. if (is_array($fileds)) $fileds = join(',', $fileds);
  395. $this->fields = $fileds;
  396. return $this;
  397. }
  398. /**
  399. *
  400. * GROUP BY方法
  401. * @param String $fields
  402. */
  403. final function groupBy($fields)
  404. {
  405. $this->groupBy = null;
  406. if (!empty($fields)) {
  407. $this->groupBy = sprintf($this->_query['GROUP'], $fields);
  408. }
  409. return $this;
  410. }
  411. /**
  412. *
  413. * 插入数据用
  414. * @param Array $array
  415. */
  416. final function dataArray($array)
  417. {
  418. $this->fileds = null;
  419. if (is_array($array)) {
  420. $tmpArray = array();
  421. foreach ($array AS $k => $v) {
  422. $tmpArray['k'][] = $k;
  423. $tmpArray['v'][] = $this->setQuote($v);
  424. }
  425. $this->fileds = $tmpArray;
  426. }
  427. return $this;
  428. }
  429. /**
  430. *
  431. * Order By函数
  432. * @param String $field
  433. * @param String $orderBy
  434. */
  435. final function orderBy($field, $orderBy)
  436. {
  437. $this->orderBy = null;
  438. if (!empty($field)) {
  439. $this->orderBy = sprintf($this->_query['ORDER'], $field, $orderBy);
  440. }
  441. return $this;
  442. }
  443. /**
  444. *
  445. * Limit函数,如果省略第二个参数则第一个为0,第二个参数值取第一个
  446. * @param Int $limit
  447. * @param Int $offset
  448. */
  449. final function limit($limit, $offset = 0)
  450. {
  451. $this->limit = null;
  452. if ($limit !== '') {
  453. if (!$offset) {
  454. $this->limit = sprintf($this->_query["LIMIT"], 0, $limit);
  455. } else {
  456. $this->limit = sprintf($this->_query["LIMIT"], $limit, $offset);
  457. }
  458. }
  459. return $this;
  460. }
  461. /**
  462. * 传的条件为数组
  463. * @param Array $where 条件
  464. * @return Object 对象本身
  465. */
  466. final function whereArray($where)
  467. {
  468. $this->where = null;
  469. if (!empty($where)) {
  470. $whereArray = array();
  471. foreach ($where AS $k => $v) {
  472. $whereArray[] = " `{$k}` = '{$v}'";
  473. }
  474. if (sizeof($whereArray) > 0) {
  475. $whereSQL = join(" AND ", $whereArray);
  476. $this->where = sprintf($this->_query["WHERE"], $whereSQL);
  477. }
  478. }
  479. return $this;
  480. }
  481. /**
  482. *
  483. * WHERE 子句
  484. * @param String $where
  485. */
  486. final function where($where)
  487. {
  488. if (is_array($where)) return $this->whereArray($where);
  489. $this->where = null;
  490. if (!empty($where)) {
  491. $this->where = sprintf($this->_query["WHERE"], $where);
  492. }
  493. return $this;
  494. }
  495. /**
  496. *
  497. * 插入数据到指定表中
  498. * @param String $table
  499. */
  500. final function insertRow($table)
  501. {
  502. $this->modelSQL = $sql = sprintf($this->_query['INSERT'], $table, join(",", $this->fileds['k']), join("', '", $this->fileds['v']));
  503. $this->cleanData();
  504. $this->setQuery($sql, '');
  505. return $this->lastInsertId();
  506. }
  507. /**
  508. *
  509. * Replace方法
  510. * @param String $table
  511. */
  512. final function replaceRow($table)
  513. {
  514. $this->modelSQL = $sql = sprintf($this->_query['REPLACE'], $table, join(",", $this->fileds['k']), join("', '", $this->fileds['v']));
  515. $this->cleanData();
  516. return $this->exec($sql);
  517. }
  518. /**
  519. *
  520. * 查询一行
  521. * @param String $table
  522. */
  523. final function selectRow($table)
  524. {
  525. $this->modelSQL = $sql = sprintf($this->_query['SELECT'], ((trim($this->fields) != '') ? $this->fields : "*"), $table) . $this->where . $this->groupBy . $this->orderBy . $this->limit;
  526. $this->cleanData();
  527. return $this->getRow($sql);
  528. }
  529. /**
  530. *
  531. * 查询一行
  532. * @param String $table
  533. */
  534. final function selectOne($table)
  535. {
  536. $this->modelSQL = $sql = sprintf($this->_query['SELECT'], ((trim($this->fields) != '') ? $this->fields : "*"), $table) . $this->where . $this->groupBy . $this->orderBy . $this->limit;
  537. $this->cleanData();
  538. return $this->getOne($sql);
  539. }
  540. /**
  541. *
  542. * 查询所有
  543. * @param String $table
  544. * @return Array
  545. */
  546. final function selectAll($table)
  547. {
  548. $this->modelSQL = $sql = sprintf($this->_query['SELECT'], ((trim($this->fields) != '') ? $this->fields : "*"), $table) . $this->where . $this->groupBy . $this->orderBy . $this->limit;
  549. $this->cleanData();
  550. return $this->getAll($sql);
  551. }
  552. /**
  553. * 将指定字段减指定值
  554. *
  555. * @param $data
  556. * @return $this
  557. */
  558. final function downsetCounter($data)
  559. {
  560. if (is_array($data)) {
  561. foreach ($data AS $k => $value) {
  562. $this->setArray[] = $k . "=" . $k . '-' . $value;
  563. }
  564. }
  565. $this->set(null);
  566. return $this;
  567. }
  568. /**
  569. * 将指定字段加指定值
  570. *
  571. * @param $data
  572. * @return $this
  573. */
  574. final function upsetCounter($data)
  575. {
  576. if (is_array($data)) {
  577. foreach ($data AS $k => $value) {
  578. $this->setArray[] = $k . "=" . $k . '+' . $value;
  579. }
  580. }
  581. $this->set(null);
  582. return $this;
  583. }
  584. /**
  585. * 更新数据时候用,方法同setData
  586. * @param Array $data
  587. */
  588. final function set($data)
  589. {
  590. return $this->setData($data);
  591. }
  592. /**
  593. *
  594. * 更新数据时候用
  595. * @param Array $data
  596. * @return $this
  597. */
  598. final function setData($data)
  599. {
  600. if (is_array($data)) {
  601. $set = array();
  602. foreach ($data AS $k => $value) {
  603. $set[] = $k . "='" . $this->setQuote($value) . "'";
  604. }
  605. if (sizeof($this->setArray) > 0) {
  606. $this->set = " " . join(", ", $set) . ", " . join(",", $this->setArray);
  607. } else {
  608. $this->set = " " . join(", ", $set);
  609. }
  610. } else {
  611. if (sizeof($this->setArray) > 0) {
  612. $this->set = join(",", $this->setArray);
  613. } else {
  614. $this->set = "";
  615. }
  616. }
  617. return $this;
  618. }
  619. /**
  620. * 执行更新操作,updateRows的alias
  621. * @param String $table
  622. * @return number
  623. */
  624. /*
  625. final function update($table){
  626. return $this->updateRows($table);
  627. }
  628. */
  629. /**
  630. *
  631. * 执行更新操作
  632. * @param $table
  633. * @return Int 返回影响的行数
  634. */
  635. final function updateRows($table)
  636. {
  637. $this->modelSQL = $sql = sprintf($this->_query['UPDATE'], $table) . $this->set . $this->where . $this->limit;
  638. $this->cleanData();
  639. return $this->exec($sql);
  640. }
  641. /**
  642. *
  643. * 执行删除操作
  644. * @param String $table
  645. */
  646. final function deleteRows($table)
  647. {
  648. $this->modelSQL = $sql = sprintf($this->_query['DELETE'], $table, $this->where) . $this->limit;
  649. $this->cleanData();
  650. return $this->exec($sql);
  651. }
  652. /**
  653. * 执行Model过程中保存的相关信息
  654. *
  655. * @param String $option
  656. * @return Mix
  657. */
  658. final function querySQL($option = '')
  659. {
  660. $allow = array('_queryTimes', '_querySeconds', '_errorInfo', '_exeSQL');
  661. if (in_array($option, $allow)) {
  662. return $this->{$option};
  663. }
  664. return 0;
  665. }
  666. /**
  667. * 将结果编码一下
  668. * @param String $word
  669. * @return String|multitype:
  670. */
  671. public function setQuote($word)//过滤sql字符
  672. {
  673. if (ini_get("magic_quotes_gpc")) {
  674. return $word;
  675. }
  676. return is_array($word) ? array_map('addslashes', $word) : addslashes($word);
  677. }
  678. /**
  679. * 获取错误码
  680. */
  681. public function getCode()
  682. {
  683. return $this->_response->getCode();
  684. }
  685. /**
  686. * 获取错误信息
  687. */
  688. public function getMessage()
  689. {
  690. if($this->_response->isError())
  691. {
  692. return $this->_response->getMessage();
  693. }
  694. }
  695. /**
  696. * 返回response对象
  697. *
  698. * @return Bool
  699. */
  700. public function getResponse()
  701. {
  702. return $this->_response;
  703. }
  704. public function iconv($str)
  705. {
  706. if (is_array($str)) {
  707. return array_map(function ($n) {
  708. return iconv('GB2312', 'UTF-8', $n);
  709. }, $str);
  710. }
  711. return iconv('GB2312', 'UTF-8', $str);
  712. }
  713. /**
  714. * 如果不存在指定的方法则调用提示错误
  715. *
  716. * @param String $name
  717. * @param Mix $args
  718. * @return Mix
  719. */
  720. public function __call($method, $argvs)
  721. {
  722. if (isset($this->_modelAlias[$method])) {
  723. if (method_exists($this, $this->_modelAlias[$method])) {
  724. return call_user_func_array(array($this, $this->_modelAlias[$method]), $argvs);
  725. }
  726. \Qii::setError(false, __LINE__, 1506, 'Alias ' . get_called_class() . '->' . $method . '()');
  727. }
  728. \Qii::setError(false, __LINE__, 1506, get_called_class() . '->' . $method . '()');
  729. }
  730. }