Gallery: 设计资料:完整性检查:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
 
第1行: 第1行:
This document serves as a list of integrity checks that should be implemented in an official integrity module.
该文档列有需在官方完整性模块中实现的完整性检查。


== Requirements ==
== 要求 ==
* Check the integrity of the database
* 检查数据库的完整性
* Check the integrity of DB vs storage folder (filesystem)
* 检查DB与存储文件夹(文件系统)的完整性
* Expose via UI in site admin
* 通过站点管理中的UI暴露
* Expose via lib/support/ in case the installation is hosed up to a degree that site admin can't be accessed anymore
* 如被升至某一导致站点管理无法被访问的级别时,则通过lib/support/暴露


== Checks ==
== 检查 ==
  Disable disk cache for checking
  为了进行检查,禁用磁盘缓存


=== Check Entities ===
=== 检查实体 ===
  Foreach entity
  Foreach entity
     describeEntity entity and check that each table contains a row for this entity (e.g. by loading the entity)
     describeEntity实体并检查各表格都含有此实体的一行(如通过载入实体)


  Foreach entity table
  Foreach entity table
     verify that there's a corresponding entry in the Entity table
     确认在实体表中有对应的入口


=== Check References (Undocumented Foreign Keys) ===
=== 检查引用(未公开的外键)===
  - ChildEntity.parentId -> Entity.id
  - ChildEntity.parentId -> Entity.id
  - Derivative.derivativeSourceId
  - Derivative.derivativeSourceId
  - Entity.linkId -> Entity.id && entityType must be the same
  - Entity.linkId -> Entity.id && entityType必须相同
  - Comment.commenterId -> User.id
  - Comment.commenterId -> User.id
  - AlbumItem.theme -> PluginMap.pluginId && active
  - AlbumItem.theme -> PluginMap.pluginId && active
For Maps too...
同样对于映射.
  - 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
  - etc.
  -


=== Check Database vs Filesystem ===
=== 检查数据库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
     verify that a corresponding FilesystemEntity exists for logicPath
     确认对于logicPath 存在一个对应的FilesystemEntity


=== Check Filesystem permissions ===
=== 检查文件系统权限 ===
  Foreach g2data/ as file
  Foreach g2data/ as file
     is_writeable file
     is_writeable file


=== More Checks ===
=== 更多检查 ===
* id.everybodyGroup -> Group.id
* id.everybodyGroup -> Group.id
* id.anonymousUser -> User.id && user only in everybody group
* id.anonymousUser -> User.id && user仅在所有人用户组内
* id.adminGroup -> Group.id && groupType == GROUP_SITE_ADMINS
* id.adminGroup -> Group.id && groupType == GROUP_SITE_ADMINS
* existence of 1 or more site admins
* 1个或多个站点管理员的存在
* check root album id and other core plugin params
* 检查根相册id和其他核心插件参量
* verify that admins have access to all items / permissions for everything
* 确认管理员可以访问所有项目,并具有全部权限
* factory -> verify factory entries
* factory -> 确认厂入口
* toolkit operations, post filters (missing files, missing operations)
* 工具包操作,文章过滤器(缺失文件,缺失操作)


[[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 -> 确认厂入口
  • 工具包操作,文章过滤器(缺失文件,缺失操作)