Zend, Global variable in Application.ini?

后端 未结 6 1324
失恋的感觉
失恋的感觉 2021-02-04 14:24

I have a question as I need to have a global static variable and I have question is any possibility to add it to the application.ini file, how to do it?

Or I have to:

6条回答
  •  花落未央
    2021-02-04 15:01

    in Application.ini file

    someservice.apikey  = 12345678
    someservice.passkey = 87654321
    

    in bootstrap

    public function _initSomeservice()
    {
        $someservice = $this->getOption('someservice');
        Zend_Registry::set('someservice', $someservice);
    }
    

    to pull from Registry

    $config = Zend_Registry::get('someservice');
    

提交回复
热议问题