Code Monkey home page Code Monkey logo

Comments (6)

ciaranmcnulty avatar ciaranmcnulty commented on June 24, 2024 2

Any arbitrary function could be killed that way, we can't check all of them before calling throughout the codebase :)

It probably could be extension_loaded but I'd kinda want a compelling argument to make the change as this seems like something that'll vary across platforms/distros in ways we can't anticipate

from behat.

stof avatar stof commented on June 24, 2024 1

Requiring ext-pcntl as a mandatory requirement would make Behat incompatible with PHP on Windows as ext-pcntl is an extension that does not exist on Windows.
The goal is not to support disable_functions here (if you are on Unix and don't want the pcntl functions in your runtime, disable the extensions instead of disabling functions one by one)

from behat.

ciaranmcnulty avatar ciaranmcnulty commented on June 24, 2024

It's really just trying to detect whether the PCNTL extension is loaded, I think

from behat.

messatsuu avatar messatsuu commented on June 24, 2024

Couldn't this be done with extension_loaded()? But that wouldn't cover the case that either of the functions are disabled in a php-cli.ini, e.g.

disable_functions = pcntl_async_signals

from behat.

brandon-hargrave-cloudtec avatar brandon-hargrave-cloudtec commented on June 24, 2024

Sorry, I don't understand the argument to not implement this. How would checking if the function exists vary across platforms and distros? This is common practice in other packages already (monolog being one such example), and we are already checking for one of the functions. Whilse it is true that any function could be killed that way, it's only common practice and in some cases the default configuration (thecodingmachine/docker-images-php#168 is one example I found) to set the pcntl functions to disabled.

from behat.

uuf6429 avatar uuf6429 commented on June 24, 2024

Frankly both approaches described here feel wrong - you should just check for the pcntl extension, ideally via composer dependencies ("require": {"ext-pcntl": "*"}).

If you/users are mucking up the PHP install with disble_functions or worse (runkit, fake functions etc), it's kinda your/their fault.

(the docker image example was also doing it wrong IMO, which is why I guess they changed it later)

from behat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.