equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Db |
16 * @package Zend_Db |
17 * @subpackage Adapter |
17 * @subpackage Adapter |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: Abstract.php 25229 2013-01-18 08:17:21Z frosch $ |
20 * @version $Id$ |
21 */ |
21 */ |
22 |
22 |
23 |
23 |
24 /** |
24 /** |
25 * @see Zend_Db |
25 * @see Zend_Db |
35 * Class for connecting to SQL databases and performing common operations. |
35 * Class for connecting to SQL databases and performing common operations. |
36 * |
36 * |
37 * @category Zend |
37 * @category Zend |
38 * @package Zend_Db |
38 * @package Zend_Db |
39 * @subpackage Adapter |
39 * @subpackage Adapter |
40 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
40 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
41 * @license http://framework.zend.com/license/new-bsd New BSD License |
41 * @license http://framework.zend.com/license/new-bsd New BSD License |
42 */ |
42 */ |
43 abstract class Zend_Db_Adapter_Abstract |
43 abstract class Zend_Db_Adapter_Abstract |
44 { |
44 { |
45 |
45 |
928 public function quoteInto($text, $value, $type = null, $count = null) |
928 public function quoteInto($text, $value, $type = null, $count = null) |
929 { |
929 { |
930 if ($count === null) { |
930 if ($count === null) { |
931 return str_replace('?', $this->quote($value, $type), $text); |
931 return str_replace('?', $this->quote($value, $type), $text); |
932 } else { |
932 } else { |
933 while ($count > 0) { |
933 return implode($this->quote($value, $type), explode('?', $text, $count + 1)); |
934 if (strpos($text, '?') !== false) { |
|
935 $text = substr_replace($text, $this->quote($value, $type), strpos($text, '?'), 1); |
|
936 } |
|
937 --$count; |
|
938 } |
|
939 return $text; |
|
940 } |
934 } |
941 } |
935 } |
942 |
936 |
943 /** |
937 /** |
944 * Quotes an identifier. |
938 * Quotes an identifier. |
1125 public function __sleep() |
1119 public function __sleep() |
1126 { |
1120 { |
1127 if ($this->_allowSerialization == false) { |
1121 if ($this->_allowSerialization == false) { |
1128 /** @see Zend_Db_Adapter_Exception */ |
1122 /** @see Zend_Db_Adapter_Exception */ |
1129 require_once 'Zend/Db/Adapter/Exception.php'; |
1123 require_once 'Zend/Db/Adapter/Exception.php'; |
1130 throw new Zend_Db_Adapter_Exception(get_class($this) ." is not allowed to be serialized"); |
1124 throw new Zend_Db_Adapter_Exception( |
1131 } |
1125 get_class($this) . ' is not allowed to be serialized' |
1132 $this->_connection = false; |
1126 ); |
1133 return array_keys(array_diff_key(get_object_vars($this), array('_connection'=>false))); |
1127 } |
|
1128 $this->_connection = null; |
|
1129 |
|
1130 return array_keys( |
|
1131 array_diff_key(get_object_vars($this), array('_connection' => null)) |
|
1132 ); |
1134 } |
1133 } |
1135 |
1134 |
1136 /** |
1135 /** |
1137 * called when object is getting unserialized |
1136 * called when object is getting unserialized |
1138 * |
1137 * |