Created
August 10, 2015 21:29
-
-
Save aganglada/2b46345402a78231bd6e to your computer and use it in GitHub Desktop.
Execute php script from casperjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var casp = require('casper').create({ | |
verbose: true, | |
logLevel: 'debug' | |
}); | |
casp.start().then(function() { | |
var finished = false; | |
var cp = require('child_process'); | |
cp.execFile('/usr/bin/php','test.php', {},function(_,stdout,stderr){ | |
console.log(stdout); | |
console.log(stderr); | |
finished = true; | |
}); | |
this.waitFor(function check(){ | |
return finished; | |
}, function then(){ | |
// can stay empty | |
}); | |
}).run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment