values = array( "attributes"=>0, "version"=>0, "creationTime"=>time()+94694400, "modificationTime"=>time()+94694400, "backupTime"=>0, "modificationNumber"=>0, "appInfoID"=>0, "sortInfoID"=>0, "prcType"=>"BOOK", "creator"=>"MOBI", "uniqueIDSeed"=>rand(), "nextRecordListID"=>0, "recordAttributes"=>0, "compression"=>NO_COMPRESSION, "recordSize"=>RECORD_SIZE, "encryptionType"=>NO_ENCRYPTION, "mobiIdentifier"=>"MOBI", "mobiHeaderLength"=>0xe8, "mobiType"=>MOBIPOCKET_BOOK, "textEncoding"=>UTF8, "uniqueID"=>rand(), "fileVersion"=>6, "locale"=>0x09, "inputLanguage"=>0, "outputLanguage"=>0, "minimumVersion"=>6, "huffmanRecordOffset"=>0, "huffmanRecordCount"=>0, "exthFlags"=>0x40, "drmOffset"=>0xFFFFFFFF, "drmCount"=>0, "drmSize"=>0, "drmFlags"=>0, "extraDataFlags"=>0, "exthIdentifier"=>"EXTH", // These can be changed without any risk "title"=>"Unknown title", "author"=>"Unknown author", "subject"=>"Unknown subject" ); foreach($additionalSettings as $key=>$value){ $this->values[$key] = $value; } } /** * Get a value from the settings * @param string $key Key of the setting * @return mixed The value of the setting */ public function get($key){ return $this->values[$key]; } /** * Checks if a value is set * @param string $key Key of the setting * @return bool True if the value exists */ public function exists($key){ return isset($this->values[$key]); } public function __toString() { $out = "Settings: {\n"; foreach($this->values as $key=>$value){ $out .= "\t".$key.": ".$value."\n"; } $out .= "}"; return $out; } } ?>