mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
use directly MOBIClass
This commit is contained in:
parent
c70bfefc68
commit
fb9df0c269
47 changed files with 309 additions and 1551 deletions
41
inc/3rdparty/libraries/MOBIClass/FileShort.php
vendored
Normal file
41
inc/3rdparty/libraries/MOBIClass/FileShort.php
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Description of FileShort
|
||||
*
|
||||
* @author Sander
|
||||
*/
|
||||
class FileShort extends FileObject {
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* Make a short to be stored in a file
|
||||
* @param short $n
|
||||
*/
|
||||
public function __construct($n = 0){
|
||||
parent::__construct(2);
|
||||
$this->set($n);
|
||||
}
|
||||
|
||||
public function get(){
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function set($value){
|
||||
$this->data = intval($value) & 0xFFFF;
|
||||
}
|
||||
|
||||
public function serialize() {
|
||||
return $this->shortToString($this->data);
|
||||
}
|
||||
|
||||
public function unserialize($data) {
|
||||
__construct($this->toInt($data));
|
||||
}
|
||||
|
||||
|
||||
public function __toString(){
|
||||
return "FileShort: {".$this->shortAsString($this->data)."}";
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue