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.
@@ -0,0 +1,3 @@
1
+ module PHPVM
2
+ VERSION = "1.0.1"
3
+ end
data/lib/php_vm.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "php_vm/version"
2
+
3
+ module PHPVM
4
+ # Your code goes here...
5
+ end
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.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
- - sample/class.rb
30
- - sample/exec.rb
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
@@ -1,6 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- $LOAD_PATH << File.expand_path(__FILE__+"/../../ext/")
4
- require "php_vm"
5
-
6
- PHPVM.exec('echo "Hello world!!\n";')
@@ -1,10 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- $LOAD_PATH << File.expand_path(__FILE__+"/../../ext/")
4
- require "php_vm"
5
-
6
- begin
7
- PHPVM.exec("throw new Exception('throw exception!!');")
8
- rescue PHPVM::PHPError => e
9
- puts "#{e.php_class.name}: #{e}"
10
- end
data/sample/require.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
-
3
- echo "Hello world!!\n";
data/sample/require.rb DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- $LOAD_PATH << File.expand_path(__FILE__+"/../../ext/")
4
- require "php_vm"
5
-
6
- PHPVM.require(File.expand_path(__FILE__+"/../require.php"))
data/sample/version.rb DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- $LOAD_PATH << File.expand_path(__FILE__+"/../../ext/")
4
- require "php_vm"
5
-
6
- puts PHPVM::VERSION