本文整理汇总了PHP中Cart66Common::clearLog方法的典型用法代码示例。如果您正苦于以下问题:PHP Cart66Common::clearLog方法的具体用法?PHP Cart66Common::clearLog怎么用?PHP Cart66Common::clearLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cart66Common
的用法示例。
在下文中一共展示了Cart66Common::clearLog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forceDownload
/**
* Force downloads for
* -- Cart66 reports (admin)
* -- Downloading the debuggin log file (admin)
* -- Downloading digital product files
*/
public function forceDownload()
{
ob_end_clean();
if ($_SERVER['REQUEST_METHOD'] == 'POST' && Cart66Common::postVal('cart66-action') == 'export_csv') {
require_once CART66_PATH . "/models/Cart66Exporter.php";
$start = str_replace(';', '', $_POST['start_date']);
$end = str_replace(';', '', $_POST['end_date']);
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Date parameters for report: START {$start} and END {$end}");
$report = Cart66Exporter::exportOrders($start, $end);
header('Content-Type: application/csv');
header('Content-Disposition: inline; filename="Cart66Report.csv"');
echo $report;
die;
} elseif ($_SERVER['REQUEST_METHOD'] == 'POST' && Cart66Common::postVal('cart66-action') == 'download log file') {
$logFilePath = Cart66Log::getLogFilePath();
if (file_exists($logFilePath)) {
$logData = file_get_contents($logFilePath);
$cartSettings = Cart66Log::getCartSettings();
header('Content-Description: File Transfer');
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename=Cart66LogFile.txt');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
echo $cartSettings . "\n\n";
echo $logData;
die;
}
} elseif ($_SERVER['REQUEST_METHOD'] == 'POST' && Cart66Common::postVal('cart66-action') == 'clear log file') {
Cart66Common::clearLog();
}
}