Comments (7)
To use with php-config and configure directive --with-config-file-scan-dir
is set:
$ php-config --configure-options | \
tr -s ' ' '\n' | \
grep -e '--with-config-file-scan-dir' | \
cut -f2 -d=
from php-psr.
I have an ugly approach:
PHP_CONFD=$(php --ini | \
grep Additional | \
awk -F'parsed:' '{print $2}' | \
sed -r 's/,//g' | \
tr -d '[:space:]')
from php-psr.
I think this may be closed
from php-psr.
@dragoonis That's a pretty distribution-dependent question, no?
You could try getting the value of Scan this dir for additional .ini files
out of php -i
.
$ php -i | grep ini
Configuration File (php.ini) Path => /nix/store/1ip3r4rr646w3a658snrk638yd4vk159-php-7.1.11/lib
Scan this dir for additional .ini files => /etc/php.d
from php-psr.
Or according to php_ini_scanned_files
:
php -r "echo dirname(explode(',', php_ini_scanned_files())[0]);"
but there is a potential issue:
Returns a comma-separated string of .ini files on success. Each comma is followed by a newline. If the configure directive --with-config-file-scan-dir wasn't set and the
PHP_INI_SCAN_DIR
environment variable isn't set, FALSE is returned.
I can't realize why it returns a comma-separated string instead of array
from php-psr.
That doesn't work inside a bash script, so I've modified it to look like this:
VAL=$(
echo `php-config --configure-options` | \
tr -s ' ' '\n' | \
grep -e '--with-config-file-scan-dir' \
| cut -f2 -d=
)
echo "${VAL}"
from php-psr.
@sergeyklay Sounds good, thanks!
from php-psr.
Related Issues (20)
- Add example on how to use logger traits in an extension HOT 3
- ServerRequestInterface not implements RequestInterface methods? HOT 1
- Failed tests with PHP 5.6 HOT 5
- Is TestLogger missing HOT 3
- Thank you from Phalcon HOT 1
- PECL still says latest release is version 0.6.0 HOT 3
- PSR v7.0 fails with "symbol lookup error" HOT 2
- Failed to install with PHP 7.4 HOT 3
- 1.0? HOT 5
- Clarification on the purpose of this extension. HOT 5
- Incorrect default value for methods in \Psr\Log\LoggerInterface HOT 7
- New release with PHP 8 support? HOT 2
- Error with make when installing on macOS HOT 5
- Compatibility with psr/container 1.1 HOT 9
- Compatibility with newer psr libraries HOT 8
- This extension causes major compatibly issues HOT 17
- Not compatible with PHP <7.3
- Declaration of `Psr\Http\Message\StreamInterface::__toString()` must be compatible with `Stringable::__toString()` HOT 2
- php-7.2 build psr.so extension error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-psr.