本文整理汇总了PHP中Repository::addOption方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::addOption方法的具体用法?PHP Repository::addOption怎么用?PHP Repository::addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::addOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchAction
public function switchAction($action, $httpVars, $fileVars)
{
if ($action == "ls") {
$dir = $httpVars["dir"];
if ($dir == "/" || empty($dir)) {
// MAILBOXES CASE
$this->repository->addOption("PAGINATION_THRESHOLD", 500);
$this->driverConf["SCANDIR_RESULT_SORTFONC"] = array("imapAccessDriver", "sortInboxFirst");
} else {
// MAILS LISTING CASE
//$httpVars["dir"] = mb_convert_encoding($httpVars["dir"], "UTF7-IMAP", SystemTextEncoding::getEncoding());
$this->driverConf["SCANDIR_RESULT_SORTFONC"] = array("imapAccessDriver", "inverseSort");
}
}
parent::switchAction($action, $httpVars, $fileVars);
}
示例2: createRepositoryFromArrayInst
/**
* See static method
* @param string $index
* @param array $repository
* @return Repository
*/
public function createRepositoryFromArrayInst($index, $repository)
{
$repo = new Repository($index, $repository["DISPLAY"], $repository["DRIVER"]);
if (isset($repository["DISPLAY_ID"])) {
$repo->setDisplayStringId($repository["DISPLAY_ID"]);
}
if (isset($repository["DESCRIPTION_ID"])) {
$repo->setDescription($repository["DESCRIPTION_ID"]);
}
if (isset($repository["AJXP_SLUG"])) {
$repo->setSlug($repository["AJXP_SLUG"]);
}
if (isset($repository["IS_TEMPLATE"]) && $repository["IS_TEMPLATE"]) {
$repo->isTemplate = true;
$repo->uuid = $index;
}
if (array_key_exists("DRIVER_OPTIONS", $repository) && is_array($repository["DRIVER_OPTIONS"])) {
foreach ($repository["DRIVER_OPTIONS"] as $oName => $oValue) {
$repo->addOption($oName, $oValue);
}
}
// BACKWARD COMPATIBILITY!
if (array_key_exists("PATH", $repository)) {
$repo->addOption("PATH", $repository["PATH"]);
$repo->addOption("CREATE", intval($repository["CREATE"]));
$repo->addOption("RECYCLE_BIN", $repository["RECYCLE_BIN"]);
}
return $repo;
}
示例3: createRepositoryFromArrayInst
public function createRepositoryFromArrayInst($index, $repository)
{
$repo = new Repository($index, $repository["DISPLAY"], $repository["DRIVER"]);
if (isset($repository["DISPLAY_ID"])) {
$repo->setDisplayStringId($repository["DISPLAY_ID"]);
}
if (array_key_exists("DRIVER_OPTIONS", $repository) && is_array($repository["DRIVER_OPTIONS"])) {
foreach ($repository["DRIVER_OPTIONS"] as $oName => $oValue) {
$repo->addOption($oName, $oValue);
}
}
// BACKWARD COMPATIBILITY!
if (array_key_exists("PATH", $repository)) {
$repo->addOption("PATH", $repository["PATH"]);
$repo->addOption("CREATE", $repository["CREATE"]);
$repo->addOption("RECYCLE_BIN", $repository["RECYCLE_BIN"]);
}
return $repo;
}