Module: PHPVM

Defined in:
ext/php_vm/php_vm.c

Defined Under Namespace

Modules: PHPGlobal Classes: PHPClass, PHPError, PHPErrorReporting, PHPExceptionObject, PHPObject, PHPSyntaxError

Constant Summary collapse

VERSION =
rb_str_new2("1.3.10")

Class Method Summary collapse

Class Method Details

.define_globalObject



853
854
855
856
857
858
859
# File 'ext/php_vm/php_vm.c', line 853

VALUE rb_php_vm_define_global(VALUE cls)
{
  VALUE res1 = define_global_constants();
  VALUE res2 = define_global_functions();
  VALUE res3 = define_global_classes();
  return (res1==Qtrue && res2==Qtrue && res3==Qtrue) ? Qtrue : Qfalse;
}

.error_handlerObject



626
627
628
629
# File 'ext/php_vm/php_vm.c', line 626

VALUE rb_php_vm_get_error_handler(VALUE cls)
{
  return rb_cv_get(rb_mPHPVM, "@@error_handler");
}

.error_handler=(proc) ⇒ Object



631
632
633
634
635
636
637
638
# File 'ext/php_vm/php_vm.c', line 631

VALUE rb_php_vm_set_error_handler(VALUE cls, VALUE proc)
{
  if (proc!=Qnil && !rb_obj_is_kind_of(proc, rb_cProc)) {
    rb_raise(rb_eArgError, "proc is not proc object");
  }
  rb_cv_set(rb_mPHPVM, "@@error_handler", proc);
  return Qnil;
}

.exec(code) ⇒ Object



690
691
692
693
694
695
# File 'ext/php_vm/php_vm.c', line 690

VALUE rb_php_vm_exec(VALUE cls, VALUE code)
{
  TSRMLS_FETCH();
  php_eval_string(RSTRING_PTR(code), RSTRING_LEN(code), 0 TSRMLS_CC);
  return Qnil;
}

.get_class(v_class_name) ⇒ Object



697
698
699
700
# File 'ext/php_vm/php_vm.c', line 697

VALUE rb_php_vm_get_class(VALUE cls, VALUE v_class_name)
{
  return rb_php_class_get(rb_cPHPClass, v_class_name);
}

.include(filepath) ⇒ Object



678
679
680
681
682
# File 'ext/php_vm/php_vm.c', line 678

VALUE rb_php_vm_include(VALUE cls, VALUE filepath)
{
  TSRMLS_FETCH();
  return php_vm_require("include", filepath TSRMLS_CC);
}

.include_once(filepath) ⇒ Object



684
685
686
687
688
# File 'ext/php_vm/php_vm.c', line 684

VALUE rb_php_vm_include_once(VALUE cls, VALUE filepath)
{
  TSRMLS_FETCH();
  return php_vm_require("include_once", filepath TSRMLS_CC);
}

.output_handlerObject

module PHPVM



612
613
614
615
# File 'ext/php_vm/php_vm.c', line 612

VALUE rb_php_vm_get_output_handler(VALUE cls)
{
  return rb_cv_get(rb_mPHPVM, "@@output_handler");
}

.output_handler=(proc) ⇒ Object



617
618
619
620
621
622
623
624
# File 'ext/php_vm/php_vm.c', line 617

VALUE rb_php_vm_set_output_handler(VALUE cls, VALUE proc)
{
  if (proc!=Qnil && !rb_obj_is_kind_of(proc, rb_cProc)) {
    rb_raise(rb_eArgError, "proc is not proc object");
  }
  rb_cv_set(rb_mPHPVM, "@@output_handler", proc);
  return Qnil;
}

.require(filepath) ⇒ Object



666
667
668
669
670
# File 'ext/php_vm/php_vm.c', line 666

VALUE rb_php_vm_require(VALUE cls, VALUE filepath)
{
  TSRMLS_FETCH();
  return php_vm_require("require", filepath TSRMLS_CC);
}

.require_once(filepath) ⇒ Object



672
673
674
675
676
# File 'ext/php_vm/php_vm.c', line 672

VALUE rb_php_vm_require_once(VALUE cls, VALUE filepath)
{
  TSRMLS_FETCH();
  return php_vm_require("require_once", filepath TSRMLS_CC);
}