Skip to content

Commit e958834

Browse files
committed
Fixed loading of phar file when it isn't name codecept.phar
At a cost of complicating build process
1 parent 34b392a commit e958834

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

RoboFile.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ private function postProcessFile($pageName, $documentationFile)
475475
file_put_contents($documentationFile, $contents);
476476
}
477477

478-
public function release()
478+
public function buildPhar72()
479479
{
480-
$version = self::STABLE_BRANCH . '.' . date('Ymd');
480+
$version = self::STABLE_BRANCH . '.' . date('Ymd');
481+
$releaseDir = "releases/$version";
481482
$this->stopOnFail();
482483

483-
$this->taskFilesystemStack()->mkdir('build')->run();
484-
$releaseDir = "releases/$version";
484+
$this->taskFilesystemStack()->mkdir('build/72')->run();
485485
$this->setPlatformVersionTo('7.2.0');
486-
$buildFile = 'build/codecept72.phar';
486+
$buildFile = 'build/72/codecept.phar';
487487
$this->buildPhar($buildFile);
488488
$this->updateVersionFile($buildFile, 'codecept.version');
489489
$versionedFile = "$releaseDir/codecept.phar";
@@ -494,10 +494,18 @@ public function release()
494494
->remove('codecept.phar')
495495
->symlink($versionedFile, 'codecept.phar')
496496
->run();
497+
}
498+
499+
public function buildPhar56()
500+
{
501+
$version = self::STABLE_BRANCH . '.' . date('Ymd');
502+
$releaseDir = "releases/$version";
503+
$this->stopOnFail();
497504

505+
$this->taskFilesystemStack()->mkdir('build/56')->run();
498506
$this->setPlatformVersionTo('5.6.0');
499507
//filenames must be different, because Phar refuses to build second file with the same name
500-
$buildFile = 'build/codecept56.phar';
508+
$buildFile = 'build/56/codecept.phar';
501509
$this->buildPhar($buildFile);
502510
$this->updateVersionFile($buildFile, 'php56/codecept.version');
503511
$versionedFile = "$releaseDir/php56/codecept.phar";
@@ -509,6 +517,12 @@ public function release()
509517
->symlink("../$versionedFile", 'php56/codecept.phar')
510518
->run();
511519

520+
}
521+
522+
public function release()
523+
{
524+
$version = self::STABLE_BRANCH . '.' . date('Ymd');
525+
$releaseDir = "releases/$version";
512526
$this->updateBuildsPage();
513527

514528
$this->taskGitStack()

package/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,12 @@ Modules excluded from phar file:
1212
* zf2
1313

1414
Additional dependency compared with codeception/codecepion:
15-
* hoa/console
15+
* hoa/console
16+
17+
### Build instructions
18+
1. Download robo.phar file wget https://robo.li/robo.phar
19+
2. Disable phar.readonly in your php.ini file, it must be `phar.readonly = Off`
20+
3. Run `php robo.phar build:php72`
21+
4. Run `php robo.phar build:php56`
22+
5. Run `php robo.phar release`
23+
6. Commit added files and push

package/stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env php
22
<?php
3-
Phar::mapPhar();
3+
Phar::mapPhar('codecept.phar');
44

55
require_once 'phar://codecept.phar/vendor/codeception/codeception/app.php';
66

0 commit comments

Comments
 (0)