function includeAll($dir) { $f = scandir($dir); foreach ($f as $f2) { if ($f2 == "." || $f2 == "..") { continue; } if (is_dir($dir . DIRECTORY_SEPARATOR . $f2)) { includeAll($dir . DIRECTORY_SEPARATOR . $f2); } else { if (substr($f2, -4) == ".php") { include_once $dir . DIRECTORY_SEPARATOR . $f2; } } } }
function includeAll($filepath) { echo "Scaning " . $filepath . "\n"; $files = scandir($filepath); foreach ($files as $v) { $firstletter = substr($v, 0, 1); echo "- " . $v . "\n"; if ($v === '.' || $v === '..' || $firstletter === '.' || $v === 'Auth' || $v === 'BBGS') { } else { if (is_dir($filepath . $v)) { includeAll($filepath . $v . '/'); } elseif (is_file($filepath . $v) && strtoupper($firstletter) === $firstletter) { require_once $filepath . $v; } } } }
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Booked Scheduler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Booked Scheduler. If not, see <http://www.gnu.org/licenses/>. */ if (!defined('ROOT_DIR')) { define('ROOT_DIR', dirname(__FILE__) . '/../'); } includeAll(ROOT_DIR . 'WebServices/Requests'); includeAll(ROOT_DIR . 'WebServices/Responses'); function includeAll($directory) { foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) { require_once $filename; } } class WebServiceIntegrationTests extends PHPUnit_Framework_TestCase { private $url = 'http://localhost/dev/Services'; // private $url = 'http://localhost/development/Services/index.php'; /** * @var HttpClient */ private $client; public function setup()