I've very new to Zend framework.

I have a project that uses webservice calls instead of a database. I have a
Webservice model that looks like:

class Default_Model_WSMapper
{
        protected $_ws;
        //dev webservices
        protected $_wsURL = "http://services.webserviceurl.net:9064";;
        
        //live web services
//      protected $_wsURL = "http://services.webserviceurl.net:18086";;
        
        public function __construct(array $options = null){
                 if (is_array($options)) {
            $this->setOptions($options);
        }
                $this->_ws = new Zend_Rest_Client($this->getWSUrl());
        }
        
        public function setWSUrl($url)
    {
        $this->_wsURL = (string)$url;
    }
    
    public function getWSUrl()
    {
        return $this->_wsURL;
    }
    
     public function get( $parameters = array(), $path = '',$resultType =
'json'){
        ...
     }
     
     ...
}

In my other models this is accessed by

$this->_mapper = new Default_Model_WSMapper();

I would like to move the URL that is currently hardcoded here into
application.ini but I'm unsure of the best way to access the values in
application.ini and get the class to initialize with the url already set.

For the ini file I have tried

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resource.WSMapper.params.wsURL  = "http://services.webserviceurl.net:9064";

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resource.WSMapper.params.wsURL = "http://services.webserviceurl.net:18086";
 which causes an error
 so I adjusted it to 

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
WSMapper.params.wsURL  = "http://services.webserviceurl.net:9064";

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
WSMapper.params.wsURL = "http://services.webserviceurl.net:18086";


I used the quick start tutorial as a base for my code and can post more if
needed. Thanks in advance for the help.
-- 
View this message in context: 
http://n4.nabble.com/need-help-with-application-ini-tp1474967p1474967.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to