Download the PHP package spatie/7to5 without Composer

On this page you can find all versions of the php package spatie/7to5. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 7to5

This package has been abandoned

We are not maintaining this package any more. Feel free to fork our code and maintain your own copy.

Convert PHP 7.0 code to PHP 5 code

Latest Version on Packagist Build Status Quality Score Total Downloads

This package can convert PHP 7.0 code to PHP 5. This can be handy when you are running PHP 7 in development, but PHP 5 in production.

You can convert an entire directory with PHP 7.0 code with a the console command:

Here's an example of what it can do. It'll convert this code with PHP 7 features:

to this equivalent PHP 5 code:

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Installation

If you plan on use the console command we recommend installing the package globally:

If you want to integrate the package in your own code require the package like usual:

The conversion process

This package converts PHP 7 code to equivalent PHP 5 code by:

Because there are a lot of things that cannot be detected and/or converted properly we do not guarantee that the converted code will work. We highly recommend running your automated tests against the converted code to determine if it works.

Using the console command

This package provides a console command php7to5 to convert files and directories.

This is how a entire directory can be converted:

Want to convert a single file? That's cool too! You can use the same command.

By default the command will only copy over php-files. Want to copy over all files? Use the copy-all option:

By default the command will only convert files with a php extension, but you can customize that by using the --extension option.

If necessary, you can exclude directories / files.

Programmatically convert files

You can convert a single file by running this code:

An entire directory can be converted as well:

By default this will recursively copy all to files to the destination directory, even the non php files.

If you only want to copy over the php files do this:

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

Original idea: Jens Segers

Support us

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License

The MIT License (MIT). Please see License File for more information.


All versions of 7to5 with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|^7.0|^7.1
nikic/php-parser Version ^3.0
illuminate/support Version ~5.2.0|~5.3.0
symfony/console Version ^3.0|^4.0
symfony/finder Version ^3.0|^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spatie/7to5 contains the following files

Loading the files please wait ....