当前位置: 首页>>代码示例>>PHP>>正文


PHP Timer::tick方法代码示例

本文整理汇总了PHP中Timer::tick方法的典型用法代码示例。如果您正苦于以下问题:PHP Timer::tick方法的具体用法?PHP Timer::tick怎么用?PHP Timer::tick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timer的用法示例。


在下文中一共展示了Timer::tick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dirname

<?php

$THISPATH = dirname(dirname(__FILE__)) . '/';
require_once $THISPATH . 'lib/Timer.php';
Timer::start();
Timer::tick('started');
require_once '_include.php';
#Timer::tick('Include complete');
$config = SimpleSAML_Configuration::getInstance('foodle');
$fullURI = $_SERVER['PATH_INFO'];
$script = $_SERVER['SCRIPT_NAME'];
$path = substr($fullURI, strlen($script) + 1, strlen($fullURI) - strlen($script) - 1);
$parameters = explode('/', $path);
$availableLanguages = array('nb', 'en', 'sv');
$availableLanguages = json_decode(file_get_contents($THISPATH . 'dictionaries/languages.json'), true);
// print_r( $availableLanguages); exit;
try {
    $action = array_shift($parameters);
    switch ($action) {
        case '':
            $page = new Pages_PageFront($config, $parameters);
            $page->show();
            break;
            /*
             * API used by JS, and possibly others...
             */
        /*
         * API used by JS, and possibly others...
         */
        case 'api':
            if (count($parameters) < 1) {
开发者ID:r4mp,项目名称:Foodle,代码行数:31,代码来源:index.php

示例2: show

 function show()
 {
     $this->template->data['foodleid'] = $this->foodle->identifier;
     $this->template->data['user'] = $this->user;
     if ($this->user !== null) {
         // $this->template->data['userid'] = $this->user->userid;
         $this->template->data['userToken'] = $this->user->getToken();
     }
     $this->template->data['title'] = 'Foodle :: ' . $this->foodle->name;
     $this->template->data['foodle'] = $this->foodle;
     $this->template->data['optimize'] = $this->config->getValue('optimize', false);
     $this->template->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
     $this->template->data['authenticated'] = $this->auth->isAuth();
     $this->template->data['loginurl'] = $this->auth->getLoginURL();
     $this->template->data['logouturl'] = $this->auth->getLogoutURL('/');
     $this->template->data['url'] = FoodleUtils::getUrl() . 'foodle/' . $this->foodle->identifier;
     $this->template->data['bread'] = array(array('href' => '/' . $this->config->getValue('baseurlpath'), 'title' => 'bc_frontpage'), array('href' => '/foodle/' . $this->foodle->identifier, 'title' => $this->foodle->name));
     Timer::tick('Presenting page');
     $this->template->data['timer'] = Timer::getList();
     $this->template->show();
 }
开发者ID:r4mp,项目名称:Foodle,代码行数:21,代码来源:PageFoodle.php

示例3: test_percent_calcuations

 public function test_percent_calcuations()
 {
     $timer = new Timer();
     $timer->set_total_items(100);
     $timer->tick();
     $timer->tick();
     $timer->tick();
     $timer->tick();
     $timer->tick();
     $this->assertEquals(5, $timer->percent_complete());
 }
开发者ID:cmmarslender,项目名称:timer,代码行数:11,代码来源:TimerTests.php


注:本文中的Timer::tick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。