数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / Gallery:API弃用日志

Gallery:API弃用日志

查看全部产品文档命名空间:Gallery

以下为自Gallery2.1以来已弃用函数,类别,文件及库的历史。

定义

如果被标记了“已弃用”,那它通常在下次较大的API改动之前(如核心API从7.x升级为8.0)还被支持,接着就会被移除并不再被支持了。这就意味着不鼓励用户使用已弃用的特点,这样你的代码在下次较大API改动时就无需重新编写了。

Core API 7.x => 8.0

lib/wz_dragdrop/

  • 替换:lib/yui/dragdrop-min.js (example usage and migration code: watermark module from G2.1 vs G2.2)

lib/javascript/AutoComplete.js

  • 替换:lib/yui/autocomplete.min.js

GalleryUtilities::utf8Substring

  • 替换:移至GalleryCoreApi::utf8Substring

GallerySession::getSessionId

  • 替换:代之使用GallerySession::getId

GalleryPlatform::recursiveFixDirPermissions

  • 替换:代之使用GalleryPlatform::recursiveChmod

GalleryUtilities::htmlEntityDecode

  • 替换:html_entity_decode (available in PHP 4.3.0)

GalleryUrlGenerator::getGalleryId

  • 替换:无(现在多站点的工作方式各不相同)

GalleryStatus::wrap

  • 替换:取代return $ret->wrap(...); 而只return $ret;

GalleryCoreApi::error File and Line Arguments

GalleryCapabilities

  • 替换:代之使用$gallery->setConfig() and getConfig()。

Gallery Config: 'link'

  • 替换:取代'link' config 而使用replica模块。

GalleryCoreApi::getPluginBaseDirs, getPluginBaseDir

  • 替换:代之使用dirname(dirname(...(__FILE__)...)),或GalleryCoreApi::requireOnce()

GalleryCoreApi::isPluginInDefaultLocation

  • 替换:无(不同插件文件夹的概念已废除)

$skipBaseDirectoryDetection Argument of GalleryCoreApi::requireOnce

  • 替换:无(不同插件文件夹的概念已废除)

Params for ShouldShowEmergencyEditItemLink Callback

  • 替换:取代check[Sidebar|Album|Photo]Blocks而使用checkBlocks = ...。

modules/core/classes/GalleryStorage/GallerySqlFragment.class

  • 替换:类别被移入GalleryStorage.class。通常无需包括任何文件,因为GalleryStorage已被包括。

GalleryCoreApi::studyPermissions

  • 替换:代之使用fetchPermissionsForItems()。它也能用于缓存。

Params for GalleryCoreApi::loadEntitiesById

  • $requiredEntityType参量(在核心API 7.27中引入的)自核心API 8.0开始为强制性的。目前为可选的。

GalleryCoreApi::registerEventListener

  • 替换:GalleryCoreApi::registerFactoryImplementation('GalleryEventListener', ...)

Module API 3.x => 4.0

Support for : Separator in View and Controller Identifiers

  • 替换:代之使用. Separator (core.ShowItem取代core:ShowItem).

GalleryView::_getItem

  • 替换:代之使用GalleryView::getitem() 。

Redirect URL in GalleryPlugin::deactivate

  • 替换:重新导向URL 将被移除,无替换。

SQL schema.tpl Format

  • 替换:TYPE=DB_TABLE_TYPE,为G2.1之前的schema.tpl文件一部分,将不再被支持。使用最新G2开发版本来生成schema.tpl文件。

GalleryModule::getItemlinks Signature

  • 替换:将getItemlinks()(添加新参量)的签名改为传输PHP 5的严格解析.

GalleryModule::registerEventListsners

  • 替换:在YourModule::performFactoryRegistrations中使用GalleryCoreApi::registerFactoryImplementation('GalleryEventListener', ...)

Theme API 2.x => 3.0

Embed API 1.x => 2.0

GalleryEmbed::getImageBlock()

  • 替换:代之使用GalleryEmbed::getBlock('imageblock', 'ImageBlock', $params) (自1.4)