Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1376 broke finding correct config.php file in windows #1426

Closed
talal424 opened this issue Jan 29, 2020 · 2 comments · Fixed by #1487
Closed

#1376 broke finding correct config.php file in windows #1426

talal424 opened this issue Jan 29, 2020 · 2 comments · Fixed by #1487
Assignees
Milestone

Comments

@talal424
Copy link
Contributor

Expected and Actual Behavior

Describe what you are trying to achieve and what goes wrong.

#1376 committed on Nov 21, 2019

the added slash in preg_match returns false in windows

Provide minimal script to reproduce the issue

phalcon project test1

cd test1

phalcon controller foo

throws exception: Error: Builder can't locate the configuration file

suggested solution:

target file: src/Builder/Path.php

change line # 63

if (preg_match('/config\.php$/i', $f->getFilename())) {

change line # 71

if (preg_match('/config\.ini$/i', $f->getFilename())) {

Details

Environment:
OS: Windows NT TALAL-PC 10.0 build 18362 (Windows 10) AMD64
PHP Version: 7.2.18
PHP SAPI: cli
PHP Bin: C:\wamp\bin\php\php7.2.18\php.exe
PHP Extension Dir: C:\php\ext
PHP Bin Dir: C:\php
Loaded PHP config: C:\wamp\bin\php\php7.2.18\php.ini
Versions:
Phalcon DevTools Version: 4.0.1
Phalcon Version: 4.0.2
AdminLTE Version: 2.3.6

@talal424 talal424 mentioned this issue Jan 29, 2020
3 tasks
@Jeckerson Jeckerson self-assigned this Jan 29, 2020
@Hembi
Copy link

Hembi commented May 25, 2020

The suggested solution fixed this problem on Windows 10:

change line # 63
if (preg_match('/config\.php$/i', $f->getFilename())) {

change line # 71
if (preg_match('/config\.ini$/i', $f->getFilename())) {

@BeMySlaveDarlin
Copy link
Contributor

Because of preg_match is too sensitive and getPathName returns different data on differend platforms, replaced regex matching to less stict strpos in #1487

@Jeckerson Jeckerson linked a pull request Mar 14, 2021 that will close this issue
3 tasks
@niden niden added this to Phalcon v5 Aug 25, 2022
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants