Exemple #1
0
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
require_once 'PAGI/Autoloader/Autoloader.php';
// Include PAGI autoloader.
\PAGI\Autoloader\Autoloader::register();
// Call autoloader register for PAGI autoloader.
use PAGI\Application\Exception\InvalidApplicationException;
use PAGI\Application\PAGIApplication;
$appName = getenv('PAGIApplication');
$bootstrap = getenv('PAGIBootstrap');
$log4php = realpath(getenv('log4php_properties'));
$myApp = '';
try {
    include_once $bootstrap;
    if (!class_exists($appName, true)) {
        throw new \Exception($appName . ' is not loaded');
    }
    $rClass = new ReflectionClass($appName);
    if (!$rClass->isSubclassOf('PAGI\\Application\\PAGIApplication')) {
        throw new \Exception($appName . ': Invalid application');
Exemple #2
0
 /**
  * @test
  */
 public function can_register_autoloader()
 {
     \PAGI\Autoloader\Autoloader::register();
     spl_autoload_register(array($this, 'dummyAutoloader'));
     $this->assertFalse(class_exists('A\\B\\C', true));
 }