+
+
+ /**
+ * List all tables on the database
+ *
+ * @param $prefix string Only show tables with this prefix, e.g. mw_
+ * @param $fname String: calling function name
+ *
+ * @return array
+ */
+ function listTables( $prefix = null, $fname = 'DatabaseSqlite::listTables' ) {
+ $result = $this->select(
+ 'sqlite_master',
+ 'name',
+ "type='table'"
+ );
+
+ $endArray = array();
+
+ foreach( $result as $table ) {
+ $vars = get_object_vars($table);
+ $table = array_pop( $vars );
+
+ if( !$prefix || strpos( $table, $prefix ) === 0 ) {
+ if ( strpos( $table, 'sqlite_' ) !== 0 ) {
+ $endArray[] = $table;
+ }
+
+ }
+ }
+
+ return $endArray;
+ }