コード例 #1
0
 /**
  * Find ResourceMap by entry point or create a new one.
  *
  * @param string $entryPoint Path to search for ResourceMap
  * @param bool $force Flag to force rebuilding Resource map from entry point
  * @param array $ignoreFolders Collection of folders to ignore
  * @return ResourceMap Pointer to ResourceMap object for passed entry point
  */
 public static function &get($entryPoint, $force = false, $ignoreFolders = array())
 {
     /** @var ResourceMap $resourceMap Pointer to resource map */
     $resourceMap = null;
     // If we have not already scanned this entry point or not forced to do it again
     if (!self::find($entryPoint, $resourceMap)) {
         // Create new resource map for this entry point
         $resourceMap = new ResourceMap();
         $resourceMap->prepare($entryPoint, $ignoreFolders);
         // Build ResourceMap for this entry point
         $resourceMap->build($entryPoint);
     } elseif ($force) {
         // If we have found ResourceMap for this entry point but we forced to rebuild it
         $resourceMap->build($entryPoint);
     }
     return $resourceMap;
 }