public function main()
	{
		$result = array();

		if( !isset( $this->_file ) && count( $this->_filesets ) == 0 ) {
			throw new BuildException( "Missing either a nested fileset or attribute 'file' set" );
		}

		if( !isset( $this->_optfile ) || ( $string = file_get_contents( $this->_optfile ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to open optfile "%1$s"', $this->_optfile ) );
		}

		if( ( $options = unserialize( $string ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to unserialize content of file "%1$s"', $this->_optfile ) );
		}

		if( $this->_file instanceof PhingFile )
		{
			$this->_extract( $this->_file->getPath(), $options );
		}
		else // process filesets
		{
			$project = $this->getProject();

			foreach( $this->_filesets as $fs )
			{
				$files = $fs->getDirectoryScanner( $project )->getIncludedFiles();
				$dir = $fs->getDir( $this->project )->getPath();

				foreach( $files as $file ) {
					$this->_extract( $dir . DIRECTORY_SEPARATOR . $file, $options );
				}
			}
		}

		$len = strlen( $this->_keyprefix );

		foreach( $options as $key => $values )
		{
			if( strncmp( $key, $this->_keyprefix, $len ) !== 0 ) {
				unset( $options[$key] );
			} else if( strpos( $key, 'unknown' ) !== false ) {
				unset( $options[$key] );
			} else if( !isset( $values['short'] ) && $key[0] !== "\n" ) {
				$this->log( 'No doc: ' . $key );
			}
		}

		ksort( $options );
		$this->log( 'Number of config options for ' . $this->_keyprefix . ': ' . count( $options ) );

		$this->_createWikiPages( $options );
	}
public function main()
	{
		$result = array();

		if( !isset( $this->_file ) && count( $this->_filesets ) == 0 ) {
			throw new BuildException( "Missing either a nested fileset or attribute 'file' set" );
		}

		if( !isset( $this->_optfile ) || ( $string = file_get_contents( $this->_optfile ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to open optfile "%1$s"', $this->_optfile ) );
		}

		if( ( $options = unserialize( $string ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to unserialize content of file "%1$s"', $this->_optfile ) );
		}

		if( $this->_file instanceof PhingFile )
		{
			$this->_extract( $this->_file->getPath(), $options );
		}
		else // process filesets
		{
			$project = $this->getProject();

			foreach( $this->_filesets as $fs )
			{
				$files = $fs->getDirectoryScanner( $project )->getIncludedFiles();
				$dir = $fs->getDir( $this->project )->getPath();

				foreach( $files as $file ) {
					$this->_extract( $dir . DIRECTORY_SEPARATOR . $file, $options );
				}
			}
		}

		$len = strlen( $this->_keyprefix );

		foreach( $options as $key => $values )
		{
			if( strncmp( $key, $this->_keyprefix, $len ) !== 0 ) {
				unset( $options[$key] );
			} else if( strpos( $key, 'unknown' ) !== false ) {
				unset( $options[$key] );
			} else if( !isset( $values['short'] ) && $key[0] !== "\n" ) {
				$this->log( 'No doc: ' . $key );
			}
		}

		ksort( $options );
		$this->log( 'Number of config options for ' . $this->_keyprefix . ': ' . count( $options ) );

		$this->_createWikiPages( $options );
	}
public function main ( ) { $ result = array ( ) ; if ( ! isset ( $ this -> _file ) && count ( $ this -> _filesets ) == 0 ) { throw new BuildException ( "Missing either a nested fileset or attribute 'file' set" ) ; } if ( ! isset ( $ this -> _optfile ) || ( $ string = file_get_contents ( $ this -> _optfile ) ) === false ) { throw new BuildException ( sprintf ( 'Unable to open optfile "%1$s"' , $ this -> _optfile ) ) ; } if ( ( $ options = unserialize ( $ string ) ) === false ) { throw new BuildException ( sprintf ( 'Unable to unserialize content of file "%1$s"' , $ this -> _optfile ) ) ; } if ( $ this -> _file instanceof PhingFile ) { $ this -> _extract ( $ this -> _file -> getPath ( ) , $ options ) ; } else // process filesets { $ project = $ this -> getProject ( ) ; foreach ( $ this -> _filesets as $ fs ) { $ files = $ fs -> getDirectoryScanner ( $ project ) -> getIncludedFiles ( ) ; $ dir = $ fs -> getDir ( $ this -> project ) -> getPath ( ) ; foreach ( $ files as $ file ) { $ this -> _extract ( $ dir . DIRECTORY_SEPARATOR . $ file , $ options ) ; } } } $ len = strlen ( $ this -> _keyprefix ) ; foreach ( $ options as $ key => $ values ) { if ( strncmp ( $ key , $ this -> _keyprefix , $ len ) !== 0 ) { unset ( $ options [ $ key ] ) ; } else if ( strpos ( $ key , 'unknown' ) !== false ) { unset ( $ options [ $ key ] ) ; } else if ( ! isset ( $ values [ 'short' ] ) && $ key [ 0 ] !== "\n" ) { $ this -> log ( 'No doc: ' . $ key ) ; } } ksort ( $ options ) ; $ this -> log ( 'Number of config options for ' . $ this -> _keyprefix . ': ' . count ( $ options ) ) ; $ this -> _createWikiPages ( $ options ) ; }
Generates Mediawiki pages for the configuration documentation.
Generates Mediawiki pages for the configuration documentation .