1
0
mirror of https://github.com/deuill/go-php.git synced 2024-09-21 00:40:45 +00:00

Remove deprecated value bindings.

This commit is contained in:
Alex Palaistras 2015-09-19 22:19:27 +01:00
parent 403a114ef2
commit 44909ebb7f
3 changed files with 0 additions and 67 deletions

View File

@ -1,5 +0,0 @@
#include "value.h"
void value_destroy(void *val) {
zval_dtor((zval *) val);
}

View File

@ -1,53 +0,0 @@
package php
// #include "value.h"
import "C"
import (
"fmt"
"reflect"
"runtime"
"unsafe"
)
type Value struct {
val unsafe.Pointer
kind reflect.Kind
}
func (v *Value) Int() int64 {
return 0
}
func (v *Value) Float() float64 {
return 0.0
}
func (v *Value) Bool() bool {
return false
}
func (v *Value) String() string {
return ""
}
func (v *Value) Kind() reflect.Kind {
var k reflect.Kind = reflect.String
return k
}
func NewValue(ptr unsafe.Pointer) (*Value, error) {
if ptr == nil {
return nil, fmt.Errorf("Attempted to initialize value with nil pointer")
}
val := &Value{
val: ptr,
}
runtime.SetFinalizer(val, func(v *Value) {
C.value_destroy(v.val)
})
return val, nil
}

View File

@ -1,9 +0,0 @@
#ifndef VALUE_H
#define VALUE_H
/* PHP includes */
#include <zend.h>
void value_destroy(void *val);
#endif