<?php
set_time_limit(240);
require($_SERVER['DOCUMENT_ROOT']."/classes/import_templates/import_templates.php");
function microtime_float() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
$body = "You updated the template shop...\r\n\r\n";
$daily_import = new Import_templates;
$body .= $daily_import->daily_update();
$time_end = microtime_float();
$time = $time_end - $time_start;
$body .= "The script's execution time was ".number_format($time, 4, ".", "")." seconds...";
$body .= "\n\r\n\rCheck here: http://".$_SERVER['HTTP_HOST'];
$header = "From: \"yoursite.com\" <templates@yoursite.com>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n";
$subject = "Template import from ".date("d-m-Y");
mail("your@mail.com", $subject, $body, $header);
exit;
?>
|