diff --git a/kernels/ZendEngine3/require.c b/kernels/ZendEngine3/require.c index c9be4c94c6..078cbdde43 100644 --- a/kernels/ZendEngine3/require.c +++ b/kernels/ZendEngine3/require.c @@ -1,22 +1,13 @@ - /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ + * This file is part of the Zephir. + * + * (c) Zephir Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. If you did not receive + * a copy of the license it is available through the world-wide-web at the + * following url: https://docs.zephir-lang.com/en/latest/license + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -42,17 +33,8 @@ int zephir_require_ret(zval *return_value_ptr, const char *require_path) zend_file_handle file_handle; zend_op_array *new_op_array; zval dummy, local_retval; - char realpath[MAXPATHLEN]; int ret; - if (UNEXPECTED(!VCWD_REALPATH(require_path, realpath))) { -#ifndef ZEPHIR_RELEASE - fprintf(stderr, "%s: Failed opening file %s", __func__, require_path); - zephir_print_backtrace(); -#endif - return FAILURE; - } - ZVAL_UNDEF(&local_retval); #ifndef ZEPHIR_RELEASE diff --git a/unit-tests/Extension/RequiresTest.php b/unit-tests/Extension/RequiresTest.php index 6cee1f8a27..8451d456c9 100644 --- a/unit-tests/Extension/RequiresTest.php +++ b/unit-tests/Extension/RequiresTest.php @@ -39,4 +39,18 @@ public function testRequireExternal3() $r->requireExternal3(__DIR__ . '/../fixtures/require-me-3.php') ); } + + /** + * @test + * @issue https://github.com/phalcon/zephir/issues/1713 + */ + public function shouldRequirePhar() + { + $r = new Requires(); + + $this->assertEquals( + "I'm in", + $r->requireExternal1('phar://' . __DIR__ . '/../fixtures/requires/myapp.phar/index.php') + ); + } } diff --git a/unit-tests/fixtures/requires/myapp.phar b/unit-tests/fixtures/requires/myapp.phar new file mode 100644 index 0000000000..79ac46c620 Binary files /dev/null and b/unit-tests/fixtures/requires/myapp.phar differ