summaryrefslogtreecommitdiff
path: root/buildscripts/phing/tasks/ManualIndexTask.php
blob: 3590a500eac47acac834caaf125a3744c3004918 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

require_once 'phing/Task.php';

/**
 * Task to index PRADO API docs.
 */	
class ManualIndexTask extends Task
{
	private $docdir;
	private $todir;
	
	/**
	 * @param string the API documentation directory
	 */
	public function setDocdir($value)
	{
		$this->docdir=$value;
	}
	
	public function setTodir($value)
	{
		$this->todir=$value;
	}

	public function main()
	{
		$srcdir=realpath(dirname(__FILE__).'/../../../');
		$zend_path = $srcdir.'/demos/quickstart/protected/index';
		set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path));
		require_once ('Zend/Search/Lucene.php');
		require_once($srcdir.'/buildscripts/index/api_index.php');
		$api = new api_index($this->todir, realpath($this->docdir));
		$api->create_index();
	}
}