Changeset 84 for trunk/File/Bittorrent/Encode.php
- Timestamp:
- 12.06.2008 11:52:16 (7 months ago)
- Files:
-
- 1 modified
-
trunk/File/Bittorrent/Encode.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/File/Bittorrent/Encode.php
r76 r84 46 46 */ 47 47 require_once 'PEAR.php'; 48 require_once 'File/Bittorrent/Exception.php'; 48 49 49 50 /** … … 72 73 * @param mixed Variable to encode 73 74 * @return string 75 * @throws File_Bittorrent_Exception if unsupported type should be encoded 74 76 */ 75 77 function encode($mixed) … … 86 88 return $this->encode_array($mixed); 87 89 default: 88 PEAR::raiseError('File_Bittorrent_Encode::encode() - Unsupported type.', null, null, "Variable must be one of 'string', 'integer', 'double' or 'array'");90 throw new File_Bittorrent_Exception('Unsupported type. Variable must be one of \'string\', \'integer\', \'double\' or \'array\'', File_Bittorrent_Exception::encode); 89 91 } 90 92 } … … 139 141 * @return string 140 142 */ 141 function encode_array( $array)143 function encode_array(array $array) 142 144 { 143 145 // Check for strings in the keys