當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OC_App::parseAppInfo方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:kebenxiaoming,項目名稱:owncloudRedis,代碼行數:48,代碼來源:app.php

示例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;
     }
 }
開發者ID:pierreozoux,項目名稱:core,代碼行數:55,代碼來源:app.php

示例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));
 }
開發者ID:kenwi,項目名稱:core,代碼行數:11,代碼來源:app.php

示例4: testParseAppInfo

 /**
  * Test app info parser
  *
  * @dataProvider appDataProvider
  */
 public function testParseAppInfo($data, $expected)
 {
     $this->assertEquals($expected, \OC_App::parseAppInfo($data));
 }
開發者ID:shivaraj12,項目名稱:core,代碼行數:9,代碼來源:app.php


注:本文中的OC_App::parseAppInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。