本文整理汇总了PHP中disable_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP disable_cache函数的具体用法?PHP disable_cache怎么用?PHP disable_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable_cache函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: controller
public function controller($app)
{
$plugin = $this;
$app->get('/gallery(/?|/by/:key/:val)', function ($key = false, $val = false) use($app, $plugin) {
disable_cache($app);
$user = DatawrapperSession::getUser();
$curPage = $app->request()->params('page');
if (empty($curPage)) {
$curPage = 0;
}
$perPage = 60;
$filter = !empty($key) ? array($key => $val) : array();
try {
$charts = ChartQuery::create()->getGalleryCharts($filter, $curPage * $perPage, $perPage);
$total = ChartQuery::create()->countGalleryCharts($filter);
} catch (Exception $e) {
// make sure bogus input for the filter doesn't kill the site
$charts = array();
$total = 0;
}
$page = array('charts' => $charts, 'byvis' => $plugin->nbChartsByType(), 'key' => $key, 'val' => $val);
add_pagination_vars($page, $total, $curPage, $perPage);
add_header_vars($page, 'gallery');
$app->render('plugins/' . $plugin->getName() . '/gallery.twig', $page);
});
}
示例2: function
<?php
require_once ROOT_PATH . 'lib/utils/themes.php';
require_once ROOT_PATH . 'vendor/jsmin/jsmin.php';
/*
* PUBLISH STEP - shows progress of publishing action and thumbnail generation
* forwards to /chart/:id/finish
*/
$app->get('/chart/:id/publish', function ($id) use($app) {
disable_cache($app);
check_chart_writable($id, function ($user, $chart) use($app) {
$cfg = $GLOBALS['dw_config'];
$page = array('title' => $chart->getID() . ' :: ' . __('Publish'), 'chartData' => $chart->loadData(), 'chart' => $chart, 'visualizations' => DatawrapperVisualization::all(), 'vis' => DatawrapperVisualization::get($chart->getType()), 'chartUrl' => $chart->getPublicUrl(), 'chartUrlLocal' => '/chart/' . $chart->getID() . '/preview', 'themes' => DatawrapperTheme::all(), 'exportStaticImage' => !empty($cfg['phantomjs']), 'chartActions' => DatawrapperHooks::execute(DatawrapperHooks::GET_CHART_ACTIONS, $chart), 'estExportTime' => ceil(JobQuery::create()->estimatedTime('export_image') / 60));
add_header_vars($page, 'chart', 'chart-editor/publish.css');
add_editor_nav($page, 4);
if ($user->isAbleToPublish() && ($chart->getLastEditStep() == 3 || $app->request()->get('republish') == 1)) {
// actual publish process
$chart->publish();
$page['chartUrl'] = $chart->getPublicUrl();
// generate thumbnails
$page['publish'] = true;
$page['republish'] = $app->request()->get('republish') == 1;
}
$app->render('chart/publish.twig', $page);
});
});