[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/gallery/ -> G2EmbedDiscoveryUtilities.class (summary)

(no description)

Author: Andy Staudacher <ast@gmx.ch>
Version: $Revision: 1.3.2.2 $ $Date: 2007/11/27 18:10:32 $
File Size: 466 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

G2EmbedDiscoveryUtilities:: (7 methods):
  normalizeG2Uri()
  normalizeEmbedUri()
  getG2EmbedPathByG2Uri()
  getG2EmbedPathByG2UriEmbedUriAndLocation()
  _normalizeUri()
  isFileReadable()
  _isRestrictedByOpenBaseDir()


Class: G2EmbedDiscoveryUtilities  - X-Ref

A collection of useful G2Embed related utilities to find the correct GalleryEmbed::init
parameters

normalizeG2Uri($g2Uri)   X-Ref
The format for g2Uri accepted by GalleryEmbed::init is quite strict and well defined
missing traling / leading slashes have a meaning.
This function is more tolerant for incorrect user input and tries to normalize the
given g2Uri to a value that is probably what the user meant to provide

The returned URI is either a server-relative URI (e.g. /gallery2/) or an absolute URI
including the schema (e.g. http://example.com/gallery/)

The file / query string part is always removed)

param: string g2Uri
return: string normalized g2Uri

normalizeEmbedUri($embedUri)   X-Ref


getG2EmbedPathByG2Uri($g2Uri)   X-Ref
Find the absolute filesystem path to G2's embed.php when given the g2Uri

Returns false if the g2Uri is wrong. Can also fail if G2 and emApp are
on different (sub)domains / IPs

param: string the g2Uri, a full URL or a server-relative URI
return: array boolean success,

getG2EmbedPathByG2UriEmbedUriAndLocation($g2Uri, $embedUri, $dirnameOfEmApp)   X-Ref
Get the absolute filesystem path to embed.php from the given g2Uri, embedUri and the
absolute filesystem path of the entry point file of your embedding application

Can be unreliable if short URLs are entered or if apache alias / symlinks are used

param: string g2Uri
param: string embedUri
param: string the dirname of the location of the entry point of your embedding application
return: array boolean success,

_normalizeUri($uri)   X-Ref
Helper function for normalizeG2Uri and normalizeEmbedUri


isFileReadable($path)   X-Ref
No description

_isRestrictedByOpenBaseDir($path)   X-Ref
Return true if the path provided is not allowed by the current open_basedir configuration.

Copied from GalleryPlatform and adjusted to be independent of the G2 framework

return: true if the path is restricted



Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7