CDbAuthManager

优质
小牛编辑
127浏览
2023-12-01
所有包 | 属性 | 方法
system.web.auth
继承class CDbAuthManager » CAuthManager » CApplicationComponent » CComponent
实现IAuthManager, IApplicationComponent
源自1.0
版本$Id: CDbAuthManager.php 3515 2011-12-28 12:29:24Z mdomba $
源码framework/web/auth/CDbAuthManager.php
CDbAuthManager代表一种在数据库里存储授权信息的授权管理器。

数据库连接是由connectionID指定的。数据库架构应该描述为 “framework/web/auth/*.sql”。你可以通过设置itemTable,itemChildTable和 assignmentTable来修改 这三个用来存储验证数据的数据表。

公共属性

隐藏继承属性

属性类型描述定义在
assignmentTablestring保存授权项目任务的数据表名字。默认为‘AuthAssignment’。CDbAuthManager
authItemsarray返回指定类型和用户的授权项目。CDbAuthManager
behaviorsarray这个应用组件附加的行为。 这此行为将在应用组件调用init时附加在应用组件上。 请参照CModel::behaviors如何指定此属性值。CApplicationComponent
connectionIDstringCDbConnection应用组件的ID。默认为‘db’。 数据库里面必须包含着在"framework/web/auth/*.CDbAuthManager
dbCDbConnection数据库连接对象。默认是,这个会根据应用组件里面公认的connectionIDID自动 初始化的。CDbAuthManager
defaultRolesarray隐式赋予给所有用户的角色名字列表。 这些角色不需要显式赋予给所有用户。 当调用checkAccess,会首先检查这些角色。 为了能够提高程序效率,这样的角色越少越好。 一个典型的用法是,定义一个“authenticated”角色,然后 把它关联到一个业务逻辑规则,这个规则是用来验证当前用户的。 然后在这个属性声明“authenticated”以便应用到 所有的验证用户。CAuthManager
isInitializedboolean检查应用组件是否已经初始化。CApplicationComponent
itemChildTablestring保存授权项目层级关系的数据表名字。默认为‘AuthItemChild’。CDbAuthManager
itemTablestring保存授权项目的数据表名字。默认为‘AuthItem’。CDbAuthManager
operationsarray返回操作。CAuthManager
rolesarray返回角色。CAuthManager
showErrorsboolean允许业务规则错误报告。CAuthManager
tasksarray返回任务。CAuthManager

受保护属性

隐藏继承属性

属性类型描述定义在
dbConnectionCDbConnection数据库连接对象。CDbAuthManager

公共方法

隐藏继承方法

方法描述定义在
__call()如果类中没有调的方法名,则调用这个方法。CComponent
__get()返回一个属性值、一个事件处理程序列表或一个行为名称。CComponent
__isset()检查一个属性是否为null。CComponent
__set()设置一个组件的属性值。CComponent
__unset()设置一个组件的属性为null。CComponent
addItemChild()将一个项目作为一个子项目添加。CDbAuthManager
asa()返回这个名字的行为对象。CComponent
assign()将授权项目赋予给用户。CDbAuthManager
attachBehavior()附加一个行为到组件。CComponent
attachBehaviors()附加一个行为列表到组件。CComponent
attachEventHandler()为事件附加一个事件处理程序。CComponent
canGetProperty()确定属性是否可读。CComponent
canSetProperty()确定属性是否可写。CComponent
checkAccess()检测指定用户的访问权限。CDbAuthManager
clearAll()移除所有授权数据。CDbAuthManager
clearAuthAssignments()移除所有授权任务。CDbAuthManager
createAuthItem()创建一个授权项目。CDbAuthManager
createOperation()创建一个操作。CAuthManager
createRole()创建一个角色。CAuthManager
createTask()创建一个任务。CAuthManager
detachBehavior()从组件中分离一个行为。CComponent
detachBehaviors()从组件中分离所有行为。CComponent
detachEventHandler()分离一个存在的事件处理程序。CComponent
disableBehavior()禁用一个附加行为。CComponent
disableBehaviors()禁用组件附加的所有行为。CComponent
enableBehavior()启用一个附加行为。CComponent
enableBehaviors()启用组件附加的所有行为。CComponent
evaluateExpression()计算一个PHP表达式,或根据组件上下文执行回调。CComponent
executeBizRule()执行指定的业务规则。CAuthManager
getAuthAssignment()返回项目任务信息。CDbAuthManager
getAuthAssignments()返回指定用户的项目任务。CDbAuthManager
getAuthItem()返回指定名字的授权项目。CDbAuthManager
getAuthItems()返回指定类型和用户的授权项目。CDbAuthManager
getEventHandlers()返回一个事件的附加处理程序列表。CComponent
getIsInitialized()检查应用组件是否已经初始化。CApplicationComponent
getItemChildren()返回这个项目的所有子项目。CDbAuthManager
getOperations()返回操作。CAuthManager
getRoles()返回角色。CAuthManager
getTasks()返回任务。CAuthManager
hasEvent()确定一个事件是否定义。CComponent
hasEventHandler()检查事件是否有附加的处理程序。CComponent
hasItemChild()返回一个值说明这个子项目是否存在CDbAuthManager
hasProperty()确定属性是否被定义。CComponent
init()初始化这个应用组件。CDbAuthManager
isAssigned()返回值说明这个项目是否已经赋予给用户。CDbAuthManager
raiseEvent()发起一个事件。CComponent
removeAuthItem()移除指定的授权项目。CDbAuthManager
removeItemChild()移除子项目。CDbAuthManager
revoke()撤消用户的授权任务。CDbAuthManager
save()将授权数据保存到持久化存储器。CDbAuthManager
saveAuthAssignment()保存修改过的授权任务。CDbAuthManager
saveAuthItem()将授权项目保存到持久化存储器。CDbAuthManager

受保护方法

隐藏继承方法

方法描述定义在
checkAccessRecursive()检测指定用户的访问权限。CDbAuthManager
checkItemChildType()检查项目类型以确定一个子项目已经赋予给一个父项目。CAuthManager
detectLoop()检测是否在授权项目层级中存在循环。CDbAuthManager
getDbConnection()返回数据库连接对象。CDbAuthManager
usingSqlite()CDbAuthManager

属性详细

assignmentTable 属性 public string $assignmentTable;

保存授权项目任务的数据表名字。默认为‘AuthAssignment’。

authItems 属性 只读 public array getAuthItems(integer $type=NULL, mixed $userId=NULL)

返回指定类型和用户的授权项目。

connectionID 属性 public string $connectionID;

CDbConnection应用组件的ID。默认为‘db’。 数据库里面必须包含着在"framework/web/auth/*.sql"声明的数据表。

db 属性 public CDbConnection $db;

数据库连接对象。默认是,这个会根据应用组件里面公认的connectionIDID自动 初始化的。

dbConnection 属性 只读 protected CDbConnection getDbConnection()

数据库连接对象。

itemChildTable 属性 public string $itemChildTable;

保存授权项目层级关系的数据表名字。默认为‘AuthItemChild’。

itemTable 属性 public string $itemTable;

保存授权项目的数据表名字。默认为‘AuthItem’。

方法详细

addItemChild() 方法
public boolean addItemChild(string $itemName, string $childName)
$itemNamestring父项目名字
$childNamestring子项目名字
{return}boolean添加是否成功。
源码: framework/web/auth/CDbAuthManager.php#125 (显示) publicfunctionaddItemChild($itemName,$childName)
{
if($itemName===$childName)
thrownewCException(Yii::t('yii','Cannotadd"{name}"asachildofitself.',
array('{name}'=>$itemName)));

$rows=$this->db->createCommand()
->select()
->from($this->itemTable)
->where('name=:name1ORname=:name2',array(
':name1'=>$itemName,
':name2'=>$childName
))
->queryAll();

if(count($rows)==2)
{
if($rows[0]['name']===$itemName)
{
$parentType=$rows[0]['type'];
$childType=$rows[1]['type'];
}
else
{
$childType=$rows[0]['type'];
$parentType=$rows[1]['type'];
}
$this->checkItemChildType($parentType,$childType);
if($this->detectLoop($itemName,$childName))
thrownewCException(Yii::t('yii','Cannotadd"{child}"asachildof"{name}".Aloophasbeendetected.',
array('{child}'=>$childName,'{name}'=>$itemName)));

$this->db->createCommand()
->insert($this->itemChildTable,array(
'parent'=>$itemName,
'child'=>$childName,
));

returntrue;
}
else
thrownewCException(Yii::t('yii','Either"{parent}"or"{child}"doesnotexist.',array('{child}'=>$childName,'{parent}'=>$itemName)));
}

将一个项目作为一个子项目添加。

assign() 方法
public CAuthAssignment assign(string $itemName, mixed $userId, string $bizRule=NULL, mixed $data=NULL)
$itemNamestring项目名字
$userIdmixed用户ID(详情请参考IWebUser::getId)。
$bizRulestring当调用checkAccess时, 具体的授权项目的业务规则。
$datamixed这个任务额外的数据。
{return}CAuthAssignment授权任务的信息。
源码: framework/web/auth/CDbAuthManager.php#248 (显示) publicfunctionassign($itemName,$userId,$bizRule=null,$data=null)
{
if($this->usingSqlite()&&$this->getAuthItem($itemName)===null)
thrownewCException(Yii::t('yii','Theitem"{name}"doesnotexist.',array('{name}'=>$itemName)));

$this->db->createCommand()
->insert($this->assignmentTable,array(
'itemname'=>$itemName,
'userid'=>$userId,
'bizrule'=>$bizRule,
'data'=>serialize($data)
));
returnnewCAuthAssignment($this,$itemName,$userId,$bizRule,$data);
}

将授权项目赋予给用户。

checkAccess() 方法
public void checkAccess(string $itemName, mixed $userId, array $params=array ( ))
$itemNamestring需要检测的访问操作名字
$userIdmixed用户ID。这个可以是数字,或者是唯一识别用户身份的 字符串。详情请看IWebUser::getId。
$paramsarray键名-键值对,将关联到用户的任务和角色传递给 业务规则。
源码: framework/web/auth/CDbAuthManager.php#71 (显示) publicfunctioncheckAccess($itemName,$userId,$params=array())
{
$assignments=$this->getAuthAssignments($userId);
return$this->checkAccessRecursive($itemName,$userId,$params,$assignments);
}

检测指定用户的访问权限。

checkAccessRecursive() 方法 (可用自 v1.1.3)
protected boolean checkAccessRecursive(string $itemName, mixed $userId, array $params, array $assignments)
$itemNamestring需要检测的访问操作名字
$userIdmixed用户ID。这个可以是数字,或者是唯一识别用户身份的 字符串。详情请看IWebUser::getId。
$paramsarray键名-键值对,将关联到用户的任务和角色传递给 业务规则。
$assignmentsarray指定用户的任务
{return}boolean返回值说明用户是否有权限进行操作。
源码: framework/web/auth/CDbAuthManager.php#89 (显示) protectedfunctioncheckAccessRecursive($itemName,$userId,$params,$assignments)
{
if(($item=$this->getAuthItem($itemName))===null)
returnfalse;
Yii::trace('Checkingpermission"'.$item->getName().'"','system.web.auth.CDbAuthManager');
if($this->executeBizRule($item->getBizRule(),$params,$item->getData()))
{
if(in_array($itemName,$this->defaultRoles))
returntrue;
if(isset($assignments[$itemName]))
{
$assignment=$assignments[$itemName];
if($this->executeBizRule($assignment->getBizRule(),$params,$assignment->getData()))
returntrue;
}
$parents=$this->db->createCommand()
->select('parent')
->from($this->itemChildTable)
->where('child=:name',array(':name'=>$itemName))
->queryColumn();
foreach($parentsas$parent)
{
if($this->checkAccessRecursive($parent,$userId,$params,$assignments))
returntrue;
}
}
returnfalse;
}

检测指定用户的访问权限。 这个方法是checkAccess内部调用。

clearAll() 方法
public void clearAll()
源码: framework/web/auth/CDbAuthManager.php#544 (显示) publicfunctionclearAll()
{
$this->clearAuthAssignments();
$this->db->createCommand()->delete($this->itemChildTable);
$this->db->createCommand()->delete($this->itemTable);
}

移除所有授权数据。

clearAuthAssignments() 方法
public void clearAuthAssignments()
源码: framework/web/auth/CDbAuthManager.php#554 (显示) publicfunctionclearAuthAssignments()
{
$this->db->createCommand()->delete($this->assignmentTable);
}

移除所有授权任务。

createAuthItem() 方法
public CAuthItem createAuthItem(string $name, integer $type, string $description='', string $bizRule=NULL, mixed $data=NULL)
$namestring项目名字。这个一个是唯一标识。
$typeinteger项目类型(0:操作,1:任务,2:角色)。
$descriptionstring项目描述
$bizRulestring关联到项目的业务规则。这里是PHP代码段,当调用checkAccess时 会执行。
$datamixed项目关联的额外数据。
{return}CAuthItem授权项目
源码: framework/web/auth/CDbAuthManager.php#431 (显示) publicfunctioncreateAuthItem($name,$type,$description='',$bizRule=null,$data=null)
{
$this->db->createCommand()
->insert($this->itemTable,array(
'name'=>$name,
'type'=>$type,
'description'=>$description,
'bizrule'=>$bizRule,
'data'=>serialize($data)
));
returnnewCAuthItem($this,$name,$type,$description,$bizRule,$data);
}

创建一个授权项目。 代表动作权限的授权项目(如,创建一个内容)。 它有三种类型:操作,任务,角色。 层级授权项目。高层项目继承 低层项目的权限。

detectLoop() 方法
protected boolean detectLoop(string $itemName, string $childName)
$itemNamestring父项目名字
$childNamestring添加到层级的子项目名字。
{return}boolean返回值说明是否存在循环
源码: framework/web/auth/CDbAuthManager.php#565 (显示) protectedfunctiondetectLoop($itemName,$childName)
{
if($childName===$itemName)
returntrue;
foreach($this->getItemChildren($childName)as$child)
{
if($this->detectLoop($itemName,$child->getName()))
returntrue;
}
returnfalse;
}

检测是否在授权项目层级中存在循环。

getAuthAssignment() 方法
public CAuthAssignment getAuthAssignment(string $itemName, mixed $userId)
$itemNamestring项目名字
$userIdmixed用户ID(详情请参考IWebUser::getId)。
{return}CAuthAssignment项目任务信息。如果没有赋予给用户, 则返回null。
源码: framework/web/auth/CDbAuthManager.php#302 (显示) publicfunctiongetAuthAssignment($itemName,$userId)
{
$row=$this->db->createCommand()
->select()
->from($this->assignmentTable)
->where('itemname=:itemnameANDuserid=:userid',array(
':itemname'=>$itemName,
':userid'=>$userId))
->queryRow();
if($row!==false)
{
if(($data=@unserialize($row['data']))===false)
$data=null;
returnnewCAuthAssignment($this,$row['itemname'],$row['userid'],$row['bizrule'],$data);
}
else
returnnull;
}

返回项目任务信息。

getAuthAssignments() 方法
public array getAuthAssignments(mixed $userId)
$userIdmixed用户ID(详情请参考IWebUser::getId)。
{return}array用户的项目任务信息。如果没有项目赋予给用户, 则返回null。
源码: framework/web/auth/CDbAuthManager.php#327 (显示) publicfunctiongetAuthAssignments($userId)
{
$rows=$this->db->createCommand()
->select()
->from($this->assignmentTable)
->where('userid=:userid',array(':userid'=>$userId))
->queryAll();
$assignments=array();
foreach($rowsas$row)
{
if(($data=@unserialize($row['data']))===false)
$data=null;
$assignments[$row['itemname']]=newCAuthAssignment($this,$row['itemname'],$row['userid'],$row['bizrule'],$data);
}
return$assignments;
}

返回指定用户的项目任务。

getAuthItem() 方法
public CAuthItem getAuthItem(string $name)
$namestring项目名字
{return}CAuthItem授权项目。如果找不到该项目,则返回null。
源码: framework/web/auth/CDbAuthManager.php#475 (显示) publicfunctiongetAuthItem($name)
{
$row=$this->db->createCommand()
->select()
->from($this->itemTable)
->where('name=:name',array(':name'=>$name))
->queryRow();

if($row!==false)
{
if(($data=@unserialize($row['data']))===false)
$data=null;
returnnewCAuthItem($this,$row['name'],$row['type'],$row['description'],$row['bizrule'],$data);
}
else
returnnull;
}

返回指定名字的授权项目。

getAuthItems() 方法
public array getAuthItems(integer $type=NULL, mixed $userId=NULL)
$typeinteger项目类型(0:操作,1:任务,2:角色)。默认为null, 意味着返回所有类型。
$userIdmixed用户ID。默认为null,意味着即使没有赋予给用户, 也返回所有的项目。
{return}array指定类型的授权项目。
源码: framework/web/auth/CDbAuthManager.php#368 (显示) publicfunctiongetAuthItems($type=null,$userId=null)
{
if($type===null&&$userId===null)
{
$command=$this->db->createCommand()
->select()
->from($this->itemTable);
}
elseif($userId===null)
{
$command=$this->db->createCommand()
->select()
->from($this->itemTable)
->where('type=:type',array(':type'=>$type));
}
elseif($type===null)
{
$command=$this->db->createCommand()
->select('name,type,description,t1.bizrule,t1.data')
->from(array(
$this->itemTable.'t1',
$this->assignmentTable.'t2'
))
->where('name=itemnameANDuserid=:userid',array(':userid'=>$userId));
}
else
{
$command=$this->db->createCommand()
->select('name,type,description,t1.bizrule,t1.data')
->from(array(
$this->itemTable.'t1',
$this->assignmentTable.'t2'
))
->where('name=itemnameANDtype=:typeANDuserid=:userid',array(
':type'=>$type,
':userid'=>$userId
));
}
$items=array();
foreach($command->queryAll()as$row)
{
if(($data=@unserialize($row['data']))===false)
$data=null;
$items[$row['name']]=newCAuthItem($this,$row['name'],$row['type'],$row['description'],$row['bizrule'],$data);
}
return$items;
}

返回指定类型和用户的授权项目。

getDbConnection() 方法
protected CDbConnection getDbConnection()
{return}CDbConnection数据库连接对象。
源码: framework/web/auth/CDbAuthManager.php#581 (显示) protectedfunctiongetDbConnection()
{
if($this->db!==null)
return$this->db;
elseif(($this->db=Yii::app()->getComponent($this->connectionID))instanceofCDbConnection)
return$this->db;
else
thrownewCException(Yii::t('yii','CDbAuthManager.connectionID"{id}"isinvalid.PleasemakesureitreferstotheIDofaCDbConnectionapplicationcomponent.',
array('{id}'=>$this->connectionID)));
}
getItemChildren() 方法
public array getItemChildren(mixed $names)
$namesmixed父项目名字。可以是字符串或数组。 后者代表项目名字列表。
{return}array父项目的所有子项目。
源码: framework/web/auth/CDbAuthManager.php#208 (显示) publicfunctiongetItemChildren($names)
{
if(is_string($names))
$condition='parent='.$this->db->quoteValue($names);
elseif(is_array($names)&&$names!==array())
{
foreach($namesas&$name)
$name=$this->db->quoteValue($name);
$condition='parentIN('.implode(',',$names).')';
}

$rows=$this->db->createCommand()
->select('name,type,description,bizrule,data')
->from(array(
$this->itemTable,
$this->itemChildTable
))
->where($condition.'ANDname=child')
->queryAll();

$children=array();
foreach($rowsas$row)
{
if(($data=@unserialize($row['data']))===false)
$data=null;
$children[$row['name']]=newCAuthItem($this,$row['name'],$row['type'],$row['description'],$row['bizrule'],$data);
}
return$children;
}

返回这个项目的所有子项目。

hasItemChild() 方法
public boolean hasItemChild(string $itemName, string $childName)
$itemNamestring父项目名字
$childNamestring子项目名字
{return}boolean子项目是否存在
源码: framework/web/auth/CDbAuthManager.php#191 (显示) publicfunctionhasItemChild($itemName,$childName)
{
return$this->db->createCommand()
->select('parent')
->from($this->itemChildTable)
->where('parent=:parentANDchild=:child',array(
':parent'=>$itemName,
':child'=>$childName))
->queryScalar()!==false;
}

返回一个值说明这个子项目是否存在

init() 方法
public void init()
源码: framework/web/auth/CDbAuthManager.php#57 (显示) publicfunctioninit()
{
parent::init();
$this->_usingSqlite=!strncmp($this->getDbConnection()->getDriverName(),'sqlite',6);
}

初始化这个应用组件。 这个方法覆盖父类方法,实现了数据库连接。

isAssigned() 方法
public boolean isAssigned(string $itemName, mixed $userId)
$itemNamestring项目名字
$userIdmixed用户ID(详情请参考IWebUser::getId)。
{return}boolean这个项目是否已经赋予给用户。
源码: framework/web/auth/CDbAuthManager.php#284 (显示) publicfunctionisAssigned($itemName,$userId)
{
return$this->db->createCommand()
->select('itemname')
->from($this->assignmentTable)
->where('itemname=:itemnameANDuserid=:userid',array(
':itemname'=>$itemName,
':userid'=>$userId))
->queryScalar()!==false;
}

返回值说明这个项目是否已经赋予给用户。

removeAuthItem() 方法
public boolean removeAuthItem(string $name)
$namestring要移除的项目名字
{return}boolean存储器存在的项目是否已经移除成功。
源码: framework/web/auth/CDbAuthManager.php#449 (显示) publicfunctionremoveAuthItem($name)
{
if($this->usingSqlite())
{
$this->db->createCommand()
->delete($this->itemChildTable,'parent=:name1ORchild=:name2',array(
':name1'=>$name,
':name2'=>$name
));
$this->db->createCommand()
->delete($this->assignmentTable,'itemname=:name',array(
':name'=>$name,
));
}

return$this->db->createCommand()
->delete($this->itemTable,'name=:name',array(
':name'=>$name
))>0;
}

移除指定的授权项目。

removeItemChild() 方法
public boolean removeItemChild(string $itemName, string $childName)
$itemNamestring父项目名字
$childNamestring子项目名字
{return}boolean移除是否成功
源码: framework/web/auth/CDbAuthManager.php#176 (显示) publicfunctionremoveItemChild($itemName,$childName)
{
return$this->db->createCommand()
->delete($this->itemChildTable,'parent=:parentANDchild=:child',array(
':parent'=>$itemName,
':child'=>$childName
))>0;
}

移除子项目。 要注意的是,子项目是没有被删除的。只是它跟父项目的关系解。

revoke() 方法
public boolean revoke(string $itemName, mixed $userId)
$itemNamestring项目名字
$userIdmixed用户ID(详情请参考IWebUser::getId)。
{return}boolean撤消是否成功
源码: framework/web/auth/CDbAuthManager.php#269 (显示) publicfunctionrevoke($itemName,$userId)
{
return$this->db->createCommand()
->delete($this->assignmentTable,'itemname=:itemnameANDuserid=:userid',array(
':itemname'=>$itemName,
':userid'=>$userId
))>0;
}

撤消用户的授权任务。

save() 方法
public void save()
源码: framework/web/auth/CDbAuthManager.php#537 (显示) publicfunctionsave()
{
}

将授权数据保存到持久化存储器。

saveAuthAssignment() 方法
public void saveAuthAssignment(CAuthAssignment $assignment)
$assignmentCAuthAssignment已经修改过的任务。
源码: framework/web/auth/CDbAuthManager.php#348 (显示) publicfunctionsaveAuthAssignment($assignment)
{
$this->db->createCommand()
->update($this->assignmentTable,array(
'bizrule'=>$assignment->getBizRule(),
'data'=>serialize($assignment->getData()),
),'itemname=:itemnameANDuserid=:userid',array(
'itemname'=>$assignment->getItemName(),
'userid'=>$assignment->getUserId()
));
}

保存修改过的授权任务。

saveAuthItem() 方法
public void saveAuthItem(CAuthItem $item, string $oldName=NULL)
$itemCAuthItem要保存的项目。
$oldNamestring旧的项目名字。如果为null,意味着项目名字没有改变。
源码: framework/web/auth/CDbAuthManager.php#498 (显示) publicfunctionsaveAuthItem($item,$oldName=null)
{
if($this->usingSqlite()&&$oldName!==null&&$item->getName()!==$oldName)
{
$this->db->createCommand()
->update($this->itemChildTable,array(
'parent'=>$item->getName(),
),'parent=:whereName',array(
':whereName'=>$oldName,
));
$this->db->createCommand()
->update($this->itemChildTable,array(
'child'=>$item->getName(),
),'child=:whereName',array(
':whereName'=>$oldName,
));
$this->db->createCommand()
->update($this->assignmentTable,array(
'itemname'=>$item->getName(),
),'itemname=:whereName',array(
':whereName'=>$oldName,
));
}

$this->db->createCommand()
->update($this->itemTable,array(
'name'=>$item->getName(),
'type'=>$item->getType(),
'description'=>$item->getDescription(),
'bizrule'=>$item->getBizRule(),
'data'=>serialize($item->getData()),
),'name=:whereName',array(
':whereName'=>$oldName===null?$item->getName():$oldName,
));
}

将授权项目保存到持久化存储器。

usingSqlite() 方法
protected boolean usingSqlite()
{return}boolean数据库是否是SQLite
源码: framework/web/auth/CDbAuthManager.php#595 (显示) protectedfunctionusingSqlite()
{
return$this->_usingSqlite;
}