示例#1
0
 /**
  * Get a log path.
  *
  * @param   string  $type  The log type.
  *
  * @return  string
  *
  * @since   1.0
  */
 public function getLogPath($type)
 {
     if ('root' == $type) {
         $logPath = $this->application->get('debug.log-path');
         if (!realpath($logPath)) {
             $logPath = JPATH_ROOT . '/' . $logPath;
         }
         if (realpath($logPath)) {
             return realpath($logPath);
         }
         return JPATH_ROOT;
     }
     if ('php' == $type) {
         return ini_get('error_log');
     }
     // @todo: remove the rest..
     $logPath = $this->application->get('debug.' . $type . '-log');
     if (!realpath(dirname($logPath))) {
         $logPath = JPATH_ROOT . '/' . $logPath;
     }
     if (realpath(dirname($logPath))) {
         return realpath($logPath);
     }
     return JPATH_ROOT;
 }
示例#2
0
 /**
  * Method to set the file validations.
  *
  * @return  void
  *
  * @since   1.0
  */
 private function setValidations()
 {
     $this->addValidations(array(new Mimetype($this->application->get('validation.mime_types')), new Size($this->application->get('validation.file_size'))));
 }
示例#3
0
 /**
  * Get a string for usage in comment footers.
  *
  * @param   Application     $application  The application object.
  * @param   TrackerProject  $project      The project object.
  * @param   integer         $issueNumber  The issue number.
  *
  * @since   1.0
  * @return string
  */
 public function getApplicationComment(Application $application, TrackerProject $project, $issueNumber)
 {
     return sprintf('<hr /><sub>This comment was created with the <a href="%1$s">%2$s Application</a> at <a href="%3$s">%4$s</a>.</sub>', 'https://github.com/joomla/jissues', 'J!Tracker', $application->get('uri')->base->full . 'tracker/' . $project->alias . '/' . $issueNumber, str_replace(['http://', 'https://'], '', $application->get('uri')->base->full) . $project->alias . '/' . $issueNumber);
 }