Download the PHP package mbence/livephp-bundle without Composer
On this page you can find all versions of the php package mbence/livephp-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mbence/livephp-bundle
More information about mbence/livephp-bundle
Files in mbence/livephp-bundle
Package livephp-bundle
Short Description LivePHP Bundle for Symfony2
License MIT
Homepage https://github.com/mbence/LivePHPBundle
Informations about the package livephp-bundle
LivePHPBundle for Symfony
LivePHP will save developers time by automatically refreshing the browser when a file is changed in the working directory.
Description
This bundle was written to make developers' life easier. Inspired by the brilliant live.js (written by Martin Kool), this script will auto refresh your browser if you change any files in your working directory. No need for Alt-Tab and manual refresh anymore.
With this script, it is also very easy to check your work in many browsers simultaneously. Just load the site in all your browsers or devices and the rest goes automatically.
WARNING!
You should never activate this on a live server! It is meant for developer environment only!
Prerequisites
This bundle requires Symfony2.
Installation
Step 1: Download the bundle using composer
Add the following in your composer.json:
Then download / update by running the command:
Composer will install the bundle to your project's vendor/mbence/livephp-bundle
directory.
Step 2: Enable the bundle in your AppKernel
It is strongly recommended that you never use this script on a live site, so it's best to add the bundle only for the dev environment.
Step 3: Import LivePHP routing files
Add this to your routing_dev.yml file:
Step 4: Include the livephp.js in your templates
Livephp.js must be loaded on every page you want to work with, so a layout template file is a good place to add the following:
Now LivePHP is ready. You can open one of your pages in a browser and if you edit and save a file in your project, the browser will automatically refresh and show the new contents.
Optional Steps
Configure LivePHP
You can set many options in LivePHP, including what directories to monitor or ignore, by adding the following configuration to your config_dev.yml
:
By default LivePHP will monitor the app
, src
and web
directories and it will ignore the logs
and cache
directories.
You can also set the time limit - how long a monitor worker should run in the background. Default is 125 sec. LivePHP will try to use this value,
but if it cant set the timeout for some reason it will fall back to your servers settings, and work just fine.
New feature since v1.2: With the cssonthefly
you can enable or disable css refresh without reloading the page. By default this is enabled.
If your app requires authentication, you should add LivePHP to your firewall rules:
The front controller name in js
The app_dev.php
front controller is hardcoded in livephp.js
. If you use a different filename, you should update it in the line 17: