<?php
/**
 * YANA library
 *
 * @package yana
 * @licence http://creativecommons.org/licenses/by-nc-sa/2.5/
 */

/**
 * «abstract» Singleton
 *
 * To create a Singleton class, simply add "extends Singleton" to your class definition
 * and add $this->checkSingletonConstraint() as the first line in your constructor.
 * 
 * Note: this class is abstract, because it extends an abstract super-class without
 * implementing all abstract functions - NOT because it declares any abstract members
 * itself.
 *
 * @abstract
 * @access      public
 * @package     yana
 * @subpackage  utilities
 */
class Singleton extends SerializeableObject
{
    /**
     * @ignore
     * @access  private
     * @var     bool
     */ 
    var $instance_exists = false;

    /**
     * check Singleton - constraint
     *
     * Terminates the program and issues an E_USER_ERROR if singleton constraint is breached.
     * (if the constructor is called and another instance of this class already exists)
     *
     * @access protected
     */
    function checkSingletonConstraint()
    {
        /* PHP4 workaround for creating static vars */
        static $instance_exists;
        $this->instance_exists = &$instance_exists;
        /* check singleton constraint */
        if ($this->instance_exists === true) {
            trigger_error('Cannot create more than one instance of singleton class '.get_class($this).'.', E_USER_ERROR);
            exit;
        } else {
            $this->instance_exists = true;
        }
    }

}

$instance_id = base64_decode('PHAgY2xhc3M9IktPTU1FTlRBUiIgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlciI+V2ViVG9vbHMgcG93ZXJlZCBieSA8QSBIUkVGPSJodHRwOi8vd3d3LkFsbC1Db21tdW5pdHkuZGUiIHRhcmdldD0iX2JsYW5rIiB0aXRsZT0iRGllIENvbW11bml0eSBkZXIgV2VibWFzdGVyIj48c3BhbiBzdHlsZT0iY29sb3I6IzY0OTVFRCI+d3d3Ljwvc3Bhbj48c3BhbiBzdHlsZT0iY29sb3I6I0ZGQTUwMCI+IEFsbCAtIENvbW11bml0eSA8L3NwYW4+PHNwYW4gc3R5bGU9ImNvbG9yOiM2NDk1RUQiPi5kZTwvc3Bhbj48L0E+');
$lcn_note  = urldecode("%3Cp%20class%3D%22KOMMENTAR%22%20style%3D%22text-align%3Acenter%22%3Eregistered%20VIP-version%3A%20%3Cspan%20class%3D%22BESCHRIFTUNG%22%3E%26quot%3B%25LICENCE%2FOWNER%25%26quot%3B%3C%2Fspan%3E%3C%2Fp%3E");

?>