function __construct($agentData, $sessionLink = '', $POST = true, $formVarname = 'form') { if ($agentData) { if ($formVarname) { if (isset($agentData->{$formVarname})) { user_error(__CLASS__ . ": Overwriting existing \$agentData->{$formVarname}! If this is the intended behavior, unset(\$agentData->{$formVarname}) to remove this warning."); } $agentData->{$formVarname} = $this; } $this->agentData = $agentData; } else { $this->agentData = false; } $this->POST = (bool) $POST; if ($this->POST) { p::canPost(); if (isset($_POST['_POST_BACKUP'])) { // This should only be used for field persistence, not as valid input $this->rawValues =& $GLOBALS['_POST_BACKUP']; // $this->filesValues =& $GLOBALS['_FILES_BACKUP']; } else { $this->rawValues =& $_POST; $this->filesValues =& $_FILES; } } else { $this->rawValues =& $_GET; } if ($sessionLink) { s::bind($sessionLink, $this->sessionLink); if (!$this->sessionLink) { $this->sessionLink = array(0); } } }
function metaCompose() { p::setMaxage($this->maxage); p::setExpires($this->expires); p::watch($this->watch); if ($this->canPost) { p::canPost(); } }