/**
  * Get contents of MANIFEST files.
  * @return array (file => array('checksum'=>..,'size'=>..,'viewable'=>..), ..)
  */
 function readManifest()
 {
     /*
      * Be careful not to reference $gallery here; this method is called from the installer.
      * Look in (modules|themes)/.../MANIFEST and top level MANIFEST.
      */
     $base = realpath(dirname(__FILE__) . '/../../..') . '/';
     $list = array();
     if (file_exists($base . 'MANIFEST')) {
         $list[] = 'MANIFEST';
     }
     foreach (array('modules', 'themes') as $dir) {
         $dh = opendir($base . $dir);
         while (($file = readdir($dh)) !== false) {
             if ($file == '..' || $file == '.') {
                 continue;
             }
             if (file_exists($base . $dir . '/' . $file . '/MANIFEST')) {
                 $list[] = $dir . '/' . $file . '/MANIFEST';
             }
         }
         closedir($dh);
     }
     $manifest = array();
     foreach ($list as $file) {
         MyOOS_Utilities::readIndividualManifest($base . $file, $manifest);
     }
     return $manifest;
 }