Esempio n. 1
0
 public function passthroughCSS($req)
 {
     $loc = PApps::getBuildDir() . 'rox/' . $req;
     if (!file_exists($loc)) {
         exit;
     }
     $headers = apache_request_headers();
     // Checking if the client is validating his cache and if it is current.
     if (isset($headers['If-Modified-Since']) && strtotime($headers['If-Modified-Since']) == filemtime($loc)) {
         // Client's cache IS current, so we just respond '304 Not Modified'.
         header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($loc)) . ' GMT', true, 304);
     } else {
         // File not cached or cache outdated, we respond '200 OK' and output the image.
         header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($loc)) . ' GMT', true, 200);
         header('Content-Length: ' . filesize($loc));
     }
     header('Content-type: text/css');
     @copy($loc, 'php://output');
     exit;
 }
Esempio n. 2
0
 /**
  * singleton getter
  *
  * @param void
  * @return PApps
  */
 public static function get()
 {
     if (!isset(self::$_instance)) {
         $c = __CLASS__;
         self::$_instance = new $c();
     }
     return self::$_instance;
 }
Esempio n. 3
0
 protected function loadPApps($class_loader)
 {
     $Apps = PApps::get();
     $Apps->build();
     // process includes
     $includes = $Apps->getIncludes();
     if ($includes) {
         foreach ($includes as $inc) {
             require_once $inc;
         }
     }
     PSurveillance::setPoint('apps_loaded');
 }