本文整理汇总了PHP中Repository::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::getId方法的具体用法?PHP Repository::getId怎么用?PHP Repository::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initRepository
function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
$create = $this->repository->getOption("CREATE");
$path = $this->repository->getOption("PATH");
$recycle = $this->repository->getOption("RECYCLE_BIN");
if ($create == true) {
if (!is_dir($path)) {
@mkdir($path);
}
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot create root path for repository. Please check repository configuration or that your folder is writeable!");
}
if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
@mkdir($path . "/" . $recycle);
if (!is_dir($path . "/" . $recycle)) {
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
}
}
} else {
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
}
}
$wrapperData = $this->detectStreamWrapper(true);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例2: initRepository
public function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
$smbclientPath = $this->driverConf["SMBCLIENT"];
define('SMB4PHP_SMBCLIENT', $smbclientPath);
$smbtmpPath = $this->driverConf["SMB_PATH_TMP"];
define('SMB4PHP_SMBTMP', $smbtmpPath);
require_once $this->getBaseDir() . "/smb.php";
$create = $this->repository->getOption("CREATE");
$recycle = $this->repository->getOption("RECYCLE_BIN");
$this->detectStreamWrapper(true);
$this->urlBase = "pydio://" . $this->repository->getId();
if ($recycle != "" && !is_dir($this->urlBase . "/" . $recycle)) {
@mkdir($this->urlBase . "/" . $recycle);
if (!is_dir($this->urlBase . "/" . $recycle)) {
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
}
}
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例3: initRepository
public function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
if (!function_exists('ssh2_connect')) {
throw new Exception("You must have the php ssh2 extension active!");
}
ConfService::setConf("PROBE_REAL_SIZE", false);
$path = $this->repository->getOption("PATH");
$recycle = $this->repository->getOption("RECYCLE_BIN");
$this->detectStreamWrapper(true);
$this->urlBase = "pydio://" . $this->repository->getId();
restore_error_handler();
if (!file_exists($this->urlBase)) {
if ($this->repository->getOption("CREATE")) {
$test = @mkdir($this->urlBase);
if (!$test) {
throw new AJXP_Exception("Cannot create path ({$path}) for your repository! Please check the configuration.");
}
} else {
throw new AJXP_Exception("Cannot find base path ({$path}) for your repository! Please check the configuration!");
}
}
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例4: initRepository
function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
$wrapperData = $this->detectStreamWrapper(true);
AJXP_Logger::debug("Detected wrapper data", $wrapperData);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
$consumerKey = $this->repository->getOption("CONSUMER_KEY");
$consumerSecret = $this->repository->getOption("CONSUMER_SECRET");
$oauth = new Dropbox_OAuth_PEAR($consumerKey, $consumerSecret);
// TOKENS IN SESSION?
if (!empty($_SESSION["OAUTH_DROPBOX_TOKENS"])) {
return;
}
// TOKENS IN FILE ?
$tokens = $this->getTokens($this->repository->getId());
if (!empty($tokens)) {
$_SESSION["OAUTH_DROPBOX_TOKENS"] = $tokens;
return;
}
// OAUTH NEGOCIATION
if (isset($_SESSION['DROPBOX_NEGOCIATION_STATE'])) {
$state = $_SESSION['DROPBOX_NEGOCIATION_STATE'];
} else {
$state = 1;
}
switch ($state) {
case 1:
$tokens = $oauth->getRequestToken();
//print_r($tokens);
// Note that if you want the user to automatically redirect back, you can
// add the 'callback' argument to getAuthorizeUrl.
//echo "Step 2: You must now redirect the user to:\n";
$_SESSION['DROPBOX_NEGOCIATION_STATE'] = 2;
$_SESSION['oauth_tokens'] = $tokens;
throw new Exception("Please go to <a style=\"text-decoration:underline;\" target=\"_blank\" href=\"" . $oauth->getAuthorizeUrl() . "\">" . $oauth->getAuthorizeUrl() . "</a> to authorize the access to your dropbox. Then try again to switch to this repository.");
case 2:
$oauth->setToken($_SESSION['oauth_tokens']);
$tokens = $oauth->getAccessToken();
$_SESSION['DROPBOX_NEGOCIATION_STATE'] = 3;
$_SESSION['OAUTH_DROPBOX_TOKENS'] = $tokens;
$this->setTokens($this->repository->getId(), $tokens);
return;
}
throw new Exception("Impossible to find the tokens for accessing the dropbox repository");
}
示例5: getClientForRepository
/**
* @param Repository $repoObject
* @param boolean $registerStream
* @return \AccessS3\S3Client
*/
protected static function getClientForRepository($repoObject, $registerStream = true)
{
require_once "aws.phar";
if (!isset(self::$clients[$repoObject->getId()])) {
// Get a client
$options = array('key' => $repoObject->getOption("API_KEY"), 'secret' => $repoObject->getOption("SECRET_KEY"));
$signatureVersion = $repoObject->getOption("SIGNATURE_VERSION");
if (!empty($signatureVersion)) {
$options['signature'] = $signatureVersion;
}
$baseURL = $repoObject->getOption("STORAGE_URL");
if (!empty($baseURL)) {
$options["base_url"] = $baseURL;
}
$region = $repoObject->getOption("REGION");
if (!empty($region)) {
$options["region"] = $region;
}
$proxy = $repoObject->getOption("PROXY");
if (!empty($proxy)) {
$options['request.options'] = array('proxy' => $proxy);
}
$apiVersion = $repoObject->getOption("API_VERSION");
if ($apiVersion === "") {
$apiVersion = "latest";
}
//SDK_VERSION IS A GLOBAL PARAM
ConfService::getConfStorageImpl()->_loadPluginConfig("access.s3", $globalOptions);
$sdkVersion = $globalOptions["SDK_VERSION"];
//$repoObject->driverInstance->driverConf['SDK_VERSION'];
if ($sdkVersion !== "v2" && $sdkVersion !== "v3") {
$sdkVersion = "v2";
}
if ($sdkVersion === "v3") {
require_once __DIR__ . DIRECTORY_SEPARATOR . "class.pydioS3Client.php";
$s3Client = new \AccessS3\S3Client(["version" => $apiVersion, "region" => $region, "credentials" => $options]);
$s3Client->registerStreamWrapper($repoObject->getId());
} else {
$s3Client = Aws\S3\S3Client::factory($options);
if ($repoObject->getOption("VHOST_NOT_SUPPORTED")) {
// Use virtual hosted buckets when possible
require_once "ForcePathStyleListener.php";
$s3Client->addSubscriber(new \Aws\S3\ForcePathStyleStyleListener());
}
$s3Client->registerStreamWrapper();
}
self::$clients[$repoObject->getId()] = $s3Client;
}
return self::$clients[$repoObject->getId()];
}
示例6: getAccessDriver
/**
* @return AjxpWrapperProvider
* @throws \Sabre\DAV\Exception\NotFound
*/
public function getAccessDriver()
{
if (!isset($this->accessDriver)) {
//$RID = $this->repository->getId();
//ConfService::switchRootDir($RID);
ConfService::getConfStorageImpl();
$this->accessDriver = ConfService::loadDriverForRepository($this->repository);
if (!$this->accessDriver instanceof AjxpWrapperProvider) {
throw new Sabre\DAV\Exception\NotFound($this->repository->getId());
}
$this->accessDriver->detectStreamWrapper(true);
}
return $this->accessDriver;
}
示例7: initRepository
/**
* initRepository
*/
public function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
ConfService::setConf("PROBE_REAL_SIZE", false);
require_once $this->getBaseDir() . "/SFTPPSL_StreamWrapper.php";
$create = $this->repository->getOption("CREATE");
$path = $this->repository->getOption("PATH");
$wrapperData = $this->detectStreamWrapper(true);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
}
示例8: initRepository
public function initRepository()
{
$wrapperData = $this->detectStreamWrapper(true);
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
$recycle = $this->repository->getOption("RECYCLE_BIN");
ConfService::setConf("PROBE_REAL_SIZE", false);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例9: initRepository
function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
$smbclientPath = $this->driverConf["SMBCLIENT"];
define('SMB4PHP_SMBCLIENT', $smbclientPath);
require_once $this->getBaseDir() . "/smb.php";
$create = $this->repository->getOption("CREATE");
$recycle = $this->repository->getOption("RECYCLE_BIN");
$wrapperData = $this->detectStreamWrapper(true);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
}
示例10: init
function init($options)
{
parent::init($options);
$pServ = AJXP_PluginsService::getInstance();
$aPlugs = $pServ->getActivePlugins();
$accessPlugs = $pServ->getPluginsByType("access");
$this->repository = ConfService::getRepository();
foreach ($accessPlugs as $pId => $plug) {
if (array_key_exists("access." . $pId, $aPlugs) && $aPlugs["access." . $pId] === true) {
$this->accessDriver = $plug;
if (!isset($this->accessDriver->repository)) {
$this->accessDriver->init($this->repository);
$this->accessDriver->initRepository();
$wrapperData = $this->accessDriver->detectStreamWrapper(true);
} else {
$wrapperData = $this->accessDriver->detectStreamWrapper(false);
}
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
}
}
$this->metaStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
if ($this->metaStore !== false) {
$this->metaStore->initMeta($this->accessDriver);
}
}
示例11: currentBaseUrl
public function currentBaseUrl()
{
if (!isset($this->repository)) {
throw new Exception("UserSelection::currentBaseUrl: cannot build nodes URL without a proper repository");
}
return "pydio://" . $this->repository->getId();
}
示例12: initRepository
function initRepository()
{
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
if (isset($this->pluginConf["PROBE_REAL_SIZE"])) {
// PASS IT TO THE WRAPPER
ConfService::setConf("PROBE_REAL_SIZE", $this->pluginConf["PROBE_REAL_SIZE"]);
}
$create = $this->repository->getOption("CREATE");
$path = $this->repository->getOption("PATH");
$recycle = $this->repository->getOption("RECYCLE_BIN");
if ($create == true) {
if (!is_dir($path)) {
@mkdir($path, 0755, true);
}
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot create root path for repository (" . $this->repository->getDisplay() . "). Please check repository configuration or that your folder is writeable!");
}
if ($recycle != "" && !is_dir($path . "/" . $recycle)) {
@mkdir($path . "/" . $recycle);
if (!is_dir($path . "/" . $recycle)) {
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
}
}
$dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
if (!empty($dataTemplate) && is_dir($dataTemplate) && !is_file($path . "/.ajxp_template")) {
$errs = array();
$succ = array();
$this->dircopy($dataTemplate, $path, $succ, $errs, false, false);
touch($path . "/.ajxp_template");
}
} else {
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot find base path for your repository! Please check the configuration!");
}
}
$wrapperData = $this->detectStreamWrapper(true);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例13: isWriteable
public function isWriteable($dir, $type = "dir")
{
if ($this->getFilteredOption("USE_POSIX", $this->repository->getId()) == true && extension_loaded('posix')) {
$real = call_user_func(array($this->wrapperClassName, "getRealFSReference"), $dir);
return posix_access($real, POSIX_W_OK);
}
return is_writable($dir);
}
示例14: initRepository
public function initRepository()
{
@(include_once "HTTP/WebDAV/Client.php");
if (is_array($this->pluginConf)) {
$this->driverConf = $this->pluginConf;
} else {
$this->driverConf = array();
}
if (!class_exists('HTTP_WebDAV_Client_Stream')) {
throw new Exception("You must have Pear HTTP/WebDAV/Client package installed to use this access driver!");
}
$create = $this->repository->getOption("CREATE");
$path = $this->repository->getOption("PATH");
$recycle = $this->repository->getOption("RECYCLE_BIN");
ConfService::setConf("PROBE_REAL_SIZE", false);
/*
if ($create == true) {
if(!is_dir($path)) @mkdir($path);
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot create root path for repository (".$this->repository->getDisplay()."). Please check repository configuration or that your folder is writeable!");
}
if ($recycle!= "" && !is_dir($path."/".$recycle)) {
@mkdir($path."/".$recycle);
if (!is_dir($path."/".$recycle)) {
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
}
}
} else {
if (!is_dir($path)) {
throw new AJXP_Exception("Cannot find base path ($path) for your repository! Please check the configuration!");
}
}
*/
$wrapperData = $this->detectStreamWrapper(true);
$this->wrapperClassName = $wrapperData["classname"];
$this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId();
if (!is_dir($this->urlBase)) {
if (webdavAccessWrapper::$lastException) {
throw webdavAccessWrapper::$lastException;
}
throw new AJXP_Exception("Cannot connect to the WebDAV server ({$path}). Please check the configuration!");
}
if ($recycle != "") {
RecycleBinManager::init($this->urlBase, "/" . $recycle);
}
}
示例15: isWriteable
public function isWriteable($dir, $type = "dir")
{
if ($this->getFilteredOption("USE_POSIX", $this->repository->getId()) == true && extension_loaded('posix')) {
$real = AJXP_MetaStreamWrapper::getRealFSReference($dir);
return posix_access($real, POSIX_W_OK);
}
//clearstatcache();
return is_writable($dir);
}