Exemple #1
0
 public static function exportUser($uids)
 {
     $users = User::model()->fetchAllByUids($uids);
     $xmlContents = XmlUtil::arrayToXml($users);
     $xmlName = date("Y-m-d") . "-user";
     if (ob_get_length()) {
         ob_end_clean();
     }
     header("Cache-control: private");
     header("Content-type: text/xml");
     header("Content-Disposition: attachment; filename= {$xmlName}.xml");
     exit($xmlContents);
 }
Exemple #2
0
 public static function export($id)
 {
     $flow = FlowType::model()->fetchByPk($id);
     $rs = array();
     if ($flow) {
         $name = $flow["name"];
         $rs["base"] = $flow;
     }
     foreach (FlowProcess::model()->fetchAllByFlowId($id) as $process) {
         $rs["process_" . $process["processid"]] = $process;
     }
     $xml = XmlUtil::arrayToXml($rs);
     ob_end_clean();
     header("Cache-control: private");
     header("Content-type: text/xml");
     header("Content-Disposition: attachment; filename= {$name}.xml");
     exit($xml);
 }