Skip to content

Instantly share code, notes, and snippets.

@codler
codler / gist:3906826
Created October 17, 2012 17:18
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@Robdebert
Robdebert / preprint.php
Last active October 4, 2015 20:28
Debugging-Output for PHP. Simple Usage
/**
* Simple Usage: preprint($mixed) will output everything, that can be outputtet by PHP in a formatted way using the html pre-tag.
* You can use __FILE__.__LINE__ as second parameter, to see, where the ouput was generated
*
* I always include this function in all of my projects because i output a lot of debugging-data. And i don't want to write those html tags everytime :-)
*
* @author: Robert Heine
* @link: www.joomla-jquery-internet.de
* @changes: RH, 21.08.2014: Ergänzung um den Backtrace, was $where überflüßig macht.
* RH, 29.05.2015: Ergänzung wegen ENVIRONMENT. Soll NUR im DEV-Modus etwas ausgeben.