PHP Classes

File: remote_update.php

Recommend this page to a friend!
  Classes of Olaf Lederer   Import templates   remote_update.php   Download  
File: remote_update.php
Role: Example script
Content type: text/plain
Description: execute this file to with a CRON job
Class: Import templates
Import data about TemplateMonster.com templates
Author: By
Last change:
Date: 19 years ago
Size: 1,403 bytes
 

Contents

Class file image Download
<?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 = "The following updates are done:\r\n\r\n";

$test_import = new Import_templates;

$test_import->handle_keywords(1, "yes");
$body .= $test_import->show_messages();

$test_import->handle_categories(1, "yes");
$body .= $test_import->show_messages();

$test_import->handle_screenshots(1, "yes");
$body .= $test_import->show_messages();

$test_import->handle_categorie_list("en", "yes");
$body .= $test_import->show_messages();

$test_import->handle_authors("yes");
$body .= $test_import->show_messages();

$test_import->get_zero_thumbs();
$body .= $test_import->show_messages();
$test_import->write_log(1);

$time_end = microtime_float();
$time = $time_end - $time_start;

$body .= "The script's execution time was ".number_format($time, 4, ".", "")." seconds...";

$header = "From: \"Webmaster\" <mail@provider.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("google@gmail.com", $subject, $body, $header);
exit;
?>