Beispiel #1
0
 /**
  * Loads a cached registry file's data into a registry
  *
  * @param string $filePath The cache registry file path
  * @param IBootstrapperRegistry $registry The registry to read settings into
  */
 protected function loadRegistryFromCache($filePath, IBootstrapperRegistry &$registry)
 {
     $rawContents = file_get_contents($filePath);
     $decodedContents = json_decode($rawContents, true);
     foreach ($decodedContents["eager"] as $eagerBootstrapperClass) {
         $registry->registerEagerBootstrapper($eagerBootstrapperClass);
     }
     foreach ($decodedContents["lazy"] as $boundClass => $bindingData) {
         if ($bindingData["target"] === null) {
             $registry->registerLazyBootstrapper([$boundClass], $bindingData["bootstrapper"]);
         } else {
             $registry->registerLazyBootstrapper([[$boundClass => $bindingData["target"]]], $bindingData["bootstrapper"]);
         }
     }
 }