示例#1
0
 public function testClassLoader()
 {
     $classLoader = new ClassLoader('ClassLoaderTest');
     $classLoader->setIncludePath(__DIR__);
     $classLoader->setFileExtension('.class.php');
     $classLoader->setNamespaceSeparator('_');
     $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassA'));
     $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassB'));
     $this->assertTrue($classLoader->canLoadClass('ClassLoaderTest_ClassC'));
     $this->assertFalse($classLoader->canLoadClass('OtherClass'));
     $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassA'), true);
     $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassB'), true);
     $this->assertEquals($classLoader->loadClass('ClassLoaderTest_ClassC'), true);
 }
示例#2
0
    exit;
}
/**
 * Check for the correct DoctrineORM version. We only support Doctrine 2.1.0 or higher.
 */
if (\Doctrine\ORM\Version::compare("2.2.0") > 0) {
    $versionInvalidMessage = "DoctrineORM is installed, but needs to be at Version 2.2.0 or higher. ";
    $versionInvalidMessage .= "Please run pear upgrade-all to bring your packages up-to-date.";
    echo json_encode(array("error" => true, "message" => $versionInvalidMessage));
    exit;
}
/**
 * Check for the Symfony YAML component. This component is required to parse YAML files and is used during installation
 * of footprints.
 */
if (!$doctrineClassLoader->canLoadClass("Doctrine\\Symfony\\Component\\Yaml\\Yaml")) {
    $yamlErrorMessage = "The YAML component of symfony is not installed. This component is required; please install ";
    $yamlErrorMessage .= "it using:<br/><br/>";
    $yamlErrorMessage .= "<code>pear install pear.doctrine-project.org/DoctrineSymfonyYaml</code><br/><br/>";
    $yamlErrorMessage .= "If you are getting the error:<br/><br/><code>doctrine/DoctrineSymfonyYaml is already ";
    $yamlErrorMessage .= "installed and is the same as the released version</code><br/><br/>";
    $yamlErrorMessage .= "please REINSTALL the package using<br/><br/><code>pear uninstall ";
    $yamlErrorMessage .= "doctrine/DoctrineSymfonyYaml<br/>pear install doctrine/DoctrineSymfonyYaml</code>";
    echo json_encode(array("error" => true, "message" => $yamlErrorMessage));
    exit;
}
/**
 * Check for the Symfony Console component.
 * of footprints.
 */
if (!$doctrineClassLoader->canLoadClass("Doctrine\\Symfony\\Component\\Console\\Command\\Command")) {