Project

General

Profile

« Previous | Next » 

Revision 2134

Added by darkviper over 8 years ago

  1. class msgQueue: logic error fixed in constructor
    ! class msgQueue: now trigger error when deprecated methods are called

View differences:

msgQueue.php
53 53
 * constructor
54 54
 */
55 55
    protected function __construct() {
56
        self::clear();
56
        $this->aLogs = array(
57
            self::ERROR   => array(),
58
            self::SUCCESS => array(),
59
            self::WARN    => array(),
60
            self::LOG     => array()
61
        );
57 62
    }
58 63
/** disable cloning */
59 64
    private function __clone() { }
......
81 86
        self::getInstance()->aLogs[$iStatus][]  = $sMessage;
82 87
    }
83 88
/**
84
 *
85
 * @param int $iStatus
89
 * clear error lists
90
 * @param int $iStatus defiones which list should be cleared (one or all)
91
 * @return void
86 92
 */
87 93
    public static function clear($iStatus = self::ALL)
88 94
    {
......
114 120
    }
115 121
/**
116 122
 * returns selected kind of messages
117
 * @param type $iStatus  which messages
118
 * @param type $iRetvalType  return as string or array(default)
123
 * @param integer $iStatus  which messages
124
 * @param integer $iRetvalType  return as string or array(default)
119 125
 * @return mixed  string|array
126
 * @description  msgQueue::SHOW_ALL returns a multidimensional array as  $x[Type][Messages]
127
 *                all others return a string of messages concated by \n
120 128
 */
121
    public static function getMessages($iStatus = self::ERROR, $iRetvalType = self::RETVAL_Array)
129
    public static function getMessages($iStatus = self::ERROR, $iRetvalType = self::RETVAL_ARRAY)
122 130
    {
123 131
        $aRetval = array();
124 132
        if ($iStatus == self::SHOW_ALL) {
......
140 148
 */
141 149
    public static function getError($iType = self::RETVAL_STRING)
142 150
    {
151
        trigger_error('Deprecated function call: '.__CLASS__.'::'.__METHOD__, E_USER_DEPRECATED);
143 152
        return self::getMessages(self::ERROR, $iType);
144 153
    }
145 154
/**
......
150 159
 */
151 160
    public static function getSuccess($iType = self::RETVAL_STRING)
152 161
    {
162
        trigger_error('Deprecated function call: '.__CLASS__.'::'.__METHOD__, E_USER_DEPRECATED);
153 163
        return self::getMessages(self::OK, $iType);
164
}
165
/**
166
 *
167
 * @return array
168
 * @deprecated set deprecated since 2.8.4 and removed in next version
169
 */
170
    public static function getLoglist()
171
    {
172
        trigger_error('Deprecated function call: '.__CLASS__.'::'.__METHOD__, E_USER_DEPRECATED);
173
        return self::getMessages(self::LOG, self::RETVAL_ARRAY);
154 174
    }
155 175

  
156 176
} // end of class msgQueue

Also available in: Unified diff