예제 #1
0
<?php

// 用forp做性能测试,在public/index_forp.php
forp_start();
date_default_timezone_set('Asia/Chongqing');
define('APP_PATH', dirname(__FILE__) . '/../');
define('APP_PATH', dirname(__FILE__) . '/../');
if (!extension_loaded("yaf")) {
    include APP_PATH . '/globals/framework/loader.php';
}
$application = new Yaf_Application(APP_PATH . "/conf/application.ini");
$application->bootstrap()->run();
forp_end();
?>

<script src="js/forp.min.js"></script>
<script>
   (function($) {
      $(".forp")
      .forp({
         stack : <?php 
echo json_encode(forp_dump());
?>
,
         //mode : "fixed"
      })
   })(jMicro);
</script>
예제 #2
0
    dl($module . '.' . PHP_SHLIB_SUFFIX);
}
$functions = get_extension_funcs($module);
echo "Functions available in the test extension:" . $br;
foreach ($functions as $func) {
    echo $func . $br;
}
echo $br;
// testing forp functions
echo '- Enable' . $br;
forp_start();
/**
 * @ProfileGroup("fibo")
 * @ProfileCaption("fibo of #1")
 */
function fibo($x)
{
    if ($x <= 1) {
        return $x;
    } else {
        return fibo($x - 1) + fibo($x - 2);
    }
}
for ($i = 1; $i < 10; $i++) {
    printf('fibo(%1$s) = %2$s' . $br, $i, fibo($i));
}
echo '- Dump' . $br;
$dump = forp_dump();
print_r($dump['stack'][0]);
echo '- Print' . $br;
forp_print();
예제 #3
0
파일: Forp.php 프로젝트: nextop/forp-ui
 /**
  * @return \forp\Response
  */
 public function send()
 {
     $this->getResponse()->send(forp_dump());
     return $this;
 }