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


PHP OC_Mount_Config::getBackends方法代码示例

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


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

示例1: testDependencyGetBackend

 public function testDependencyGetBackend()
 {
     // is the backend listed?
     Test_Mount_Config_Dummy_Backend::$checkDependencies = true;
     $backEnds = OC_Mount_Config::getBackends();
     $this->assertArrayHasKey('Test_Mount_Config_Dummy_Backend', $backEnds);
     // backend shall not be listed
     Test_Mount_Config_Dummy_Backend::$checkDependencies = false;
     $backEnds = OC_Mount_Config::getBackends();
     $this->assertArrayNotHasKey('Test_Mount_Config_Dummy_Backend', $backEnds);
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:11,代码来源:dynamicmountconfig.php

示例2: validate

 /**
  * Validate storage config
  *
  * @param StorageConfig $storage storage config
  *
  * @return DataResponse|null returns response in case of validation error
  */
 protected function validate(StorageConfig $storage)
 {
     $mountPoint = $storage->getMountPoint();
     if ($mountPoint === '' || $mountPoint === '/') {
         return new DataResponse(array('message' => (string) $this->l10n->t('Invalid mount point')), Http::STATUS_UNPROCESSABLE_ENTITY);
     }
     // TODO: validate that other attrs are set
     $backends = \OC_Mount_Config::getBackends();
     if (!isset($backends[$storage->getBackendClass()])) {
         // invalid backend
         return new DataResponse(array('message' => (string) $this->l10n->t('Invalid storage backend "%s"', array($storage->getBackendClass()))), Http::STATUS_UNPROCESSABLE_ENTITY);
     }
     return null;
 }
开发者ID:ninjasilicon,项目名称:core,代码行数:21,代码来源:storagescontroller.php

示例3: setUp

 public function setUp()
 {
     \OC_User::createUser(self::TEST_USER1, self::TEST_USER1);
     \OC_User::createUser(self::TEST_USER2, self::TEST_USER2);
     \OC_Group::createGroup(self::TEST_GROUP1);
     \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1);
     \OC_Group::createGroup(self::TEST_GROUP2);
     \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2);
     \OC_User::setUserId(self::TEST_USER1);
     $this->userHome = \OC_User::getHome(self::TEST_USER1);
     mkdir($this->userHome);
     $this->dataDir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
     $this->oldAllowedBackends = OCP\Config::getAppValue('files_external', 'user_mounting_backends', '');
     $this->allBackends = OC_Mount_Config::getBackends();
     OCP\Config::setAppValue('files_external', 'user_mounting_backends', implode(',', array_keys($this->allBackends)));
     OC_Mount_Config::$skipTest = true;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:17,代码来源:mountconfig.php

示例4: array

* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*/
OC_Util::checkAdminUser();
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addscript('3rdparty', 'chosen/chosen.jquery.min');
OCP\Util::addStyle('files_external', 'settings');
OCP\Util::addStyle('3rdparty', 'chosen/chosen');
$backends = OC_Mount_Config::getBackends();
$personal_backends = array();
$enabled_backends = explode(',', OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''));
foreach ($backends as $class => $backend) {
    if ($class != '\\OC\\Files\\Storage\\Local') {
        $personal_backends[$class] = array('backend' => $backend['backend'], 'enabled' => in_array($class, $enabled_backends));
    }
}
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', true);
$tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints());
$tmpl->assign('backends', $backends);
$tmpl->assign('personal_backends', $personal_backends);
$tmpl->assign('groups', OC_Group::getGroups());
$tmpl->assign('users', OCP\User::getUsers());
$tmpl->assign('userDisplayNames', OC_User::getDisplayNames());
开发者ID:olucao,项目名称:owncloud-core,代码行数:31,代码来源:settings.php

示例5:

/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*/
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addscript('3rdparty', 'chosen/chosen.jquery.min');
OCP\Util::addStyle('files_external', 'settings');
OCP\Util::addStyle('3rdparty', 'chosen/chosen');
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', true, false);
$tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints());
$tmpl->assign('backends', OC_Mount_Config::getBackends());
$tmpl->assign('groups', OC_Group::getGroups());
$tmpl->assign('users', OCP\User::getUsers());
$tmpl->assign('allowUserMounting', OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes'));
return $tmpl->fetchPage();
开发者ID:noci2012,项目名称:owncloud,代码行数:31,代码来源:settings.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     OC_Mount_Config::registerBackend('Test_Mount_Config_Dummy_Storage', array('backend' => 'dummy', 'priority' => 150, 'configuration' => array()));
     \OC_User::createUser(self::TEST_USER1, self::TEST_USER1);
     \OC_User::createUser(self::TEST_USER2, self::TEST_USER2);
     \OC_Group::createGroup(self::TEST_GROUP1);
     \OC_Group::createGroup(self::TEST_GROUP1B);
     \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1);
     \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1B);
     \OC_Group::createGroup(self::TEST_GROUP2);
     \OC_Group::createGroup(self::TEST_GROUP2B);
     \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2);
     \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2B);
     \OC_User::setUserId(self::TEST_USER1);
     $this->userHome = \OC_User::getHome(self::TEST_USER1);
     @mkdir($this->userHome);
     $this->dataDir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
     $this->oldAllowedBackends = OCP\Config::getAppValue('files_external', 'user_mounting_backends', '');
     $this->allBackends = OC_Mount_Config::getBackends();
     OCP\Config::setAppValue('files_external', 'user_mounting_backends', implode(',', array_keys($this->allBackends)));
     OC_Mount_Config::$skipTest = true;
     Test_Mount_Config_Hook_Test::setupHooks();
 }
开发者ID:yheric455042,项目名称:owncloud82,代码行数:24,代码来源:mountconfig.php


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