Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created January 15, 2011 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icambridge/780986 to your computer and use it in GitHub Desktop.
Save icambridge/780986 to your computer and use it in GitHub Desktop.
<?php
$buildFiles = array();
$builds = array();
foreach ( $files as $controller => $controllerFiles ){
foreach ( $controllerFiles as $file ){
if ( !isset($buildFiles[$file]) || !is_array($buildFiles[$file]) ){
$buildFiles[$file] = array();
}
$buildFiles[$file][] = $controller;
}
}
foreach( $buildFiles as $file => $controllerArray ){
sort($controllerArray);
$key = implode("", $controllerArray);
if ( !isset($builds[$key]) || !is_array($builds[$key]) ){
$builds[$key] = array();
}
$builds[$key][] = $file;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment