<?php

include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/lib');
AutoLoader::registerDirectory('/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/data_source');
AutoLoader::registerDirectory('/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/tests/app/controllers');
AutoLoader::registerDirectory('/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/tests/app/models');
AutoLoader::registerDirectory('/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/apps');
define("APP_ROOT", "/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/tests/app/");
define("LOG_LEVEL", "DEBUG");
define("LOG_MAX_SIZE", 10485760);
define("LOG_FOLDER", "/Users/mgiraldo/Google Drive/2015/Projects/phpXelerator5/tests/app/log/");
Ejemplo n.º 2
0
    /**
     * Store the filename (sans extension) & full path of all ".php" files found
     */
    public static function registerDirectory($dirName)
    {
        $di = new DirectoryIterator($dirName);
        foreach ($di as $file) {
            if ($file->isDir() && !$file->isLink() && !$file->isDot()) {
                // recurse into directories other than a few special ones
                self::registerDirectory($file->getPathname());
            } elseif (substr($file->getFilename(), -4) === '.php') {
                // save the class name / path of a .php file found
                $className = substr($file->getFilename(), 0, -4);
                AutoLoader::registerClass($className, $file->getPathname());
            }
        }
    }
    public static function registerClass($className, $fileName)
    {
        AutoLoader::$classNames[$className] = $fileName;
    }
    public static function loadClass($className)
    {
        if (isset(AutoLoader::$classNames[$className])) {
            require_once AutoLoader::$classNames[$className];
        }
    }
}
spl_autoload_register(array('AutoLoader', 'loadClass'));
AutoLoader::registerDirectory(dirname(__FILE__) . "/src");
Ejemplo n.º 3
0
    public static function registerDirectory($dirName)
    {
        $di = new DirectoryIterator($dirName);
        foreach ($di as $file) {
            if ($file->isDir() && !$file->isLink() && !$file->isDot()) {
                // recurse into directories other than a few special ones
                self::registerDirectory($file->getPathname());
            } elseif (substr($file->getFilename(), -4) === '.php') {
                // save the class name / path of a .php file found
                $className = substr($file->getFilename(), 0, -4);
                AutoLoader::registerClass($className, $file->getPathname());
            }
        }
    }
    public static function registerClass($className, $fileName)
    {
        AutoLoader::$classNames[$className] = $fileName;
    }
    public static function loadClass($className)
    {
        $properClassName = trim($className);
        if (isset(AutoLoader::$classNames[$properClassName])) {
            //            echo AutoLoader::$classNames[$className] . '<br />';
            require_once AutoLoader::$classNames[$properClassName];
        }
    }
}
spl_autoload_register(array('AutoLoader', 'loadClass'));
AutoLoader::registerDirectory(REAL_PATH_ROOT . 'config/');
AutoLoader::registerDirectory(REAL_PATH_ROOT . 'app/');
Ejemplo n.º 4
0
<?php

echo "RUNNING (" . __FILE__ . ")!!!!\n";
require_once dirname(__FILE__) . '/../AutoLoader.class.php';
// set the timezone to avoid spurious errors from PHP
date_default_timezone_set("America/Chicago");
AutoLoader::registerDirectory(dirname(__FILE__) . '/../');
Ejemplo n.º 5
0
{
    private static $classNames = array();
    public static function registerDirectory($dirName, $mainDir = '')
    {
        $di = new \DirectoryIterator($dirName);
        if (empty($mainDir)) {
            $mainDir = $dirName;
        }
        foreach ($di as $file) {
            if ($file->isDir() && !$file->isLink() && !$file->isDot()) {
                self::registerDirectory($file->getPathname(), $mainDir);
            } elseif (substr($file->getFilename(), -4) === '.php') {
                $namespace = 'Mautic' . str_replace('/', '\\', substr(str_replace($mainDir, '', $file->getPathname()), 0, -4));
                AutoLoader::registerClass($namespace, $file->getPathname());
            }
        }
    }
    public static function registerClass($className, $fileName)
    {
        AutoLoader::$classNames[$className] = $fileName;
    }
    public static function loadClass($className)
    {
        if (isset(AutoLoader::$classNames[$className])) {
            require_once AutoLoader::$classNames[$className];
        }
    }
}
spl_autoload_register(array('Mautic\\AutoLoader', 'loadClass'));
AutoLoader::registerDirectory(__DIR__);
Ejemplo n.º 6
0
<?php

