Commit ae0263bb authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1003 Protected methods should start with a lowercase letter. Fixed

names plural.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 075aefa3
This diff is collapsed.
...@@ -75,7 +75,7 @@ abstract class SyncWorker { ...@@ -75,7 +75,7 @@ abstract class SyncWorker {
* - gets all GAB entries * - gets all GAB entries
* - sorts them into chunks * - sorts them into chunks
* - serializes the chunk * - serializes the chunk
* - sends it to SetChunkData() to be written * - sends it to setChunkData() to be written
* - shows some stats * - shows some stats
* *
* @param string $targetGab the gab name id that should be synchronized, if not set 'default' or all are used. * @param string $targetGab the gab name id that should be synchronized, if not set 'default' or all are used.
...@@ -86,7 +86,7 @@ abstract class SyncWorker { ...@@ -86,7 +86,7 @@ abstract class SyncWorker {
*/ */
public function Sync($targetGab = false, $doWrite = true) { public function Sync($targetGab = false, $doWrite = true) {
// gets a list of GABs // gets a list of GABs
$gabs = $this->GetGABs(); $gabs = $this->getGABs();
if (empty($gabs)) { if (empty($gabs)) {
if($targetGab) { if($targetGab) {
...@@ -122,10 +122,10 @@ abstract class SyncWorker { ...@@ -122,10 +122,10 @@ abstract class SyncWorker {
// remove all messages that do not match the current $chunkType // remove all messages that do not match the current $chunkType
if ($doWrite) if ($doWrite)
$this->ClearAllNotCurrentChunkType($folderid, $gabId, $gabName); $this->clearAllNotCurrentChunkType($folderid, $gabId, $gabName);
// get all GAB entries // get all GAB entries
$gab = $this->GetGAB(false, $gabId, $gabName); $gab = $this->getGAB(false, $gabId, $gabName);
// build the chunks // build the chunks
$chunks = array(); $chunks = array();
...@@ -170,7 +170,7 @@ abstract class SyncWorker { ...@@ -170,7 +170,7 @@ abstract class SyncWorker {
if ($doWrite) { if ($doWrite) {
$chunkName = $this->chunkType . "/". $chunkId; $chunkName = $this->chunkType . "/". $chunkId;
$chunkCRC = md5($chunkData); $chunkCRC = md5($chunkData);
$this->SetChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId, $gabName); $this->setChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId, $gabName);
} }
} }
...@@ -200,7 +200,7 @@ abstract class SyncWorker { ...@@ -200,7 +200,7 @@ abstract class SyncWorker {
$this->Log(sprintf("Sync-one: %s = '%s'%s", UNIQUEID, $uniqueId, ($targetGab) ? " of '".$targetGab."'":'')); $this->Log(sprintf("Sync-one: %s = '%s'%s", UNIQUEID, $uniqueId, ($targetGab) ? " of '".$targetGab."'":''));
// gets a list of GABs // gets a list of GABs
$gabs = $this->GetGABs(); $gabs = $this->getGABs();
if (empty($gabs)) { if (empty($gabs)) {
if($targetGab) { if($targetGab) {
...@@ -221,7 +221,7 @@ abstract class SyncWorker { ...@@ -221,7 +221,7 @@ abstract class SyncWorker {
} }
// search for the entry in the GAB // search for the entry in the GAB
$entries = $this->GetGAB($uniqueId, $gabId, $gabName); $entries = $this->getGAB($uniqueId, $gabId, $gabName);
// if an entry is found, update the chunk // if an entry is found, update the chunk
// if the entry is NOT found, we should remove it from the chunk (entry deleted) // if the entry is NOT found, we should remove it from the chunk (entry deleted)
...@@ -241,7 +241,7 @@ abstract class SyncWorker { ...@@ -241,7 +241,7 @@ abstract class SyncWorker {
$folderid = $this->getFolderId($gabId, $gabName); $folderid = $this->getFolderId($gabId, $gabName);
$chunkId = $this->calculateChunkId($key); $chunkId = $this->calculateChunkId($key);
$chunkName = $this->chunkType . "/". $chunkId; $chunkName = $this->chunkType . "/". $chunkId;
$chunkdata = $this->GetChunkData($folderid, $chunkName, $gabId, $gabName); $chunkdata = $this->getChunkData($folderid, $chunkName, $gabId, $gabName);
$chunk = json_decode($chunkdata, true); $chunk = json_decode($chunkdata, true);
// update or remove the entry // update or remove the entry
...@@ -269,7 +269,7 @@ abstract class SyncWorker { ...@@ -269,7 +269,7 @@ abstract class SyncWorker {
// update the chunk data // update the chunk data
$chunkCRC = md5($chunkData); $chunkCRC = md5($chunkData);
$status = $this->SetChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId, $gabName); $status = $this->setChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId, $gabName);
if ($status) { if ($status) {
$this->Log("Success!"); $this->Log("Success!");
} }
...@@ -286,7 +286,7 @@ abstract class SyncWorker { ...@@ -286,7 +286,7 @@ abstract class SyncWorker {
*/ */
public function ClearAll($targetGab) { public function ClearAll($targetGab) {
// gets a list of GABs // gets a list of GABs
$gabs = $this->GetGABs(); $gabs = $this->getGABs();
if (empty($gabs)) { if (empty($gabs)) {
if($targetGab) { if($targetGab) {
...@@ -315,13 +315,13 @@ abstract class SyncWorker { ...@@ -315,13 +315,13 @@ abstract class SyncWorker {
* @return boolean * @return boolean
*/ */
private function doClearAll($gabId = null, $gabName = 'default') { private function doClearAll($gabId = null, $gabName = 'default') {
$folderid = $this->GetHiddenFolderId($gabId, $gabName); $folderid = $this->getHiddenFolderId($gabId, $gabName);
if (!$folderid) { if (!$folderid) {
$this->Log(sprintf("Could not locate folder in '%s'. Aborting.", $gabName)); $this->Log(sprintf("Could not locate folder in '%s'. Aborting.", $gabName));
return false; return false;
} }
$status = $this->ClearFolderContents($folderid, $gabId, $gabName); $status = $this->clearFolderContents($folderid, $gabId, $gabName);
if ($status) { if ($status) {
$this->Log(sprintf("Success for '%s'!", $gabName)); $this->Log(sprintf("Success for '%s'!", $gabName));
} }
...@@ -339,7 +339,7 @@ abstract class SyncWorker { ...@@ -339,7 +339,7 @@ abstract class SyncWorker {
*/ */
public function DeleteAll($targetGab) { public function DeleteAll($targetGab) {
// gets a list of GABs // gets a list of GABs
$gabs = $this->GetGABs(); $gabs = $this->getGABs();
if (empty($gabs)) { if (empty($gabs)) {
if($targetGab) { if($targetGab) {
...@@ -368,14 +368,14 @@ abstract class SyncWorker { ...@@ -368,14 +368,14 @@ abstract class SyncWorker {
* @return boolean * @return boolean
*/ */
private function doDeleteAll($gabId = null, $gabName = 'default') { private function doDeleteAll($gabId = null, $gabName = 'default') {
$folderid = $this->GetHiddenFolderId($gabId, $gabName); $folderid = $this->getHiddenFolderId($gabId, $gabName);
if (!$folderid) { if (!$folderid) {
$this->Log(sprintf("Could not locate folder in '%s'", $gabName)); $this->Log(sprintf("Could not locate folder in '%s'", $gabName));
return false; return false;
} }
$emptystatus = $this->ClearFolderContents($folderid, $gabId, $gabName); $emptystatus = $this->clearFolderContents($folderid, $gabId, $gabName);
if ($emptystatus) { if ($emptystatus) {
$status = $this->DeleteHiddenFolder($folderid, $gabId, $gabName); $status = $this->deleteHiddenFolder($folderid, $gabId, $gabName);
if ($status) { if ($status) {
$this->Log(sprintf("Success for '%s'!", $gabName)); $this->Log(sprintf("Success for '%s'!", $gabName));
return true; return true;
...@@ -422,10 +422,10 @@ abstract class SyncWorker { ...@@ -422,10 +422,10 @@ abstract class SyncWorker {
* @return string * @return string
*/ */
protected function getFolderId($gabId = null, $gabName = 'default', $doCreate = true) { protected function getFolderId($gabId = null, $gabName = 'default', $doCreate = true) {
$id = $this->GetHiddenFolderId($gabId, $gabName); $id = $this->getHiddenFolderId($gabId, $gabName);
if (!$id) { if (!$id) {
if ($doCreate) if ($doCreate)
$id = $this->CreateHiddenFolder($gabId, $gabName); $id = $this->createHiddenFolder($gabId, $gabName);
else else
$id = "<does not yet exist>"; $id = "<does not yet exist>";
} }
...@@ -478,7 +478,7 @@ abstract class SyncWorker { ...@@ -478,7 +478,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return boolean * @return boolean
*/ */
protected abstract function CreateHiddenFolder($gabId = null, $gabName = 'default'); protected abstract function createHiddenFolder($gabId = null, $gabName = 'default');
/** /**
* Deletes the hidden folder. * Deletes the hidden folder.
...@@ -490,7 +490,7 @@ abstract class SyncWorker { ...@@ -490,7 +490,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return boolean * @return boolean
*/ */
protected abstract function DeleteHiddenFolder($folderid, $gabId = null, $gabName = 'default'); protected abstract function deleteHiddenFolder($folderid, $gabId = null, $gabName = 'default');
/** /**
* Returns the internal identifier (folder-id) of the hidden folder. * Returns the internal identifier (folder-id) of the hidden folder.
...@@ -501,7 +501,7 @@ abstract class SyncWorker { ...@@ -501,7 +501,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return string * @return string
*/ */
protected abstract function GetHiddenFolderId($gabId = null, $gabName = 'default'); protected abstract function getHiddenFolderId($gabId = null, $gabName = 'default');
/** /**
* Removes all messages that have not the same chunkType (chunk configuration changed!). * Removes all messages that have not the same chunkType (chunk configuration changed!).
...@@ -513,7 +513,7 @@ abstract class SyncWorker { ...@@ -513,7 +513,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return boolean * @return boolean
*/ */
protected abstract function ClearFolderContents($folderid, $gabId = null, $gabName = 'default'); protected abstract function clearFolderContents($folderid, $gabId = null, $gabName = 'default');
/** /**
* Removes all messages that do not match the current ChunkType. * Removes all messages that do not match the current ChunkType.
...@@ -525,15 +525,15 @@ abstract class SyncWorker { ...@@ -525,15 +525,15 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return boolean * @return boolean
*/ */
protected abstract function ClearAllNotCurrentChunkType($folderid, $gabId = null, $gabName = 'default'); protected abstract function clearAllNotCurrentChunkType($folderid, $gabId = null, $gabName = 'default');
/** /**
* Returns a list of Global Address Books with their name and ids. * Returns a list of Global Address Books with their names and ids.
* *
* @access protected * @access protected
* @return array * @return array
*/ */
protected abstract function GetGABs(); protected abstract function getGABs();
/** /**
* Returns a list with all GAB entries or a single entry specified by $uniqueId. * Returns a list with all GAB entries or a single entry specified by $uniqueId.
...@@ -549,7 +549,7 @@ abstract class SyncWorker { ...@@ -549,7 +549,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return array of GABEntry * @return array of GABEntry
*/ */
protected abstract function GetGAB($uniqueId = false, $gabId = null, $gabName = 'default'); protected abstract function getGAB($uniqueId = false, $gabId = null, $gabName = 'default');
/** /**
* Returns the chunk data of the chunkId of the hidden folder. * Returns the chunk data of the chunkId of the hidden folder.
...@@ -564,7 +564,7 @@ abstract class SyncWorker { ...@@ -564,7 +564,7 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return json string * @return json string
*/ */
protected abstract function GetChunkData($folderid, $chunkName, $gabId = null, $gabName = 'default'); protected abstract function getChunkData($folderid, $chunkName, $gabId = null, $gabName = 'default');
/** /**
* Updates the chunk data in the hidden folder if it changed. * Updates the chunk data in the hidden folder if it changed.
...@@ -583,5 +583,5 @@ abstract class SyncWorker { ...@@ -583,5 +583,5 @@ abstract class SyncWorker {
* @access protected * @access protected
* @return boolean * @return boolean
*/ */
protected abstract function SetChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId = null, $gabName = 'default'); protected abstract function setChunkData($folderid, $chunkName, $amountEntries, $chunkData, $chunkCRC, $gabId = null, $gabName = 'default');
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment