Skip to content

Commit

Permalink
Merge branch 'development' into zephir-php8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Mar 6, 2021
2 parents 514f544 + 8a412a1 commit f91e745
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 7 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com)
The format based on [Keep a Changelog](http://keepachangelog.com)
and this project adheres to [Semantic Versioning](http://semver.org).

## [Unreleased]

## [0.12.21] - 2021-03-05
### Fixed
- Fixed path separators in generated `config.m4` file on Windows [#2153](https://github.com/phalcon/zephir/issues/2153)

## [0.12.20] - 2020-12-16
### Added
- Added supports void type return value for stubs
Expand Down Expand Up @@ -421,7 +426,8 @@ and this project adheres to [Semantic Versioning](http://semver.org).
- Fixed casting resource to int (only ZendEngine 3)
[#1524](https://github.com/phalcon/zephir/issues/1524)

[Unreleased]: https://github.com/phalcon/zephir/compare/0.12.20...HEAD
[Unreleased]: https://github.com/phalcon/zephir/compare/0.12.21...HEAD
[0.12.21]: https://github.com/phalcon/zephir/compare/0.12.20...0.12.21
[0.12.20]: https://github.com/phalcon/zephir/compare/0.12.19...0.12.20
[0.12.19]: https://github.com/phalcon/zephir/compare/0.12.18...0.12.19
[0.12.18]: https://github.com/phalcon/zephir/compare/0.12.17...0.12.18
Expand Down
16 changes: 13 additions & 3 deletions Library/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1119,9 +1119,9 @@ public function createConfigFiles($project)
'%PROJECT_LOWER%' => strtolower($project),
'%PROJECT_UPPER%' => strtoupper($project),
'%PROJECT_CAMELIZE%' => ucfirst($project),
'%FILES_COMPILED%' => implode("\n\t", $compiledFiles),
'%HEADERS_COMPILED%' => implode(' ', $compiledHeaders),
'%EXTRA_FILES_COMPILED%' => implode("\n\t", $this->extraFiles),
'%FILES_COMPILED%' => implode("\n\t", $this->toUnixPaths($compiledFiles)),
'%HEADERS_COMPILED%' => implode(' ', $this->toUnixPaths($compiledHeaders)),
'%EXTRA_FILES_COMPILED%' => implode("\n\t", $this->toUnixPaths($this->extraFiles)),
'%PROJECT_EXTRA_LIBS%' => $extraLibs,
'%PROJECT_EXTRA_CFLAGS%' => $extraCflags,
'%PROJECT_BUILD_DIRS%' => implode(' ', $buildDirs),
Expand Down Expand Up @@ -2336,4 +2336,14 @@ private function getGccVersion()

return '0.0.0';
}

private function toUnixPaths(array $paths): array
{
return array_map(
static function (string $path): string {
return str_replace(\DIRECTORY_SEPARATOR, '/', $path);
},
$paths
);
}
}
2 changes: 1 addition & 1 deletion Library/Zephir.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
final class Zephir
{
const VERSION = '0.12.20-$Id$';
const VERSION = '0.12.21-$Id$';

const LOGO = <<<'ASCII'
_____ __ _
Expand Down
2 changes: 1 addition & 1 deletion ext/php_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PHP_STUB_VERSION "1.0.0"
#define PHP_STUB_EXTNAME "stub"
#define PHP_STUB_AUTHOR "Phalcon Team and contributors"
#define PHP_STUB_ZEPVERSION "0.12.20-$Id$"
#define PHP_STUB_ZEPVERSION "0.12.21-$Id$"
#define PHP_STUB_DESCRIPTION "Description <b>test</b> for<br/>Test Extension."

typedef struct _zephir_struct_db {
Expand Down
24 changes: 24 additions & 0 deletions tests/Zephir/CompilerFile/CheckPathSeparatorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
* This file is part of the Zephir.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Zephir\Test\CompilerFile;

use PHPUnit\Framework\TestCase;

class CheckPathSeparatorTest extends TestCase
{
public function testExtendsClassThatDoesNotExist()
{
$configM4Path = realpath(__DIR__.'/../../../ext/config.m4');
$configM4Contents = file_get_contents($configM4Path);
$this->assertTrue(strpos($configM4Contents, 'stub/oo/abstractstatic.zep.c') !== false);
}
}

0 comments on commit f91e745

Please sign in to comment.