Add php script to list projects

Can we move this block (lines 57-67) into the main() function?

Then the only lines that are in global scope are 3-6, which just set the exception handler and call the main() function