\seekquarry\yioop\executablesMirror

This class is responsible for syncing crawl archives between machines using the SeekQuarry/Yioop search engine

Mirror periodically queries the queue server asking for a list of files that have changed in its parent since the last sync time. It then proceeds to download them.

Summary

Methods
Properties
Constants
__construct()
start()
loop()
checkScheduler()
copyNextSyncFile()
$db
$name_server
$last_sync
$last_notify
$last_sync_file
$start_sync
$sync_schedule
$sync_dir
$parent_url
DOWNLOAD_RANGE
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

DOWNLOAD_RANGE

DOWNLOAD_RANGE

Maximum number of bytes from a file to download in one go

Properties

$db

$db : object

Reference to a database object. Used since has directory manipulation functions

Type

object

$name_server

$name_server : string

Url or IP address of the name_server to get sites to crawl from

Type

string

$last_sync

$last_sync : string

Last time a sync list was obtained from master machines

Type

string

$last_notify

$last_notify : string

Last time the machine being mirrored was notified Mirror.php is still running

Type

string

$last_sync_file

$last_sync_file : string

File name where last sync time is written

Type

string

$start_sync

$start_sync : string

Time of start of current sync

Type

string

$sync_schedule

$sync_schedule : string

Files to download for current sync

Type

string

$sync_dir

$sync_dir : string

Directory to sync

Type

string

$parent_url

$parent_url : string

Url of the Yioop instance we are mirroring

Type

string

Methods

__construct()

__construct(string  $name_server) 

Sets up the field variables so that syncing can begin

Parameters

string $name_server

URL or IP address of the name server

start()

start() 

This is the function that should be called to get the mirror to start syncing. Calls init to handle the command line arguments then enters the syncer's main loop

loop()

loop() 

Main loop for the mirror script.

checkScheduler()

checkScheduler() : mixed

Gets status and, if done processing all other mirroring activities, gets a new list of files that have changed since the last synchronization from the web app of the machine we are mirroring with.

Returns

mixed —

array or bool. Returns false if weren't successful in contacting web app, otherwise, returns an array with a status and potentially a list of files ot sync

copyNextSyncFile()

copyNextSyncFile() 

Downloads the next file from the schedule of files to download received from the web app.