note 96777 deleted from function.system by danbrown

From: Date: Mon, 15 Mar 2010 22:45:50 +0000
Subject: note 96777 deleted from function.system by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-167076@lists.php.net to get a copy of this message
Note Submitter: Harry ---- system() could be very low. I have a webpage that needs to display some thumbnail images. It calls a function that includes this line of code: <?php !is_dir($cachedir) ? mkdir ($cachedir, 0755) : system ("chmod 0755 ".$cachedir); ?> The page took 59 seconds to process a few thousands images, I removed system() and changed the line to: <?php !is_dir($cachedir) ? mkdir ($cachedir, 0755) : chmod($cachedir, 0755); ?> Now it takes only 3 seconds to load the page. I don't have much experience with PHP. Have I done the right thing here?

« previous php.notes (#167076) next »