Comments (2)
Let me start by saying...
- I know relatively little about
browser-sync
- Directly. No.
However, you can cheat. Judging purely by the name of that variable you passed in i assume the wp
to stand for WordPress... WordPress as well as many PHP websites use Apache's (or equivalent in other environments) mod_rewrite
, PHP's dev server is SUPER simple and doesn't implement such a functionality... However it does permit you to roll your own basic compatibility layer...
You want to supply a router
command to connect.server
. This should be a relative path to a .php
file. Basically, PHP will invoke this file on EVERY CALL. You choose what to return as data (and set your own headers) or to include
in to that invocation of PHP for the request. This will allow you to examine $_SERVER['REQUEST_URI']
for a file without a .php
ending and include
/require
it if it exists... This will be invoked for EVERY call, that means resources too... so if it ends in an extension you will be responsible for outputting the Content-Type
header (http://php.net/manual/en/book.fileinfo.php
might help here... though i relied on Node's mime-db
module which i parsed via the JSON decoder because fileinfo wasnt available in all cases for the project i was on) as well as outputting the data (as simple as print file_get_contents($actualFilePath)
...
from gulp-connect-php.
Sorry about not clarifying that it was indeed relating to a Wordpress build. Thanks for the detailed writeup on how I could work around my issue. Unfortunately due to some other circumstances I can't go about syncing the files as I originally wanted for a localhost anyway, though what you provided was helpful for possible future work.
Thanks for the assistance.
from gulp-connect-php.
Related Issues (20)
- Port 8088 is already taken and the system does not start. HOT 1
- Closing sessions HOT 10
- Is this project still maintained? HOT 1
- Crash calling a batch under Windows HOT 4
- Crash when running version 1.0.0 HOT 11
- Doesn't Work In Gulp 4 HOT 9
- Cache with gulp-connect-php HOT 8
- Integration with Google Web Starter Kit
- Directory ../ does not exist. HOT 2
- Can't run server from custom bin directory HOT 4
- Opening/Closing a Gulp PHP session in an Electron build HOT 1
- Suggest: options-open an URL
- Allow more than one string for the base path HOT 1
- TypeError: connect.server is not a function HOT 11
- when opening php file chrome downloads it HOT 1
- Add functionality to pass command line args to PHP HOT 3
- Odd issue with server occasionally stopping completely HOT 3
- Limiting logs to errors only HOT 1
- Electron | Blank window after build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-connect-php.