mod: Konstruktor: Klasse erst später definiert

Beitrag lesen

Das Fehlerausgabesystem ist Teil des Template-Systems und springt an wenn ein beispielsweise ein DB-Fehler auftritt, deshalb wird das Template-System mit in die DB-Klasse geladen und das Script sofort beendet.

[code=php]

class MySQL {
public $count = 0;
    public $error = 'ERROR_SQL';
    public $fields = array();
    public $linkID = 0;
    public $output = '';
    public $result = '';

function __construct( $output )
    {
        $this->setOutput( $output );
    }

function setOutput( $output )
    {
        $this->output = $output;
    }

function connect()
    {
        $this->linkID = @mysql_connect( DB_HOST, DB_USER, DB_PASSWORD );

if ( ! $this->linkID ) {
            $this->output->createMessage( $this->error, 'DB_NO_CONNECTION' );
        }
    }

function errno()
    {
        return mysql_errno( $this->linkID );
    }

function error()
    {
        return mysql_error( $this->linkID );
    }

function start()  
{  
	$this->connect();  
	$this->selectDatabase();  
}  

}

$output = new Output( $cfg );
$db = new MySQL( $output );
$db->start();[/code]

0 55

Konstruktor: Klasse erst später definiert

mod
  • php
  1. 0
    mod
  2. 0
    dedlfix
    1. 0
      mod
      1. 0
        mod
        1. 1
          Sven Rautenberg
          1. 0
            mod
          2. 0
            mod
            1. 0
              dedlfix
              1. 0
                mod
                1. 0
                  Sven Rautenberg
                  1. 0
                    mod
                    1. 0
                      dedlfix
            2. 0
              Sven Rautenberg
              1. 0
                hotti
                1. 0
                  Sven Rautenberg
                  1. 0
                    hotti
                    1. 2
                      Sven Rautenberg
              2. 0
                mod
        2. 0
          dedlfix
          1. 0
            mod
            1. 0
              hotti
              1. 0
                mod
                1. 0
                  hotti
                  1. 0
                    dedlfix
                    1. 0
                      hotti
                      1. 0
                        dedlfix
                        1. 0
                          hotti
                          1. 0
                            dedlfix
                            1. 0
                              Sven Rautenberg
                              1. 0
                                hotti
                                1. 0
                                  dedlfix
                                  1. 0
                                    hotti
                                    1. 0
                                      dedlfix
                              2. 0
                                asdf
                            2. 0
                              hotti
                              1. 0
                                Sven Rautenberg
                                1. 0
                                  hotti
                                  1. 1
                                    Sven Rautenberg
                                    1. 0
                                      hotti
                                2. 1
                                  asdf
                              2. 0
                                dedlfix
                                1. 0
                                  hotti
                                  1. 0
                                    dedlfix
                                    1. 0
                                      hotti
                                      1. 1
                                        Sven Rautenberg
            2. 0
              dedlfix
      2. 0
        dedlfix
        1. 0
          Tom
          1. 0
            dedlfix
  3. 0
    hotti
    1. 0

      @mod Vorsicht

      Christopher
      1. 0
        hotti
        1. 0
          Tom
          1. 0
            hotti