public function phpDoctor($config = 'default.ini')
{
// record start time
$this->_startTime = $this->_getTime();
// set the path
$this->_path = dirname(dirname(__FILE__));
// read config file
if (is_file($config)) {
$this->_options = @parse_ini_file($config);
if (count($this->_options) == 0) {
$this->error('Could not parse configuration file "' . $config . '"');
exit;
}
} else {
$this->error('Could not find configuration file "' . $config . '"');
exit;
}
// set phpdoctor options
if (isset($this->_options['verbose'])) {
$this->_verbose = $this->_options['verbose'];
$this->verbose('Being verbose');
}
if (isset($this->_options['quiet'])) {
$this->_quiet = $this->_options['quiet'];
}
if (isset($this->_options['source_path'])) {
$this->_sourcePath = array();
foreach (explode(',', $this->_options['source_path']) as $path) {
$this->_sourcePath[] = $this->fixPath($path, getcwd());
}
}
if (isset($this->_options['subdirs'])) {
$this->_subdirs = $this->_options['subdirs'];
}
if (isset($this->_options['files'])) {
$files = explode(',', $this->_options['files']);
} else {
$files = array('*.php');
}
if (isset($this->_options['ignore'])) {
$this->_ignore = explode(',', $this->_options['ignore']);
}
$this->verbose('Searching for files to parse...');
$this->_files = array();
foreach ($this->_sourcePath as $path) {
$this->_files[$path] = array_unique($this->_buildFileList($files, $path));
}
if (count($this->_files) == 0) {
$this->error('Could not find any files to parse');
exit;
}
if (isset($this->_options['default_package'])) {
$this->_defaultPackage = $this->_options['default_package'];
}
if (isset($this->_options['use_class_path_as_package'])) {
$this->_useClassPathAsPackage = $this->_options['use_class_path_as_package'];
}
if (isset($this->_options['ignore_package_tags'])) {
$this->_ignorePackageTags = $this->_options['ignore_package_tags'];
}
// use first path element
if (isset($this->_options['overview'])) {
$this->_overview = $this->makeAbsolutePath($this->_options['overview'], $this->_sourcePath[0]);
}
if (isset($this->_options['package_comment_dir'])) {
$this->_packageCommentDir = $this->makeAbsolutePath($this->_options['package_comment_dir'], $this->_sourcePath[0]);
}
if (isset($this->_options['globals'])) {
$this->_globals = $this->_options['globals'];
}
if (isset($this->_options['constants'])) {
$this->_constants = $this->_options['constants'];
}
if (isset($this->_options['tree'])) {
$this->_tree = $this->_options['tree'];
}
if (isset($this->_options['private']) && $this->_options['private']) {
$this->_public = TRUE;
$this->_protected = TRUE;
$this->_private = TRUE;
} elseif (isset($this->_options['protected']) && $this->_options['protected']) {
$this->_public = TRUE;
$this->_protected = TRUE;
$this->_private = FALSE;
} elseif (isset($this->_options['public']) && $this->_options['public']) {
$this->_public = TRUE;
$this->_protected = FALSE;
$this->_private = FALSE;
}
if (isset($this->_options['doclet'])) {
$this->_doclet = $this->_options['doclet'];
}
if (isset($this->_options['doclet_path'])) {
$this->_docletPath = $this->_options['doclet_path'];
} else {
$this->_docletPath = $this->_path . DIRECTORY_SEPARATOR . $this->_docletPath;
}
if (isset($this->_options['taglet_path'])) {
$this->_tagletPath = $this->_options['taglet_path'];
}
if (isset($this->_options['formatter'])) {
$this->_formatter = $this->_options['formatter'];
}
if (isset($this->_options['formatter_path'])) {
$this->_formatterPath = $this->_options['formatter_path'];
} else {
$this->_formatterPath = $this->_path . DIRECTORY_SEPARATOR . $this->_formatterPath;
}
if (isset($this->_options['pear_compat'])) {
$this->_pearCompat = $this->_options['pear_compat'];
}
}