本文整理匯總了PHP中OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::isIncomingServer2serverShareEnabled方法的具體用法?PHP Helper::isIncomingServer2serverShareEnabled怎麽用?PHP Helper::isIncomingServer2serverShareEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OCA\Files_Sharing\Helper
的用法示例。
在下文中一共展示了Helper::isIncomingServer2serverShareEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(array $urlParams = array())
{
parent::__construct('files_sharing', $urlParams);
$container = $this->getContainer();
$server = $container->getServer();
/**
* Controllers
*/
$container->registerService('ShareController', function (SimpleContainer $c) use($server) {
return new ShareController($c->query('AppName'), $c->query('Request'), $c->query('UserSession'), $server->getAppConfig(), $server->getConfig(), $c->query('URLGenerator'), $c->query('UserManager'), $server->getLogger(), $server->getActivityManager());
});
$container->registerService('ExternalSharesController', function (SimpleContainer $c) {
return new ExternalSharesController($c->query('AppName'), $c->query('Request'), $c->query('IsIncomingShareEnabled'), $c->query('ExternalManager'), $c->query('HttpClientService'));
});
/**
* Core class wrappers
*/
$container->registerService('UserSession', function (SimpleContainer $c) use($server) {
return $server->getUserSession();
});
$container->registerService('URLGenerator', function (SimpleContainer $c) use($server) {
return $server->getUrlGenerator();
});
$container->registerService('UserManager', function (SimpleContainer $c) use($server) {
return $server->getUserManager();
});
$container->registerService('HttpClientService', function (SimpleContainer $c) use($server) {
return $server->getHTTPClientService();
});
$container->registerService('IsIncomingShareEnabled', function (SimpleContainer $c) {
return Helper::isIncomingServer2serverShareEnabled();
});
$container->registerService('ExternalManager', function (SimpleContainer $c) use($server) {
$user = $server->getUserSession()->getUser();
$uid = $user ? $user->getUID() : null;
return new \OCA\Files_Sharing\External\Manager($server->getDatabaseConnection(), \OC\Files\Filesystem::getMountManager(), \OC\Files\Filesystem::getLoader(), $server->getHTTPHelper(), $server->getNotificationManager(), $uid);
});
/**
* Middleware
*/
$container->registerService('SharingCheckMiddleware', function (SimpleContainer $c) use($server) {
return new SharingCheckMiddleware($c->query('AppName'), $server->getConfig(), $server->getAppManager());
});
// Execute middlewares
$container->registerMiddleware('SharingCheckMiddleware');
$container->registerService('MountProvider', function (IContainer $c) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
return new MountProvider($server->getConfig(), $c->query('PropagationManager'));
});
$container->registerService('PropagationManager', function (IContainer $c) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
return new PropagationManager($server->getUserSession(), $server->getConfig());
});
/*
* Register capabilities
*/
$container->registerCapability('OCA\\Files_Sharing\\Capabilities');
}
示例2: setupMounts
private function setupMounts()
{
// don't setup server-to-server shares if the admin disabled it
if (\OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled() === false) {
return false;
}
if ($this->uid) {
$query = $this->connection->prepare('
SELECT `remote`, `share_token`, `password`, `mountpoint`, `owner`
FROM `*PREFIX*share_external`
WHERE `user` = ?
');
$query->execute(array($this->uid));
while ($row = $query->fetch()) {
$row['manager'] = $this;
$row['token'] = $row['share_token'];
$this->mountShare($row);
}
}
}
示例3: __construct
/**
* @param array $urlParams
*/
public function __construct(array $urlParams = array())
{
parent::__construct('files_sharing', $urlParams);
$container = $this->getContainer();
/**
* Controllers
*/
$container->registerService('ShareController', function (SimpleContainer $c) {
return new ShareController($c->query('AppName'), $c->query('Request'), $c->query('UserSession'), $c->query('ServerContainer')->getAppConfig(), $c->query('ServerContainer')->getConfig(), $c->query('URLGenerator'), $c->query('ServerContainer')->getUserManager(), $c->query('ServerContainer')->getLogger(), $c->query('ServerContainer')->getActivityManager());
});
$container->registerService('ExternalSharesController', function (SimpleContainer $c) {
return new ExternalSharesController($c->query('AppName'), $c->query('Request'), $c->query('IsIncomingShareEnabled'), $c->query('ExternalManager'));
});
/**
* Core class wrappers
*/
$container->registerService('UserSession', function (SimpleContainer $c) {
return $c->query('ServerContainer')->getUserSession();
});
$container->registerService('URLGenerator', function (SimpleContainer $c) {
return $c->query('ServerContainer')->getUrlGenerator();
});
$container->registerService('IsIncomingShareEnabled', function (SimpleContainer $c) {
return Helper::isIncomingServer2serverShareEnabled();
});
$container->registerService('ExternalManager', function (SimpleContainer $c) {
return new \OCA\Files_Sharing\External\Manager(\OC::$server->getDatabaseConnection(), \OC\Files\Filesystem::getMountManager(), \OC\Files\Filesystem::getLoader(), \OC::$server->getUserSession(), \OC::$server->getHTTPHelper());
});
/**
* Middleware
*/
$container->registerService('SharingCheckMiddleware', function (SimpleContainer $c) {
return new SharingCheckMiddleware($c->query('AppName'), $c->query('ServerContainer')->getAppConfig(), $c->getCoreApi());
});
// Execute middlewares
$container->registerMiddleware('SharingCheckMiddleware');
}
示例4: isS2SEnabled
/**
* check if server-to-server sharing is enabled
*
* @param bool $incoming
* @return bool
*/
private function isS2SEnabled($incoming = false)
{
$result = \OCP\App::isEnabled('files_sharing');
if ($incoming) {
$result = $result && \OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled();
} else {
$result = $result && \OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled();
}
return $result;
}