include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('./lib/');
AutoLoader::registerDirectory('./apps/');
AutoLoader::registerDirectory('./data_source');
AutoLoader::registerDirectory('./tests/app/controllers');
AutoLoader::registerDirectory('./tests/app/models');
define("APP_ROOT", "/home/travis/build/giraldomauricio/phpXelerator5/tests/app/");
define("LOG_LEVEL", "DEBUG");
define("LOG_MAX_SIZE", 10485760);
define("LOG_FOLDER", "/home/travis/build/giraldomauricio/phpXelerator5/tests/app/log/");
Ejemplo n.º 7
0
<?php

namespace InvincibleMarketing\Courses;

// Set internal encoding to utf-8,
// it will be the default internal php string functions encoding, i.e. mb_...
mb_internal_encoding('utf-8');
require_once APP_PATH . '/AutoLoader.php';
AutoLoader::registerDirectory(APP_PATH);
require_once VENDOR_PATH . '/autoload.php';
// trim POST array, preserve array values
function storeArrays(array $input)
{
    $result = array();
    foreach ($input as $key => $value) {
        if (is_array($value)) {
            $result[$key] = $value;
        }
    }
    return $result;
}
$preservedArrays = storeArrays($_POST);
$_POST = array_map('trim', $_POST);
$_POST = array_merge($_POST, $preservedArrays);
// load the dependencies into the container
$container = DependencyContainer::getInstance();
try {
    $container->setConfiguration(APP_PATH . '/config/settings.yml');
} catch (ParameterNotFoundException $e) {
    echo "Missing Environment!";
    die;
Ejemplo n.º 8
0
 public function setUp()
 {
     AutoLoader::registerDirectory(ROOT . DIRECTORY_SEPARATOR . 'src');
 }
Ejemplo n.º 9
0
define('TEST', true);
define('MODULES_PATH', '');
define('REQUEST_BASE', '');
define('APP_ROOT', getcwd());
define('DB_NAME', 'szchkt');
define('DB_USER', 'szchkt');
define('DB_PASSWD', 'zvazchkt');
// DATABASE
require_once 'test/database_config.php';
$dbconn = pg_pconnect('host=localhost port=5432 dbname=' . TEST_DB_NAME . ' user='******' password='******'Nepodarilo sa spoji&#357; s datab&aacute;zou: ' . pg_last_error());
global $i18n;
$i18n = [];
require_once 'test/helpers/spec_helpers.php';
include_once 'test/helpers/auto_loader.php';
require_once 'lib/system/helpers.php';
require_once 'lib/system/model.php';
require_once 'lib/system/html_helpers.php';
require_once 'main/application/application_helpers.php';
AutoLoader::registerDirectory('services');
AutoLoader::registerDirectory('models');
AutoLoader::registerDirectory('traits');
require_once 'lib/faker/autoload.php';
require_once 'test/helpers/factory.php';
require_once 'test/factories.php';
require_once 'test/helpers/silent_logger.php';
include_once 'lib/countries.php';
// Router with an empty URL
require_once 'lib/system/router.php';
global $map;
$map = new Router('');
include 'config/routes.php';
Ejemplo n.º 10
0
<?php

/**
 * source : http://jes.st/2011/phpunit-bootstrap-and-autoloading-classes/
 */
include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('src');
AutoLoader::registerDirectory('src/Example');
AutoLoader::registerDirectory('src/Example/Mystery');
Ejemplo n.º 11
0
<?php

$_SERVER['REQUEST_URI'] = "teste";
defined("_PS_VERSION_") ? "" : define("_PS_VERSION_", 1);
defined("_PS_CACHE_ENABLED_") ? "" : define("_PS_CACHE_ENABLED_", 0);
include_once 'AutoLoader.php';
AutoLoader::registerDirectory('tests/vendors/');
require_once "correios.php";
Ejemplo n.º 12
0
<?php

// This is global bootstrap for autoloading
namespace InvincibleMarketing\Courses;

define('ENVIRONMENT', 'test');
$appDir = 'app';
define('APP_PATH', realpath($appDir));
$vendorDir = 'vendor';
define('VENDOR_PATH', realpath($vendorDir));
$tmpDir = 'tmp';
define('TMP_PATH', realpath($tmpDir));
// Set internal encoding to utf-8,
// it will be the default internal php string functions encoding, i.e. mb_...
mb_internal_encoding('utf-8');
require_once APP_PATH . '/AutoLoader.php';
AutoLoader::registerDirectory(APP_PATH);
require_once VENDOR_PATH . '/autoload.php';
$fakesDir = 'tests/fakes';
define('FAKES_PATH', $fakesDir);
AutoLoader::registerDirectory(FAKES_PATH);
Ejemplo n.º 13
0
                // recurse into directories other than a few special ones
                self::registerDirectory($file->getPathname());
            } elseif (substr($file->getFilename(), -4) === '.php') {
                // save the class name / path of a .php file found
                $className = substr($file->getFilename(), 0, -4);
                AutoLoader::registerClass($className, $file->getPathname());
            }
        }
    }
    public static function registerClass($className, $fileName)
    {
        AutoLoader::$classNames[$className] = $fileName;
    }
    public static function loadClass($className)
    {
        if (isset(AutoLoader::$classNames[$className])) {
            require_once AutoLoader::$classNames[$className];
        }
    }
}
spl_autoload_register(array('AutoLoader', 'loadClass'));
AutoLoader::registerDirectory('app/models');
AutoLoader::registerDirectory('app/controllers');
AutoLoader::registerDirectory('app/controllers/calculator');
AutoLoader::registerDirectory('app/controllers/loader');
AutoLoader::registerDirectory('app/definitions');
AutoLoader::registerDirectory('app/views');
AutoLoader::registerDirectory('app/views/customer');
$f3 = (require '../fatfree-master/lib/base.php');
$f3->config('config/config.ini');
$f3->config('config/route.ini');
<?php

