This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = '/var/www/./../html/.././webkit'; | |
var str2 = './var/www/./html/testdir/../assets/.'; | |
function normalizeUnix(string) { | |
var arr = string.split('/'); | |
if(arr[0] == '') | |
arr.splice(0, 1); | |
for(var i = 0; i < arr.length; i++) { | |
if(arr[i] == '.') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Deletes files recursively on windows and linux */ | |
function delTree($dir) { | |
$files = array_diff(scandir($dir), array('.','..')); | |
foreach ($files as $file) { | |
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); | |
} | |
return rmdir($dir); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* For AJAX, if frustrated, try the following (see http://www.php.net/manual/en/function.flush.php#91556): | |
@apache_setenv('no-gzip', 1); | |
@ini_set('zlib.output_compression', 0); | |
*/ | |
ob_start(); | |
set_time_limit(0); // for scripts that run really long | |
function force_flush ($add_whitespace = TRUE) { |
NewerOlder