seek_quarry
[ class tree: seek_quarry ] [ index: seek_quarry ] [ all elements ]

Class: Mirror

Source Location: /bin/mirror.php

Class Overview


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


Author(s):

  • Chris Pollett

Implements interfaces:

Variables

Constants

Methods



Class Details

[line 90]
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.




Tags:

author:  Chris Pollett
see:  buildMiniInvertedIndex()


[ Top ]


Class Variables

$db =

[line 97]

Reference to a database object. Used since has directory manipulation

functions



Type:   object


[ Top ]

$last_notify =

[line 115]

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

running



Type:   string


[ Top ]

$last_sync =

[line 108]

Last time a sync list was obtained from master machines


Type:   string


[ Top ]

$last_sync_file =

[line 121]

File name where last sync time is written


Type:   string


[ Top ]

$name_server =

[line 102]

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


Type:   string


[ Top ]

$start_sync =

[line 127]

Time of start of current sync


Type:   string


[ Top ]

$sync_dir =

[line 139]

Directory to sync


Type:   string


[ Top ]

$sync_schedule =

[line 133]

Files to download for current sync


Type:   string


[ Top ]



Class Methods


method checkScheduler [line 237]

mixed checkScheduler( )

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.



Tags:

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


[ Top ]

method copyNextSyncFile [line 293]

void copyNextSyncFile( )

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



[ Top ]

constructor __construct [line 151]

Mirror __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

[ Top ]

method loop [line 190]

void loop( )

Main loop for the mirror script.



[ Top ]

method start [line 175]

void 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




[ Top ]


Class Constants

DOWNLOAD_RANGE =  50000000

[line 144]

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


[ Top ]



Documentation generated by phpDocumentor 1.4.3