php_process 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.5
data/lib/php_process.rb CHANGED
@@ -61,9 +61,13 @@ class Php_process
61
61
  @args[:on_err].call(str) if @args[:on_err]
62
62
  $stderr.print "Process error: #{str}" if @debug or @args[:debug_stderr]
63
63
 
64
- if str.match(/^PHP Fatal error: (.+)\s+/)
64
+ if str.match(/^PHP Fatal error: (.+)\s*/)
65
65
  @fatal = str.strip
66
+ elsif str.match(/^Killed\s*$/)
67
+ @fatal = "Process was killed."
66
68
  end
69
+
70
+ break if (!@args and str.to_s.strip.length <= 0) or (@stderr and @stderr.closed?)
67
71
  end
68
72
  end
69
73
 
@@ -316,6 +320,8 @@ class Php_process
316
320
  def start_read_loop
317
321
  @thread = Knj::Thread.new do
318
322
  @stdout.lines do |line|
323
+ break if line == nil or @stdout.closed?
324
+
319
325
  data = line.split(":")
320
326
  args = PHP.unserialize(Base64.strict_decode64(data[2].strip))
321
327
  type = data[0]
data/lib/php_script.php CHANGED
@@ -39,7 +39,7 @@ class php_process{
39
39
  $id = intval($data[1]);
40
40
  $args = unserialize(base64_decode($data[2]));
41
41
  if ($args === false){
42
- throw new exception("The args-data was not unserializeable: " . utf8_encode(base64_decode($data[2])));
42
+ throw new exception("The args-data was not unserializeable: " . base64_decode($data[2]));
43
43
  }
44
44
 
45
45
  try{
data/php_process.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{php_process}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: php_process
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="
128
128
  - !ruby/object:Gem::Version
129
- hash: -690325750737638364
129
+ hash: -1085351998058726147
130
130
  segments:
131
131
  - 0
132
132
  version: "0"