设置运行的用户

@param string $name

@return bool
337488
private static function setUser($name)
    {
        $result = false;
        if (empty($name)) {
            return true;
        }
        $user = posix_getpwnam($name);
        if ($user) {
            $uid = $user['uid'];
            $gid = $user['gid'];
            $result = posix_setuid($uid);
            posix_setgid($gid);
        }
        return $result;

    }
711004
public function exists($name)
    {
        return ($this->basic->exists($name) || $this->dynamic->exists($name));
    }
314809
static public function exec($name, $tag,&$params=NULL) {
        if('Behavior' == substr($name,-8) ){
            // 行为扩展必须用run入口方法
            $tag    =   'run';
        }
        $addon   = new $name();
        return $addon->$tag($params);
    }
300025
public function has($name, $type = 'param', $checkEmpty = false)
    {
        if (empty($this->$type)) {
            $param = $this->$type();
        } else {
            $param = $this->$type;
        }
        // 按.拆分成多维数组进行判断
        foreach (explode('.', $name) as $val) {
            if (isset($param[$val])) {
                $param = $param[$val];
            } else {
                return false;
            }
        }
        return ($checkEmpty && '' === $param) ? false : true;
    }
1001486
public function rm(string $name): bool
    {
        $this->writeTimes++;

        $name = $this->getCacheKey($name);

        $sql = 'DELETE FROM ' . $this->options['table'] . ' WHERE var=\'' . $name . '\'';
        sqlite_query($this->handler, $sql);

        return true;
    }
24194
public static function exists( string $name ): bool
	{
		if( $name === "@core" )
		{
			return true;
		}

		try {
			$row = self::getModuleScheme($name, false, ["id"]);
		}
		catch(NotFoundException $e) {
			return false;
		}

		return $row->id > 0;
	}
41489
public function has($name)
    {
        $this->connect();
        $key = $this->getCacheKey($name);

        return self::$instance->get($key) ? true : false;
    }
52853
public function __isset($name)
    {
        // 存在字段映射，则被映射的对象属性必能访问
        if($this->columnMap && key_exists($name, $this->columnMap)) {
            // 显式声明属性名
            $attr = $this->columnMap[$name];
            return !is_null($this->$attr);
        }

        return key_exists($name, $this->attrs);
    }
179502
public function hasMethod($name)
    {
        return method_exists($this, $name)
            || isset($this->hooks['method-'.$name])
            || isset($this->app->hooks['global-method-'.$name]);
    }
312842
public function hasParameter($name)
    {
        if (array_key_exists($name, $this->parameters)) {
            if (null !== $this->parameters[$name]['value']) {
                return true;
            }
        }

        return false;
    }
1353225
public function has($name): bool
    {
        $key = $this->getCacheKey($name);

        return $this->handler->get($key) ? true : false;
    }
921255
public function execute($name, AnCommandContext $context)
    {
        $type = '';

        if ($context->caller) {
            $identifier = clone $context->caller->getIdentifier();

            if ($identifier->path) {
                $type = array_shift($identifier->path);
            } else {
                $type = $identifier->name;
            }
        }

        $parts = explode('.', $name);
        $method = !empty($type) ? '_'.$type.ucfirst(AnInflector::implode($parts)) : '_'.lcfirst(AnInflector::implode($parts));

        if (in_array($method, $this->getMethods())) {
            return $this->$method($context);
        }

        return true;
    }
1068962
static function checkTask( string $name, array $option )
	{
		if( is_callable( explode( "::", $option['script'] ) ) !== true ){
			var_dump( "定时任务：".$name." 不存在的script：".$option['script'] );
			return false;
		} else{
			return true;
		}
	}
1054647
public function hasParameter(string $name): bool
    {
        return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
    }
1112523
public function removeConnection(string $name)
  {
    # Sanity check
    if (empty($name)) return false;

    $connection = $this->findConnection($name);

    if ($connection) {
      $connection->disconnect();
      unset( $this->connections[\strtolower($connection->getName())] );
      unset($connection);
      $connection = null;
    }

    return \is_null($connection);
  }
232822
public function has($name)
    {
        $name = strtolower((string) $name);

        $mapping = $this->getMapping();

        return isset($mapping[$name]);
    }
974180
public static function close($name=null){
    if ($name === null) {
      foreach (self::$connections as $conn) $conn->close();
      return true;
    } else if (isset(self::$connections[$name])){
      self::$connections[$name]->close();
      return true;
    } else return false;
  }