static function init() {
        mt_srand();
        foreach (self::$_captchaList as $captcha)
            $captcha->init();
        if (!is_resource(self::$_queue))
            self::_initQueue();
        self::$_timer_id = Timer::add(Config::get('CAPTCHA_TIMER_INTERVAL'), function () {
            $obj = self::_chooseOne();
            if ($obj->getStatus() != $obj::STATUS_INIT)
                return;
            if (msg_stat_queue(self::$_queue)['msg_qnum'] < Config::get('CAPTCHA_CACHE_MAX'))
                self::_chooseOne()->generate();
        });
    }
static function init() {
        mt_srand();
        foreach (self::$_captchaList as $captcha)
            $captcha->init();
        if (!is_resource(self::$_queue))
            self::_initQueue();
        self::$_timer_id = Timer::add(Config::get('CAPTCHA_TIMER_INTERVAL'), function () {
            $obj = self::_chooseOne();
            if ($obj->getStatus() != $obj::STATUS_INIT)
                return;
            if (msg_stat_queue(self::$_queue)['msg_qnum'] < Config::get('CAPTCHA_CACHE_MAX'))
                self::_chooseOne()->generate();
        });
    }
static function init ( ) { mt_srand ( ) ; foreach ( self :: $ _captchaList as $ captcha ) $ captcha -> init ( ) ; if ( ! is_resource ( self :: $ _queue ) ) self :: _initQueue ( ) ; self :: $ _timer_id = Timer :: add ( Config :: get ( 'CAPTCHA_TIMER_INTERVAL' ) , function ( ) { $ obj = self :: _chooseOne ( ) ; if ( $ obj -> getStatus ( ) != $ obj :: STATUS_INIT ) return ; if ( msg_stat_queue ( self :: $ _queue ) [ 'msg_qnum' ] < Config :: get ( 'CAPTCHA_CACHE_MAX' ) ) self :: _chooseOne ( ) -> generate ( ) ; } ) ; }
Initialize all registered captcha generators and start generating captcha.
Initialize all registered captcha generators and start generating captcha .