예제 #1
0
파일: Export.php 프로젝트: jv10/pimpon
 public static function doExport()
 {
     self::$exportFile = self::getExportFilePath();
     $routeList = new Staticroute_List();
     $routeList->load();
     $routesCollection = $routeList->getRoutes();
     self::openExportFile();
     array_walk($routesCollection, 'PimPon_Routes_Export::exportRoute');
     self::closeExportFile();
     return self::$exportFile;
 }
예제 #2
0
 public function exportAction()
 {
     try {
         $exportFile = PimPon_Routes_Export::doExport();
         ob_end_clean();
         header("Content-type: application/json");
         header("Content-Disposition: attachment; filename=\"pimponexport.routes.json\"");
         echo file_get_contents($exportFile);
         exit;
     } catch (Exception $ex) {
         Logger::err($ex->getMessage());
         $this->_helper->json(array("success" => false, "data" => 'error'), false);
     }
 }