function rewind() {
if ( fseek( $this->fh, 0 ) ) {
- wfDie( "Couldn't fseek to the start of '$filename'\n" );
+ wfDie( "Couldn't fseek to the start of '$this->file'\n" );
}
$this->index = -1;
$this->lineNum = 0;
$section = strtolower( $matches[1] );
if ( $section == 'endarticle' ) {
if ( !isset( $data['text'] ) ) {
- wfDie( "'endarticle' without 'text' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'endarticle' without 'text' at line {$this->lineNum} of $this->file\n" );
}
if ( !isset( $data['article'] ) ) {
- wfDie( "'endarticle' without 'article' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'endarticle' without 'article' at line {$this->lineNum} of $this->file\n" );
}
if ( $this->parser ) {
$this->parser->addArticle( $this->parser->chomp( $data['article'] ), $this->parser->chomp( $data['text'] ),
}
if ( $section == 'endhooks' ) {
if ( !isset( $data['hooks'] ) ) {
- wfDie( "'endhooks' without 'hooks' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'endhooks' without 'hooks' at line {$this->lineNum} of $this->file\n" );
}
foreach ( explode( "\n", $data['hooks'] ) as $line ) {
$line = trim( $line );
}
if ( $section == 'endfunctionhooks' ) {
if ( !isset( $data['functionhooks'] ) ) {
- wfDie( "'endfunctionhooks' without 'functionhooks' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'endfunctionhooks' without 'functionhooks' at line {$this->lineNum} of $this->file\n" );
}
foreach ( explode( "\n", $data['functionhooks'] ) as $line ) {
$line = trim( $line );
}
if ( $section == 'end' ) {
if ( !isset( $data['test'] ) ) {
- wfDie( "'end' without 'test' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'end' without 'test' at line {$this->lineNum} of $this->file\n" );
}
if ( !isset( $data['input'] ) ) {
- wfDie( "'end' without 'input' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'end' without 'input' at line {$this->lineNum} of $this->file\n" );
}
if ( !isset( $data['result'] ) ) {
- wfDie( "'end' without 'result' at line {$this->lineNum} of $filename\n" );
+ wfDie( "'end' without 'result' at line {$this->lineNum} of $this->file\n" );
}
if ( !isset( $data['options'] ) ) {
$data['options'] = '';
return true;
}
if ( isset ( $data[$section] ) ) {
- wfDie( "duplicate section '$section' at line {$this->lineNum} of $filename\n" );
+ wfDie( "duplicate section '$section' at line {$this->lineNum} of $this->file\n" );
}
$data[$section] = '';
continue;