本文整理汇总了PHP中OC_App::parseAppInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_App::parseAppInfo方法的具体用法?PHP OC_App::parseAppInfo怎么用?PHP OC_App::parseAppInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_App
的用法示例。
在下文中一共展示了OC_App::parseAppInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAppstoreApps
/**
* get a list of all apps on apps.owncloud.com
* @return array, multi-dimensional array of apps.
* Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
*/
public static function getAppstoreApps($filter = 'approved', $category = null)
{
$categories = array($category);
if (is_null($category)) {
$categoryNames = OC_OCSClient::getCategories();
if (is_array($categoryNames)) {
// Check that categories of apps were retrieved correctly
if (!($categories = array_keys($categoryNames))) {
return false;
}
} else {
return false;
}
}
$page = 0;
$remoteApps = OC_OCSClient::getApplications($categories, $page, $filter);
$app1 = array();
$i = 0;
$l = \OC::$server->getL10N('core');
foreach ($remoteApps as $app) {
$potentialCleanId = self::getInternalAppIdByOcs($app['id']);
// enhance app info (for example the description)
$app1[$i] = OC_App::parseAppInfo($app);
$app1[$i]['author'] = $app['personid'];
$app1[$i]['ocs_id'] = $app['id'];
$app1[$i]['internal'] = 0;
$app1[$i]['active'] = $potentialCleanId !== false ? self::isEnabled($potentialCleanId) : false;
$app1[$i]['update'] = false;
$app1[$i]['groups'] = false;
$app1[$i]['score'] = $app['score'];
$app1[$i]['removable'] = false;
if ($app['label'] == 'recommended') {
$app1[$i]['internallabel'] = (string) $l->t('Recommended');
$app1[$i]['internalclass'] = 'recommendedapp';
}
$i++;
}
if (empty($app1)) {
return false;
} else {
return $app1;
}
}
示例2: getAppstoreApps
/**
* Get a list of all apps on the appstore
* @param string $filter
* @param string|null $category
* @param OCSClient $ocsClient
* @return array|bool multi-dimensional array of apps.
* Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
*/
public static function getAppstoreApps($filter = 'approved', $category = null, OCSClient $ocsClient)
{
$categories = [$category];
if (is_null($category)) {
$categoryNames = $ocsClient->getCategories(\OCP\Util::getVersion());
if (is_array($categoryNames)) {
// Check that categories of apps were retrieved correctly
if (!($categories = array_keys($categoryNames))) {
return false;
}
} else {
return false;
}
}
$page = 0;
$remoteApps = $ocsClient->getApplications($categories, $page, $filter, \OCP\Util::getVersion());
$apps = [];
$i = 0;
$l = \OC::$server->getL10N('core');
foreach ($remoteApps as $app) {
$potentialCleanId = self::getInternalAppIdByOcs($app['id']);
// enhance app info (for example the description)
$apps[$i] = OC_App::parseAppInfo($app);
$apps[$i]['author'] = $app['personid'];
$apps[$i]['ocs_id'] = $app['id'];
$apps[$i]['internal'] = 0;
$apps[$i]['active'] = $potentialCleanId !== false ? self::isEnabled($potentialCleanId) : false;
$apps[$i]['update'] = false;
$apps[$i]['groups'] = false;
$apps[$i]['score'] = $app['score'];
$apps[$i]['removable'] = false;
if ($app['label'] == 'recommended') {
$apps[$i]['internallabel'] = (string) $l->t('Recommended');
$apps[$i]['internalclass'] = 'recommendedapp';
}
// Apps from the appstore are always assumed to be compatible with the
// the current release as the initial filtering is done on the appstore
$apps[$i]['dependencies']['owncloud']['@attributes']['min-version'] = implode('.', \OCP\Util::getVersion());
$apps[$i]['dependencies']['owncloud']['@attributes']['max-version'] = implode('.', \OCP\Util::getVersion());
$i++;
}
if (empty($apps)) {
return false;
} else {
return $apps;
}
}
示例3: testParseAppInfo
/**
* Test app info parser
*
* @dataProvider appDataProvider
* @param array $data
* @param array $expected
*/
public function testParseAppInfo(array $data, array $expected)
{
$this->assertSame($expected, \OC_App::parseAppInfo($data));
}
示例4: testParseAppInfo
/**
* Test app info parser
*
* @dataProvider appDataProvider
*/
public function testParseAppInfo($data, $expected)
{
$this->assertEquals($expected, \OC_App::parseAppInfo($data));
}