getDataDirectory() public static method

Return the position of the package data directory.
public static getDataDirectory ( ) : string
return string Path to the directory holding data files.
コード例 #1
0
ファイル: Application.php プロジェクト: jubinpatel/horde
 /**
  * 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'];
     }
 }
コード例 #2
0
ファイル: Md.php プロジェクト: jubinpatel/horde
 /**
  * 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();
 }
コード例 #3
0
ファイル: Cs.php プロジェクト: jubinpatel/horde
 /**
  * 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);
 }