Documentation is available at docsis_error.php
- <?php
- /**
- * DOCSIS Error Encoder
- *
- * @author David Eder <david@eder.us>
- * @copyright 2004 David Eder
- * @package docsis_config
- * @version .3
- */
- /**
- */
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'docsis_common.php');
- define('DOCSIS_ERROR_PARAMETER', 1);
- define('DOCSIS_ERROR_CODE', 2);
- define('DOCSIS_ERROR_MESSAGE', 3);
- /**
- * DOCSIS Error Encoder
- *
- * @package docsis_config
- */
- class docsis_error extends docsis_encoder_complex
- {
- /**
- * Constructor
- *
- * @param int $code docsis code
- * @param array $value predefined values
- */
- function docsis_error($code, $value=array())
- {
- parent::docsis_encoder_complex($code, $value);
- $this->set_parameter(0);
- }
- /**
- * Set Error Parameter
- *
- * The value of this parameter identifies the subtype in error.
- *
- * @param string $value
- */
- function set_parameter($value)
- {
- $this->value[DOCSIS_ERROR_PARAMETER] = new docsis_encoder_string(DOCSIS_ERROR_PARAMETER, $value);
- }
- /**
- * Set Error Code
- *
- * @param int $value
- */
- function set_code($value)
- {
- $this->value[DOCSIS_ERROR_CODE] = new docsis_encoder_uchar(DOCSIS_ERROR_CODE, $value);
- }
- /**
- * Set Error Message
- *
- * Set the text string to be displayed on the CM console and/or log.
- *
- * @param string $value
- */
- function set_message($value)
- {
- if(strpos($value, chr(0)) !== false)
- trigger_error('Error message cannot include the NULL character', E_USER_WARNING);
- if(strlen($value) > 255)
- trigger_error('Error message must be less than 256 characters in length', E_USER_WARNING);
- $this->value[DOCSIS_ERROR_MESSAGE] = new docsis_encoder_string(DOCSIS_ERROR_MESSAGE, $value . chr(0));
- }
- }
- ?>
Documentation generated on Mon, 14 Nov 2005 18:00:12 -0700 by phpDocumentor 1.3.0RC3