From 521ecdf4ca74daca93ef043784731dbc60d414b8 Mon Sep 17 00:00:00 2001 From: justinhunt Date: Sun, 20 Jan 2019 21:28:57 +0900 Subject: [PATCH] support for fast loading and cron improvement --- CHANGES.txt | 5 +++++ classes/generico_utils.php | 20 ++++++++++---------- poodllloader.html | 36 ++++++++++++++++++++++++++++++++++++ version.php | 4 ++-- 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 poodllloader.html diff --git a/CHANGES.txt b/CHANGES.txt index c5a5e49..6318e07 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,10 @@ Change List ========= + +Version 1.4.07 (Build 2019012000) +-Added better cron calling +-Added Poodll loader.html for cloudpoodll + Version 1.4.06(Build 2018120500) -Fixed bug when presets dir contained a directory. diff --git a/classes/generico_utils.php b/classes/generico_utils.php index a38fb08..17a5d93 100644 --- a/classes/generico_utils.php +++ b/classes/generico_utils.php @@ -166,8 +166,9 @@ public static function fetch_token($apiuser, $apisecret) } // Send the request & save response to $resp - $token_url ="https://cloud.poodll.com/local/cpapi/poodlltoken.php?username=$apiuser&password=$apisecret&service=cloud_poodll"; - $token_response = self::curl_fetch($token_url); + $token_url ="https://cloud.poodll.com/local/cpapi/poodlltoken.php"; + $postdata=array('username'=>$apiuser,'password'=>$apisecret,'service'=>'cloud_poodll'); + $token_response = self::curl_fetch($token_url,$postdata); if ($token_response) { $resp_object = json_decode($token_response); if($resp_object && property_exists($resp_object,'token')) { @@ -202,13 +203,12 @@ public static function fetch_token($apiuser, $apisecret) //we use curl to fetch transcripts from AWS and Tokens from cloudpoodll //this is our helper - public static function curl_fetch($url){ - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HEADER, false); - $data = curl_exec($curl); - curl_close($curl); - return $data; + public static function curl_fetch($url,$postdata){ + global $CFG; + require_once($CFG->libdir.'/filelib.php'); + $curl = new \curl(); + + $result = $curl->get($url, $postdata); + return $result; } } \ No newline at end of file diff --git a/poodllloader.html b/poodllloader.html new file mode 100644 index 0000000..6a64abb --- /dev/null +++ b/poodllloader.html @@ -0,0 +1,36 @@ + + + + + + + + Poodll Recorder + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/version.php b/version.php index 50fbf9a..a20538f 100644 --- a/version.php +++ b/version.php @@ -25,8 +25,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2018120500; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2019012000; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2011070100; // Requires this Moodle version $plugin->component = 'filter_generico'; // Full name of the plugin (used for diagnostics) $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'Version 1.4.06(Build 2018120500)'; +$plugin->release = 'Version 1.4.07(Build 2019012000)';