Gallery: 设计资料:完整性检查:修订间差异
来自站长百科
Firebrance(讨论 | 贡献) |
Firebrance(讨论 | 贡献) 无编辑摘要 |
||
第1行: | 第1行: | ||
该文档列有需在官方完整性模块中实现的完整性检查。 | |||
== | == 要求 == | ||
* | * 检查数据库的完整性 | ||
* | * 检查DB与存储文件夹(文件系统)的完整性 | ||
* | * 通过站点管理中的UI暴露 | ||
* | * 如被升至某一导致站点管理无法被访问的级别时,则通过lib/support/暴露 | ||
== | == 检查 == | ||
为了进行检查,禁用磁盘缓存 | |||
=== | === 检查实体 === | ||
Foreach entity | Foreach entity | ||
describeEntity实体并检查各表格都含有此实体的一行(如通过载入实体) | |||
Foreach entity table | Foreach entity table | ||
确认在实体表中有对应的入口 | |||
=== | === 检查引用(未公开的外键)=== | ||
- ChildEntity.parentId -> Entity.id | - ChildEntity.parentId -> Entity.id | ||
- Derivative.derivativeSourceId | - Derivative.derivativeSourceId | ||
- Entity.linkId -> Entity.id && | - Entity.linkId -> Entity.id && entityType必须相同 | ||
- Comment.commenterId -> User.id | - Comment.commenterId -> User.id | ||
- AlbumItem.theme -> PluginMap.pluginId && active | - AlbumItem.theme -> PluginMap.pluginId && active | ||
同样对于映射. | |||
- UserGroupMap.userId -> User.id | - UserGroupMap.userId -> User.id | ||
- UserGroupMap.groupId -> Group.id | - UserGroupMap.groupId -> Group.id | ||
第37行: | 第37行: | ||
- ExternalIdMap.entityType -> describeEntity hit (no miss) | - ExternalIdMap.entityType -> describeEntity hit (no miss) | ||
- G1MigrateMap.itemId -> Item.id | - G1MigrateMap.itemId -> Item.id | ||
- | - 等 | ||
=== | === 检查数据库vs文件系统 === | ||
Foreach FilesystemEntity as entity | Foreach FilesystemEntity as entity | ||
file_exists entity.fetchPath() | file_exists entity.fetchPath() | ||
Foreach g2data/albums/ as logicPath | Foreach g2data/albums/ as logicPath | ||
确认对于logicPath 存在一个对应的FilesystemEntity | |||
=== | === 检查文件系统权限 === | ||
Foreach g2data/ as file | Foreach g2data/ as file | ||
is_writeable file | is_writeable file | ||
=== | === 更多检查 === | ||
* id.everybodyGroup -> Group.id | * id.everybodyGroup -> Group.id | ||
* id.anonymousUser -> User.id && | * id.anonymousUser -> User.id && user仅在所有人用户组内 | ||
* id.adminGroup -> Group.id && groupType == GROUP_SITE_ADMINS | * id.adminGroup -> Group.id && groupType == GROUP_SITE_ADMINS | ||
* | * 1个或多个站点管理员的存在 | ||
* | * 检查根相册id和其他核心插件参量 | ||
* | * 确认管理员可以访问所有项目,并具有全部权限 | ||
* factory -> | * factory -> 确认厂入口 | ||
* | * 工具包操作,文章过滤器(缺失文件,缺失操作) | ||
[[Category:Gallery 2:Development|Developers]] | [[Category:Gallery 2:Development|Developers]] |
2008年11月29日 (六) 14:32的最新版本
该文档列有需在官方完整性模块中实现的完整性检查。
要求[ ]
- 检查数据库的完整性
- 检查DB与存储文件夹(文件系统)的完整性
- 通过站点管理中的UI暴露
- 如被升至某一导致站点管理无法被访问的级别时,则通过lib/support/暴露
检查[ ]
为了进行检查,禁用磁盘缓存
检查实体[ ]
Foreach entity describeEntity实体并检查各表格都含有此实体的一行(如通过载入实体)
Foreach entity table 确认在实体表中有对应的入口
检查引用(未公开的外键)[ ]
- ChildEntity.parentId -> Entity.id - Derivative.derivativeSourceId - Entity.linkId -> Entity.id && entityType必须相同 - Comment.commenterId -> User.id - AlbumItem.theme -> PluginMap.pluginId && active
同样对于映射.
- UserGroupMap.userId -> User.id - UserGroupMap.groupId -> Group.id - AccessMap.userOrGroupId -> Entity.id - AccessSubscriberMap.itemId -> Item.id - AccessSUbscriberMap.accessListId -> AccessMap.accessListId - CustomfieldMap.itemId -> Item.id - PluginParameterMap.itemId -> Entity.id - DerivativePrefsMap.itemId -> Item.id - DescendentCountsMap.userId -> User.id - DescendentCountsMap.itemId -> Item.id - ExternalIdMap.entityId -> Entity.id - ExternalIdMap.entityType -> describeEntity hit (no miss) - G1MigrateMap.itemId -> Item.id - 等
检查数据库vs文件系统[ ]
Foreach FilesystemEntity as entity file_exists entity.fetchPath() Foreach g2data/albums/ as logicPath 确认对于logicPath 存在一个对应的FilesystemEntity
检查文件系统权限[ ]
Foreach g2data/ as file is_writeable file
更多检查[ ]
- id.everybodyGroup -> Group.id
- id.anonymousUser -> User.id && user仅在所有人用户组内
- id.adminGroup -> Group.id && groupType == GROUP_SITE_ADMINS
- 1个或多个站点管理员的存在
- 检查根相册id和其他核心插件参量
- 确认管理员可以访问所有项目,并具有全部权限
- factory -> 确认厂入口
- 工具包操作,文章过滤器(缺失文件,缺失操作)