php_vm 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/php_vm/version.rb +3 -0
- data/lib/php_vm.rb +5 -0
- metadata +3 -7
- data/sample/class.rb +0 -57
- data/sample/exec.rb +0 -6
- data/sample/exec_raise_exception.rb +0 -10
- data/sample/require.php +0 -3
- data/sample/require.rb +0 -6
- data/sample/version.rb +0 -6
data/lib/php_vm.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: php_vm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -26,12 +26,8 @@ files:
|
|
26
26
|
- ext/php_vm_v2z.h
|
27
27
|
- ext/php_vm_z2v.c
|
28
28
|
- ext/php_vm_z2v.h
|
29
|
-
-
|
30
|
-
-
|
31
|
-
- sample/exec_raise_exception.rb
|
32
|
-
- sample/require.php
|
33
|
-
- sample/require.rb
|
34
|
-
- sample/version.rb
|
29
|
+
- lib/php_vm.rb
|
30
|
+
- lib/php_vm/version.rb
|
35
31
|
homepage: ''
|
36
32
|
licenses: []
|
37
33
|
post_install_message:
|
data/sample/class.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
$LOAD_PATH << File.expand_path(__FILE__+"/../../ext/")
|
4
|
-
require "php_vm"
|
5
|
-
|
6
|
-
PHPVM.exec <<EOS
|
7
|
-
class HelloClass
|
8
|
-
{
|
9
|
-
public function __construct($name)
|
10
|
-
{
|
11
|
-
$this->name = $name;
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
// instance
|
16
|
-
|
17
|
-
public function instanceGetHello()
|
18
|
-
{
|
19
|
-
return "Hello {$this->name}!!";
|
20
|
-
}
|
21
|
-
|
22
|
-
public function instanceSayHello()
|
23
|
-
{
|
24
|
-
var_dump($this->instanceGetHello());
|
25
|
-
}
|
26
|
-
|
27
|
-
|
28
|
-
// static
|
29
|
-
|
30
|
-
public static function classGetHello($name)
|
31
|
-
{
|
32
|
-
return "Hello {$name}!!";
|
33
|
-
}
|
34
|
-
|
35
|
-
public static function classSayHello($name)
|
36
|
-
{
|
37
|
-
var_dump(self::classGetHello($name));
|
38
|
-
}
|
39
|
-
}
|
40
|
-
EOS
|
41
|
-
|
42
|
-
HelloClass = PHPVM::getClass("HelloClass")
|
43
|
-
|
44
|
-
puts "[class]"
|
45
|
-
puts HelloClass
|
46
|
-
puts HelloClass.name
|
47
|
-
puts ""
|
48
|
-
|
49
|
-
puts "[instance method]"
|
50
|
-
h = HelloClass.new("instance world")
|
51
|
-
h.instanceSayHello
|
52
|
-
p h.instanceGetHello
|
53
|
-
puts ""
|
54
|
-
|
55
|
-
puts "[class method]"
|
56
|
-
HelloClass.classSayHello("class world")
|
57
|
-
p HelloClass.classGetHello("class world")
|
data/sample/exec.rb
DELETED
data/sample/require.php
DELETED
data/sample/require.rb
DELETED