Skip to content

Commit

Permalink
Merge branch '2.7' of into 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Mar 2, 2012
2 parents f97dbed + fddffb9 commit 237c47f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 170 deletions.
5 changes: 1 addition & 4 deletions build.xml
Expand Up @@ -51,10 +51,7 @@


<target name="phpunit" description="Run unit tests and generate junit.xml and clover.xml"> <target name="phpunit" description="Run unit tests and generate junit.xml and clover.xml">
<exec executable="phpunit" failonerror="true"> <exec executable="phpunit" failonerror="true">
<arg line="--coverage-clover ${basedir}/build/logs/clover.xml <arg line="--configuration phpunit.xml --coverage-text" />
--coverage-html ${basedir}/build/coverage/
--log-junit ${basedir}/build/logs/junit.xml
${basedir}/phpmyfaq/tests" />
</exec> </exec>
</target> </target>


Expand Down
19 changes: 3 additions & 16 deletions phpmyfaq/inc/PMF_DB/Driver.php
@@ -1,6 +1,6 @@
<?php <?php
/** /**
* Base interface for database drivers. * Interface for database drivers
* *
* PHP Version 5.2 * PHP Version 5.2
* *
Expand All @@ -18,7 +18,7 @@
* @package PMF_DB * @package PMF_DB
* @author Johannes Schlüter <johannes@php.net> * @author Johannes Schlüter <johannes@php.net>
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @copyright 2007-2011 phpMyFAQ Team * @copyright 2007-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @since 2007-08-19 * @since 2007-08-19
Expand All @@ -35,7 +35,7 @@
* @package PMF_DB * @package PMF_DB
* @author Johannes Schlüter <johannes@php.net> * @author Johannes Schlüter <johannes@php.net>
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @copyright 2007-2011 phpMyFAQ Team * @copyright 2007-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @since 2007-08-19 * @since 2007-08-19
Expand Down Expand Up @@ -145,19 +145,6 @@ public function serverVersion();
*/ */
public function getTableNames($prefix = ''); public function getTableNames($prefix = '');


