Crontab\Crontab::getUser PHP Method

getUser() public method

Get unix user to add crontab
public getUser ( ) : string
return string
    public function getUser()
    {
        return $this->user;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Calcuates crontab command
  *
  * @param Crontab $crontab
  *
  * @return string
  */
 protected function crontabCommand(Crontab $crontab)
 {
     $cmd = $this->getCrontabExecutable();
     if ($crontab->getUser()) {
         $cmd .= sprintf(' -u %s ', $crontab->getUser());
     }
     return $cmd;
 }