Ejemplo n.º 1
0
    function testCurrentVersionMoreRecent()
    {
        $checker = new Tiki_Version_Checker();
        $checker->setCycle('regular');
        $checker->setVersion('10.0');
        $response = $checker->check(function ($url) use(&$out) {
            $out = $url;
            return <<<O
8.4
9.0
6.7
O;
        });
        $this->assertEquals(array(), $response);
    }
Ejemplo n.º 2
0
}
$headerlib->add_cssfile('themes/base_files/feature_css/admin.css');
if (isset($admintitle) && isset($description)) {
    $crumbs[] = new Breadcrumb($admintitle, $description, $url, $helpUrl, $helpDescription);
    $smarty->assign_by_ref('admintitle', $admintitle);
    $headtitle = breadcrumb_buildHeadTitle($crumbs);
    $smarty->assign_by_ref('headtitle', $headtitle);
    $smarty->assign_by_ref('helpUrl', $helpUrl);
    $smarty->assign_by_ref('description', $description);
}
// VERSION TRACKING
$forcecheck = !empty($_GET['forcecheck']);
// Versioning feature has been enabled, so if the time is right, do a live
// check, otherwise display the stored data.
if ($prefs['feature_version_checks'] == 'y' || $forcecheck) {
    $checker = new Tiki_Version_Checker();
    $checker->setVersion($TWV->version);
    $checker->setCycle($prefs['tiki_release_cycle']);
    $expiry = $tikilib->now - $prefs['tiki_version_check_frequency'];
    $upgrades = $checker->check(function ($url) use($expiry) {
        $cachelib = TikiLib::lib('cache');
        $tikilib = TikiLib::lib('tiki');
        $content = $cachelib->getCached($url, 'http', $expiry);
        if ($content === false) {
            $content = $tikilib->httprequest($url);
            $cachelib->cacheItem($url, $content, 'http');
        }
        return $content;
    });
    $smarty->assign('upgrade_messages', array_map(function ($upgrade) {
        return $upgrade->getMessage();