Download the PHP package sitroz/laravel-legacy-bridge without Composer

On this page you can find all versions of the php package sitroz/laravel-legacy-bridge. 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 laravel-legacy-bridge

laravel-legacy-bridge ( LaraBridge )

This package allows you to use all the familiar and powerful functionality of laravel as a library for an existing project.

Possibilities

Requirements

Usage

Suppose your project is located in the /path1/path2/my-project directory. Follow these steps:

  1. Install Laravel next to your project, for example in the /path1/path2/laravel directory. The name of the folder containing Laravel does not matter.

  2. Install and configure the laravel-legacy-bridge package using Composer in /path1/path2/laravel.

  3. Create a file /path1/path2/my-project/bridgeExample.php with the following content:

  4. You can include bootstrap/init.php in any file.

To make this more elegant and maintainable, we recommend to define a LARAVEL_INIT constant equal to path/to/bootstrap/init.php and add it to the global PHP constants. Then your bridgeExample.php will be like:

Installation

Here we suppose you have a laravel installation. If laravel is not installed, start from the topic before.

  1. Install the package via composer

  2. Then run the register-script.php to register the LaraBridgeServiceProvider in the config app.php

    or place service provider to your app.providers config

  3. Run the artisan command to embed the code into the standard files and push other files

  4. Open config/laraBridge.php file and set your old boot files or other parameters as you wish

  5. Include .../laravel/bootstrap/init.php file in any php file outside the Laravel folder You can also include your boot file in the LaraBridge configuration and include init.php to your boot file, protection against recursive includes is configured here.

UNINSTALL

  1. Run artisan remove command and remove package in auto mode or follow the instructions if there is any issues.

  2. Remove LaraBridgeServiceProvider::class from app.providers config
  3. Remove package via composer

Error Handling

By default, laravel handles exceptions and render an exception-page. But if you are not sure that your application is 100% stable and work without errors/warnings/etc. , then it is recommended to disable this behavior so that the application does not break by using laravel.

Important: you can disable error handling only for HTTP requests, CLI-scripts behaviour won't be changed.

For example:

So the smthImportant won't be done.

Disabling

To solve it you can disable that by setting config parameter laraBridge.handling_exceptions.disabled to TRUE. In this case you will see a warning and smthImportant be done.

Enable Parameter

However, if you want to use an ErrorHandler, you can choose the name and the secret in laraBridge.handling_exceptions.enable_param config. Then you can enable handler for a single request you do.

Param usage: http://example.com/index.php?name=secret

To protect it from unauthorized use, you can control the configuration value from the ServiceProviders.

Using laravel router to handle your requests.

LaraBridge provides the ability to handle HTTP requests to any files through a laravel router if you set laraBridge.use_router to True.

How it works

When router is turned on, laravel will try to find matching route. In success case Router will handle request, send a response just after "include .../init.php" and will be finished.

Mismatch with registered routes not cause any errors/exceptions. The script will continue it's work properly as usual.

There is an extra option rewrite_path_info. When it sets to True the path from domain to filename will be added to router path. The exception to this rule is the index.php file: the /index.php substring will be ignored.

Routing examples table

URL to file with included init.php Default Router Path Router path with 'rewrite_path_info' option
example.com/index.php / /
example.com/index.php/p1/p2 /p1/p2 /p1/p2
example.com/test.php / /test
example.com/test.php/p1/p2 /p1/p2 /test/p1/p2
example.com/dir1/dir2/index.php / /dir1/dir2
example.com/dir1/dir2/index.php/p1/p2 /p1/p2 /dir1/dir2/p1/p2
example.com/dir1/dir2/page.php / /dir1/dir2/page
example.com/dir1/dir2/page.php/p1/p2 /p1/p2 /dir1/dir2/page/p1/p2

TODO

Contribution to the project

Your contribution is welcome! Please send pull requests and create issues to improve this package.

License

This project is licensed under MIT terms. Details can be found in the LICENSE file.


All versions of laravel-legacy-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ~5.6
laravel/framework Version ^5.4
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 sitroz/laravel-legacy-bridge contains the following files

Loading the files please wait ....