Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class AutoInfo {
- const STAT_ERROR=2;
- const STAT_OK=0;
- public $status;
- public $status_message;
- public $myname;
- //--------------------------------------------------
- function __construct($inname) {
- $this->myname=$inname;
- $this->status=0;
- }
- //--------------------------------------------------
- protected function set_error ($statmessage) {
- $this->status = AutoInfo::STAT_ERROR;
- $this->status_message=$statmessage;
- }
- //--------------------------------------------------
- protected function set_ok() {
- $this->status = AutoInfo::STAT_OK;
- $this->status_message="";
- }
- //--------------------------------------------------
- public function is_error() {
- if ($this->status==AutoInfo::STAT_ERROR)
- return true;
- else
- return false;
- }
- //--------------------------------------------------
- public function get_error() {
- return $this->myname.': '.$this->status_message;
- }
- //--------------------------------------------------
- public function show_status() {
- if ($this->is_error())
- return $this->get_error();
- else
- return 'status ok';
- }
- //--------------------------------------------------
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement