Buddski Posted December 14, 2009 Share Posted December 14, 2009 That function returns an array.. You need echo '<pre>'; print_r(getDirectoriesFrom('apps')); echo '</pre>'; That will give you an easy to read output.. Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977053 Share on other sites More sharing options...
canadabeeau Posted December 14, 2009 Author Share Posted December 14, 2009 Buddski that returns a blank page PS the directory is wwwroot/apps and the script is run from wwwroot/index.php (if that helps any) Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977056 Share on other sites More sharing options...
canadabeeau Posted December 14, 2009 Author Share Posted December 14, 2009 Applogies <?php function getMySQLResult($result, $mode = MYSQL_ASSOC) { $rows = array(); while ($row = mysql_fetch_array($result, $mode)) { $rows[] = $row; } return $rows; } function getDirectoriesFrom($directory) { $directories = array(); $directory = rtrim($directory, '\/'); if ($dh =@ opendir($directory)) { while (false !== ($file = readdir($dh))) { if (!isDot($file) && is_dir($directory . DIRECTORY_SEPARATOR . $file)) { $directories[] = $directory . DIRECTORY_SEPARATOR . $file; } } closedir($dh); } return $directories; } function isDot($file) { return $file !== '.' && $file !== '..'; } function installApplication($applicationDirectory) { $sqlFile = $applicationDirectory . DIRECTORY_SEPARATOR . 'install.sql'; if (file_exists($sqlFile)) { $sql = readfile($sqlFile); } } echo '<pre>'; print_r(getDirectoriesFrom('apps')); echo '</pre>'; does not return blank it returns Array ( [0] => apps\. [1] => apps\.. ) when in the apps folder THERE IS mac folder Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977059 Share on other sites More sharing options...
Buddski Posted December 14, 2009 Share Posted December 14, 2009 the isDot function should be function isDot($file) { return $file == '.' || $file == '..'; } Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977060 Share on other sites More sharing options...
canadabeeau Posted December 14, 2009 Author Share Posted December 14, 2009 Thanks a million Buddski, again you have come to my rescue, your a genius :-) Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977062 Share on other sites More sharing options...
Buddski Posted December 14, 2009 Share Posted December 14, 2009 Im no genius. Im just a bum with ALOT of free time... Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977063 Share on other sites More sharing options...
canadabeeau Posted December 14, 2009 Author Share Posted December 14, 2009 Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977064 Share on other sites More sharing options...
ignace Posted December 14, 2009 Share Posted December 14, 2009 No need to thank me or anything after all it's my script that your using.. Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977277 Share on other sites More sharing options...
canadabeeau Posted December 15, 2009 Author Share Posted December 15, 2009 Sorry if I have affeneded you ignace but yes thankyou for the scrtip, I though I had already posted a thanks to you Link to comment https://forums.phpfreaks.com/topic/185077-auto-install/page/2/#findComment-977406 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.