/**
* Move internal result pointer
*
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber);

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
22 changes: 4 additions & 18 deletions phpmyfaq/inc/PMF_DB/Mssql.php
@@ -1,7 +1,7 @@
<?php <?php
/** /**
* The PMF_DB_Mssql class provides methods and functions for a Microsoft SQL Server * The PMF_DB_Mssql class provides methods and functions for a Microsoft SQL
* database. * Server database.
* *
* PHP Version 5.2 * PHP Version 5.2
* *
Expand Down Expand Up @@ -254,6 +254,8 @@ public function serverVersion()
if (isset($version)) { if (isset($version)) {
return $version; return $version;
} }

return 42;
} }


/** /**
Expand All @@ -276,22 +278,6 @@ public function getTableNames($prefix = '')
} }
} }


/**
* Move internal result pointer
*
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return mssql_data_seek($result, $rowNumber);
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
34 changes: 9 additions & 25 deletions phpmyfaq/inc/PMF_DB/Mysql.php
@@ -1,9 +1,9 @@
<?php <?php
/** /**
* The PMF_DB_Mysql class provides methods and functions for a MySQL 4.0.x * The PMF_DB_Mysql class provides methods and functions for MySQL 5.0.x,
* and higher database. * 5.1.x, and 5.5.x databases.
* *
* PHP Version 5.2.3 * PHP Version 5.2
* *
* The contents of this file are subject to the Mozilla Public License * The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in * Version 1.1 (the "License"); you may not use this file except in
Expand All @@ -20,7 +20,7 @@
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Meikel Katzengreis <meikel@katzengreis.com> * @author Meikel Katzengreis <meikel@katzengreis.com>
* @author Tom Rochester <tom.rochester@gmail.com> * @author Tom Rochester <tom.rochester@gmail.com>
* @copyright 2003-2011 phpMyFAQ Team * @copyright 2003-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @package 2003-02-24 * @package 2003-02-24
Expand All @@ -38,7 +38,7 @@
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Meikel Katzengreis <meikel@katzengreis.com> * @author Meikel Katzengreis <meikel@katzengreis.com>
* @author Tom Rochester <tom.rochester@gmail.com> * @author Tom Rochester <tom.rochester@gmail.com>
* @copyright 2003-2011 phpMyFAQ Team * @copyright 2003-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @package 2003-02-24 * @package 2003-02-24
Expand Down Expand Up @@ -221,7 +221,7 @@ public function nextId($table, $id)
/** /**
* Returns the error string. * Returns the error string.
* *
* @return void * @return string
*/ */
public function error() public function error()
{ {
Expand All @@ -231,7 +231,7 @@ public function error()
/** /**
* Returns the client version string. * Returns the client version string.
* *
* @return void * @return string
*/ */
public function clientVersion() public function clientVersion()
{ {
Expand All @@ -241,7 +241,7 @@ public function clientVersion()
/** /**
* Returns the server version string. * Returns the server version string.
* *
* @return void * @return string
*/ */
public function serverVersion() public function serverVersion()
{ {
Expand Down Expand Up @@ -269,22 +269,6 @@ public function getTableNames($prefix = '')
} }
} }


/**
* Move internal result pointer
*
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return mysql_data_seek($result, $rowNumber);
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
22 changes: 4 additions & 18 deletions phpmyfaq/inc/PMF_DB/Mysqli.php
@@ -1,7 +1,7 @@
<?php <?php
/** /**
* The PMF_DB_Mysqli class provides methods and functions for a MySQL 5.0.x, * The PMF_DB_Mysqli class provides methods and functions for MySQL 5.0.x,
* 5.1.x, 5.5.x and 5.6.x databases. * 5.1.x, and 5.5.x databases.
* *
* PHP Version 5.2 * PHP Version 5.2
* *
Expand All @@ -19,7 +19,7 @@
* @package PMF_DB * @package PMF_DB
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author David Soria Parra <dsoria@gmx.net> * @author David Soria Parra <dsoria@gmx.net>
* @copyright 2005-2011 phpMyFAQ Team * @copyright 2005-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @package 2005-02-21 * @package 2005-02-21
Expand All @@ -36,7 +36,7 @@
* @package PMF_DB * @package PMF_DB
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author David Soria Parra <dsoria@gmx.net> * @author David Soria Parra <dsoria@gmx.net>
* @copyright 2005-2010 phpMyFAQ Team * @copyright 2005-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @package 2005-02-21 * @package 2005-02-21
Expand Down Expand Up @@ -279,20 +279,6 @@ function getTableNames($prefix = '')
} }
} }


/**
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return mysqli_data_seek($result, $rowNumber);
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
18 changes: 1 addition & 17 deletions phpmyfaq/inc/PMF_DB/Pgsql.php
Expand Up @@ -297,23 +297,7 @@ public function getTableNames($prefix = '')
} }
} }
} }


/**
* Move internal result pointer
*
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return pg_result_seek($result, $rowNumber);
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
29 changes: 9 additions & 20 deletions phpmyfaq/inc/PMF_DB/Sqlite.php
@@ -1,6 +1,7 @@
<?php <?php
/** /**
* The PMF_DB_Sqlite class provides methods and functions for a sqlite database. * The PMF_DB_Sqlite class provides methods and functions for a SQLite v2
* database. This class is deprecated for PHP 5.3 and PHP 5.4.
* *
* PHP Version 5.2 * PHP Version 5.2
* *
Expand All @@ -18,7 +19,7 @@
* @package PMF_DB * @package PMF_DB
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Johannes Schlüter <johannes@php.net> * @author Johannes Schlüter <johannes@php.net>
* @copyright 2005-2011 phpMyFAQ Team * @copyright 2005-2012 phpMyFAQ Team
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @since 2005-06-27 * @since 2005-06-27
Expand All @@ -30,12 +31,16 @@


/** /**
* PMF_DB_Sqlite * PMF_DB_Sqlite
* *
* @category phpMyFAQ * @category phpMyFAQ
* @package PMF_DB * @package PMF_DB
* @author Thorsten Rinne <thorsten@phpmyfaq.de> * @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @author Johannes Schlüter <johannes@php.net> * @author Johannes Schlüter <johannes@php.net>
<<<<<<< HEAD
* @copyright 2005-2011 phpMyFAQ Team * @copyright 2005-2011 phpMyFAQ Team
=======
* @copyright 2005-2012 phpMyFAQ Team
>>>>>>> fddffb9c8c34227473034cf5c50d7a8127f3ffb3
* @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1 * @license http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
* @link http://www.phpmyfaq.de * @link http://www.phpmyfaq.de
* @since 2005-06-27 * @since 2005-06-27
Expand Down Expand Up @@ -210,7 +215,7 @@ public function nextId($table, $id)
/** /**
* Returns the error string. * Returns the error string.
* *
* @return string * @return void|string
*/ */
public function error() public function error()
{ {
Expand Down Expand Up @@ -258,22 +263,6 @@ public function getTableNames($prefix = '')
} }
} }


/**
* Move internal result pointer
*
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return sqlite_seek($result, $rowNumber);
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down
35 changes: 2 additions & 33 deletions phpmyfaq/inc/PMF_DB/Sqlite3.php
@@ -1,6 +1,7 @@
<?php <?php
/** /**
* The PMF_DB_Sqlite3 class provides methods and functions for a SQLite v3 database * The PMF_DB_Sqlite3 class provides methods and functions for a SQLite v3
* database
* *
* PHP Version 5.2 * PHP Version 5.2
* *
Expand Down Expand Up @@ -274,38 +275,6 @@ public function serverVersion()
return $this->clientVersion(); return $this->clientVersion();
} }


/**
* Returns an array with all table names
*
* @return array
*/
public function getTableNames($prefix = '')
{
// First, declare those tables that are referenced by others
$this->tableNames[] = $prefix.'faquser';

$result = $this->query("SELECT name FROM sqlite_master WHERE type='table' ".(('' == $prefix) ? '': "AND name LIKE '".$prefix."%' ")."ORDER BY name");
while ($row = $this->fetch_object($result)) {
if (!in_array($row->name, $this->tableNames)) {
$this->tableNames[] = $row->name;
}
}
}

/**
* Moves the pointer within the query result to a specified location, or
* to the beginning if nothing is specified.
*
* @param resource $result Resultset
* @param integer $rowNumber Row number
*
* @return boolean
*/
public function resultSeek($result, $rowNumber)
{
return null;
}

/** /**
* Closes the connection to the database. * Closes the connection to the database.
* *
Expand Down

0 comments on commit 237c47f

Please sign in to comment.