Giter VIP home page Giter VIP logo

exec-with-fallback's People

Contributors

rosell-dk avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

liquidmarble

exec-with-fallback's Issues

nocs/notes.md missing

Hi @rosell-dk,

I am using the Wordpress webp-express plugin, which includes this repository.
Since version 0.25.1 the wp-cli file sum check is failing because of a missing file, which results in a failing automated deploy script.

$ which wp
/usr/local/bin/wp
$ wp plugin verify-checksums webp-express 
+--------------+---------------------------------------------------+-----------------+
| plugin_name  | file                                              | message         |
+--------------+---------------------------------------------------+-----------------+
| webp-express | vendor/rosell-dk/exec-with-fallback/docs/notes.md | File is missing |
+--------------+---------------------------------------------------+-----------------+
Error: No plugins verified (1 failed).

Could you add the missing file again or update the webp-express plugin accordingly, please?

Rename the library?

Naming ideas:

Simply what it does:

  • ExecWithFallback
  • ExecOrSimilar
  • TryHarderExec / ExecTryHarder

The rat finds its way… And dont give up easily. Tries different ways

  • ExecRat / RatExec

Eller navngiv efter Wolfe, “the fixer” i Pulp Fiction - a no nonense charactor who gets the job done (with style)

  • WolfeExec / ExecWolfe

Nationality:

  • GermanExec
  • DanishExec

Material:

  • RubberExec
  • RubberbandExec

Other ideas:
StrongExec, ResilientExec, EmulatedExec, GoalOrientedExec, ExecContractor, ExecDeLuxe, DropInExec, BetterExec, ExecMaster, ExecDragon, CuteExec, PersistantExec, ToughExec, ExecWithFallback, AdaptableExec, CompliantExec, ImprovedExec, ResoluteExec, StautExec, ObstinateExec, KeenExec, AgileExec, Smooth, Flexible, ExecAndFriends, SturdyExex, ResilientExec

Make it possible to disable globally with constant or environment variable

It is possible (but very rare!) to configure PHP such that exec() is disabled, but it is impossible to find out from inside PHP.
We have met a system that behaved like this:

  • function_exists('exec') returns true
  • ini_get('disable_functions') is blank
  • is_callable('exec') returns true
  • calling exec('echo hi') results in a FATAL error (Uncatchable. Yes, register_shutdown_function() could be used, but it is no help)

So, for these poorly setup systems, lets provide some escape hatches. To disable disable exec, one should be able to do one of the following:

  • Set the "EXEC_WITH_FALLBACK_DISABLE_ALL" environment variable to "1"
  • Define a constant, "EXEC_WITH_FALLBACK_DISABLE_ALL" , setting it to true (define('EXEC_WITH_FALLBACK_DISABLE_ALL', true);)

We add the following in the top of our exec function:

        if (defined('EXEC_WITH_FALLBACK_DISABLE_ALL') && EXEC_WITH_FALLBACK_DISABLE_EXEC) {
            throw new \Exception('exec() is is disabled with EXEC_WITH_FALLBACK_DISABLE_ALL constant');
        }
        if (getenv('EXEC_WITH_FALLBACK_DISABLE_ALL')) {
            throw new \Exception('exec() is is disabled with EXEC_WITH_FALLBACK_DISABLE_ALL environment variable');
        }

shell_exec returns false

The shell_exec function is called with three parameters, even though Exec is invoked with just two. It causes it to return false.

  1. Exec() should be fixed, so it only passes two arguments to ShellExec::exec()
  2. ShellExec() should not just return false if passed 3 arguments, it should throw.

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.