* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface, LimitableObject {
+abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface {
// Constants for exceptions
const EXCEPTION_SQL_QUERY = 0x050;
// Clean up a little
$this->removeNumberFormaters();
}
-
- /**
- * Getter for limitation instance
- *
- * @return $limitInstance The instance to the object ObjectLimits
- */
- public final function getLimitInstance () {
- return $this->limitInstance;
- }
-
- /**
- * Setup limitation for the saving process
- *
- * @param $limitInstance An instance of ObjectLimits which contains
- * elements we shall exclusivly include in
- * saving process
- * @return void
- */
- public final function limitObject (ObjectLimits $limitInstance) {
- // Get limitArray for validation
- $array = $limitInstance->getLimitArray();
-
- // Sanity-check if some limitations are in the object
- if ($array->count() > 0) {
- // Okay, there is enougth
- $this->limitInstance = $limitInstance;
- }
- }
}
// [EOF]
return $this->lastException;
}
- /**
- * Saves a given object to the local file system by serializing and
- * transparently compressing it
- *
- * @param $object The object we shall save to the local file system
- * @return void
- * @deprecated
- */
- public final function saveObject (FrameworkInterface $object) {
- // Get a string containing the serialized object. We cannot exchange
- // $this and $object here because $object does not need to worry
- // about it's limitations... ;-)
- $serialized = $this->serializeObject($object);
-
- // Get a path name plus file name and append the extension
- $fqfn = $this->getSavePath() . $object->getPathFileNameFromObject() . "." . $this->getFileExtension();
-
- // Save the file to disc we don't care here if the path is there,
- // this must be done in later methods.
- $this->getFileIoInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized));
- }
-
- /**
- * Get a serialized string from the given object
- *
- * @param $object The object we want to serialize and transparently
- * compress
- * @return $serialized A string containing the serialzed/compressed object
- * @see ObjectLimits An object holding limition information
- * @see SerializationContainer A special container class for e.g.
- * attributes from limited objects
- * @deprecated
- */
- private function serializeObject (FrameworkInterface $object) {
- // If there is no limiter instance we serialize the whole object
- // otherwise only in the limiter object (ObjectLimits) specified
- // attributes summarized in a special container class
- if ($this->getLimitInstance() === null) {
- // Serialize the whole object. This tribble call is the reason
- // why we need a fall-back implementation in CompressorChannel
- // of the methods compressStream() and decompressStream().
- $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($object));
- } else {
- // Serialize only given attributes in a special container
- $container = SerializationContainer::createSerializationContainer($this->getLimitInstance(), $object);
-
- // Serialize the container
- $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($container));
- }
-
- // Return the serialized object string
- return $serialized;
- }
-
/**
* Analyses if a unique ID has already been used or not by search in the
* local database folder.
* is not an object instance
* @throws MissingMethodException If the required method
* toString() is missing
+ * @deprecated
*/
public final function getObjectFromCachedData ($uniqueID) {
// Get instance for file handler
/**
* Private method for re-gathering (repairing) the FQFN
*
- * @param $fqfn The current FQFN we shall validate
- * @param $uniqueID The unique ID number
+ * @param $fqfn The current FQFN we shall validate
+ * @param $uniqueID The unique ID number
* @return $fqfn The repaired FQFN when it is empty
* @throws NoArrayCreatedException If explode() has not
- * created an array
+ * created an array
* @throws InvalidArrayCountException If the array count is not
- * as the expected
+ * as the expected
+ * @deprecated
*/
private function repairFQFN ($fqfn, $uniqueID) {
// Cast both strings
* @param $contents The (maybe) already cached contents as an array
* @param $fqfn The current FQFN we shall validate
* @return $contents The repaired contents from the given file
+ * @deprecated
*/
private function repairContents ($contents, $fqfn) {
// Is there some content and header (2 indexes) in?
/* @TODO Do some checks on the database directory and files here */
}
- /**
- * Loads data saved with saveObject from the database and re-creates a
- * full object from it.
- * If limitObject() was called before a new object ObjectContainer with
- * all requested attributes will be returned instead.
- *
- * @return Object The fully re-created object or instance to
- * ObjectContainer
- * @throws SavePathIsEmptyException If the given save path is an
- * empty string
- * @throws SavePathIsNoDirectoryException If the save path is no
- * path (e.g. a file)
- * @throws SavePathReadProtectedException If the save path is read-
- * protected
- * @throws SavePathWriteProtectedException If the save path is write-
- * protected
- */
- public function loadObject () {
- // Already connected? Then abort here
- if ($this->alreadyConnected === true) return true;
-
- // Get the save path
- $savePath = $this->getSavePath();
-
- if (empty($savePath)) {
- // Empty string
- throw new SavePathIsEmptyException($dbInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif (!is_dir($savePath)) {
- // Is not a dir
- throw new SavePathIsNoDirectoryException($savePath, self::EXCEPTION_INVALID_PATH_NAME);
- } elseif (!is_readable($savePath)) {
- // Path not readable
- throw new SavePathReadProtectedException($savePath, self::EXCEPTION_READ_PROTECED_PATH);
- } elseif (!is_writeable($savePath)) {
- // Path not writeable
- throw new SavePathWriteProtectedException($savePath, self::EXCEPTION_WRITE_PROTECED_PATH);
- }
-
- // "Connection" established... ;-)
- $this->alreadyConnected = true;
- }
-
/**
* Starts a SELECT query on the database by given return type, table name
* and search criteria