Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Standardizing the comment blocks, cleaning up notes. (all classes) [c…
Browse files Browse the repository at this point in the history
…i skip]
  • Loading branch information
timothymarois committed Feb 24, 2019
1 parent b64f8af commit e847412
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 366 deletions.
42 changes: 2 additions & 40 deletions src/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ class Backup
*/
protected $backupLocation;


//--------------------------------------------------------------------


/**
* $config
*
Expand All @@ -24,21 +20,13 @@ class Backup
*/
protected $config;


//--------------------------------------------------------------------


/**
* $database
*
* \Filebase\Database
*/
protected $database;


//--------------------------------------------------------------------


/**
* __construct
*
Expand All @@ -63,10 +51,6 @@ public function __construct($backupLocation = '', Database $database)
}
}


//--------------------------------------------------------------------


/**
* save()
*
Expand All @@ -84,10 +68,6 @@ public function create()
throw new \Exception('Error backing up database.');
}


//--------------------------------------------------------------------


/**
* find()
*
Expand All @@ -109,10 +89,6 @@ public function find()
return $backups;
}


//--------------------------------------------------------------------


/**
* clean()
*
Expand All @@ -124,10 +100,6 @@ public function clean()
return array_map('unlink', glob(realpath($this->backupLocation)."/*.zip"));
}


//--------------------------------------------------------------------


/**
* rollback()
*
Expand All @@ -144,10 +116,6 @@ public function rollback()
return $this->extract($restore, $this->config->dir);
}


//--------------------------------------------------------------------


/**
* extract()
*
Expand All @@ -172,10 +140,6 @@ protected function extract($source = '', $target = '')
return false;
}


//--------------------------------------------------------------------


/**
* zip()
*
Expand Down Expand Up @@ -218,13 +182,11 @@ protected function zip($source = '', $target = '')
$zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
}
}

}

return $zip->close();

}


}

}
35 changes: 0 additions & 35 deletions src/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class Cache
*/
protected $key;


//--------------------------------------------------------------------

/**
* __construct()
*
Expand All @@ -44,10 +41,6 @@ public function __construct(Database $database)
]);
}


//--------------------------------------------------------------------


/**
* setKey()
*
Expand All @@ -60,10 +53,6 @@ public function setKey($key)
$this->key = md5($key);
}


//--------------------------------------------------------------------


/**
* getKey()
*
Expand All @@ -73,10 +62,6 @@ public function getKey()
return $this->key;
}


//--------------------------------------------------------------------


/**
* flush()
*
Expand All @@ -86,10 +71,6 @@ public function flush()
$this->cache_database->flush(true);
}


//--------------------------------------------------------------------


/**
* expired()
*
Expand All @@ -106,10 +87,6 @@ public function expired($time)
return true;
}


//--------------------------------------------------------------------


/**
* getDocuments()
*
Expand All @@ -125,10 +102,6 @@ public function getDocuments($documents)
return $d;
}


//--------------------------------------------------------------------


/**
* get()
*
Expand All @@ -155,10 +128,6 @@ public function get()
return $this->getDocuments($cache_doc->toArray());
}


//--------------------------------------------------------------------


/**
* store()
*
Expand All @@ -173,8 +142,4 @@ public function store($data)
return $this->cache_database->get( $this->getKey() )->set($data)->save();
}


//--------------------------------------------------------------------


}
20 changes: 0 additions & 20 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ class Config
*/
public $dir = __DIR__;


/**
* $format
* Format Class
* Must implement Format\FormatInterface
*/
public $format = \Filebase\Format\Json::class;


/**
* $cache
* Caching for queries
Expand All @@ -28,7 +26,6 @@ class Config
*/
public $cache = true;


/**
* $cache_time
* When should cache be cleared?
Expand All @@ -37,7 +34,6 @@ class Config
*/
public $cache_expires = 1800;


/**
* $safe_filename
* (if true) Be sure to automatically change the file name if it does not fit validation
Expand All @@ -47,7 +43,6 @@ class Config
*/
public $safe_filename = true;


/**
* $read_only
* (if true) We will not attempt to create the database directory or allow the user to create anything
Expand All @@ -57,7 +52,6 @@ class Config
*/
public $read_only = false;


/**
* $backupLocation
* The location to store backups
Expand All @@ -66,7 +60,6 @@ class Config
*/
public $backupLocation = '';


/**
* $pretty
*
Expand All @@ -77,17 +70,12 @@ class Config
*/
public $pretty = true;


/**
* $validate
*
*/
public $validate = [];


//--------------------------------------------------------------------


/**
* __construct
*
Expand All @@ -110,10 +98,6 @@ public function __construct($config)
$this->validateFormatClass();
}


//--------------------------------------------------------------------


/**
* format
*
Expand All @@ -138,8 +122,4 @@ protected function validateFormatClass()
throw new \Exception('Filebase Error: Format Class must be an instance of Filebase\Format\FormatInterface');
}
}


//--------------------------------------------------------------------

}
Loading

0 comments on commit e847412

Please sign in to comment.