$root = dirname(dirname(__FILE__));
require_once $root . '/constants/SprintConstants.php';
require_once $root . '/tests/Autoloader.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/internationalization/pht.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/utils/utils.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/moduleutils/core.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/moduleutils/moduleutils.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/markup/render.php';
AutoLoader::registerDirectory($root);
AutoLoader::registerDirectory(SprintConstants::PHABRICATOR_ROOT_DIR);
AutoLoader::registerDirectory(SprintConstants::LIBPHUTIL_ROOT_DIR);
Ejemplo n.º 15
0
<?php

require 'src/classes/AutoLoader.php';
AutoLoader::registerDirectory(dirname(__FILE__) . '/src/classes');
$store = new HourlyRainForecastStore();
$hrf_list = $store->readDb_all();
//var_dump($hrf_list);
$graphService = new RainGraphService();
$graphService->createRainGraph($hrf_list);
echo file_get_contents('index.tpl');
Ejemplo n.º 16
0
<?php

include_once 'Phpunit_AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('./Classes');
Ejemplo n.º 17
0
<?php

include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('src');
Ejemplo n.º 18
0
<?php

/**
 * The bootstrap contains the initialization for unit tests.
 *
 * @author Stefanie Janine Stoelting <*****@*****.**>
 * @link http://saskphp.com/ Sask website
 * @license http://opensource.org/licenses/MIT MIT
 */
