function __construct() { global $CONFIG; try { parent::__construct($CONFIG->dataroot . 'izap_queue.db'); $this->setup(); } catch (PDOException $e) { register_error(elgg_echo("izap_videos:error:sqliteDrivers")); izap_admin_settings_izap_videos('izapVideoOptions', array('OFFSERVER', 'EMBED'), TRUE); izap_admin_settings_izap_videos('izap_cron_time', 'none', TRUE); } }
$Fail_functions = ini_get('disable_functions'); $php_version = phpversion(); $exec = function_exists('exec') ? TRUE : FALSE; $curl = extension_loaded('curl') ? TRUE : FALSE; $_ffmpeg = explode(' ', elgg_get_plugin_setting('izapVideoCommand', 'izap-videos')); if ($_ffmpeg[0]) { $ffmpeg_path = exec($_ffmpeg[0] . ' -version', $out, $err); } else { $_ffmpeg = exec("which ffmpeg"); $ffmpeg_path = exec($_ffmpeg . ' -version', $out, $err); } if ($err == 0) { $ffmpeg = $ffmpeg_path; } $pdo_sqlite = extension_loaded('pdo_sqlite') ? TRUE : FALSE; $php_command = exec(izap_admin_settings_izap_videos('izapPhpInterpreter') . ' --version', $output_PHP, $return_value); if (!$php_command) { $which_php = exec("which php"); $php_command = exec($which_php . ' --version', $output_PHP, $return_value); } if ($return_value === 0) { $php = nl2br(implode('', $output_PHP)); } $plugin = elgg_get_plugin_from_id('izap-videos'); $max_file_upload = izap_readable_size_izap_videos(ini_get('upload_max_filesize')); $max_post_size = izap_readable_size_izap_videos(ini_get('post_max_size')); $max_input_time = ini_get('max_input_time'); $max_execution_time = ini_get('max_execution_time'); $memory_limit = ini_get('memory_limit'); $plugin = elgg_get_plugin_from_id('izap-videos'); ?>
/** * This function return the path of PHP Interpreter * * @return string path for php interpreter * * @version 5.0 */ function izap_get_php_path_izap_videos() { $path = izap_admin_settings_izap_videos('izapPhpInterpreter'); $path = html_entity_decode($path); if (!$path) { $path = ''; } return $path; }
/** * Return authenticated http client * * @param string $token * * @return \self * * @version 5.0 */ public static function getAuthSubHttpClient($token = false) { $next = elgg_get_site_url() . GLOBAL_IZAP_VIDEOS_PAGEHANDLER . '/upload/' . elgg_get_logged_in_user_entity()->username . '/youtube'; $scope = 'http://gdata.youtube.com'; $secure = false; $session = true; if (!isset($_SESSION['YT_TOKEN']) && !$token) { return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session); } else { if (!isset($_SESSION['YT_TOKEN']) && $token) { $_SESSION['YT_TOKEN'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($token); } } return new self(Zend_Gdata_AuthSub::getHttpClient($_SESSION['YT_TOKEN']), izap_admin_settings_izap_videos('youtubeDeveloperKey')); }