c675478fd639c7052a1d70b49d38ce766c5efb16
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / includes / createphar.php
1 <?php
2
3 $file = __DIR__.'/ProjectWithXsdExtensionInPhar.phar';
4 if (is_file($file)) {
5     @unlink($file);
6 }
7
8 $phar = new Phar($file, 0, 'ProjectWithXsdExtensionInPhar.phar');
9 $phar->addFromString('ProjectWithXsdExtensionInPhar.php', <<<'EOT'
10 <?php
11
12 class ProjectWithXsdExtensionInPhar extends ProjectExtension
13 {
14     public function getXsdValidationBasePath()
15     {
16         return __DIR__.'/schema';
17     }
18
19     public function getNamespace()
20     {
21         return 'http://www.example.com/schema/projectwithxsdinphar';
22     }
23
24     public function getAlias()
25     {
26         return 'projectwithxsdinphar';
27     }
28 }
29 EOT
30 );
31 $phar->addFromString('schema/project-1.0.xsd', <<<'EOT'
32 <?xml version="1.0" encoding="UTF-8" ?>
33
34 <xsd:schema xmlns="http://www.example.com/schema/projectwithxsdinphar"
35     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
36     targetNamespace="http://www.example.com/schema/projectwithxsdinphar"
37     elementFormDefault="qualified">
38
39   <xsd:element name="bar" type="bar" />
40
41   <xsd:complexType name="bar">
42     <xsd:attribute name="foo" type="xsd:string" />
43   </xsd:complexType>
44 </xsd:schema>
45 EOT
46 );
47 $phar->setStub('<?php Phar::mapPhar("ProjectWithXsdExtensionInPhar.phar"); require_once "phar://ProjectWithXsdExtensionInPhar.phar/ProjectWithXsdExtensionInPhar.php"; __HALT_COMPILER(); ?>');