You are here

function media_youtube_zend_path in Media: YouTube 6

Return the path to the Zend library.

If media_youtube_variable_get('zend_path') has not yet been set, then this will attempt to autodiscover the path if the Gdata.php file exists within sites/all/libraries/* or sites/example.com/libraries/*. It will also set the path to media_youtube_variable_get('zend_path').

The library is available from http://framework.zend.com/download/gdata/.

Parameters

boolean $reset: (Optional) If TRUE, then reset the variable and attempt a new autodiscovery.

Return value

string The path to the Zend Gdata.php and related files.

7 calls to media_youtube_zend_path()
media_youtube_admin_form in includes/media_youtube.admin.inc
This form will be displayed both at /admin/settings/media_youtube and admin/content/emfield.
media_youtube_autoload in ./media_youtube.module
Autoload the Zend_Loader class when needed.
media_youtube_check_status in ./media_youtube.module
Check the availability of a video.
media_youtube_upload_video in includes/media_youtube.media_mover.inc
Upload a video to YouTube through Media Mover.
_media_youtube_check_upload in includes/media_youtube.api.inc
Check the upload status of a video.

... See full list

File

./media_youtube.module, line 311
Embedded Video Field provider file for YouTube.com.

Code

function media_youtube_zend_path($reset = FALSE) {
  static $path;
  if (!isset($path) || $reset) {
    if (!($path = media_youtube_variable_get('zend_path')) || $reset) {
      $files = drupal_system_listing('^Gdata\\.php$', 'libraries', 'basename', 0);
      if (isset($files['Gdata.php'])) {
        $path = dirname($files['Gdata.php']->filename);
        $path = substr($path, 0, -strlen(strrchr($path, "/")));
        media_youtube_variable_set('zend_path', $path);
      }
      else {
        $path = '';
      }
    }
    if ($path) {
      _media_youtube_set_include_path($path);
    }
  }
  return $path;
}