Hi, I am developing using a Windows 7 machine with the local server being UniServer.
I have some PHP code to include all php files in a directory.
# Include all library classes.
$library_files = scandir(LIBRARY_PATH);
foreach ($library_files as $file) {
$path_parts = pathinfo($file);
if ($path_parts['extension'] == 'php') {
require(LIBRARY_PATH . DIRECTORY_SEPARATOR . $file);
}
}
Calling the scandir function causes the script to never end. I am not sure if this is a problem with the permissions of the folder. I am able to include files from within the folder.
What is going wrong here? Thankyou.
Edit: LIBRARY_PATH equals E:\Tools\UniServer\www\LIBRARY
Edit: Apparently it is working now. I'm confused, I haven't changed anything at all. I think I might need to reinstall PHP. Thanks for helping