"Fossies" - the Fresh Open Source Software Archive

Member "z-push/compat.php" (2 Aug 2013, 1166 Bytes) of package /linux/www/old/group-e_z-push_v3.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "compat.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 /***********************************************
    3 * File      :   compat.php
    4 * Project   :   Z-Push
    5 * Descr     :   Help function for files
    6 *
    7 * Created   :   01.10.2007
    8 *
    9 * � Zarafa Deutschland GmbH, www.zarafaserver.de
   10 * This file is distributed under GPL v2.
   11 * Consult LICENSE file for details
   12 ************************************************/
   13 
   14 if (!function_exists("file_put_contents")) {
   15     function file_put_contents($n,$d) {
   16         $f=@fopen($n,"w");
   17         if (!$f) {
   18             return false;
   19         } else {
   20             fwrite($f,$d);
   21             fclose($f);
   22             return true;
   23         }
   24     }
   25 }
   26 
   27 // dw2412 should help all using either php-cgi or not apache server at all.
   28 // This doesn't mean that other servers are supported officially - it just should help
   29 // lowering the question rate ;-)
   30 
   31 if (!function_exists("apache_request_headers")) {
   32     function apache_request_headers() {
   33         $headers = array();
   34         foreach ($_SERVER as $k => $v) {
   35             if (substr($k, 0, 5) == "HTTP_") {
   36                 $k = str_replace('_', ' ', substr($k, 5));
   37                 $k = str_replace(' ', '-', ucwords(strtolower($k)));
   38                 $headers[$k] = $v;
   39             }
   40         }
   41         return $headers;
   42     }
   43 }
   44 
   45 ?>