Zend_Auth_Adapter_Exception example


    public function __construct(array $config)
    {
        if (!extension_loaded('hash')) {
            /** * @see Zend_Auth_Adapter_Exception */
            throw new Zend_Auth_Adapter_Exception(__CLASS__  . ' requires the \'hash\' extension');
        }

        $this->_request  = null;
        $this->_response = null;
        $this->_ieNoOpaque = false;


        if (empty($config['accept_schemes'])) {
            /** * @see Zend_Auth_Adapter_Exception */
            

    public function authenticate()
    {
        $optionsRequired = array('filename', 'realm', 'username', 'password');
        foreach ($optionsRequired as $optionRequired) {
            if (null === $this->{"_$optionRequired"}) {
                /** * @see Zend_Auth_Adapter_Exception */
                throw new Zend_Auth_Adapter_Exception("Option '$optionRequired' must be set before authentication");
            }
        }

        if (false === ($fileHandle = @fopen($this->_filename, 'r'))) {
            /** * @see Zend_Auth_Adapter_Exception */
            throw new Zend_Auth_Adapter_Exception("Cannot open '$this->_filename' for reading");
        }

        $id       = "$this->_username:$this->_realm";
        

    protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null)
    {
        $this->_zendDb = $zendDb;

        /* * If no adapter is specified, fetch default database adapter. */
        if ($this->_zendDb === null) {
            $this->_zendDb = Zend_Db_Table_Abstract::getDefaultAdapter();
            if ($this->_zendDb === null) {
                throw new Zend_Auth_Adapter_Exception('No database adapter present');
            }
        }

        return $this;
    }

    /** * _authenticateSetup() - This method abstracts the steps involved with * making sure that this adapter was indeed setup properly with all * required pieces of information. * * @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly * * @return true */
Home | Imprint | This part of the site doesn't use cookies.