misc style fix
[lhc/web/wiklou.git] / includes / installer / Ibm_db2Installer.php
index 246d590..bf19055 100644 (file)
@@ -2,6 +2,21 @@
 /**
  * IBM_DB2-specific installer.
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
  * @ingroup Deployment
  */
@@ -32,7 +47,7 @@ class Ibm_db2Installer extends DatabaseInstaller {
         * Get the DB2 database extension name
         * @return string
         */
-       public function getName(){
+       public function getName() {
                return 'ibm_db2';
        }
 
@@ -53,7 +68,7 @@ class Ibm_db2Installer extends DatabaseInstaller {
                        $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
                        $this->getTextBox( 'wgDBport', 'config-db-port', array(), $this->parent->getHelpBox( 'config-db-port' ) ) .
                        Html::openElement( 'fieldset' ) .
-                       Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
+                       Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
                        $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
                        $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
                        Html::closeElement( 'fieldset' ) .
@@ -144,6 +159,9 @@ class Ibm_db2Installer extends DatabaseInstaller {
                if ( !$status->isOK() ) {
                        return $status;
                }
+               /**
+                * @var $conn DatabaseBase
+                */
                $conn = $status->value;
                $dbName = $this->getVar( 'wgDBname' );
                if( !$conn->selectDB( $dbName ) ) {
@@ -185,7 +203,7 @@ class Ibm_db2Installer extends DatabaseInstaller {
                $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
                $this->db->begin( __METHOD__ );
 
-               $error = $this->db->sourceFile( $this->db->getSchema() );
+               $error = $this->db->sourceFile( $this->db->getSchemaPath() );
                if( $error !== true ) {
                        $this->db->reportQueryError( $error, 0, '', __METHOD__ );
                        $this->db->rollback( __METHOD__ );
@@ -213,15 +231,16 @@ class Ibm_db2Installer extends DatabaseInstaller {
                $this->db->selectDB( $this->getVar( 'wgDBname' ) );
 
                try {
-                       $result = $this->db->query( 'SELECT PAGESIZE FROM SYSCAT.TABLESPACES' );
+                       $result = $this->db->query( 'SELECT PAGESIZE FROM SYSCAT.TABLESPACES FOR READ ONLY' );
                        if( $result == false ) {
                                $status->fatal( 'config-connection-error', '' );
-                       }
-                       else {
-                               while ( $row = $this->db->fetchRow( $result ) ) {
+                       } else {
+                               $row = $this->db->fetchRow( $result );
+                               while ( $row ) {
                                        if( $row[0] >= 32768 ) {
                                                return $status;
                                        }
+                                       $row = $this->db->fetchRow( $result );
                                }
                                $status->fatal( 'config-ibm_db2-low-db-pagesize', '' );
                        }
@@ -245,7 +264,7 @@ class Ibm_db2Installer extends DatabaseInstaller {
 \$wgDBport             = \"{$port}\";";
        }
 
-       public function __construct($parent) {
-               parent::__construct($parent);
+       public function __construct( $parent ) {
+               parent::__construct( $parent );
        }
 }