• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Zend/Translate/Adapter/Array.php

00001 <?php
00024 require_once 'Zend/Locale.php';
00025 
00027 require_once 'Zend/Translate/Adapter.php';
00028 
00029 
00036 class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter
00037 {
00038     private $_data = array();
00039 
00048     public function __construct($data, $locale = null, array $options = array())
00049     {
00050         parent::__construct($data, $locale, $options);
00051     }
00052 
00062     protected function _loadTranslationData($data, $locale, array $options = array())
00063     {
00064         $this->_data = array();
00065         if (!is_array($data)) {
00066             if (file_exists($data)) {
00067                 ob_start();
00068                 $data = include($data);
00069                 ob_end_clean();
00070             }
00071         }
00072         if (!is_array($data)) {
00073             require_once 'Zend/Translate/Exception.php';
00074             throw new Zend_Translate_Exception("Error including array or file '".$data."'");
00075         }
00076 
00077         if (!isset($this->_data[$locale])) {
00078             $this->_data[$locale] = array();
00079         }
00080 
00081         $this->_data[$locale] = $data + $this->_data[$locale];
00082         return $this->_data;
00083     }
00084 
00090     public function toString()
00091     {
00092         return "Array";
00093     }
00094 }

Generated on Thu Apr 19 2012 17:01:18 for openbiz by  doxygen 1.7.2