Пример #1
0
 private function verifyRepository()
 {
     /**
      * verify required device ids
      */
     foreach ($this->userAgentHandlerChain->getHandlers() as $handler) {
         /**
          * @var $handler WURFL_Handlers_Handler
          */
         foreach ($handler::$constantIDs as $require_device_id) {
             $device = $this->persistenceProvider->load($require_device_id);
             if ($device === null) {
                 throw new WURFL_Exception_WURFLConsistencyException("wurfl.xml load error - you may need to update the wurfl.xml file to a more recent version");
             }
         }
     }
     /**
      * verify required capabilities
      */
     $required_caps = WURFL_VirtualCapabilityProvider::getRequiredCapabilities();
     $generic_device = new WURFL_CustomDevice([$this->persistenceProvider->load('generic')]);
     $loaded_caps = array_keys($generic_device->getAllCapabilities());
     $missing_caps = array_diff($required_caps, $loaded_caps);
     if (count($missing_caps) > 0) {
         throw new WURFL_Exception_WURFLConsistencyException("Missing required WURFL Capabilities: " . implode(', ', $missing_caps));
     }
     $invalid_fallbacks = array_diff(array_keys($this->fallbacks), $this->devices);
     if (count($invalid_fallbacks) > 0) {
         foreach ($invalid_fallbacks as $invalid_fallback) {
             $device = new WURFL_CustomDevice([$this->persistenceProvider->load($this->fallbacks[$invalid_fallback])]);
             throw new WURFL_Exception_WURFLConsistencyException(sprintf("Invalid Fallback %s for the device %s", $invalid_fallback, $device->id));
         }
     }
     unset($this->fallbacks);
     unset($this->devices);
 }
Пример #2
0
 public function getAllVirtualCapabilities()
 {
     return $this->virtualCapabilityProvider->getAll();
 }