1<?php 2 3/** 4 * implements a NULL adapter that accepts the standard input and does nothing 5 * 6 * this is used to suppress followup errors when SQLite is not available or the database files still 7 * need conversion 8 * 9 */ 10class helper_plugin_sqlite_adapter_null extends helper_plugin_sqlite_adapter { 11 12 /** 13 * return name of adapter 14 * 15 * @return string backend name as defined in helper.php 16 */ 17 public function getName() { 18 return DOKU_EXT_NULL; 19 } 20 21 /** 22 * Registers a User Defined Function for use in SQL statements 23 */ 24 public function create_function($function_name, $callback, $num_args) { 25 } 26 27 /** 28 * open db 29 */ 30 protected function opendb($init, $sqliteupgrade = false) { 31 return false; 32 } 33 34 /** 35 * close current db 36 */ 37 protected function closedb() { 38 } 39 40 /** 41 * Execute a raw query 42 * 43 * @param $sql.. 44 */ 45 public function executeQuery($sql) { 46 false; 47 } 48 49 /** 50 * Run sqlite_escape_string() on the given string and surround it 51 * with quotes 52 */ 53 public function quote_string($string) { 54 return $string; 55 } 56 57 /** 58 * Escape string for sql 59 */ 60 public function escape_string($str) { 61 return $str; 62 } 63 64 /** 65 * Close the result set and it's cursors 66 * 67 * @param $res 68 * @return bool 69 */ 70 public function res_close($res) { 71 return true; 72 } 73 74 /** 75 * Returns a complete result set as array 76 */ 77 public function res2arr($res, $assoc = true) { 78 return array(); 79 } 80 81 /** 82 * Return the next row of the given result set as associative array 83 */ 84 public function res2row($res) { 85 return false; 86 } 87 88 /** 89 * Return the first value from the next row. 90 */ 91 public function res2single($res) { 92 return false; 93 } 94 95 /** 96 * fetch the next row as zero indexed array 97 */ 98 public function res_fetch_array($res) { 99 return false; 100 } 101 102 /** 103 * fetch the next row as assocative array 104 */ 105 public function res_fetch_assoc($res) { 106 return false; 107 } 108 109 /** 110 * Count the number of records in result 111 */ 112 public function res2count($res) { 113 return 0; 114 } 115 116 /** 117 * Count the number of records changed last time 118 * 119 * Don't work after a SELECT statement in PDO 120 */ 121 public function countChanges($res) { 122 return 0; 123 } 124 }