PageRenderTime 53ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/php-bartlett-PHP-CompatInfo-2.5.0/PHP_CompatInfo-2.5.0/PHP/CompatInfo/Reference/pdo.php

#
PHP | 206 lines | 111 code | 13 blank | 82 comment | 32 complexity | 1ea6f624380ac755ae5e9025c962ca17 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * Version informations about PDO extension
  4. *
  5. * PHP version 5
  6. *
  7. * @category PHP
  8. * @package PHP_CompatInfo
  9. * @author Laurent Laville <pear@laurent-laville.org>
  10. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  11. * @version SVN: $Id$
  12. * @link http://php5.laurent-laville.org/compatinfo/
  13. */
  14. /**
  15. * All interfaces, classes, functions, constants about PDO extension
  16. *
  17. * @category PHP
  18. * @package PHP_CompatInfo
  19. * @author Laurent Laville <pear@laurent-laville.org>
  20. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  21. * @version Release: 2.5.0
  22. * @link http://php5.laurent-laville.org/compatinfo/
  23. * @link http://www.php.net/manual/en/book.pdo.php
  24. */
  25. class PHP_CompatInfo_Reference_PDO implements PHP_CompatInfo_Reference
  26. {
  27. /**
  28. * Gets all informations at once about:
  29. * extensions, interfaces, classes, functions, constants
  30. *
  31. * @param string $extension OPTIONAL
  32. * @param string $version OPTIONAL PHP version
  33. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  34. *
  35. * @return array
  36. */
  37. public function getAll($extension = null, $version = null)
  38. {
  39. $references = array(
  40. 'extensions' => $this->getExtensions($extension, $version),
  41. 'interfaces' => $this->getInterfaces($extension, $version),
  42. 'classes' => $this->getClasses($extension, $version),
  43. 'functions' => $this->getFunctions($extension, $version),
  44. 'constants' => $this->getConstants($extension, $version),
  45. );
  46. return $references;
  47. }
  48. /**
  49. * Gets informations about extensions
  50. *
  51. * @param string $extension OPTIONAL
  52. * @param string $version OPTIONAL PHP version
  53. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  54. *
  55. * @return array
  56. */
  57. public function getExtensions($extension = null, $version = null)
  58. {
  59. $extensions = array(
  60. 'PDO' => array('5.1.0', '', '1.0.4dev')
  61. );
  62. return $extensions;
  63. }
  64. /**
  65. * Gets informations about interfaces
  66. *
  67. * @param string $extension OPTIONAL
  68. * @param string $version OPTIONAL PHP version
  69. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  70. *
  71. * @return array
  72. */
  73. public function getInterfaces($extension = null, $version = null)
  74. {
  75. $interfaces = array();
  76. if ((null == $version ) || ('4' == $version)) {
  77. $version4 = array(
  78. );
  79. $interfaces = array_merge(
  80. $interfaces,
  81. $version4
  82. );
  83. }
  84. if ((null == $version ) || ('5' == $version)) {
  85. $version5 = array(
  86. );
  87. $interfaces = array_merge(
  88. $interfaces,
  89. $version5
  90. );
  91. }
  92. return $interfaces;
  93. }
  94. /**
  95. * Gets informations about classes
  96. *
  97. * @param string $extension OPTIONAL
  98. * @param string $version OPTIONAL PHP version
  99. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  100. *
  101. * @return array
  102. * @link http://www.php.net/manual/en/class.pdoexception.php
  103. * @link http://www.php.net/manual/en/class.pdo.php
  104. * @link http://www.php.net/manual/en/class.pdostatement.php
  105. */
  106. public function getClasses($extension = null, $version = null)
  107. {
  108. $classes = array();
  109. if ((null == $version ) || ('4' == $version)) {
  110. $version4 = array(
  111. );
  112. $classes = array_merge(
  113. $classes,
  114. $version4
  115. );
  116. }
  117. if ((null == $version ) || ('5' == $version)) {
  118. $version5 = array(
  119. 'PDOException' => array('5.1.0', ''),
  120. 'PDO' => array('5.1.0', ''),
  121. 'PDOStatement' => array('5.1.0', ''),
  122. 'PDORow' => array('5.1.0', ''),
  123. );
  124. $classes = array_merge(
  125. $classes,
  126. $version5
  127. );
  128. }
  129. return $classes;
  130. }
  131. /**
  132. * Gets informations about functions
  133. *
  134. * @param string $extension OPTIONAL
  135. * @param string $version OPTIONAL PHP version
  136. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  137. *
  138. * @return array
  139. */
  140. public function getFunctions($extension = null, $version = null)
  141. {
  142. $functions = array();
  143. if ((null == $version ) || ('4' == $version)) {
  144. $version4 = array(
  145. );
  146. $functions = array_merge(
  147. $functions,
  148. $version4
  149. );
  150. }
  151. if ((null == $version ) || ('5' == $version)) {
  152. $version5 = array(
  153. 'pdo_drivers' => array('5.1.0', ''),
  154. );
  155. $functions = array_merge(
  156. $functions,
  157. $version5
  158. );
  159. }
  160. return $functions;
  161. }
  162. /**
  163. * Gets informations about constants
  164. *
  165. * @param string $extension OPTIONAL
  166. * @param string $version OPTIONAL PHP version
  167. * (4 => only PHP4, 5 or null => PHP4 + PHP5)
  168. *
  169. * @return array
  170. * @link http://www.php.net/manual/en/pdo.constants.php
  171. */
  172. public function getConstants($extension = null, $version = null)
  173. {
  174. $constants = array();
  175. if ((null == $version ) || ('4' == $version)) {
  176. $version4 = array(
  177. );
  178. $constants = array_merge(
  179. $constants,
  180. $version4
  181. );
  182. }
  183. if ((null == $version ) || ('5' == $version)) {
  184. $version5 = array(
  185. );
  186. $constants = array_merge(
  187. $constants,
  188. $version5
  189. );
  190. }
  191. return $constants;
  192. }
  193. }