本文整理匯總了PHP中cache::fromUUID方法的典型用法代碼示例。如果您正苦於以下問題:PHP cache::fromUUID方法的具體用法?PHP cache::fromUUID怎麽用?PHP cache::fromUUID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cache
的用法示例。
在下文中一共展示了cache::fromUUID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
require_once './lib2/logic/cachelog.class.php';
$tpl->name = 'picture';
$tpl->menuitem = MNU_CACHES_PICTURE;
$login->verify();
if ($login->userid == 0) {
$tpl->redirect_login();
}
$action = isset($_REQUEST['action']) ? mb_strtolower($_REQUEST['action']) : '';
$redirect = isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : '';
$redirect = $tpl->checkTarget($redirect, '');
$tpl->assign('action', $action);
$tpl->assign('redirect', $redirect);
if ($action == 'add') {
$picture = new picture();
if (isset($_REQUEST['cacheuuid'])) {
$cache = cache::fromUUID($_REQUEST['cacheuuid']);
if ($cache === null) {
$tpl->error(ERROR_CACHE_NOT_EXISTS);
}
if ($cache->allowEdit() == false) {
$tpl->error(ERROR_NO_ACCESS);
}
$picture->setObjectId($cache->getCacheId());
$picture->setObjectType(OBJECT_CACHE);
$cache = null;
} else {
if (isset($_REQUEST['loguuid'])) {
$cachelog = cachelog::fromUUID($_REQUEST['loguuid']);
if ($cachelog === null) {
$tpl->error(ERROR_CACHELOG_NOT_EXISTS);
}
示例2: header
*
* Unicode Reminder メモ
***************************************************************************/
//prepare the templates and include all neccessary
$opt['rootpath'] = '../../';
require_once $opt['rootpath'] . 'lib2/web.inc.php';
require_once $opt['rootpath'] . 'lib2/logic/cache.class.php';
header('Content-type: text/html; charset=utf-8');
$cache = null;
if (isset($_REQUEST['cacheid'])) {
$cacheid = $_REQUEST['cacheid'] + 0;
$cache = new cache($cacheid);
} else {
if (isset($_REQUEST['uuid'])) {
$uuid = $_REQUEST['uuid'];
$cache = cache::fromUUID($uuid);
} else {
if (isset($_REQUEST['wp'])) {
$wp = $_REQUEST['wp'];
$cache = cache::fromWP($wp);
}
}
}
if ($cache === null) {
echo '0';
} else {
if (!$cache->isPublic()) {
echo '0';
} else {
echo $cache->getCacheId();
echo ';';