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

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

debuging high IO wait under linux

To do that you can use block IO debugging capability of Linux kernel. echo 1 > /proc/sys/vm/block_dump After this run dmesg | egrep „READ|WRITE|dirtied“ |  awk ‘{print $1}’|  sort | uniq -c | sort -rn | head 1583 kjournald(2764): 545

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

php post with big array

Starting from php 5.3.9 there is brand new config option max_input_vars which is limiting the input variables to posted arrays and etc. max_input_vars integer How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal

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

mysql import all sql files from directory

for SQL in *.sql; do  echo importing $SQL; mysql -u user  -ppassword table< $SQL;rm $SQL; done

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