public static function readPackageFile($file)
 {
     // Sanity
     if (!file_exists($file) || !is_file($file) || strtolower(pathinfo($file, PATHINFO_EXTENSION)) != 'tar') {
         throw new Engine_Package_Exception('File does not exist or is not a tar file');
     }
     self::_loadArchiveClass();
     // Create archive object
     $archive = new Archive_Tar($file);
     // List files
     $fileList = $archive->listContent();
     if (empty($fileList)) {
         throw new Engine_Package_Exception('Unable to open archive');
     }
     // Check for root package file
     $rootPackageFile = null;
     foreach ($fileList as $arFile) {
         if ($arFile['filename'] == 'package.json') {
             $rootPackageFile = $arFile['filename'];
             break;
         }
     }
     if (null === $rootPackageFile) {
         throw new Engine_Package_Exception('Root package file not found.');
     }
     // Start building package stuff
     $packageFileObject = new Engine_Package_Manifest();
     $packageFileObject->fromString($archive->extractInString($rootPackageFile), 'json');
     return $packageFileObject;
 }