当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Appconfig::getApps方法代码示例

本文整理汇总了PHP中OC_Appconfig::getApps方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Appconfig::getApps方法的具体用法?PHP OC_Appconfig::getApps怎么用?PHP OC_Appconfig::getApps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Appconfig的用法示例。


在下文中一共展示了OC_Appconfig::getApps方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetApps

 public function testGetApps()
 {
     $query = \OC_DB::prepare('SELECT DISTINCT `appid` FROM `*PREFIX*appconfig` ORDER BY `appid`');
     $result = $query->execute();
     $expected = array();
     while ($row = $result->fetchRow()) {
         $expected[] = $row['appid'];
     }
     sort($expected);
     $apps = \OC_Appconfig::getApps();
     $this->assertEquals($expected, $apps);
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:12,代码来源:appconfig.php

示例2: loadApps

 /**
  * @brief loads all apps
  * @returns true/false
  *
  * This function walks through the owncloud directory and loads all apps
  * it can find. A directory contains an app if the file /appinfo/app.php
  * exists.
  */
 public static function loadApps()
 {
     // Did we allready load everything?
     if (self::$init) {
         return true;
     }
     // Our very own core apps are hardcoded
     foreach (array('files', 'settings') as $app) {
         require $app . '/appinfo/app.php';
     }
     // The rest comes here
     $apps = OC_Appconfig::getApps();
     foreach ($apps as $app) {
         if (self::isEnabled($app)) {
             if (is_file(OC::$SERVERROOT . '/apps/' . $app . '/appinfo/app.php')) {
                 require 'apps/' . $app . '/appinfo/app.php';
             }
         }
     }
     self::$init = true;
     // return
     return true;
 }
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_lib_app.php

示例3: array

// This change is due the fact that an admin may not be expected
// to execute arbitrary code in every environment.
if ($app === 'core' && isset($_POST['key']) && (substr($_POST['key'], 0, 7) === 'remote_' || substr($_POST['key'], 0, 7) === 'public_')) {
    OC_JSON::error(array('data' => array('message' => 'Unexpected error!')));
    return;
}
$result = false;
switch ($action) {
    case 'getValue':
        $result = OC_Appconfig::getValue($app, $_GET['key'], $_GET['defaultValue']);
        break;
    case 'setValue':
        $result = OC_Appconfig::setValue($app, $_POST['key'], $_POST['value']);
        break;
    case 'getApps':
        $result = OC_Appconfig::getApps();
        break;
    case 'getKeys':
        $result = OC_Appconfig::getKeys($app);
        break;
    case 'hasKey':
        $result = OC_Appconfig::hasKey($app, $_GET['key']);
        break;
    case 'deleteKey':
        $result = OC_Appconfig::deleteKey($app, $_POST['key']);
        break;
    case 'deleteApp':
        $result = OC_Appconfig::deleteApp($app);
        break;
}
OC_JSON::success(array('data' => $result));
开发者ID:olucao,项目名称:owncloud-core,代码行数:31,代码来源:appconfig.php

示例4: substr

}
if (substr($userName, 0, 5) == 'acct:') {
    $userName = substr($userName, 5);
}
if ($userName == "") {
    $id = "";
} else {
    $id = $userName . '@' . $hostName;
}
if (isset($_SERVER['HTTPS'])) {
    $baseAddress = 'https://';
} else {
    $baseAddress = 'http://';
}
$baseAddress .= $_SERVER['SERVER_NAME'] . OC::$WEBROOT;
if (empty($id)) {
    header("HTTP/1.0 400 Bad Request");
}
define('WF_USER', $userName);
define('WF_ID', $id);
define('WF_BASEURL', $baseAddress);
echo "{\"links\":[";
$apps = OC_Appconfig::getApps();
foreach ($apps as $app) {
    if (OCP\App::isEnabled($app)) {
        if (is_file(OC_App::getAppPath($app) . '/appinfo/webfinger.php')) {
            require $app . '/appinfo/webfinger.php';
        }
    }
}
echo "]}";
开发者ID:blablubli,项目名称:owncloudapps,代码行数:31,代码来源:webfinger.php

