/** * @param string $path * * @return array */ private function parse_plist($path) { $plist = new CFPropertyList($path, CFPropertyList::FORMAT_BINARY); $dict = $plist->getValue('CFDictionary'); $form = array('ad_name' => $dict->get('CFBundleDisplayName'), 'ad_lib' => $dict->get('CFBundleShortVersionsString'), 'pack_name' => $dict->get('CFBundleIdentifier'), 'process_name' => $dict->get('CFBundleExecutable')); foreach ($form as $key => $value) { if ($value instanceof CFType) { $form[$key] = $value->getValue(); } if ($key == 'ad_lib' && !$value) { $ad_lib = $dict->get('CFBundleVersion'); $form[$key] = $ad_lib instanceof CFType ? $ad_lib->getValue() : ''; } } $urls = $dict->get('CFBundleURLTypes'); $url_schemes = array(); if ($urls) { $urls = $urls->toArray(); foreach ($urls as $url) { $url_schemes[] = $url['CFBundleURLSchemes']; } } $form['url_type'] = implode(';', Utils::array_flatten($url_schemes)); return $form; }