* Runs a command requested from an action of the command line
*
* @return
* @access public
*/
staticpublicfunctionRunCommand(){
echo"\n";
switch(self::$command){
caseself::COMMAND_SIMULATE:
self::$syncher->Simulate();
break;
caseself::COMMAND_SYNC:
self::$syncher->Sync();
break;
caseself::COMMAND_SYNC_ONE:
self::$syncher->SyncOne(self::$uniqueId);
break;
caseself::COMMAND_CLEARALL:
echo"Are you sure you want to remove all chunks and data from the public folder. ALL GAB data will be removed from ALL Outlook instances [y/N]: ";
$confirm=strtolower(trim(fgets(STDIN)));
if($confirm==='y'||$confirm==='yes')
self::$syncher->ClearAll();
else
echo"Aborted!\n";
break;
caseself::COMMAND_DELETEALL:
echo"Are you sure you want to remove all chunks and data from the public folder and delete it? ALL GAB data will be removed from ALL Outlook instances [y/N]: ";
// Calc the ideal amount of chunks (round up to 5)
// by size: we want to have chunks with arount 500 KB of data in it
// by entries: max 10 entries per chunk
$idealBySize=ceil($bytes/500000/5)*5;
$idealByEntries=ceil((count($gab)/10)/5)*5;
$l=sprintf("\nSync:\n\tItems in GAB:\t\t\t%d\n\tTotal data size: \t\t%d B\n\n",count($gab),$bytes);
$l.=sprintf("\tAvg. of items per chunk: \t%g\n\tMin. of items per chunk: \t%d\n\tMax. of items per chunk: \t%d\n\n",($entries/count($chunks)),$minEntries,$maxEntries);
$l.=sprintf("\tAvg. of size per chunk: \t%d B\n\tMin. of size per chunk: \t%d B\n\tMax. of size per chunk: \t%d B\n\n",($bytes/count($chunks)),$minSize,$maxSize);
$l.=sprintf("\tConfigured amout of chunks:\t%d\n\tIdeal amount by entries: \t%d\n\tIdeal amount by size: \t\t%d",AMOUT_OF_CHUNKS,$idealByEntries,$idealBySize);
$this->Log($l);
}
/**
* Updates a single entry of the GAB in the respective chunk.
ZLog::Write(LOGLEVEL_DEBUG,sprintf("MAPIUtils->readPropStream: property 0x%s not found. It is either empty or not set. It will be ignored.",str_pad(dechex($prop),8,0,STR_PAD_LEFT)));