lib/Pagon/ChildProcess.php
protected function tryChangeUser($user)
    {
        $changed_user = false;
        // Check user can be changed?
        if ($user && posix_getuid() > 0) {
            // Not root
            throw new \RuntimeException('Only root can change user to spawn the process');
        }

        // Check user if exists?
        if ($user && !($changed_user = posix_getpwnam($user))) {
            throw new \RuntimeException('Can not look up user: ' . $user);
        }

        return $changed_user;
    }
protected function tryChangeUser($user)
    {
        $changed_user = false;
        // Check user can be changed?
        if ($user && posix_getuid() > 0) {
            // Not root
            throw new \RuntimeException('Only root can change user to spawn the process');
        }

        // Check user if exists?
        if ($user && !($changed_user = posix_getpwnam($user))) {
            throw new \RuntimeException('Can not look up user: ' . $user);
        }

        return $changed_user;
    }
protected function tryChangeUser ( $ user ) { $ changed_user = false ; // Check user can be changed? if ( $ user && posix_getuid ( ) > 0 ) { // Not root throw new \ RuntimeException ( 'Only root can change user to spawn the process' ) ; } // Check user if exists? if ( $ user && ! ( $ changed_user = posix_getpwnam ( $ user ) ) ) { throw new \ RuntimeException ( 'Can not look up user: ' . $ user ) ; } return $ changed_user ; }
Try to change user

@param string $user
@return array|bool
@throws \RuntimeException
Try to change user