Security update for permissions_by_term
[yaffs-website] / vendor / behat / mink-extension / build.php
1 <?php
2
3 /*
4  * This file is part of the Behat
5  *
6  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7  *
8  * This source file is subject to the MIT license that is bundled
9  * with this source code in the file LICENSE.
10  */
11
12 $filename = 'mink_extension.phar';
13
14 if (file_exists($filename)) {
15     unlink($filename);
16 }
17
18 $phar = new \Phar($filename, 0, 'extension.phar');
19 $phar->setSignatureAlgorithm(\Phar::SHA1);
20 $phar->startBuffering();
21
22 foreach (findFiles('src') as $path) {
23     $phar->addFromString($path, file_get_contents(__DIR__.'/'.$path));
24 }
25
26 $phar->addFromString('init.php', file_get_contents(__DIR__.'/init.php'));
27
28 $phar->setStub(<<<STUB
29 <?php
30
31 /*
32  * This file is part of the Behat
33  *
34  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
35  *
36  * This source file is subject to the MIT license that is bundled
37  * with this source code in the file LICENSE.
38  */
39
40 Phar::mapPhar('extension.phar');
41
42 return require 'phar://extension.phar/init.php';
43
44 __HALT_COMPILER();
45 STUB
46 );
47 $phar->stopBuffering();
48
49 function findFiles($dir) {
50     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir),
51       RecursiveIteratorIterator::CHILD_FIRST);
52
53     $files = array();
54     foreach ($iterator as $path) {
55       if ($path->isFile()) {
56           $files[] = $path->getPath().DIRECTORY_SEPARATOR.$path->getFilename();
57       }
58     }
59
60     return $files;
61 }