Example #1
0
<?php

/**
 * iZAP izap_videos
 *
 * @package Elgg videotizer, by iZAP Web Solutions.
 * @license GNU Public License version 3
 * @Contact iZAP Team "<*****@*****.**>"
 * @Founder Tarun Jangra "<*****@*****.**>"
 * @link http://www.izap.in/
 * 
 */
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
ini_set('max_execution_time', 0);
ini_set('memory_limit', (int) get_plugin_setting('izapMaxFileSize', GLOBAL_IZAP_VIDEOS_PLUGIN) + 100 . 'M');
// only works if started from command line
if ($argc > 1 && $argv[1] == 'izap' && $argv[2] == 'web') {
    izapGetAccess_izap_videos();
    // get the complete access to the system;
    izapRunQueue_izap_videos();
    izapRemoveAccess_izap_videos();
    // remove the access from the system
}
Example #2
0
function izapRunQueue_izap_videos()
{
    $queue_object = new izapQueue();
    $queue = $queue_object->fetch_videos();
    if (is_array($queue)) {
        foreach ($queue as $pending) {
            $converted = izapConvertVideo_izap_videos($pending['main_file'], $pending['guid'], $pending['title'], $pending['url'], $pending['owner_id']);
            if (!$converted) {
                $queue_object->move_to_trash($pending['guid']);
            }
            $queue_object->delete($pending['guid']);
            izap_update_all_defined_access_id($pending['guid'], $pending['access_id']);
        }
        // re-check if there are new videos in the queue
        if ($queue_object->count() > 0) {
            izapRunQueue_izap_videos();
        }
    }
    return true;
}