Index: trunk/extensions/DataTransclusion/ImportMAB2.php |
— | — | @@ -113,6 +113,11 @@ |
114 | 114 | |
115 | 115 | $this->output( "scanning directory $dir\n" ); |
116 | 116 | $d = opendir( $dir ); |
| 117 | + if ( !$d ) { |
| 118 | + $this->error( "unable to open directory $dir!\n" ); |
| 119 | + return false; |
| 120 | + } |
| 121 | + |
117 | 122 | while( ( $file = readdir( $d ) ) ) { |
118 | 123 | if ( $file == "." or $file == ".." ) { |
119 | 124 | continue; |
— | — | @@ -187,7 +192,7 @@ |
188 | 193 | if ( $this->noblob ) { |
189 | 194 | $id = 0; |
190 | 195 | } else { |
191 | | - $db->insert( $this->blob_table, $insert ); |
| 196 | + $db->insert( $this->blob_table, $insert, __METHOD__ ); |
192 | 197 | $id = $db->insertId(); |
193 | 198 | } |
194 | 199 | |
— | — | @@ -201,7 +206,7 @@ |
202 | 207 | } |
203 | 208 | } |
204 | 209 | |
205 | | - $db->insert( $this->index_table, $insert ); |
| 210 | + $db->insert( $this->index_table, $insert, __METHOD__, array( 'IGNORE' ) ); |
206 | 211 | } |
207 | 212 | |
208 | 213 | public function readMabFile( $file ) { |