1   <?php
  2  
  3   $start = getmicrotime();
  4  
  5   define('ADMIN', 1);
  6   define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
  7   define('APPLICATION_CLASS', 'MyApplication');
  8   define('ADMINS_LIST','/in-portal/users/users.php');
  9   include_once(FULL_PATH.'/kernel/kernel4/startup.php');
  10  
  11   /*
  12           kApplication $application
  13   */
  14   $application =& kApplication::Instance();
  15   $application->Init();
  16   $application->Run();
  17   $application->Done();
  18  
  19   $end = getmicrotime();
  20  
  21   if (defined('DEBUG_MODE')) {
  22           echo '  <br><br>
  23                           <style> .dbg_flat_table TD { font-family: arial,verdana; font-size: 9pt; } </style>
  24                           <table class="dbg_flat_table">
  25                                   <tr>
  26                                           <td>Memory used:</td>
  27                                           <td>'.round(memory_get_usage()/1024/1024, 1).' MB</td>
  28                                   </tr>
  29                                   <tr>
  30                                           <td>Time used:</td>
  31                                           <td>'.round(($end - $start), 5).' sec</td>
  32                                   </tr>
  33                           </table>';
  34   }
  35  
  36   function getmicrotime()
  37   {
  38       list($usec, $sec) = explode(" ", microtime());
  39       return ((float)$usec + (float)$sec);
  40   }
  41  
  42   //update_memory_check_script();
  43  
  44   function update_memory_check_script() {
  45           $files = get_included_files();
  46           $script = '$files = Array('."\n";
  47           foreach ($files as $file_name) {
  48                   $script .= "\t\t'".str_replace(DOC_ROOT.BASE_PATH, '', $file_name)."',\n";
  49           }
  50           $script .= ");\n";
  51           echo "<pre>";
  52           echo $script;
  53           echo "</pre>";
  54   }
  55  
  56   ?>