Архиви на блога

mysql server has gone away or connection timeout

If you do a lots of things in one php script this usually takes some time and mysql can gone away 😉 for this when you run new query you can run it with this function which will connect again

С етикет: , ,
Публикувано в linux, php

php recursive copy

This function copy recursive files and folders in php function recursive_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != ‘.’ ) && ( $file != ‘..’ )) { if ( is_dir($src

Публикувано в linux, php

php recursive delete

This function do recursive delete on files and folders in php function recursiveDelete($str){ if(is_file($str)){ return @unlink($str); } elseif(is_dir($str)){ $scan = glob(rtrim($str,’/’).’/*’); foreach($scan as $index=>$path){ recursiveDelete($path); } return @rmdir($str); } }

С етикет: , , ,
Публикувано в linux, php