1
- <?php
1
+ <?php
2
2
3
3
namespace XBase ;
4
4
5
- class Column
5
+ class Column
6
6
{
7
7
8
8
public $ name ;
@@ -18,10 +18,11 @@ class Column
18
18
protected $ bytePos ;
19
19
protected $ colIndex ;
20
20
21
- public function __construct ($ name , $ type , $ memAddress , $ length , $ decimalCount , $ reserved1 , $ workAreaID , $ reserved2 , $ setFields , $ reserved3 , $ indexed , $ colIndex , $ bytePos )
21
+ public function __construct ($ name , $ type , $ memAddress , $ length , $ decimalCount , $ reserved1 , $ workAreaID , $ reserved2 , $ setFields , $ reserved3 , $ indexed , $ colIndex , $ bytePos )
22
22
{
23
23
$ this ->rawname = $ name ;
24
- $ this ->name = (strpos ($ name , 0x00 ) !== false ) ? substr ($ name , 0 , strpos ($ name , 0x00 )) : $ name ;
24
+ $ needle = PHP_VERSION_ID >= 80000 ? "\0" : 0x00 ;
25
+ $ this ->name = (strpos ($ name , $ needle ) !== false ) ? substr ($ name , 0 , strpos ($ name , $ needle )) : $ name ;
25
26
$ this ->type = $ type ;
26
27
$ this ->memAddress = $ memAddress ;
27
28
$ this ->length = $ length ;
@@ -33,23 +34,23 @@ public function __construct($name, $type, $memAddress, $length, $decimalCount, $
33
34
$ this ->colIndex = $ colIndex ;
34
35
}
35
36
36
-
37
- public function getDecimalCount ()
37
+
38
+ public function getDecimalCount ()
38
39
{
39
40
return $ this ->decimalCount ;
40
41
}
41
-
42
- public function isIndexed ()
42
+
43
+ public function isIndexed ()
43
44
{
44
45
return $ this ->indexed ;
45
46
}
46
-
47
- public function getLength ()
47
+
48
+ public function getLength ()
48
49
{
49
50
return $ this ->length ;
50
51
}
51
-
52
- public function getDataLength ()
52
+
53
+ public function getDataLength ()
53
54
{
54
55
switch ($ this ->type ) {
55
56
case Record::DBFFIELD_TYPE_DATE : return 8 ;
@@ -59,48 +60,48 @@ public function getDataLength()
59
60
default : return $ this ->length ;
60
61
}
61
62
}
62
-
63
- public function getMemAddress ()
63
+
64
+ public function getMemAddress ()
64
65
{
65
66
return $ this ->memAddress ;
66
67
}
67
-
68
- public function getName ()
68
+
69
+ public function getName ()
69
70
{
70
71
return $ this ->name ;
71
72
}
72
-
73
- public function isSetFields ()
73
+
74
+ public function isSetFields ()
74
75
{
75
76
return $ this ->setFields ;
76
77
}
77
-
78
- public function getType ()
78
+
79
+ public function getType ()
79
80
{
80
81
return $ this ->type ;
81
82
}
82
-
83
- public function getWorkAreaID ()
83
+
84
+ public function getWorkAreaID ()
84
85
{
85
86
return $ this ->workAreaID ;
86
87
}
87
-
88
- public function toString ()
88
+
89
+ public function toString ()
89
90
{
90
91
return $ this ->name ;
91
92
}
92
-
93
- public function getBytePos ()
93
+
94
+ public function getBytePos ()
94
95
{
95
96
return $ this ->bytePos ;
96
97
}
97
-
98
- public function getRawname ()
98
+
99
+ public function getRawname ()
99
100
{
100
101
return $ this ->rawname ;
101
102
}
102
-
103
- public function getColIndex ()
103
+
104
+ public function getColIndex ()
104
105
{
105
106
return $ this ->colIndex ;
106
107
}
0 commit comments