From 0554db044cd5b024037a0eb0f8060bbafdc8fb76 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Sat, 1 Jun 2019 12:23:36 -0400 Subject: [PATCH] Add some debug --- lib/Download.php | 7 ++++++- lib/PremiumizeMe.php | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Download.php b/lib/Download.php index 71f36d6..965e7f1 100644 --- a/lib/Download.php +++ b/lib/Download.php @@ -32,6 +32,12 @@ class Download { // $myDownload->addEvent([ // 'state' => 'downloading' // ]); + // + if (!empty($myDownload->_id)) { + echo 'New job: '.$myDownload->dtype.':'.$myDownload->url; + } else { + echo 'No job in the queue'; + } return $myDownload; } @@ -135,7 +141,6 @@ class Download { */ static function launchNextDownload() { - echo json_encode('Traitement'); if ('cgi-fcgi' === php_sapi_name()) { //fastcgi_finish_request(); } diff --git a/lib/PremiumizeMe.php b/lib/PremiumizeMe.php index f0bd30d..ec62502 100644 --- a/lib/PremiumizeMe.php +++ b/lib/PremiumizeMe.php @@ -145,10 +145,9 @@ class PremiumizeMe { // Pour le moment nous ne gérons que des cas avec un seul fichier retourné $premInfos = PremiumizeMe::getLink($element->url); + // TODO: only if debug + //echo 'Premimumizeme link: '.$premInfos['link']; - file_put_contents( 'test', $premInfos, FILE_APPEND); - file_put_contents('test', stat(file_exists(DOWNLOADINGDIR.DIRECTORY_SEPARATOR.$premInfos['path']))); - file_put_contents('test', stat(file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$premInfos['path']))); if (file_exists(DOWNLOADINGDIR.DIRECTORY_SEPARATOR.$premInfos['path']) || file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$premInfos['path'])) { $element->addEvent(['state' => 'dupp' ]); $element->updateState('dupp');