示例5: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('news', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('PageController', function ($c) {
         return new PageController($c->query('AppName'), $c->query('Request'), $c->query('CoreConfig'), $c->query('L10N'), $c->query('UserId'));
     });
     $container->registerService('FolderController', function ($c) {
         return new FolderController($c->query('AppName'), $c->query('Request'), $c->query('FolderBusinessLayer'), $c->query('FeedBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('UserId'));
     });
     $container->registerService('FeedController', function ($c) {
         return new FeedController($c->query('AppName'), $c->query('Request'), $c->query('FolderBusinessLayer'), $c->query('FeedBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('CoreConfig'), $c->query('UserId'));
     });
     $container->registerService('ItemController', function ($c) {
         return new ItemController($c->query('AppName'), $c->query('Request'), $c->query('FeedBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('CoreConfig'), $c->query('UserId'));
     });
     $container->registerService('ExportController', function ($c) {
         return new ExportController($c->query('AppName'), $c->query('Request'), $c->query('FeedBusinessLayer'), $c->query('FolderBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('OPMLExporter'), $c->query('UserId'));
     });
     $container->registerService('ApiController', function ($c) {
         return new ApiController($c->query('AppName'), $c->query('Request'), $c->query('Updater'), $c->query('CoreConfig'));
     });
     $container->registerService('FolderApiController', function ($c) {
         return new FolderApiController($c->query('AppName'), $c->query('Request'), $c->query('FolderBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('UserId'));
     });
     $container->registerService('FeedApiController', function ($c) {
         return new FeedApiController($c->query('AppName'), $c->query('Request'), $c->query('FolderBusinessLayer'), $c->query('FeedBusinessLayer'), $c->query('ItemBusinessLayer'), $c->query('Logger'), $c->query('UserId'));
     });
     $container->registerService('ItemApiController', function ($c) {
         return new ItemApiController($c->query('AppName'), $c->query('Request'), $c->query('ItemBusinessLayer'), $c->query('UserId'));
     });
     /**
      * Business Layer
      */
     $container->registerService('FolderBusinessLayer', function ($c) {
         return new FolderBusinessLayer($c->query('FolderMapper'), $c->query('L10N'), $c->query('TimeFactory'), $c->query('Config'));
     });
     $container->registerService('FeedBusinessLayer', function ($c) {
         return new FeedBusinessLayer($c->query('FeedMapper'), $c->query('Fetcher'), $c->query('ItemMapper'), $c->query('Logger'), $c->query('L10N'), $c->query('TimeFactory'), $c->query('Config'), $c->query('Enhancer'), $c->query('HTMLPurifier'));
     });
     $container->registerService('ItemBusinessLayer', function ($c) {
         return new ItemBusinessLayer($c->query('ItemMapper'), $c->query('StatusFlag'), $c->query('TimeFactory'), $c->query('Config'));
     });
     /**
      * Mappers
      */
     $container->registerService('MapperFactory', function ($c) {
         return new MapperFactory($c->query('DatabaseType'), $c->query('Db'));
     });
     $container->registerService('FolderMapper', function ($c) {
         return new FolderMapper($c->query('Db'));
     });
     $container->registerService('FeedMapper', function ($c) {
         return new FeedMapper($c->query('Db'));
     });
     $container->registerService('ItemMapper', function ($c) {
         return $c->query('MapperFactory')->getItemMapper($c->query('Db'));
     });
     /**
      * App config parser
      */
     $container->registerService('AppConfig', function ($c) {
         // not performant but well :/
         // $config = $c->query('ServerContainer')->getAppConfig(); oc7 only
         $installedApps = \OC_Appconfig::getApps();
         $apps = array();
         foreach ($installedApps as $app) {
             $apps[] = array($app => \OC_Appconfig::getValue($app, 'installed_version', '0'));
         }
         // order extensions in name => version
         $loadedExtensions = get_loaded_extensions();
         $extensions = array();
         foreach ($loadedExtensions as $extension) {
             $extensions[$extension] = phpversion($extension);
         }
         return new AppConfig($c->query('ServerContainer')->getNavigationManager(), $c->query('L10N'), $c->query('ServerContainer')->getURLGenerator(), phpversion(), implode('.', \OCP\Util::getVersion()), $apps, $extensions, $c->query('DatabaseType'));
     });
     /**
      * Core
      */
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     $container->registerService('UserId', function () {
         return \OCP\User::getUser();
     });
     $container->registerService('Logger', function ($c) {
         return new Logger($c->query('AppName'));
     });
     $container->registerService('Db', function () {
         return new Db();
     });
     $container->registerService('CoreConfig', function ($c) {
         return $c->query('ServerContainer')->getConfig();
     });
     $container->registerService('DatabaseType', function ($c) {
         return $c->query('ServerContainer')->getConfig()->getSystemValue('dbtype');
//.........这里部分代码省略.........
开发者ID:hroo772,项目名称:news,代码行数:101,代码来源:application.php


注:本文中的OC_Appconfig::getApps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。