Exemplo n.º 1
0
Arquivo: cfg.php Projeto: undera/pwe
<?php

use PWE\Core\PWELogger;
use PWE\Core\PWEAutoloader;
header('Server: Apache');
header('X-Powered-By: PWE');
$root = str_replace('\\', '/', __DIR__);
PWELogger::setLevel(PWELogger::WARNING);
$PWECore->setStaticDirectory($root . '/img');
$PWECore->setStaticHref('/img');
$PWECore->setDataDirectory($root . '/dat');
$PWECore->setTempDirectory($root . '/dat/tmp');
PWEAutoloader::addSourceRoot($root . '/PWE');
Exemplo n.º 2
0
use PWE\Core\PWEAutoloader;
use PWE\Core\PWECore;
use PWE\Core\PWELogger;
use PWE\Exceptions\PHPFatalException;
use PWE\Utils\FilesystemHelper;
error_reporting(E_ALL ^ E_NOTICE);
$src = __DIR__ . '/..';
require_once $src . '/PWE/Core/PWELogger.php';
require_once $src . '/PWE/Core/PWEAutoloader.php';
PWELogger::setStdOut('php://stdout');
PWELogger::setStdErr('php://stdout');
PWELogger::setLevel(PWELogger::DEBUG);
PWEAutoloader::addSourceRoot(__DIR__);
PWEAutoloader::addSourceRoot(__DIR__ . '/..');
PWEAutoloader::addSourceRoot(__DIR__ . '/../../vendor/');
PWEAutoloader::addSourceRoot('/usr/share/php');
PWEAutoloader::activate();
require_once __DIR__ . '/../PWE/Utils/FilesystemHelper.php';
PHPFatalException::activate();
set_time_limit(180);
$_SERVER["DOCUMENT_ROOT"] = dirname($_SERVER["SCRIPT_FILENAME"]);
//require_once __DIR__ . '/PWE/Core/UnitTestPWECore.php';
class PWEUnitTests
{
    public static function dumpArrayToFile($arr2, $toFile)
    {
        ob_start();
        print_r($arr2);
        file_put_contents($toFile, ob_get_contents());
        ob_end_clean();
    }