本文整理汇总了PHP中checkSiteaccess函数的典型用法代码示例。如果您正苦于以下问题:PHP checkSiteaccess函数的具体用法?PHP checkSiteaccess怎么用?PHP checkSiteaccess使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkSiteaccess函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$isValid = true;
break;
default:
break;
}
return $isValid;
}
// script initializing
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "\n" . "This script will upgrade ezwebin.", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true, 'user' => true));
$script->startup();
$scriptOptions = $script->getOptions("[to-version:][repository:][package:][package-dir:][url:][auto-mode:]", "", array('to-version' => "Specify what upgrade path to use. \n" . " available options: '1.2-0' - upgrade 1.1-1 to 1.2-0\n" . " '1.3-0' - upgrade 1.2-0 to 1.3-0\n" . " '1.4-0' - upgrade 1.3-0 to 1.4-0", 'repository' => "Path to repository where unpacked(unarchived) packages are \n" . "placed. it's relative to 'var/[site.ini].[FileSettings].[StorageDir]/[package.ini].[RepositorySettings].[RepositoryDirectory]' \n" . "(default is 'var/storage/packages/ez_systems')", 'package' => "Package(s) to install, f.e. 'ezwebin_classes'", 'package-dir' => "Path to directory with packed(ezpkg) packages(default is '/tmp/ezwebin') ", 'url' => "URL to download packages, f.e. 'http://packages.ez.no/ezpublish/3.9'.\n" . "'package-dir' can be specified to store uploaded packages on local computer.\n" . "if 'package-dir' is not specified then default dir('/tmp/ezwebin') will be used.", 'auto-mode' => "[on/off]. Do not ask what to do in case of confilicts. By default is 'on'"), false, array('user' => true));
if (!$scriptOptions['siteaccess']) {
showNotice("No siteaccess provided, will use default siteaccess");
} else {
$siteAccessExists = checkSiteaccess($scriptOptions['siteaccess']);
if ($siteAccessExists) {
showNotice("Using siteaccess " . $scriptOptions['siteaccess']);
$script->setUseSiteAccess($scriptOptions['siteaccess']);
} else {
showError("Siteaccess '" . $scriptOptions['siteaccess'] . "' does not exist. Exiting...");
}
}
$script->initialize();
/**************************************************************
* process options *
***************************************************************/
$toVersion = '1.2-0';
if ($scriptOptions['to-version']) {
$version = $scriptOptions['to-version'];
if (isValidWebinUpgradeVersion($version)) {
示例2: siteAccessMap
function siteAccessMap($siteAccessNameArray)
{
if (is_array($siteAccessNameArray)) {
//Build array map of checked siteaccesses.
//Siteaccess name as key, points to root dir, to be used in eZINI methods.
$siteAccessMap = array();
foreach ($siteAccessNameArray as $siteAccessName) {
$mapEntry = checkSiteaccess($siteAccessName);
$siteAccessMap[] = $mapEntry;
}
return $siteAccessMap;
} else {
return false;
}
}
示例3: array
require_once 'autoload.php';
// script initializing
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "\n" . "Install eZWebin package\n", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true, 'user' => true));
$script->startup();
$scriptOptions = $script->getOptions("[repository:][package:][package-dir:][url:][admin-siteaccess:][user-siteaccess:][auto-mode:]", "", array('repository' => "Path to repository where unpacked(unarchived) packages are \n" . "placed. it's relative to 'var/[site.ini].[FileSettings].[StorageDir]/[package.ini].[RepositorySettings].[RepositoryDirectory]' \n" . "(default is 'var/storage/packages/ez_systems')", 'package-dir' => "Path to directory with packed(ezpkg) packages(default is '/tmp/ezwebin') ", 'url' => "URL to download packages, f.e. 'http://packages.ez.no/ezpublish/3.9'.\n" . "'package-dir' can be specified to store uploaded packages on local computer.\n" . "if 'package-dir' is not specified then default dir('/tmp/ezwebin') will be used.", 'admin-siteaccess' => 'Will be used as base for eZWebin admin siteaccess', 'user-siteaccess' => 'Will be used as base for eZWebin user siteaccesses', 'auto-mode' => "[on/off]. Do not ask what to do in case of confilicts. By default is 'on'"), false, array('user' => true));
if (!$scriptOptions['admin-siteaccess']) {
showError("No admin siteaccess provided");
}
if (!$scriptOptions['user-siteaccess']) {
showError("No user siteaccess provided");
}
$adminSiteaccess = $scriptOptions['admin-siteaccess'];
$userSiteaccess = $scriptOptions['user-siteaccess'];
checkSiteaccess($adminSiteaccess, true);
checkSiteaccess($userSiteaccess, true);
showNotice("Using siteaccess '" . $adminSiteaccess . "'");
$script->setUseSiteAccess($adminSiteaccess);
$script->initialize();
/**************************************************************
* process options *
***************************************************************/
//
// 'repository' option
//
$packageRepository = $scriptOptions['repository'];
if (!$packageRepository) {
$packageRepository = repositoryByVendor(defaultVendor());
}
//
// 'package' option