PHP Classes

File: process.syncfile.php

Recommend this page to a friend!
  Classes of Brant Messenger   3SS Sync File   process.syncfile.php   Download  
File: process.syncfile.php
Role: Example script
Content type: text/plain
Description: File that installs syncfile class and processes all sync examples
Class: 3SS Sync File
Update a local file retrieved from a remote server
Author: By
Last change: - Fixed URL Error
- Fixed defined error
Date: 18 years ago
Size: 1,270 bytes
 

Contents

Class file image Download
<?php
// LOCATION FROM ROOT TO WHERE THE CLASSES WILL BE STORED
// EXAMPLE: '/home/user/classes'
define('PATH_CLASSES','');

// ARRAY of other classes by 3 Service Solution
$aClasses = array('syncfile','ddf','te','ftp','cpanel');

$vFilePath = 'http://www.3servicesolution.com/_classes';

$vRemoteSyncFile = $vFilePath.'/threesssyncfile.class.inc';
$vLocalSyncFile = PATH_CLASSES.'/threesssyncfile.class.inc';

if (!
file_exists($vLocalSyncFile))
{
   
$vSyncFileString = file_get_contents($vRemoteSyncFile);
   
    if (
$vSyncFileString != '')
    {
        if (
$vHandle = fopen($vLocalSyncFile, 'a'))
        {
           
fwrite($vHandle, $vSyncFileString);
           
fclose($vHandle);
        }
    }
   
    require(
$vLocalSyncFile);
}
else require(
$vRemoteSyncFile);

if (
PATH_CLASSES != '')
{
    for(
$i=0;$i<count($aClasses);$i++)
    {
       
$vRemoteFile = $vFilePath."/threess".$aClasses[$i].".class.inc";
       
$vLocalFile = PATH_CLASSES."/threess".$aClasses[$i].".class.inc";
       
       
$sync = new threessSyncFile($vRemoteFile,$vLocalFile);
   
       
//$sync->debug = True; // UNCOMMENT to view errors
      
       
$sync->startSync();
       
    }
}
else echo
'Missing PATH_CLASSES';
?>