Return the position of the package data directory.
public static getDataDirectory ( ) : string | ||
return | string | Path to the directory holding data files. |
/** * Return the path to the template directory * * @return string The path to the template directory. */ public function getTemplateDirectory() { $options = $this->_config->getOptions(); if (!isset($options['templatedir'])) { return Components_Constants::getDataDirectory(); } else { return $options['templatedir']; } }
/** * Run the task. * * @param array &$options Additional options. * * @return integer Number of errors. */ public function run(&$options) { $lib = realpath($this->_config->getPath() . '/lib'); $renderer = new PHP_PMD_Renderer_TextRenderer(); $renderer->setWriter(new PHP_PMD_Writer_Stream(STDOUT)); $ruleSetFactory = new PHP_PMD_RuleSetFactory(); $ruleSetFactory->setMinimumPriority(PHP_PMD_AbstractRule::LOWEST_PRIORITY); $phpmd = new PHP_PMD(); $phpmd->processFiles($lib, Components_Constants::getDataDirectory() . '/qc_standards/phpmd.xml', array($renderer), $ruleSetFactory); return $phpmd->hasViolations(); }
/** * Run the task. * * @param array &$options Additional options. * * @return integer Number of errors. */ public function run(&$options) { $old_dir = getcwd(); $lib = realpath($this->_config->getPath() . '/lib'); $argv = $_SERVER['argv']; $argc = $_SERVER['argv']; $_SERVER['argv'] = array(); $_SERVER['argc'] = 0; define('PHPCS_DEFAULT_WARN_SEV', 0); $phpcs = new PHP_CodeSniffer(); $phpcs->process($lib, Components_Constants::getDataDirectory() . '/qc_standards/phpcs.xml'); $_SERVER['argv'] = $argv; $_SERVER['argc'] = $argc; chdir($old_dir); return $phpcs->reporting->printReport('emacs', false, null); }