Exemplo n.º 1
0
 private function getEnabledFilesystemPaths($repositoryPath)
 {
     // Get a copy so that we can remove the entries that we processed
     // already
     $inMappings = $this->mappings->toArray();
     $outMappings = array();
     $filesystemPaths = array();
     $this->filterEnabledMappings($repositoryPath, $inMappings, $outMappings);
     foreach ($outMappings as $mappingPath => $mappingsByPackage) {
         foreach ($mappingsByPackage as $packageName => $mapping) {
             $filesystemPaths[$packageName][$mappingPath] = $mapping->getFilesystemPaths();
         }
     }
     if (!$filesystemPaths) {
         return array();
     }
     // Sort primary keys (package names)
     $sortedNames = $this->overrideGraph->getSortedPackageNames(array_keys($filesystemPaths));
     $filesystemPaths = array_replace(array_flip($sortedNames), $filesystemPaths);
     // Sort secondary keys (repository paths)
     foreach ($filesystemPaths as $packageName => $pathsByPackage) {
         ksort($filesystemPaths[$packageName]);
     }
     return $filesystemPaths;
 }
Exemplo n.º 2
0
 private function getEnabledFilesystemPaths($repositoryPath)
 {
     // Get a copy so that we can remove the entries that we processed
     // already
     $mappings = $this->mappingsByResource->toArray();
     $this->collectEnabledFilesystemPaths($repositoryPath, $mappings, $filesystemPaths);
     if (!$filesystemPaths) {
         return array();
     }
     // Sort primary keys (package names)
     $sortedNames = $this->overrideGraph->getSortedPackageNames(array_keys($filesystemPaths));
     $filesystemPaths = array_replace(array_flip($sortedNames), $filesystemPaths);
     // Sort secondary keys (repository paths)
     foreach ($filesystemPaths as $packageName => $pathsByPackage) {
         ksort($filesystemPaths[$packageName]);
     }
     return $filesystemPaths;
 }
 /**
  * {@inheritdoc}
  */
 public function hasPathMappings(Expression $expr = null)
 {
     $this->assertMappingsLoaded();
     if (!$expr) {
         return !$this->mappings->isEmpty();
     }
     foreach ($this->mappings->toArray() as $mappingsByPackage) {
         foreach ($mappingsByPackage as $mapping) {
             if ($mapping->match($expr)) {
                 return true;
             }
         }
     }
     return false;
 }