| @@ 22-39 (lines=18) @@ | ||
| 19 | self::$filters[$mimetype] = $class; |
|
| 20 | } |
|
| 21 | ||
| 22 | public static function read($content, $mimetype){ |
|
| 23 | $data = array( |
|
| 24 | 'mimetype' => $mimetype, |
|
| 25 | 'content' => $content |
|
| 26 | ); |
|
| 27 | ||
| 28 | if (isset(self::$filters[$mimetype])){ |
|
| 29 | $data = call_user_func( |
|
| 30 | array( |
|
| 31 | self::$filters[$mimetype], |
|
| 32 | 'read' |
|
| 33 | ), |
|
| 34 | $data |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | return $data; |
|
| 39 | } |
|
| 40 | ||
| 41 | public static function write($content, $mimetype){ |
|
| 42 | $data = array( |
|
| @@ 41-58 (lines=18) @@ | ||
| 38 | return $data; |
|
| 39 | } |
|
| 40 | ||
| 41 | public static function write($content, $mimetype){ |
|
| 42 | $data = array( |
|
| 43 | 'mimetype' => $mimetype, |
|
| 44 | 'content' => $content |
|
| 45 | ); |
|
| 46 | ||
| 47 | if (isset(self::$filters[$mimetype])){ |
|
| 48 | $data = call_user_func( |
|
| 49 | array( |
|
| 50 | self::$filters[$mimetype], |
|
| 51 | 'write' |
|
| 52 | ), |
|
| 53 | $data |
|
| 54 | ); |
|
| 55 | } |
|
| 56 | ||
| 57 | return $data; |
|
| 58 | } |
|
| 59 | ||
| 60 | public static function getAll(){ |
|
| 61 | return array_keys(self::$filters); |
|