1: <?php
2:
3: /**
4: * This loads all Cypht classes and functions to make manual CLI testing easier.
5: * To use this loader, create a PHP file in this directory with the following:
6: *
7: *
8: * <?php
9: *
10: * define('APP_PATH', dirname(dirname(__FILE__)).'/');
11: * require sprintf('%s/scripts/load.php', APP_PATH);
12: *
13: * // test code goes here
14: *
15: */
16:
17:
18: if (mb_strtolower(php_sapi_name()) !== 'cli') {
19: die("Must be run from the command line\n");
20: }
21:
22: define('DEBUG_MODE', false);
23: require APP_PATH.'lib/framework.php';
24: require sprintf("%s/modules/core/modules.php", APP_PATH);
25:
26: foreach (scandir(sprintf('%s/modules/', APP_PATH)) as $mod) {
27: if ($mod == 'core' || $mod == '.' || $mod == '..') {
28: continue;
29: }
30: if (is_readable(sprintf("%s/modules/%s/modules.php", APP_PATH, $mod))) {
31: require_once sprintf("%s/modules/%s/modules.php", APP_PATH, $mod);
32: }
33: }
34:
35: function out($str) {
36: echo "\n";
37: echo Hm_Debug::str($str);
38: echo "\n\n";
39: }
40: