From b9b71a96c16be42ab9853f92f56159dc440240a9 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 27 Jan 2012 12:58:03 -0500 Subject: [PATCH] Simplified module inclusion --- src/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.php b/src/index.php index ab5f892..a6ad6d4 100644 --- a/src/index.php +++ b/src/index.php @@ -14,18 +14,18 @@ if ( ! class_exists('gtk')) die("Please load the php-gtk2 module in your php.ini\r\n"); } +// Wrapper workaround for PHP < 5.4 +function do_include($path) +{ + require_once($path); +} + $dir = dirname(__FILE__); // Load modules { - - $requires = glob("{$dir}/databases/*.php"); - $requires = array_merge($requires, glob("{$dir}/windows/*.php")); - - for($i=0, $count=count($requires); $i<$count; $i++) - { - require_once($requires[$i]); - } + array_map('do_include', glob("{$dir}/databases/*.php")); + array_map('do_include', glob("{$dir}/windows/*.php")); } // Create the main window