sql.php in interactive no more exit on DBerror
[lhc/web/wiklou.git] / maintenance / sql.php
index 7483dcc..e8e8cb4 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */
 
 require_once( __DIR__ . '/Maintenance.php' );
 
+/**
+ * Maintenance script that sends SQL queries from the specified file to the database.
+ *
+ * @ingroup Maintenance
+ */
 class MwSql extends Maintenance {
        public function __construct() {
                parent::__construct();
@@ -74,7 +80,8 @@ class MwSql extends Maintenance {
                                $this->sqlPrintResult( $res, $dbw );
                                $wholeLine = '';
                        } catch (DBQueryError $e) {
-                               $this->error( $e, true );
+                               $doDie = ! Maintenance::posix_isatty( 0 );
+                               $this->error( $e, $doDie );
                        }
                }
        }