Gallery2:API Deprecation Log - Gallery Codex
Personal tools

Gallery2:API Deprecation Log

From Gallery Codex

This is the history of deprecated functions, classes, files, libraries, etc. since Gallery 2.1.


If something is marked deprecated, it will usually be supported until the next major API change (e.g. core API from 7.x to 8.0) and then removed and no longer supported. This means that you're discouraged from using deprecated features such that your code doesn't need to be rewritten on the next major API change.

Core API 7.x => 8.0


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


  • Replacement: lib/yui/autocomplete.min.js


  • Replacement: Moved to GalleryCoreApi::utf8Substring


  • Replacement: Use GallerySession::getId instead


  • Replacement: Use GalleryPlatform::recursiveChmod instead


  • Replacement: html_entity_decode (available in PHP 4.3.0)


  • Replacement: None (multisites work differently now)


  • Replacement: Instead of return $ret->wrap(...); just do return $ret;

GalleryCoreApi::error File and Line Arguments

  • Replacement: Omit the File and Line arguments, see Core API 7.4


  • Replacement: Use $gallery->setConfig() and getConfig() instead.

Gallery Config: 'link'

  • Replacement: Use the replica module instead of the 'link' config.

GalleryCoreApi::getPluginBaseDirs, getPluginBaseDir

  • Replacement: Use dirname(dirname(...(__FILE__)...)) instead, or GalleryCoreApi::requireOnce()


  • Replacement: None (Concept of different plugin folders has been abandonded)

$skipBaseDirectoryDetection Argument of GalleryCoreApi::requireOnce

  • Replacement: None (Concept of different plugin folders has been abandonded)

Params for ShouldShowEmergencyEditItemLink Callback

  • Replacement: Use checkBlocks = ... instead of check[Sidebar|Album|Photo]Blocks.


  • Replacement: The class has been moved into GalleryStorage.class. Usually there is no need to include any file since GalleryStorage is usually included for you.


  • Replacement: Use fetchPermissionsForItems() instead. It does caching as well.

Params for GalleryCoreApi::loadEntitiesById

  • The $requiredEntityType parameter (introduced in core API 7.27) is mandatory starting with core API 8.0. Currently it is optional.


  • Replacement: GalleryCoreApi::registerFactoryImplementation('GalleryEventListener', ...)

Module API 3.x => 4.0

Support for : Separator in View and Controller Identifiers

  • Replacement: Use the . Separator instead (core.ShowItem instead of core:ShowItem).


  • Replacement: Use GalleryView::getitem() instead.

Redirect URL in GalleryPlugin::deactivate

  • Replacement: The redirect URL will be removed without substitution.

SQL schema.tpl Format

  • Replacement: TYPE=DB_TABLE_TYPE which is part of pre-G2.1 schema.tpl files will no longer be supported. Regenerate schema.tpl with a recent development version of G2.

GalleryModule::getItemlinks Signature

  • Replacement: Change signature of getItemlinks() (add new parameter) to pass PHP 5 Strict parsing.


  • Replacement: Use GalleryCoreApi::registerFactoryImplementation('GalleryEventListener', ...) in YourModule::performFactoryRegistrations

Theme API 2.x => 3.0

Embed API 1.x => 2.0


  • Replacement: Use GalleryEmbed::getBlock('imageblock', 'ImageBlock', $params) instead (since 1.4)