note 96777 added to function.system

From: Date: Mon, 15 Mar 2010 22:42:19 +0000
Subject: note 96777 added to function.system
Groups: php.notes 
Request: Send a blank email to php-notes+get-167075@lists.php.net to get a copy of this message
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? ---- Server IP: 69.147.83.197 Probable Submitter: 64.105.139.106 ---- Manual Page -- http://www.php.net/manual/en/function.system.php Edit -- https://master.php.net/note/edit/96777 Del: integrated -- https://master.php.net/note/delete/96777/integrated Del: useless -- https://master.php.net/note/delete/96777/useless Del: bad code -- https://master.php.net/note/delete/96777/bad+code Del: spam -- https://master.php.net/note/delete/96777/spam Del: non-english -- https://master.php.net/note/delete/96777/non-english Del: in docs -- https://master.php.net/note/delete/96777/in+docs Del: other reasons-- https://master.php.net/note/delete/96777 Reject -- https://master.php.net/note/reject/96777 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#167075) next »