Index: trunk/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -1,12 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class SqliteInstaller extends DatabaseInstaller { |
| 5 | + |
5 | 6 | protected $globalNames = array( |
6 | 7 | 'wgDBname', |
7 | 8 | 'wgSQLiteDataDir', |
8 | 9 | ); |
9 | 10 | |
10 | | - function getName() { |
| 11 | + public function getName() { |
11 | 12 | return 'sqlite'; |
12 | 13 | } |
13 | 14 | |
— | — | @@ -14,7 +15,7 @@ |
15 | 16 | return self::checkExtension( 'pdo_sqlite' ); |
16 | 17 | } |
17 | 18 | |
18 | | - function getGlobalDefaults() { |
| 19 | + public function getGlobalDefaults() { |
19 | 20 | if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) { |
20 | 21 | $path = str_replace( |
21 | 22 | array( '/', '\\' ), |
— | — | @@ -27,14 +28,14 @@ |
28 | 29 | } |
29 | 30 | } |
30 | 31 | |
31 | | - function getConnectForm() { |
| 32 | + public function getConnectForm() { |
32 | 33 | return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) . |
33 | 34 | $this->parent->getHelpBox( 'config-sqlite-dir-help' ) . |
34 | 35 | $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
35 | 36 | $this->parent->getHelpBox( 'config-sqlite-name-help' ); |
36 | 37 | } |
37 | 38 | |
38 | | - function submitConnectForm() { |
| 39 | + public function submitConnectForm() { |
39 | 40 | global $wgSQLiteDataDir; |
40 | 41 | $this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname' ) ); |
41 | 42 | |
— | — | @@ -79,7 +80,7 @@ |
80 | 81 | return Status::newGood(); |
81 | 82 | } |
82 | 83 | |
83 | | - function getConnection() { |
| 84 | + public function getConnection() { |
84 | 85 | global $wgSQLiteDataDir; |
85 | 86 | |
86 | 87 | $status = Status::newGood(); |
— | — | @@ -98,7 +99,7 @@ |
99 | 100 | return $status; |
100 | 101 | } |
101 | 102 | |
102 | | - function needsUpgrade() { |
| 103 | + public function needsUpgrade() { |
103 | 104 | $dir = $this->getVar( 'wgSQLiteDataDir' ); |
104 | 105 | $dbName = $this->getVar( 'wgDBname' ); |
105 | 106 | // Don't create the data file yet |
— | — | @@ -110,15 +111,15 @@ |
111 | 112 | return parent::needsUpgrade(); |
112 | 113 | } |
113 | 114 | |
114 | | - function getSettingsForm() { |
| 115 | + public function getSettingsForm() { |
115 | 116 | return false; |
116 | 117 | } |
117 | 118 | |
118 | | - function submitSettingsForm() { |
| 119 | + public function submitSettingsForm() { |
119 | 120 | return Status::newGood(); |
120 | 121 | } |
121 | 122 | |
122 | | - function setupDatabase() { |
| 123 | + public function setupDatabase() { |
123 | 124 | $dir = $this->getVar( 'wgSQLiteDataDir' ); |
124 | 125 | |
125 | 126 | # Sanity check. We checked this before but maybe someone deleted the |
— | — | @@ -146,7 +147,7 @@ |
147 | 148 | return $this->getConnection(); |
148 | 149 | } |
149 | 150 | |
150 | | - function createTables() { |
| 151 | + public function createTables() { |
151 | 152 | global $IP; |
152 | 153 | $status = $this->getConnection(); |
153 | 154 | if ( !$status->isOK() ) { |
— | — | @@ -161,7 +162,7 @@ |
162 | 163 | return $this->setupSearchIndex(); |
163 | 164 | } |
164 | 165 | |
165 | | - function setupSearchIndex() { |
| 166 | + public function setupSearchIndex() { |
166 | 167 | global $IP; |
167 | 168 | |
168 | 169 | $status = Status::newGood(); |
— | — | @@ -181,7 +182,7 @@ |
182 | 183 | return $status; |
183 | 184 | } |
184 | 185 | |
185 | | - function doUpgrade() { |
| 186 | + public function doUpgrade() { |
186 | 187 | global $wgDatabase; |
187 | 188 | LBFactory::enableBackend(); |
188 | 189 | $wgDatabase = wfGetDB( DB_MASTER ); |
— | — | @@ -191,14 +192,15 @@ |
192 | 193 | return true; |
193 | 194 | } |
194 | 195 | |
195 | | - static function outputHandler( $string ) { |
| 196 | + public static function outputHandler( $string ) { |
196 | 197 | return htmlspecialchars( $string ); |
197 | 198 | } |
198 | 199 | |
199 | | - function getLocalSettings() { |
| 200 | + public function getLocalSettings() { |
200 | 201 | $dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) ); |
201 | 202 | return |
202 | 203 | "# SQLite-specific settings |
203 | 204 | \$wgSQLiteDataDir = \"{$dir}\";"; |
204 | 205 | } |
205 | | -} |
| 206 | + |
| 207 | +} |
\ No newline at end of file |