-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Description
When I use it in workerman, the data I get is always the same,What should I do if I want to get a new instance.
$policy = Enforcer::getPolicy();
Even if my database has been updated, this method always returns the old data,
The following method is singleton mode
/**
* Attempt to get the enforcer from the local cache.
*
* @param string $name
*
* @return \Casbin\Enforcer
*
* @throws \InvalidArgumentException
*/
public function guard($name = null)
{
$name = $name ?: $this->getDefaultGuard();
if (!isset($this->guards[$name])) {
$this->guards[$name] = $this->resolve($name);
}
return $this->guards[$name];
}
guoliang1994
Metadata
Metadata
Assignees
Labels
No labels