Jobby\Helper::getTempDir PHP Method

getTempDir() public method

public getTempDir ( ) : string
return string
    public function getTempDir()
    {
        // @codeCoverageIgnoreStart
        if (function_exists('sys_get_temp_dir')) {
            $tmp = sys_get_temp_dir();
        } elseif (!empty($_SERVER['TMP'])) {
            $tmp = $_SERVER['TMP'];
        } elseif (!empty($_SERVER['TEMP'])) {
            $tmp = $_SERVER['TEMP'];
        } elseif (!empty($_SERVER['TMPDIR'])) {
            $tmp = $_SERVER['TMPDIR'];
        } else {
            $tmp = getcwd();
        }
        // @codeCoverageIgnoreEnd
        return $tmp;
    }

Usage Example

Beispiel #1
0
 /**
  * @param string $job
  * @param array  $config
  * @param Helper $helper
  */
 public function __construct($job, array $config, Helper $helper = null)
 {
     $this->job = $job;
     $this->config = $config + ['recipients' => null, 'mailer' => null, 'maxRuntime' => null, 'smtpHost' => null, 'smtpPort' => null, 'smtpUsername' => null, 'smtpPassword' => null, 'smtpSender' => null, 'smtpSenderName' => null, 'smtpSecurity' => null, 'runAs' => null, 'environment' => null, 'runOnHost' => null, 'output' => null, 'dateFormat' => null, 'enabled' => null, 'haltDir' => null, 'debug' => null];
     $this->helper = $helper ?: new Helper();
     $this->tmpDir = $this->helper->getTempDir();
 }
All Usage Examples Of Jobby\Helper::getTempDir