public function escape($input) { $input = strtolower($input); $input = preg_replace('/[^a-z0-9_. -]+/', '', $input); $input = trim($input); $input = str_replace(' ', '_', $input); $input = preg_replace('/_{2,}/', '_', $input); return $input; }
/** * @return string */ protected function getLockFile() { $tmp = $this->tmpDir; $job = $this->helper->escape($this->job); if (!empty($this->config['environment'])) { $env = $this->helper->escape($this->config['environment']); return "{$tmp}/{$env}-{$job}.lck"; } else { return "{$tmp}/{$job}.lck"; } }