本文整理汇总了PHP中SinglePage::checkPermissionsXML方法的典型用法代码示例。如果您正苦于以下问题:PHP SinglePage::checkPermissionsXML方法的具体用法?PHP SinglePage::checkPermissionsXML怎么用?PHP SinglePage::checkPermissionsXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SinglePage
的用法示例。
在下文中一共展示了SinglePage::checkPermissionsXML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: obtainPermissionsXML
public static function obtainPermissionsXML($node, $pkg = null) {
// this function reads a file in, and grabs all the various filesystem permissions xml that applies to that file
// and returns it in a DOM object
$node = SinglePage::sanitizePath($node);
// first, we operate on this if it's not in a package
if (!is_object($pkg)) {
if (is_dir(DIR_FILES_CONTROLLERS . '/' . $node) || is_dir(DIR_FILES_CONTROLLERS_REQUIRED . '/' . $node)) {
if (is_dir(DIR_FILES_CONTROLLERS . '/' . $node)) {
$pathToPerms = DIR_FILES_CONTROLLERS . '/' . $node;
if (file_exists($pathToPerms . '/' . FILENAME_COLLECTION_ACCESS)) {
$xmlweb = $pathToPerms . '/' . FILENAME_COLLECTION_ACCESS;
}
}
if (is_dir(DIR_FILES_CONTROLLERS_REQUIRED . '/' . $node)) {
$pathToPerms = DIR_FILES_CONTROLLERS_REQUIRED . '/' . $node;
if (file_exists($pathToPerms . '/' . FILENAME_COLLECTION_ACCESS)) {
$xmlcore = $pathToPerms . '/' . FILENAME_COLLECTION_ACCESS;
}
}
} else {
if (strpos($node, '/') === false) {
if (file_exists(DIR_FILES_CONTROLLERS . '/' . FILENAME_COLLECTION_ACCESS)) {
$xmlweb = DIR_FILES_CONTROLLERS . '/' . FILENAME_COLLECTION_ACCESS;
} else if (file_exists(DIR_FILES_CONTROLLERS_REQUIRED . '/' . FILENAME_COLLECTION_ACCESS)) {
$xmlcore = DIR_FILES_CONTROLLERS_REQUIRED . '/' . FILENAME_COLLECTION_ACCESS;
}
}
}
if (isset($xmlweb)) {
$perms = SinglePage::checkPermissionsXML($xmlweb, $node);
if ($perms != null) {
return $perms;
}
}
if (isset($xmlcore)) {
$perms = SinglePage::checkPermissionsXML($xmlcore, $node);
if ($perms != null) {
return $perms;
}
}
} else {
if (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) {
$dirp = DIR_PACKAGES;
} else {
$dirp = DIR_PACKAGES_CORE;
}
$file1 = $dirp . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_PAGES . '/' . $node . '/' . FILENAME_COLLECTION_VIEW;
$file2 = $dirp . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_PAGES . '/' . $node . '.php';
if (file_exists($file1)) {
$pathToPerms = $dirp . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_CONTROLLERS . '/' . $node;
} else if (file_exists($file2)) {
$pathNode = '/' . substr($node, 0, strrpos($node, '/'));
$pathToPerms = $dirp . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_CONTROLLERS . $pathNode;
}
if (file_exists($pathToPerms . '/' . FILENAME_COLLECTION_ACCESS)) {
$xml = $pathToPerms . '/' . FILENAME_COLLECTION_ACCESS;
}
if (isset($xml)) {
$perms = SinglePage::checkPermissionsXML($xml, $node);
if ($perms != null) {
return $perms;
}
}
}
return false;
}