Update of /cvsroot/binaryphp/binaryphp
In directory sc8-pr-cvs1:/tmp/cvs-serv12905
Modified Files:
functions.php php_var.cpp testfile.php
Log Message:
Added *dir() functions, and prototypes of the socket_*() functions. Fixed oodles of bugs in tokenflow.php
Index: functions.php
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/functions.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** functions.php 2 Aug 2003 04:05:53 -0000 1.31
--- functions.php 2 Aug 2003 04:23:48 -0000 1.32
***************
*** 41,47 ****
'rtrim' => array(null, 'rtrim.cpp'),
'ltrim' => array(null, 'ltrim.cpp'),
'opendir' => array(array('cstdio', 'dirent.h'), 'opendir.cpp'),
'readdir' => array(array('cstdio', 'dirent.h'), 'readdir.cpp'),
! 'closedir' => array(array('cstdio', 'dirent.h'), 'closedir.cpp')
);
?>
--- 41,58 ----
'rtrim' => array(null, 'rtrim.cpp'),
'ltrim' => array(null, 'ltrim.cpp'),
+ 'mysql_connect' => array('mysql/mysql.h', array('mysql.cpp', 'array.cpp', 'explode.cpp', 'mysql_connect.cpp'), 'mysqlclient'),
+ 'mysql_select_db' => array('mysql/mysql.h', array('mysql.cpp', 'mysql_select_db.cpp'), 'mysqlclient'),
+ 'mysql_query' => array('mysql/mysql.h', array('mysql.cpp', 'mysql_query.cpp'), 'mysqlclient'),
+ 'mysql_fetch_row' => array('mysql/mysql.h', array('mysql.cpp', 'mysql_fetch_row.cpp'), 'mysqlclient'),
+ 'mysql_fetch_array' => array('mysql/mysql.h', array('mysql.cpp', 'mysql_fetch_array.cpp'), 'mysqlclient'),
+ 'mysql_error' => array('mysql/mysql.h', array('mysql.cpp', 'mysql_error.cpp'), 'mysqlclient'),
+ 'socket_create' => array('sys/socket.h', 'socket_create.cpp'),
+ 'socket_connect' => array(array('sys/socket.h', 'netinet/in.h', 'arpa/inet.h', 'netdb.h'), 'socket_connect.cpp'),
+ 'socket_write' => array('unistd.h', 'socket_write.cpp'),
+ 'socket_read' => array(null, 'socket_read.cpp'),
'opendir' => array(array('cstdio', 'dirent.h'), 'opendir.cpp'),
'readdir' => array(array('cstdio', 'dirent.h'), 'readdir.cpp'),
! 'closedir' => array(array('cstdio', 'dirent.h'), 'closedir.cpp'),
! null
);
?>
Index: php_var.cpp
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/php_var.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** php_var.cpp 30 Jul 2003 14:28:16 -0000 1.17
--- php_var.cpp 2 Aug 2003 04:23:48 -0000 1.18
***************
*** 8,11 ****
--- 8,14 ----
#define PHP_ARRAY 4
#define PHP_RESOURCE 5
+ #define PHP_OBJECT 6
+
+ class test;
char* intstring(long i)
***************
*** 24,27 ****
--- 27,36 ----
container = "";
}
+ /* php_var(void *ptr)
+ {
+ res = ptr;
+ type = PHP_OBJECT;
+ obj_type = &test;
+ } */
php_var(const char* str)
{
***************
*** 293,297 ****
bool operator==(const char* cmp)
{
! if(container.compare(cmp))
return true;
return false;
--- 302,306 ----
bool operator==(const char* cmp)
{
! if(container.compare(cmp) == 0)
return true;
return false;
***************
*** 374,377 ****
--- 383,390 ----
}
}
+ // test* operator->()
+ // {
+ // return (test *) res;
+ // }
friend ostream &operator<<( ostream &out, const php_var &var );
void to_array()
***************
*** 383,386 ****
--- 396,400 ----
vector<php_var> data;
void *res;
+ void *obj_type;
int res_type;
int type; // Contains current type.
Index: testfile.php
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/testfile.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** testfile.php 2 Aug 2003 04:05:53 -0000 1.39
--- testfile.php 2 Aug 2003 04:23:48 -0000 1.40
***************
*** 1,8 ****
<?php
! $file = '';
! $d = opendir('/home/amaranth/public_html/binaryphp');
! while($file = readdir($d))
! echo $file, "\n";
!
! //closedir($d);
?>
--- 1,19 ----
<?php
! $var = socket_create(AF_INET, SOCK_STREAM, 0);
! if($var == false)
! echo "Couldn't create.";
! if(socket_connect($var, 'irc.freenode.net', 6667) == false)
! echo "Couldn't connect.\n";
! $buf = true;
! while($buf != false)
! {
! $buf = socket_read($var, 1024);
! echo $buf;
! }
! if(socket_write($var, "USER daek daek daek :daek\r\n") == false)
! echo "Couldn't write. 1\n";
! if(socket_write($var, "NICK Daek\r\n") == false)
! echo "Couldn't write. 2\n";
! if(socket_write($var, "JOIN #phpfreaks\r\n") == false)
! echo "Couldn't write. 3\n";
?>
|