Git Product home page Git Product logo

Comments (2)

grmartin avatar grmartin commented on August 31, 2024

Let me start by saying...

  1. I know relatively little about browser-sync
  2. 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.

ekfuhrmann avatar ekfuhrmann commented on August 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.