PHP Classes

File: OntimeInstallerDate.php

Recommend this page to a friend!
  Classes of Mario Carrocera   OnTime Timezones and Formats Trait   OntimeInstallerDate.php   Download  
File: OntimeInstallerDate.php
Role: Example script
Content type: text/plain
Description: Example script
Class: OnTime Timezones and Formats Trait
Get formatted time and date in a given timezone
Author: By
Last change:
Date: 3 years ago
Size: 1,192 bytes
 

Contents

Class file image Download
<?php
ini_set
('display_errors', true);
error_reporting(E_ERROR | E_PARSE | E_NOTICE | E_WARNING);

function
nf($file, $to)
{
    if (
file_exists($file)) {
        if (
file_exists($to.'/'.$file)) {
            echo
'Delete '. $file .'<br>';
           
unlink($to.'/'.$file);
        }
        if (
rename($file,$to.'/'.$file)) {
            echo
'Move '.$file .'<br>';
            return(
TRUE);
        } else {
            echo
'Move Fail'.'<br>';
            return(
FALSE);
        }
    } else {
        echo
'File not found'.'<br>';
        return(
FALSE);
    }
}

$files= array('OnTime.php','OnTimetmp.php','OnTimeAllways.php','OnTimeDateA.php','OnTimeDateB.php','OTidate.php','OnTimeFunctions.php','OnTimeContent.php');
echo
'Start '.'<br>';

$base='ontime';

$back = TRUE;
foreach (
$files as $x) {
    echo
'Move '.$x.'<br>';
    if (!
nf($x,$base)) {
       
$back = FALSE;
    }
}
if (
$back) {
    include_once(
$base."/OnTimetmp.php");
   
$install = new OnTime();
   
$install->Connect('admin','OT2021Free');
   
$install->InstallDate();
   
$install->DiscConnect();
   
$install->Connect('admin','OT2021Free');
   
$install->InstallDate2();
   
unlink($base."/OnTimetmp.php");
   
unlink($base."/OTidate.php");
    echo
'Delete '. basename($_SERVER['PHP_SELF']).'<br>';
   
unlink(basename($_SERVER['PHP_SELF']));
}
echo
'End ';

?>