[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/tests_runner/lib/spikephpcoverage/src/ -> phpcoverage.remote.bottom.inc.php (source)

   1  <?php
   2  /*
   3   *  $Id: phpcoverage.remote.bottom.inc.php 14665 2005-03-23 19:37:50Z npac $
   4   *  
   5   *  Copyright(c) 2004-2005, SpikeSource Inc. All Rights Reserved.
   6   *  Licensed under the Open Source License version 2.1
   7   *  (See http://www.spikesource.com/license.html)
   8  */
   9  ?>
  10  <?php
  11  
  12      if(isset($_REQUEST)) {
  13          global $spc_config, $util;
  14          $logger = $util->getLogger();
  15  
  16          // Create a distinct hash (may or may not be unique)
  17          $session_id = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["SERVER_NAME"]);
  18          $tmpFile = $util->getTmpDir() . "/phpcoverage.session." . $session_id;
  19          $logger->info("[phpcoverage.remote.bottom.inc.php] Session id: " . $session_id,
  20              __FILE__, __LINE__);
  21  
  22          if(!isset($cov)) {
  23              if(file_exists($tmpFile)) {
  24                  $object = file_get_contents($tmpFile);
  25                  $cov = unserialize($object);
  26                  $logger->info("[phpcoverage.remote.bottom.inc.php] Coverage object found: " . $cov, __FILE__, __LINE__);
  27              }
  28          }
  29  
  30          if(isset($cov)) {
  31              // PHPCoverage bottom half
  32              if(!isset($called_script)) {
  33                  $called_script = "";
  34              }
  35              $logger->info("[phpcoverage.remote.bottom.inc.php] END: " . $called_script,
  36                  __FILE__, __LINE__);
  37              // Save the code coverage
  38              $cov->saveCoverageXml();
  39              $logger->info("[phpcoverage.remote.bottom.inc.php] Saved coverage xml",
  40                  __FILE__, __LINE__);
  41              $cov->startInstrumentation();
  42              $logger->info("[phpcoverage.remote.bottom.inc.php] Instrumentation turned on.",
  43                  __FILE__, __LINE__);
  44              $object = serialize($cov);
  45              file_put_contents($tmpFile, $object);
  46              $logger->info("[phpcoverage.remote.bottom.inc.php] ################## END ###################",
  47                  __FILE__, __LINE__);
  48          }
  49      }
  50  
  51  ?>


Generated: Tue Oct 7 05:02:03 2008 Cross-referenced by PHPXref 0.7