public function testApply() { $version = '5.3.29'; $fixture = new TemporaryFileFixture($this, getenv('PHPBREW_FIXTURES_PHP_DIR') . "/{$version}/Makefile.in"); $fixture->withFile('Makefile', function ($self, $fixturePath) use($version) { $build = new Build($version); $build->setSourceDirectory(dirname($fixturePath)); $patch = new RegexpPatch($self->logger, $build, array(basename($fixturePath)), array(RegexpPatchRule::always('/LIBTOOL/', ''))); $patch->apply(); $self->assertFileEquals($fixturePath, getenv('PHPBREW_EXPECTED_PHP_DIR') . '/5.3.29/Makefile.in'); }); }
public static function createPatchesForApxs2(Logger $logger, Buildable $build) { $rules = array(RegexpPatchRule::always('#libphp\\$\\(PHP_MAJOR_VERSION\\)\\.#', 'libphp$(PHP_VERSION).'), RegexpPatchRule::always('#libs/libphp\\$PHP_MAJOR_VERSION\\.#', 'libs/libphp$PHP_VERSION.'), RegexpPatchRule::always('#libs/libphp[57].so#', 'libs/libphp$PHP_VERSION.so'), RegexpPatchRule::always('#libs/libphp[57].la#', 'libs/libphp$PHP_VERSION.la'), RegexpPatchRule::always('#libphp\\$PHP_MAJOR_VERSION\\.#', 'libphp$PHP_VERSION.')); return array(new RegexpPatch($logger, $build, array('configure', 'Makefile.global'), $rules)); }