require_once __DIR__ . '/../Components/AutoLoader.php';
$ignore = array(realpath(__DIR__ . '/../Cache'), realpath(__DIR__ . '/../_Tests'), realpath(__DIR__ . '/../nbproject'), realpath(__DIR__ . '/../.git'));
AutoLoader::registerDirectory(realpath(__DIR__ . '/..'), $ignore);
define('TESTFOLDER', __DIR__ . '/TestResults');
if (!file_exists(TESTFOLDER)) {
    mkdir(TESTFOLDER);
}
Ejemplo n.º 19
0
<?php

include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('./lib/');
//AutoLoader::registerDirectory('./PHPUnit/Framework/');
define("DS_ROOT", realpath(dirname(__FILE__) . "/../tests/temp/"));
Ejemplo n.º 20
0
 /**
  * @covers AutoLoader::registerDirectory
  */
 public function testRegisterDirectory()
 {
     AutoLoader::registerDirectory(__DIR__);
 }
Ejemplo n.º 21
0
            }
        }
    }
    public static function registerClass($className, $fileName, $namespace = '')
    {
        AutoLoader::$classNames[$className] = $fileName;
        AutoLoader::$namespacedClassNames[$namespace . '\\' . $className] = $fileName;
    }
    public static function loadClass($className)
    {
        if (isset(AutoLoader::$classNames[$className])) {
            require_once AutoLoader::$classNames[$className];
        } else {
            if (isset(AutoLoader::$namespacedClassNames[$className])) {
                require_once AutoLoader::$namespacedClassNames[$className];
            } else {
                error_log('bootstrap.php: Could not auto load class: ' . $className);
            }
        }
    }
}
// Register php auto loader
spl_autoload_register(array('AutoLoader', 'loadClass'));
// Change directory to tests (relative paths depend on this)
chdir(__DIR__);
// Load TaxJar Namespace
AutoLoader::registerDirectory('../src');
// Load UnitTest Namespace
AutoLoader::registerDirectory('.');
// Include the unit test config
require_once 'config.php';
<?php

include_once 'AutoLoader.php';
// Register the directory to your include files
AutoLoader::registerDirectory('./lib');
AutoLoader::registerDirectory('./data_source');
AutoLoader::registerDirectory('./tests/integration/app/controllers');
AutoLoader::registerDirectory('./tests/integration/app/models');
AutoLoader::registerDirectory('./apps');
define("APP_ROOT", "./tests/integration/app/");
define("LOG_LEVEL", "DEBUG");
define("LOG_MAX_SIZE", 10485760);
define("LOG_FOLDER", "./tests/integration/app/log/");
<?php

include_once '../AutoLoader.php';
AutoLoader::registerDirectory('../src/classes');
require "config.php";
if (empty($_SESSION['user'])) {
    header("Location: ../index.php");
    die("Redirecting to index.php");
} else {
    switch ($_SESSION['user']['user_type_id']) {
        case 3:
            // nurse
            $userType = "nurse";
            break;
        case 2:
            // doctor
            $userType = "doctor";
            break;
        case 4:
            // admin
            $userType = "administrator";
            break;
        default:
            $userType = "patient";
            break;
    }
}
?>

<!doctype html>
<html lang="en">
Ejemplo n.º 24
0
<?php

/**
 * Intitialization of the application.
 *
 * @author David Summerton
 * @link http://saskphp.com/ Sask website
 * @license http://opensource.org/licenses/MIT MIT
 * @package Sask
 */
$ignore = array(__DIR__ . '/Cache', __DIR__ . '/_Tests', __DIR__ . '/nbproject', __DIR__ . '/.git');
require_once __DIR__ . '/Components/AutoLoader.php';
AutoLoader::registerDirectory(__DIR__, $ignore);
session_start();
ob_start();
$sask = new Sask(__DIR__);
/**
 * Feel free to delete this class and create your own!
 */
class Hello extends Sask
{
    public function world()
    {
        echo 'Hello World!';
    }
    public function test()
    {
        echo 'Test message';
    }
    public function page404()
    {