Esempio n. 1
0
 public static function generateReports($recipients = array(), $filename = "")
 {
     if (trim($filename) === "") {
         $filename = SocialReport::generateFileName();
     }
     $config = SocialReport::getConfig();
     $folder = $config['appdb']['shares']['path'] . "/";
     $res = SocialReport::generateShareCountReport($config, $filename);
     if ($res === true) {
         $res = SocialReport::convertReportToCSV($filename);
     }
     if ($res === true) {
         $res = SocialReport::generateNonZeroShareCountReport($filename);
     }
     if ($res === true) {
         $res = SocialReport::convertReportToCSV($filename . "_nz");
     }
     if ($res === true && count($recipients) > 0) {
         SocialReport::mailDispatchReport($recipients, $filename . "_nz", $folder);
     }
 }
Esempio n. 2
0
 public function sharecountreportAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     if (localRequest() === false) {
         header('HTTP/1.0 404 Not Found');
         header("Status: 404 Not Found");
         return;
     }
     $recipients = array();
     if (isset($_GET["recipients"])) {
         $recipients = trim($_GET["recipients"]);
         if (!is_numeric($recipients) && trim($recipients) !== "") {
             $recipients = explode(";", $recipients);
         } else {
             $recipients = array();
         }
     }
     set_time_limit(1800);
     //set timeout of script to 30 minutes
     SocialReport::generateReports($recipients);
 }