Git Product home page Git Product logo

Comments (9)

kristian avatar kristian commented on August 31, 2024 1

Worked for me on Windows, after putting the php executable on the PATH. It just gave me a hard time, as the error message when PHP is not installed was quite hard to understand. No issues on Gulp 4.0 though.

from gulp-connect-php.

grmartin avatar grmartin commented on August 31, 2024

@KITSDominicWhite so the official line would be "Gulp4 has not been released in a final form", but I hate it when people respond like that... so I'll do the best I can to assist.

Gulp 4 has a bunch of breaking differences from Gulp 3 one of which is that tasks are supposed to return a promise or implement the 'done parameter callback pattern'. Failure to do so will cause the task to timeout with that warning if it is being held open by anything it invoked internally.

An example of the 'done parameter callback pattern' would be:

var gulp = require('gulp'),
    connect = require('gulp-connect-php');
    
gulp.task('connect-sync', function(done) {
  connect.server({});
  // never invoking done should hold this task in a 'running' state
  // Gulp4 checks the param count on the supplied function and
  // if >= 1 waits indefinitely until a done() call is invoked.
});

gulp.task('default', gulp.series('connect-sync'));

Now, if for some reason you need this to hold until you are ready for it to complete... the following should work (Linux/Mac):

var gulp = require('gulp'),
    connect = require('gulp-connect-php');
    
gulp.task('connect-sync', function(done) {
  console.log(`Invoking gulp-connect-php on PID: ${process.pid}.`);

  connect.server({});

  // https://nodejs.org/api/process.html#process_signal_events
  // NOTE:
  // SIGINT might also work, that is sent when you issue CTRL+C
  // However there is a chance Gulp reacts to it or hides it internally.
  process.once('SIGUSR2', function() {
    console.log("Got SIGUSR2, invoking callback.");
    connect.closeServer();
    done();
  });
});

gulp.task('default', gulp.series('connect-sync'));

Now if you issue a signal via the command line:

kill -SIGUSR2 PID

That should tell the task to terminate.

(All of this is speculative, but it is what i'd try).

from gulp-connect-php.

grmartin avatar grmartin commented on August 31, 2024

@KITSDominicWhite any luck?

from gulp-connect-php.

 avatar commented on August 31, 2024

Sorry @grmartin I went on holiday for a few days. I have given the first one a try with a few variants of my own, and unfortunately I haven't been able to get it working.

I am going to dig a little deeper into it and see if I can get some more information / figure it out :)

from gulp-connect-php.

grmartin avatar grmartin commented on August 31, 2024

@KITSDominicWhite No worries! If i can assist or if you get it working, please let me know.

from gulp-connect-php.

kristian avatar kristian commented on August 31, 2024

+1 to this issue

from gulp-connect-php.

kirkbross avatar kirkbross commented on August 31, 2024

+1

from gulp-connect-php.

DRSDavidSoft avatar DRSDavidSoft commented on August 31, 2024

I have gulp-connect-php + browserSync working perfectly fine
using Gulp 4.0.0 + PHP 7.3.2 on Windows 10.
PHP.exe for me is on %PATH%.

Does this issue only occur on Linux / macOS?

from gulp-connect-php.

suprim12 avatar suprim12 commented on August 31, 2024

it stopped working after requiring database connection (db.php)

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.