Php find required extensions

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Library that find out the minimum version and the extensions required for a piece of code to run

License

llaville/php-compatinfo

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

PHP CompatInfo is a library that can find the minimum version and the extensions required for a piece of code to run.

Running on PHP greater or equal than 7.4 for parsing source code in a format PHP 5.2 to PHP 8.2

All the documentation is available on following websites generated from the docs folder.

  • Laurent Laville (Lead Dev)
  • Thanks to Nikita Popov who wrote a marvellous PHP Parser.
  • Thanks also to Remi Collet, a contributor of first hours.
  • Credits to Davey Shafik. He introduced his proposal in 2004, that gave birth of a PEAR package named PHP_CompatInfo.
Читайте также:  Html как указать стили

About

Library that find out the minimum version and the extensions required for a piece of code to run

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Finds PHP extensions required by code.

dg/php-extensions-finder

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

readme.md

PHP Extensions Finder for Composer

This tool finds which PHP extensions are required by source code.

It requires PHP 5.4.0 or newer.

Install it via Composer. This project is not meant to be run as a dependency, so install it as standalone:

composer create-project dg/php-extensions-finder 

Or install it globally via:

composer global require dg/php-extensions-finder 

and make sure your global vendor binaries directory is in your $PATH environment variable.

Do you like PHP Extensions Finder? Are you looking forward to the new features?

About

Finds PHP extensions required by code.

Источник

get_loaded_extensions

This function returns the names of all the modules compiled and loaded in the PHP interpreter.

Parameters

Only return Zend extensions, if not then regular extensions, like mysqli are listed. Defaults to false (return regular extensions).

Return Values

Returns an indexed array of all the modules names.

Читайте также:  Python string in hex format

Examples

Example #1 get_loaded_extensions() Example

The above example will output something similar to:

Array ( [0] => Core [1] => date [2] => libxml [3] => pcre [4] => sqlite3 [5] => zlib [6] => ctype [7] => dom [8] => fileinfo [9] => filter [10] => hash [11] => json [12] => mbstring [13] => SPL [14] => PDO [15] => session [16] => posix [17] => Reflection [18] => standard [19] => SimpleXML [20] => pdo_sqlite [21] => Phar [22] => tokenizer [23] => xml [24] => xmlreader [25] => xmlwriter [26] => gmp [27] => iconv [28] => intl [29] => bcmath [30] => sodium [31] => Zend OPcache )

See Also

  • get_extension_funcs() — Returns an array with the names of the functions of a module
  • extension_loaded() — Find out whether an extension is loaded
  • dl() — Loads a PHP extension at runtime
  • phpinfo() — Outputs information about PHP’s configuration

User Contributed Notes

  • PHP Options/Info Functions
    • assert_​options
    • assert
    • cli_​get_​process_​title
    • cli_​set_​process_​title
    • dl
    • extension_​loaded
    • gc_​collect_​cycles
    • gc_​disable
    • gc_​enable
    • gc_​enabled
    • gc_​mem_​caches
    • gc_​status
    • get_​cfg_​var
    • get_​current_​user
    • get_​defined_​constants
    • get_​extension_​funcs
    • get_​include_​path
    • get_​included_​files
    • get_​loaded_​extensions
    • get_​required_​files
    • get_​resources
    • getenv
    • getlastmod
    • getmygid
    • getmyinode
    • getmypid
    • getmyuid
    • getopt
    • getrusage
    • ini_​alter
    • ini_​get_​all
    • ini_​get
    • ini_​parse_​quantity
    • ini_​restore
    • ini_​set
    • memory_​get_​peak_​usage
    • memory_​get_​usage
    • memory_​reset_​peak_​usage
    • php_​ini_​loaded_​file
    • php_​ini_​scanned_​files
    • php_​sapi_​name
    • php_​uname
    • phpcredits
    • phpinfo
    • phpversion
    • putenv
    • set_​include_​path
    • set_​time_​limit
    • sys_​get_​temp_​dir
    • version_​compare
    • zend_​thread_​id
    • zend_​version
    • get_​magic_​quotes_​gpc
    • get_​magic_​quotes_​runtime
    • restore_​include_​path

    Источник

    Check for required PHP extensions with Composer

    Thanks to creation the Composer PHP Dependency manager, using and managing 3rd party libraries has become a breeze. Gone are the days of committing dependencies and manually keeping things up to date. Additionally using Composer removes the possibility of someone making changes to a 3rd party library and committing it. Don’t do it! Recently I began adding Composer to some of my legacy projects and refactoring dependencies like PHPMailer over to Swiftmailer. Also thanks to PHP 5.4 and its built in web server reformatting things to make development easier. Throughout a projects lifecycle I may work on multiple different systems. Maybe my laptop when working on-site or my own using Windows or Linux. The awesomeness of being able to run php composer.phar install after updating my sources just makes me smile.

    That brings me to today and preparing to deploy a new Linode instance. After provisioning my new server, grabbing the sources and running the Composer install I sat back, put my feet up on the desk and thought life is just grand.

    Houston we have a problem

    Roughly 30 minutes later I get a notification from NewRelic informing me that my error rate is at 10%, Doh! So back to the server logs to see what’s up and find.

    PHP Fatal error: Class 'Imagick' not found

    Well that explains things. Just need to install the PHP Imagick module and we are back in business. But how can I make sure this doesn’t happen again? I could configure a build system using Phing or Ant, or just write a bash build script to automate it in the future. Both would work abet be overkill for the scope of the project. That’s when I turned to composer and found information on Platform packages.

    Composer Platform Packages

    Composer has platform packages, which are virtual packages for things that are installed on the system but are not actually installable by Composer. This includes PHP itself, PHP extensions and some system libraries.

    Woo hoo! That’s exactly what I was looking for. To validate the availability of PHP extensions, all that is needed is to preface its name with ext- and add it to the requre section of the package.json file.

    Example

     "name": "composer/example", "require":  "php": ">=5.4.0", "swiftmailer/swiftmailer": "5.3.0", "ext-imagick": "*" > >

    Note: Notice the specified version is set to *. The Composer docs state that:

    Versioning can be quite inconsistent here, so it’s often a good idea to just set the constraint to *.

    Testing it out

    Now to test I locally removed the imagick extension and ran composer again which returned:

    Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested PHP extension ext-imagick * is missing from your system.

    Conclusion

    With that in place now I can track these dependencies in the future. It would be nice to have it handle the installation of the missing extensions but at least knowing makes things a whole lot easier.

    My name is Dwayne Maye and welcome to my blog. As a long time LAMP developer, graphics designer and web consultant I have a solid the belief that the message, design and functionality are all equally important.

    Источник

Оцените статью