To be clear, making this batch size come from a parameter to the script is a deployment requirement. So say the DBA. 

Sent from my iPhone

> On May 8, 2014, at 7:35 PM, Jeroen De Dauw <notifications@github.com> wrote:
> 
> In src/PropertySuggester/UpdateTable/Importer/BasicImporter.php:
> 
> > +	 * @param DatabaseBase $db
> > +	 * @param ImportContext $importContext
> > +	 * @throws UnexpectedValueException
> > +	 */
> > +	private function doImport( $fileHandle, DatabaseBase $db, ImportContext $importContext ) {
> > +		$accumulator = array();
> > +		$i = 0;
> > +		$header = fgetcsv( $fileHandle, 0, $importContext->getCsvDelimiter() ); //this is to get the csv-header
> > +		$expectedHeader = array( 'pid1', 'qid1', 'pid2', 'count', 'probability', 'context' );
> > +		if( $header != $expectedHeader ) {
> > +			throw new UnexpectedValueException( "provided csv-file does not match the expected format:\n" . join( ',', $expectedHeader ) );
> > +		}
> > +		while ( true ) {
> > +			$data = fgetcsv( $fileHandle, 0, $importContext->getCsvDelimiter() );
> > +
> > +			if ( $data == false || ++$i > 1000 ) {
> At the very least thing should not appear as a magical number in the middle of the code. If it was left a hardcoded thing, putting it in a named constant would be better
> 
> —
> Reply to this email directly or view it on GitHub.