RE: [PHP-DEV] PHP Compile errors

2002-10-04 Thread Emanuel Dejanu


Thanks Markus,

I have succeed to compile the PHP and also my extension.

Best regards,

Emanuel Dejanu

 -Original Message-
 From: Markus Fischer [mailto:[EMAIL PROTECTED]]
 Sent: 3 octombrie 2002 16:57
 To: Emanuel Dejanu
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] PHP Compile errors
 
 
 You need to make the include and lib directories from
 http://www.php.net/extra/win32build.zip to be available in
 your MSVC environment.
 
 On Thu, Oct 03, 2002 at 04:12:38PM +0200, Emanuel Dejanu wrote : 
  
  Hi,
  
  I want to compile PHP 4.2.3 on Windows 2000 but I get
  the following errors:
  
  php_fopen_wrapper.c
  ..\main\php_network.h(28) : fatal error C1083: Cannot open 
 include file:
  'arpa/inet.h': No such file or directory
  
  
  VC++ 6.0 SP5
  
  I get this also with php4-200210030600
  
  Best regards,
  
  Emanuel Dejanu
  
  
  -- 
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
 rei_ Derick, while ($xml) $ass-get_new_ideas();
 [James] Markus: IE on_user_fart()
 -- People doesn't seem to like the new XHTML2 specs :) --
 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] PHP Extension on Win32

2002-10-03 Thread Emanuel Dejanu


Hi Markus,

Thanks for the response. I want to know the impact on the performance.
I will have ~1500 of definitions or I will have 10 classes from
which 2 have ~500 variabiles.


 -Original Message-
 From: Markus Fischer [mailto:[EMAIL PROTECTED]]
 Sent: 3 octombrie 2002 14:43
 To: Emanuel Dejanu
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] PHP Extension on Win32
 
 
 On Thu, Oct 03, 2002 at 01:28:52PM +0200, Emanuel Dejanu wrote : 
  I want to make a DLL private (closed source)
  to be available in PHP language.
  Is there any documentation on how to build a
  custom module for PHP on Windows? I have developed
  modules for PHP on Linux (closed source :-( ).
 
 Try http://www.php.net/manual/en/zend.php for a start.
  
  Also my DLL has 10 enumerations out of which 2 enumerations
  have ~500 elemenents. What is the best way to export
  these enumerations in PHP?
  I have been thinking about two solutions:
  1) definitions, e.g. define('kS', 1)
  2) classes, e.g.
  
  class S {
  var $k = 1;
  };
 
 I think this depends upon you and the needs you try to
 satisfy with your extension.
 
 -- 
 GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
 rei_ Derick, while ($xml) $ass-get_new_ideas();
 [James] Markus: IE on_user_fart()
 -- People doesn't seem to like the new XHTML2 specs :) --
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] PHP Compile errors

2002-10-03 Thread Emanuel Dejanu


Hi,

I want to compile PHP 4.2.3 on Windows 2000 but I get
the following errors:

php_fopen_wrapper.c
..\main\php_network.h(28) : fatal error C1083: Cannot open include file:
'arpa/inet.h': No such file or directory


VC++ 6.0 SP5

I get this also with php4-200210030600

Best regards,

Emanuel Dejanu


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] How do I access a hash from an extention/module?

2002-06-06 Thread Emanuel Dejanu

I think that the best will be that somebody with a hole experience in
PHP internals to write a book, I will sure buy it.

Best regards,

Emanuel Dejanu

-Original Message-
From: Eric Veldhuyzen [mailto:[EMAIL PROTECTED]]
Sent: 6 iunie 2002 16:59
To: Markus Fischer
Cc: fabwash; Eric Veldhuyzen; [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] How do I access a hash from an extention/module?


On Thu, Jun 06, 2002 at 03:45:08PM +0200, Markus Fischer wrote:
 On Thu, Jun 06, 2002 at 09:36:29AM -0400, fabwash wrote :
   It would be nice it there was some REAL documentation about the API...
  
  Amen to that!!!.. I spent exactely 5 1/2 hours yesterday trying to
create a
  resource that is a structure which contains a set of pointers to an
array of
  objects (yeah it's complicated but it's great when it works !), then
later
  retrieve the array, walk throught it, get the objects back from the
hash,
  and do something with them.
 
  Works fine for now (although i'm sure i have major memory leaks for now
  because i'm not sure how to deallocate and when to do it, when to add
  references and remove references), but some documentation would have
reduced
  my research, trial and error, multiple compilations, tests, other source
  reading, debugging time, etc..
 
  I get great help from people here on specific issues, but i'd rather
read
  some documentation before asking stupid questions.

 Actually, there is: http://www.php.net/manual/en/zend.php

I've read that. Multiple times. But it is hardly anything close to real
documentation. Claiming that this is real documentation is like explaining
how to write a 'hello world' program in C is real documateion about how
to write real programs in C. It is a nice primer, but nothing more than
that. It explains how to werite a VERY basic extention and then stops.

Not my idea of real documentation.

I would settle for a small summary of all the functions one might want
to call, with a short description of its function and the parameters it
acceepts. That would be terrific.

 I've seen quite a few people in the last months writing
 extenions and therefore they know how it is for a
 newcommer. Yet no one asked if he can help out with the
 documentation.

To write documentation you first have to know how it works. And I am
nowhere near that. I have written some code that seems to work, but
since none of tha parameters are described and there is hardly any
comment in de PHP source code it is very hard to be able to understand
how it all works.

--
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_$;`

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] CLI max_execution_time

2002-03-26 Thread Emanuel Dejanu


I try to make Linux programmers to change where they
keep users configuration from $HOME to $HOME/.settings.
In this way the users home will be clean.

Please do not make a war from this suggestion, a simple
yes or no is enough.

Best regards,

Emanuel

-Original Message-
From: Martín Marqués [mailto:[EMAIL PROTECTED]]
Sent: 26 martie 2002 16:20
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] CLI  max_execution_time


On Mar 26 Mar 2002 00:46, you wrote:
 ** Reply to note from Rasmus Lerdorf [EMAIL PROTECTED] Tue, 26 Mar 2002
 01:41:59 -0800 (PST)

   Complete agree here. This is the sensible thing to do, albeit
   somehow aethetically disturbing. :-)
 
  Depends how you look at it. To me, this is a PHP script:
 
  Hello World
 
  Unlike any other scripting language, PHP gets out of the way of the
  most common operation, that of outputting stuff. It also means that
  PHP has the absolute shortest and simplest Hello World you can have.

 Please don't change this.  I have a number of scripts that use this
 feature to great advantage.

Didn't someone mention it been configurable? .php or .phprc or what ever.

Saludos... :-)

--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] _POST -- HTTP_POST_VARS (refrences!!! not)

2002-01-22 Thread Emanuel Dejanu


Hi,

I have recently installed PHP 4.1.1 and I found
that _POST is not a reference of HTTP_POST_VARS
but a copy. I think that it should be reference.


Here is a reply to one of my old message in which
Yasuo Ohgaki wrote: 
 $_SEERVER, etc are reference of $HTTP_*_VARS. 
 I think this should be noted *obvious* place when 4.1.0 is 
 released :) 
http://www.zend.com/lists/php-dev/200112/msg00376.html

A simple script for prove:

?php

function func_change($value, $key)
{
if (is_string($value)) {
$value = '***'.$value;
}
}

echo('PRE');
echo('HTTP_GET_VARS before: '); print_r($HTTP_GET_VARS);
echo('_GET before: '); print_r($_GET);

reset($HTTP_GET_VARS);
array_walk($HTTP_GET_VARS, 'func_change');
reset($HTTP_GET_VARS);

echo('HTTP_GET_VARS after: '); print_r($HTTP_GET_VARS);
echo('_GET after: '); print_r($_GET);

echo('/PRE');
?


call it as:
/testsuperglobals.php?x=lalala=1b=dkdkkd

and you will see this:

HTTP_GET_VARS before: Array
(
[x] = lalal
[a] = 1
[b] = dkdkkd
)
_GET before: Array
(
[x] = lalal
[a] = 1
[b] = dkdkkd
)
HTTP_GET_VARS after: Array
(
[x] = ***lalal
[a] = ***1
[b] = ***dkdkkd
)
_GET after: Array
(
[x] = lalal
[a] = 1
[b] = dkdkkd
)





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP Documentation

2002-01-22 Thread Emanuel Dejanu


Hi,

Do you know how can I ($PHP_SELF :) compile the
PHP documentation in Windows HTML Help format?
Any guide line?

Best regards,

Emanuel Dejanu


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] Re: PHP Documentation

2002-01-22 Thread Emanuel Dejanu


I know that... I want to make my own manual.
Include some function that I have done and
that PHP Group will never include in PHP distribution.

Now I get the phpdoc cvs and I will look into the sources
to see all the hidden goodies.

Emanuel


-Original Message-
From: J Smith [mailto:[EMAIL PROTECTED]]
Sent: 22 ianuarie 2002 17:33
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] Re: PHP Documentation



The PHP documentation is already available in Windows help format. (The new
HTML-ish kind, I believe.) See http://www.php.net/download-docs.php.

J


Emanuel Dejanu wrote:


 Hi,

 Do you know how can I ($PHP_SELF :) compile the
 PHP documentation in Windows HTML Help format?
 Any guide line?

 Best regards,

 Emanuel Dejanu


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Shared extension

2002-01-10 Thread Emanuel Dejanu


Hi,

I have switch to 4.1.1 from 4.0.6 my extension is
not compiled any more as a shared library (myext.so).

I use the following (build as apache sapi)
./configure --enable-myext=shared ...(rest of conf params)

after make; make install I found in the extension directory
myext.a but not file named myext.so?!!!

How can I activate my extension as a shared module.
The Apache server is working fine but I can not use my module.

Emanuel

NOTE: I have add the new changes for the versions. The module
is compile fain, without errors (and without warrnings) but
the build do not do the .so file only the .o, .a, .la, .lo file.

NOTE: I have SuSE Linux 7.1, 2.2.18-SMP, i686, libc.so.6
libtool  1.4.2
gcc  2.95.2
autoconf 2.13
flex 2.5.4
apache   1.3.22







-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] Shared extension

2002-01-10 Thread Emanuel Dejanu


No is not working for me.
What version of libtool do you have?

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 10 ianuarie 2002 16:34
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] Shared extension


I've no problems with 4.1.1
I configure my php with  this:
./configure --enable-tpl=yes

after make i the ext/tpl I've the tpl.so   . In the start of the tpl
development I used two other commands to compile the module
independently from the php module. Never used the apache's sapi only cgi
binary shell.
Also there are some changes in the way the extension is wriiten for 4.1.x
but I think you know that stuff already.


Mandrake 8.1 (native  vmware)



Regards,
Andrey Hristov

P.S.
1)For development purposes I wrote two .sh scripts. One to compile the
module and copy it to a directory with long name (LIKE
'%non-zts-debug%).
and second to execute a test with the newly compiled binary.
2)The two commands I stole from the book Web Development with PHP. They
can be found here :
http://bg2.php.net/manual/bg/zend.creating.php


- Original Message -
From: Emanuel Dejanu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 4:12 PM
Subject: [PHP-DEV] Shared extension



 Hi,

 I have switch to 4.1.1 from 4.0.6 my extension is
 not compiled any more as a shared library (myext.so).

 I use the following (build as apache sapi)
 ./configure --enable-myext=shared ...(rest of conf params)

 after make; make install I found in the extension directory
 myext.a but not file named myext.so?!!!

 How can I activate my extension as a shared module.
 The Apache server is working fine but I can not use my module.

 Emanuel

 NOTE: I have add the new changes for the versions. The module
 is compile fain, without errors (and without warrnings) but
 the build do not do the .so file only the .o, .a, .la, .lo file.

 NOTE: I have SuSE Linux 7.1, 2.2.18-SMP, i686, libc.so.6
 libtool  1.4.2
 gcc  2.95.2
 autoconf 2.13
 flex 2.5.4
 apache   1.3.22







 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] RE: PHP 4.1.0 released

2001-12-11 Thread Emanuel Dejanu


Hi,

Zeev Suraski [zeev at zend dot com] wrote:
- Revolutionary performance and stability improvements under Windows.  The
multithreaded server modules under Windows (ISAPI, Apache, etc.) perform as
much as 30 times faster under load!  We want to thank Brett Brewer and his
team in Microsoft for working with us to improve PHP for Windows.



This means that ISAPI is considered to be production quality?



From the manual:
However, please note that the SAPI modules are NOT yet considered to be
production quality. In particular, with the ISAPI module, you are likely to
encounter serious reliability problems especially on platforms older than
W2K - you may witness a lot of server 500 errors and suffer from other
server modules such as ASP also failing. You have been warned!

The reason for this is that the PHP SAPI modules are using the thread-safe
version of the PHP code, which is new to PHP 4, and has not yet been tested
and pounded enough to be considered completely stable, and there are
actually a few known bugs. On the other hand, some people have reported very
good results with the SAPI modules, even though we're not aware of anyone
actually running it on a production site. In short - your mileage may vary;
If you need absolute stability, trade the performance of the SAPI modules
with the stability of the CGI executable. 

Best regards,

Emanuel Dejanu




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] RE: PHP 4.1.0 released

2001-12-11 Thread Emanuel Dejanu


Can you tell me some of modules that are not thread safe?
I'm using only MySQL, file access+URL.

Best regards,

Emanuel Dejanu

-Original Message-
From: Zeev Suraski [mailto:[EMAIL PROTECTED]]
Sent: 11 decembrie 2001 17:37
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] RE: PHP 4.1.0 released
Importance: High


At 17:16 11/12/2001, Emanuel Dejanu wrote:

Hi,

Zeev Suraski [zeev at zend dot com] wrote:
 - Revolutionary performance and stability improvements under Windows.
The
 multithreaded server modules under Windows (ISAPI, Apache, etc.) perform
as
 much as 30 times faster under load!  We want to thank Brett Brewer and
his
 team in Microsoft for working with us to improve PHP for Windows.

This means that ISAPI is considered to be production quality?

Yes, even though quite a few modules inside PHP are not yet thread safe, so
if you use them, it'd crash.

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] RE: PHP 4.1.0 released

2001-12-11 Thread Emanuel Dejanu



fopen wrappers.

Here is the list of categories that we are interest of:
Array functions
Class/Object Functions
Character type functions
Date and Time functions !!!
Directory functions
Error Handling and Logging Functions
Filesystem functions
Forms Data Format functions
FTP functions
Function Handling functions
HTTP functions
Mail functions
Mathematical Functions
Mhash Functions
Miscellaneous functions
MySQL Functions
Network Functions
Output Control Functions
PHP options  information
Program Execution functions
Regular Expression Functions (Perl-Compatible)
Regular Expression Functions (POSIX Extended)
Session handling functions
Socket functions
String functions
URL Functions
Variable Functions
XML parser functions

Most of them are standard modules so I believe that they are thread safe,
but I need a confirmation for my boss :-)

Thanks,

Emanuel Dejanu


-Original Message-
From: Zeev Suraski [mailto:[EMAIL PROTECTED]]
Sent: 11 decembrie 2001 18:06
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DEV] RE: PHP 4.1.0 released


MySQL and file access should be ok.  I'm not sure what you mean by URL
(CURL?  fopen wrappers?)

At 17:48 11/12/2001, Emanuel Dejanu wrote:

Can you tell me some of modules that are not thread safe?
I'm using only MySQL, file access+URL.

Best regards,

Emanuel Dejanu

-Original Message-
From: Zeev Suraski [mailto:[EMAIL PROTECTED]]
Sent: 11 decembrie 2001 17:37
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] RE: PHP 4.1.0 released
Importance: High


At 17:16 11/12/2001, Emanuel Dejanu wrote:

 Hi,
 
 Zeev Suraski [zeev at zend dot com] wrote:
  - Revolutionary performance and stability improvements under Windows.
The
  multithreaded server modules under Windows (ISAPI, Apache, etc.)
perform
as
  much as 30 times faster under load!  We want to thank Brett Brewer and
his
  team in Microsoft for working with us to improve PHP for Windows.
 
 This means that ISAPI is considered to be production quality?

Yes, even though quite a few modules inside PHP are not yet thread safe, so
if you use them, it'd crash.

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




FW: [PHP-DEV] _SERVER HTTP_SERVER_VARS

2001-12-04 Thread Emanuel Dejanu


Hi there,

$_* arrays are a copy of the long GLOBAL vars.
So $_SERVER is a copy of $HTTP_SERVER_VARS or is a reference?

Best regards,

Emanuel Dejanu


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 5 decembrie 2001 08:31
To: Prottoss
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] _SERVER  HTTP_SERVER_VARS


Hello,

The new $_* arrays are also superglobals, ie. you don't need to define
them as 'global $HTTP_POST_VARS;' in your functions. The $_* arrays can be
used everywhere.

Derick

On Tue, 4 Dec 2001, Prottoss wrote:

 I've recently installed php 4.1.0RC5 on a test system and while testing
the
 build came across an interesting fact.

 It would appear that the new PHP creates an identical copy of every system
 generated global array, for example _SERVER  HTTP_SERVER_VARS or _COOKIE

 HTTP_COOKIE_VARS.
 Is there a reason why those were created twice?

 The phpinfo() appears to be using the new format of global arrays, which
 start with _, does this mean the long global array names will be phased
out
 in the near future?

 Regards,


 --
 Prottoss
 [EMAIL PROTECTED]
 ICQ: 23361082
 http://mediaminer.org/

 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Shared extension with needed static library.

2001-10-18 Thread Emanuel Dejanu


How can I link my extension to a statical linked library?
If I use this config file my extension is compiled but
when run my test I get (in apache error_log):
/mnt/disk1/home/edejanu/apache/aps/bin/httpd: error while loading shared
libraries: /mnt/disk1/home/edejanu/apache/aps/lib/php/20001222/phpfxp.so:
undefined symbol: parse_url

parse_url is defined in the libfxp.a library.

config.m4
--BEGIN
dnl $Id: config.m4,v 0.1 2001/10/17 17:34:57 edejanu Exp $

AC_MSG_CHECKING(for FXP support)
PHP_ARG_ENABLE(phpfxp,whether to enable FXP,
[  --enable-phpfxp   Enable FXP support])

if test $PHP_PHPFXP = yes; then
AC_DEFINE(HAVE_PHPFXP, 1, [Whether you have FXP])
PHP_EXTENSION(phpfxp, $ext_shared)

PHPFXP_DIR=/usr/local

PHP_ADD_INCLUDE($PHPFXP_DIR/include)
PHP_ADD_INCLUDE($PHPFXP_DIR/include/millweed)
PHP_ADD_LIBRARY_WITH_PATH(fxp, $PHPFXP_DIR/lib)

if test ! -f $PHPFXP_DIR/include/fxp.h; then
  AC_MSG_ERROR(Could not find fxp.h in $PHPFXP_DIR/include - please
install the fxp library)
fi
fi
--END

Makefile.in
--BEGIN
LTLIBRARY_NAME= libphpfxp.la
LTLIBRARY_SHARED_NAME = phpfxp.la
LTLIBRARY_SOURCES = php_fxp.c

include $(top_srcdir)/build/dynlib.mk
--END

fxp_test.php
--BEGIN
?php
error_reporting(E_ALL);
dl('phpfxp.so');
$fxp = new FXP('ftp://x:x/mnt/disk1/home/edejanu/');
var_dump($fxp);
?
--END


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] RE: Re: How do I register a constructor in PHP (C code)

2001-09-26 Thread Emanuel Dejanu

I have write using the init but still do not work.

Any other ideea.

Best regards,

Emanuel Dejanu


 -Original Message-
 From: Hansuck Jo [mailto:sizer@.php.net]
 Sent: Tuesday, September 25, 2001 6:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Re: How do I register a constructor in PHP (C code)
 
 
 You use rt66clsss_init() instead of rt66class_contstructor().
 may be, it's will work. :)
 
 
 Emanuel Dejanu wrote:
 
  I write an extension and I want to register a new class
  but I can not get my function to be registered as a constructor.
  
  ex:
  PHP_FUNCTION(rt66class_constructor);
  static zend_function_entry php_rt66class_class_functions[] =
  {
  PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
  };
  
  PHP_MINIT_FUNCTION(rt66util)
  {
  zend_class_entry rt66class_class_entry;
  INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
  php_rt66class_class_functions);
  RT66Class_class_entry_ptr =
  zend_register_internal_class(rt66class_class_entry);
  
  return SUCCESS;
  }
  
  PHP_FUNCTION(rt66class_constructor)
  {
  ZEND_PUTS(RT66Class Contructor);
  }
  
  
  -
  ?php
  dl(myext.so);
  $myvar = RT66Class();
  ?
  
  nothing appear on the screen.
  
  Please tell me how can I make it to work.
  
  Many thanks,
  
  Emanuel Dejanu
  
  
 -Original Message-
 From: Andy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 01, 2001 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: Fwd: FW: [PHP-DEV] print_r
 
 
 
 
 --  Forwarded Message  --
 Subject: FW: [PHP-DEV] print_r
 Date: Wed, 1 Aug 2001 08:19:09 +0300
 From: Emanuel Dejanu [EMAIL PROTECTED]
 
 
 Sorry to forward this to you but I really have problems in
 printing a doubled linked class.
 Can you take a look at the following message and give me
 an answer.
 
 Thanks,
 
 Emanuel Dejanu
 
 -Original Message-
 From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 31, 2001 9:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] print_r
 
 
 
 Hi,
 
 Is there a posibility to print an object but to not print 
 some fields.
 
 If I use print_r he will print all variabiles from my object,
 but I want on
 variabile to not be printed. I do not want to write my own function.
 Ex.
 
 class Node {
 var $name;
 var $parent = '/'
 var $children = array();
 function Node($name, $parent) {
 $this-parent = $parent;
 $this-name = $name;
 }
 }
 
 $rootNode = new Node('root', '');
 array_push($rootNode-children, new Node('child1', $rootNode));
 $child1Node = $rootNode-children[0];
 array_push($child1Node-children, new Node('child1', $child1Node));
 
 print_r($rootNode);
 
 will print make a recursivity. What will be nice is to 
 allow that some
 variabiles to not
 be printed like this:
 
 class Node {
 var $name;
 var $__parent = '/'
 var $children = array();
 function Node($name, $parent) {
 $this-__parent = $parent;
 $this-name = $name;
 }
 }
 
 . /* add the root and childrens */
 
 print_r($rootNode);
 
 will print now the corret tree.
 
 Bellow you find the only modification that need to be done
 for this to work.
 
 Best regards,
 
 Emanuel Dejanu
 
 
 File: Zend/zend.c
 
 static void print_hash(HashTable *ht, int indent)
 {
 zval **tmp;
 char *string_key;
 HashPosition iterator;
 unsigned long num_key, str_len;
 int i, key_type;  /** HERE */
 
 for (i=0; iindent; i++) {
 ZEND_PUTS( );
 }
 ZEND_PUTS((\n);
 indent += PRINT_ZVAL_INDENT;
 zend_hash_internal_pointer_reset_ex(ht, iterator);
 while (zend_hash_get_current_data_ex(ht, (void **)
 tmp, iterator) ==
 SUCCESS) {
 
 
 / HERE **/
 
 key_type = zend_hash_get_current_key_ex(ht,
 string_key, str_len,
 num_key, 0, iterator);
 if (key_type == HASH_KEY_IS_STRING)
 if (string_key[0] == '_' 
 string_key[1] == '_') continue;
 
 
 /*** HERE **/
 
 
 for (i=0; iindent; i++) {
 ZEND_PUTS( );
 }
 ZEND_PUTS([);
 switch (key_type) {
 case HASH_KEY_IS_STRING:
 ZEND_PUTS(string_key);
 break;
 case HASH_KEY_IS_LONG:
 zend_printf(%ld,num_key);
 break;
 }
 ZEND_PUTS(] = );
 zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT);
 ZEND_PUTS(\n);
 zend_hash_move_forward_ex(ht, iterator);
 }
 indent -= PRINT_ZVAL_INDENT;
 for (i=0; iindent; i++) {
 ZEND_PUTS( );
 }
 ZEND_PUTS()\n);
 }
 
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED

RE: [PHP-DEV] How do I register a constructor in PHP (C code)

2001-09-26 Thread Emanuel Dejanu


I have put zend_class_entry variabiles global and still
no success in having my constructor called.

You PHP guru do not have any ideea what is the problem.

Best regards,

Emanuel Dejanu

 -Original Message-
 From: Jeff Hughes [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 25, 2001 9:23 PM
 To: Emanuel Dejanu
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] How do I register a constructor in PHP (C code)
 
 
 I believe the problem you are having is that the 
 zend_class_entry structure
 destroyed as you leave the scope of the MINIT function.  This 
 is definitely
 going to have undefined behavior.  Move the zend_class_entry 
 so that it is
 global and you should be good to go.
 
 Jeff Hughes
 [EMAIL PROTECTED]
 
 On Tue, Sep 25, 2001 at 05:12:37PM +0300, Emanuel Dejanu wrote:
  
  I write an extension and I want to register a new class
  but I can not get my function to be registered as a constructor.
  
  ex:
  PHP_FUNCTION(rt66class_constructor);
  static zend_function_entry php_rt66class_class_functions[] =
  {
  PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
  };
  
  PHP_MINIT_FUNCTION(rt66util)
  {
  zend_class_entry rt66class_class_entry;
  INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
  php_rt66class_class_functions);
  RT66Class_class_entry_ptr =
  zend_register_internal_class(rt66class_class_entry);
  
  return SUCCESS;
  }
  
  PHP_FUNCTION(rt66class_constructor)
  {
  ZEND_PUTS(RT66Class Contructor);
  }
  
  
  -
  ?php
  dl(myext.so);
  $myvar = RT66Class();
  ?
  
  nothing appear on the screen.
  
  Please tell me how can I make it to work.
  
  Many thanks,
  
  Emanuel Dejanu
  
   -Original Message-
   From: Andy [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, August 01, 2001 3:27 PM
   To: [EMAIL PROTECTED]
   Subject: Fwd: FW: [PHP-DEV] print_r
  
  
  
  
   --  Forwarded Message  --
   Subject: FW: [PHP-DEV] print_r
   Date: Wed, 1 Aug 2001 08:19:09 +0300
   From: Emanuel Dejanu [EMAIL PROTECTED]
  
  
   Sorry to forward this to you but I really have problems in
   printing a doubled linked class.
   Can you take a look at the following message and give me
   an answer.
  
   Thanks,
  
   Emanuel Dejanu
  
   -Original Message-
   From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, July 31, 2001 9:22 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DEV] print_r
  
  
  
   Hi,
  
   Is there a posibility to print an object but to not print 
 some fields.
  
   If I use print_r he will print all variabiles from my object,
   but I want on
   variabile to not be printed. I do not want to write my 
 own function.
   Ex.
  
   class Node {
 var $name;
 var $parent = '/'
 var $children = array();
 function Node($name, $parent) {
 $this-parent = $parent;
 $this-name = $name;
 }
   }
  
   $rootNode = new Node('root', '');
   array_push($rootNode-children, new Node('child1', $rootNode));
   $child1Node = $rootNode-children[0];
   array_push($child1Node-children, new Node('child1', 
 $child1Node));
  
   print_r($rootNode);
  
   will print make a recursivity. What will be nice is to 
 allow that some
   variabiles to not
   be printed like this:
  
   class Node {
 var $name;
 var $__parent = '/'
 var $children = array();
 function Node($name, $parent) {
 $this-__parent = $parent;
 $this-name = $name;
 }
   }
  
   . /* add the root and childrens */
  
   print_r($rootNode);
  
   will print now the corret tree.
  
   Bellow you find the only modification that need to be done
   for this to work.
  
   Best regards,
  
   Emanuel Dejanu
  
  
   File: Zend/zend.c
  
   static void print_hash(HashTable *ht, int indent)
   {
 zval **tmp;
 char *string_key;
 HashPosition iterator;
 unsigned long num_key, str_len;
 int i, key_type;  /** HERE */
  
 for (i=0; iindent; i++) {
 ZEND_PUTS( );
 }
 ZEND_PUTS((\n);
 indent += PRINT_ZVAL_INDENT;
 zend_hash_internal_pointer_reset_ex(ht, iterator);
 while (zend_hash_get_current_data_ex(ht, (void **)
   tmp, iterator) ==
   SUCCESS) {
  
  
   / HERE **/
  
 key_type = zend_hash_get_current_key_ex(ht,
   string_key, str_len,
   num_key, 0, iterator);
 if (key_type == HASH_KEY_IS_STRING)
 if (string_key[0] == '_' 
   string_key[1] == '_') continue;
  
  
   /*** HERE **/
  
  
 for (i=0; iindent; i++) {
 ZEND_PUTS( );
 }
 ZEND_PUTS([);
 switch (key_type) {
 case HASH_KEY_IS_STRING:
 ZEND_PUTS(string_key);
 break;
 case HASH_KEY_IS_LONG:
 zend_printf(%ld,num_key);
 break

RE: [PHP-DEV] RE: Re: How do I register a constructor in PHP (C code)

2001-09-26 Thread Emanuel Dejanu


tr(/PHP_/ZEND_/)
and still do not work. I have compared your example with my
code and no difference found on it.

Have you any other suggestions.

I really need the constructor and I can not do it.

Best regards,

Emanuel Dejanu

P.S. I run Apache 1.3.20 PHP 4.0.6 Linux 2.2.18-SMP SuSE 7.1
on Dual Pentium III 800 MHz (712 MB RAM) machine.

 -Original Message-
 From: Hansuck Jo [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 11:02 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] RE: Re: How do I register a 
 constructor in PHP (C code)
 
 
 hm...  ZEND_* functions instead PHP_* functions.
 
 This is sample code..(of course. You must include zend.h etc..)
 
 
 
 static zend_function_entry scl_functions[] = {
   {NULL, NULL, NULL}
 };
 
 zend_module_entry scl_module_entry = {
   scl,
   scl_functions,
   ZEND_MINIT(scl),
   NULL,
   NULL,
   NULL,
   ZEND_MINFO(scl),
   STANDARD_MODULE_PROPERTIES
 };
 
 
 zend_class_entry scl_object_class_entry;
 zend_function_entry scl_object_functions[] = {
   ZEND_FALIAS(object, object_init, NULL)
   {NULL, NULL, NULL}
 };
 
 
 ZEND_FUNCTION(object_init)
 {
   zval *obj;
 
   obj = getThis();
 
   if (obj) {
   if (ZEND_NUM_ARGS() != 0) {
   ZEND_WRONG_PARAM_COUNT();
   }
   zend_printf(Object Create.);
 
   RETURN_TRUE;
   }
   else {
   zend_error(E_WARNING, This can't excute in 
 Class Method);
   RETURN_FALSE;
   }
 }
 
 ZEND_MINIT_FUNCTION(scl)
 {
 
   INIT_CLASS_ENTRY(scl_object_class_entry, object,  
   scl_object_functions);
   zend_register_internal_class(scl_object_class_entry);  
 }
 
 
 Emanuel Dejanu wrote:
 
  I have write using the init but still do not work.
  
  Any other ideea.
  
  Best regards,
  
  Emanuel Dejanu
  
  
  
 -Original Message-
 From: Hansuck Jo [mailto:sizer@.php.net]
 Sent: Tuesday, September 25, 2001 6:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Re: How do I register a constructor in 
 PHP (C code)
 
 
 You use rt66clsss_init() instead of rt66class_contstructor().
 may be, it's will work. :)
 
 
 Emanuel Dejanu wrote:
 
 
 I write an extension and I want to register a new class
 but I can not get my function to be registered as a constructor.
 
 ex:
 PHP_FUNCTION(rt66class_constructor);
 static zend_function_entry php_rt66class_class_functions[] =
 {
PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
 };
 
 PHP_MINIT_FUNCTION(rt66util)
 {
zend_class_entry rt66class_class_entry;
INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
 php_rt66class_class_functions);
RT66Class_class_entry_ptr =
 zend_register_internal_class(rt66class_class_entry);
 
return SUCCESS;
 }
 
 PHP_FUNCTION(rt66class_constructor)
 {
ZEND_PUTS(RT66Class Contructor);
 }
 
 
 -
 ?php
dl(myext.so);
$myvar = RT66Class();
 ?
 
 nothing appear on the screen.
 
 Please tell me how can I make it to work.
 
 Many thanks,
 
 Emanuel Dejanu
 
 
 
 -Original Message-
 From: Andy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 01, 2001 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: Fwd: FW: [PHP-DEV] print_r
 
 
 
 
 --  Forwarded Message  --
 Subject: FW: [PHP-DEV] print_r
 Date: Wed, 1 Aug 2001 08:19:09 +0300
 From: Emanuel Dejanu [EMAIL PROTECTED]
 
 
 Sorry to forward this to you but I really have problems in
 printing a doubled linked class.
 Can you take a look at the following message and give me
 an answer.
 
 Thanks,
 
 Emanuel Dejanu
 
 -Original Message-
 From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 31, 2001 9:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] print_r
 
 
 
 Hi,
 
 Is there a posibility to print an object but to not print 
 
 some fields.
 
 If I use print_r he will print all variabiles from my object,
 but I want on
 variabile to not be printed. I do not want to write my 
 own function.
 Ex.
 
 class Node {
   var $name;
   var $parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-parent = $parent;
   $this-name = $name;
   }
 }
 
 $rootNode = new Node('root', '');
 array_push($rootNode-children, new Node('child1', $rootNode));
 $child1Node = $rootNode-children[0];
 array_push($child1Node-children, new Node('child1', 
 $child1Node));
 
 print_r($rootNode);
 
 will print make a recursivity. What will be nice is to 
 
 allow that some
 
 variabiles to not
 be printed like this:
 
 class Node {
   var $name;
   var $__parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-__parent = $parent;
   $this-name = $name;
   }
 }
 
 . /* add the root and childrens */
 
 print_r($rootNode);
 
 will print now the corret tree.
 
 Bellow you find the only modification that need to be done
 for this to work.
 
 Best regards,
 
 Emanuel

RE: [PHP-DEV] How do I register a constructor in PHP (C code)

2001-09-26 Thread Emanuel Dejanu


I have them in my code. I have miss them in my e-mail, sorry.
Have somebody an real example that is working, really checked
because I have really check all the sources and found anything!!!

Thanks,
Emanuel Dejanu

 -Original Message-
 From: Jeff Hughes [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 11:54 AM
 To: Emanuel Dejanu
 Cc: 'Jeff Hughes'; [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] How do I register a constructor in PHP (C code)
 
 
 Another thing I noticed is that you didn't end the 
 zend_function_entry list
 with { NULL, NULL, NULL }.  That could cause some problems too.
 
  Jeff
 
 On Wed, Sep 26, 2001 at 09:55:35AM +0300, Emanuel Dejanu wrote:
  
  I have put zend_class_entry variabiles global and still
  no success in having my constructor called.
  
  You PHP guru do not have any ideea what is the problem.
  
  Best regards,
  
  Emanuel Dejanu
  
   -Original Message-
   From: Jeff Hughes [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, September 25, 2001 9:23 PM
   To: Emanuel Dejanu
   Cc: [EMAIL PROTECTED]
   Subject: Re: [PHP-DEV] How do I register a constructor in 
 PHP (C code)
   
   
   I believe the problem you are having is that the 
   zend_class_entry structure
   destroyed as you leave the scope of the MINIT function.  This 
   is definitely
   going to have undefined behavior.  Move the zend_class_entry 
   so that it is
   global and you should be good to go.
   
   Jeff Hughes
   [EMAIL PROTECTED]
   
   On Tue, Sep 25, 2001 at 05:12:37PM +0300, Emanuel Dejanu wrote:

I write an extension and I want to register a new class
but I can not get my function to be registered as a constructor.

ex:
PHP_FUNCTION(rt66class_constructor);
static zend_function_entry php_rt66class_class_functions[] =
{
PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
};

PHP_MINIT_FUNCTION(rt66util)
{
zend_class_entry rt66class_class_entry;
INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
php_rt66class_class_functions);
RT66Class_class_entry_ptr =
zend_register_internal_class(rt66class_class_entry);

return SUCCESS;
}

PHP_FUNCTION(rt66class_constructor)
{
ZEND_PUTS(RT66Class Contructor);
}


-
?php
dl(myext.so);
$myvar = RT66Class();
?

nothing appear on the screen.

Please tell me how can I make it to work.

Many thanks,

Emanuel Dejanu

 -Original Message-
 From: Andy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 01, 2001 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: Fwd: FW: [PHP-DEV] print_r




 --  Forwarded Message  --
 Subject: FW: [PHP-DEV] print_r
 Date: Wed, 1 Aug 2001 08:19:09 +0300
 From: Emanuel Dejanu [EMAIL PROTECTED]


 Sorry to forward this to you but I really have problems in
 printing a doubled linked class.
 Can you take a look at the following message and give me
 an answer.

 Thanks,

 Emanuel Dejanu

 -Original Message-
 From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 31, 2001 9:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] print_r



 Hi,

 Is there a posibility to print an object but to not print 
   some fields.

 If I use print_r he will print all variabiles from my object,
 but I want on
 variabile to not be printed. I do not want to write my 
   own function.
 Ex.

 class Node {
   var $name;
   var $parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-parent = $parent;
   $this-name = $name;
   }
 }

 $rootNode = new Node('root', '');
 array_push($rootNode-children, new Node('child1', 
 $rootNode));
 $child1Node = $rootNode-children[0];
 array_push($child1Node-children, new Node('child1', 
   $child1Node));

 print_r($rootNode);

 will print make a recursivity. What will be nice is to 
   allow that some
 variabiles to not
 be printed like this:

 class Node {
   var $name;
   var $__parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-__parent = $parent;
   $this-name = $name;
   }
 }

 . /* add the root and childrens */

 print_r($rootNode);

 will print now the corret tree.

 Bellow you find the only modification that need to be done
 for this to work.

 Best regards,

 Emanuel Dejanu


 File: Zend/zend.c

 static void print_hash(HashTable *ht, int indent)
 {
   zval **tmp;
   char *string_key;
   HashPosition

RE: [PHP-DEV] RE: Re: How do I register a constructor in PHP (C code)

2001-09-26 Thread Emanuel Dejanu


Thank you for the example. Is working.
I was figure out what was the problem:
INIT_CLASS_ENTRY(rt66class_class_entry, 
RT66Class, /* here */
php_rt66class_class_functions);

writing RT66Class do not work, but writing rt66class is working!!!

Many thanks for your help,

Emanuel Dejanu

Writing an PHP extension is a real adventure.

P.S. I also write very pour english so sorry for my mistakes.


 -Original Message-
 From: Hansuck Jo [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 1:04 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] RE: Re: How do I register a 
 constructor in PHP (C code)
 
 
 Hm.. attachement file is my full source..
 
 To compile:
 tar xzf scl.tgz
 mv scl any_path/php-4.0.6/ext
 cd php-4.0.6
 rm configure config.cache
 ./buildconf
 ./confgure --with-scl
 make
 
 
 To Test:
 ./php -q ext/scl/scl.php
 
 
 Testing Results:
 Object Created.
 Subojbect Created.
 
 
 PS. I can't speak English... ^^;;
 but I can readonly English... (You understand?? ^^;;)
 
 PS. I have 64M DRAM cylix 166MHz.. TT
 PHP 4.0.6, Wow-Linux 7.1 (Redhat 7.1 compat...)
 No Apache.. (I compile CGI mode)
 
 
 Emanuel Dejanu wrote:
 
 tr(/PHP_/ZEND_/)
 and still do not work. I have compared your example with my
 code and no difference found on it.
 
 Have you any other suggestions.
 
 I really need the constructor and I can not do it.
 
 Best regards,
 
 Emanuel Dejanu
 
 P.S. I run Apache 1.3.20 PHP 4.0.6 Linux 2.2.18-SMP SuSE 7.1
 on Dual Pentium III 800 MHz (712 MB RAM) machine.
 
 -Original Message-
 From: Hansuck Jo [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 11:02 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] RE: Re: How do I register a 
 constructor in PHP (C code)
 
 
 hm...  ZEND_* functions instead PHP_* functions.
 
 This is sample code..(of course. You must include zend.h etc..)
 
 
 
 static zend_function_entry scl_functions[] = {
 {NULL, NULL, NULL}
 };
 
 zend_module_entry scl_module_entry = {
 scl,
 scl_functions,
 ZEND_MINIT(scl),
 NULL,
 NULL,
 NULL,
 ZEND_MINFO(scl),
 STANDARD_MODULE_PROPERTIES
 };
 
 
 zend_class_entry scl_object_class_entry;
 zend_function_entry scl_object_functions[] = {
 ZEND_FALIAS(object, object_init, NULL)
 {NULL, NULL, NULL}
 };
 
 
 ZEND_FUNCTION(object_init)
 {
 zval *obj;
 
 obj = getThis();
 
 if (obj) {
 if (ZEND_NUM_ARGS() != 0) {
 ZEND_WRONG_PARAM_COUNT();
 }
 zend_printf(Object Create.);
 
 RETURN_TRUE;
 }
 else {
 zend_error(E_WARNING, This can't excute in 
 Class Method);
 RETURN_FALSE;
 }
 }
 
 ZEND_MINIT_FUNCTION(scl)
 {
 
 INIT_CLASS_ENTRY(scl_object_class_entry, object,  
 scl_object_functions);
 zend_register_internal_class(scl_object_class_entry);  
 }
 
 
 Emanuel Dejanu wrote:
 
 I have write using the init but still do not work.
 
 Any other ideea.
 
 Best regards,
 
 Emanuel Dejanu
 
 
 
 -Original Message-
 From: Hansuck Jo [mailto:sizer@.php.net]
 Sent: Tuesday, September 25, 2001 6:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Re: How do I register a constructor in 
 
 PHP (C code)
 
 
 You use rt66clsss_init() instead of rt66class_contstructor().
 may be, it's will work. :)
 
 
 Emanuel Dejanu wrote:
 
 
 I write an extension and I want to register a new class
 but I can not get my function to be registered as a constructor.
 
 ex:
 PHP_FUNCTION(rt66class_constructor);
 static zend_function_entry php_rt66class_class_functions[] =
 {
  PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
 };
 
 PHP_MINIT_FUNCTION(rt66util)
 {
  zend_class_entry rt66class_class_entry;
  INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
 php_rt66class_class_functions);
  RT66Class_class_entry_ptr =
 zend_register_internal_class(rt66class_class_entry);
 
  return SUCCESS;
 }
 
 PHP_FUNCTION(rt66class_constructor)
 {
  ZEND_PUTS(RT66Class Contructor);
 }
 
 
 -
 ?php
  dl(myext.so);
  $myvar = RT66Class();
 ?
 
 nothing appear on the screen.
 
 Please tell me how can I make it to work.
 
 Many thanks,
 
 Emanuel Dejanu
 
 
 
 -Original Message-
 From: Andy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 01, 2001 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: Fwd: FW: [PHP-DEV] print_r
 
 
 
 
 --  Forwarded Message  --
 Subject: FW: [PHP-DEV] print_r
 Date: Wed, 1 Aug 2001 08:19:09 +0300
 From: Emanuel Dejanu [EMAIL PROTECTED]
 
 
 Sorry to forward this to you but I really have problems in
 printing a doubled linked class.
 Can you take a look at the following message and give me
 an answer.
 
 Thanks,
 
 Emanuel Dejanu
 
 -Original Message-
 From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 31, 2001 9:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] print_r
 
 
 
 Hi,
 
 Is there a posibility to print an object but to not print 
 
 some fields

[PHP-DEV] How do I register a constructor in PHP (C code)

2001-09-25 Thread Emanuel Dejanu


I write an extension and I want to register a new class
but I can not get my function to be registered as a constructor.

ex:
PHP_FUNCTION(rt66class_constructor);
static zend_function_entry php_rt66class_class_functions[] =
{
PHP_FALIAS(RT66Class,  rt66class_constructor,  NULL)
};

PHP_MINIT_FUNCTION(rt66util)
{
zend_class_entry rt66class_class_entry;
INIT_CLASS_ENTRY(rt66class_class_entry, RT66Class,
php_rt66class_class_functions);
RT66Class_class_entry_ptr =
zend_register_internal_class(rt66class_class_entry);

return SUCCESS;
}

PHP_FUNCTION(rt66class_constructor)
{
ZEND_PUTS(RT66Class Contructor);
}


-
?php
dl(myext.so);
$myvar = RT66Class();
?

nothing appear on the screen.

Please tell me how can I make it to work.

Many thanks,

Emanuel Dejanu

 -Original Message-
 From: Andy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 01, 2001 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: Fwd: FW: [PHP-DEV] print_r




 --  Forwarded Message  --
 Subject: FW: [PHP-DEV] print_r
 Date: Wed, 1 Aug 2001 08:19:09 +0300
 From: Emanuel Dejanu [EMAIL PROTECTED]


 Sorry to forward this to you but I really have problems in
 printing a doubled linked class.
 Can you take a look at the following message and give me
 an answer.

 Thanks,

 Emanuel Dejanu

 -Original Message-
 From: Emanuel Dejanu [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 31, 2001 9:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] print_r



 Hi,

 Is there a posibility to print an object but to not print some fields.

 If I use print_r he will print all variabiles from my object,
 but I want on
 variabile to not be printed. I do not want to write my own function.
 Ex.

 class Node {
   var $name;
   var $parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-parent = $parent;
   $this-name = $name;
   }
 }

 $rootNode = new Node('root', '');
 array_push($rootNode-children, new Node('child1', $rootNode));
 $child1Node = $rootNode-children[0];
 array_push($child1Node-children, new Node('child1', $child1Node));

 print_r($rootNode);

 will print make a recursivity. What will be nice is to allow that some
 variabiles to not
 be printed like this:

 class Node {
   var $name;
   var $__parent = '/'
   var $children = array();
   function Node($name, $parent) {
   $this-__parent = $parent;
   $this-name = $name;
   }
 }

 . /* add the root and childrens */

 print_r($rootNode);

 will print now the corret tree.

 Bellow you find the only modification that need to be done
 for this to work.

 Best regards,

 Emanuel Dejanu


 File: Zend/zend.c

 static void print_hash(HashTable *ht, int indent)
 {
   zval **tmp;
   char *string_key;
   HashPosition iterator;
   unsigned long num_key, str_len;
   int i, key_type;  /** HERE */

   for (i=0; iindent; i++) {
   ZEND_PUTS( );
   }
   ZEND_PUTS((\n);
   indent += PRINT_ZVAL_INDENT;
   zend_hash_internal_pointer_reset_ex(ht, iterator);
   while (zend_hash_get_current_data_ex(ht, (void **)
 tmp, iterator) ==
 SUCCESS) {


 / HERE **/

   key_type = zend_hash_get_current_key_ex(ht,
 string_key, str_len,
 num_key, 0, iterator);
   if (key_type == HASH_KEY_IS_STRING)
   if (string_key[0] == '_' 
 string_key[1] == '_') continue;


 /*** HERE **/


   for (i=0; iindent; i++) {
   ZEND_PUTS( );
   }
   ZEND_PUTS([);
   switch (key_type) {
   case HASH_KEY_IS_STRING:
   ZEND_PUTS(string_key);
   break;
   case HASH_KEY_IS_LONG:
   zend_printf(%ld,num_key);
   break;
   }
   ZEND_PUTS(] = );
   zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT);
   ZEND_PUTS(\n);
   zend_hash_move_forward_ex(ht, iterator);
   }
   indent -= PRINT_ZVAL_INDENT;
   for (i=0; iindent; i++) {
   ZEND_PUTS( );
   }
   ZEND_PUTS()\n);
 }


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 ---

 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list

RE: [PHP-DEV] Bug #13039: $submit (form) variable doesn't work

2001-08-30 Thread Emanuel Dejanu

Try

if(!isset($submit) {
... //display the form
} else {
 // process the form
...
}

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 29, 2001 8:49 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Bug #13039: $submit (form) variable doesn't work
 
 
 From: [EMAIL PROTECTED]
 Operating system: Windows 2000
 PHP version:  4.0.6
 PHP Bug Type: Arrays related
 Bug description:  $submit (form) variable doesn't work
 
 I have a problem with a page that writes a form on page. What 
 is unusual
 though is that it tries to identify if the form has been 
 submitted or not.
 The script I am basing my work on is presumably made for an older PHP
 version. And I cant get it my version 4.06 on IIS 5.0 (win2k) to work.
 
 
 
 Any ideas??
 
 
 
 if(!$submit)
 
 {
 
 // form not yet submitted, display form
 
 
 
 form action=? echo $PHP_SELF; ? method=post
 
 p
 
 ul
 
 liwith skills matching the keywords
 
 input type=text name=skills size=35
 
 /ul
 
 center
 
 input type=submit name=submit value=Search
 
 /center
 
 /form
 
 ?
 
 }
 
 else
 
 {
 -- 
 Edit bug report at: http://bugs.php.net/?id=13039edit=1
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] print_r

2001-07-30 Thread Emanuel Dejanu


Hi,

Is there a posibility to print an object but to not print some fields.

If I use print_r he will print all variabiles from my object, but I want on
variabile to not be printed. I do not want to write my own function.
Ex.

class Node {
var $name;
var $parent = '/'
var $children = array();
function Node($name, $parent) {
$this-parent = $parent;
$this-name = $name;
}
}

$rootNode = new Node('root', '');
array_push($rootNode-children, new Node('child1', $rootNode));
$child1Node = $rootNode-children[0];
array_push($child1Node-children, new Node('child1', $child1Node));

print_r($rootNode);

will print make a recursivity. What will be nice is to allow that some
variabiles to not
be printed like this:

class Node {
var $name;
var $__parent = '/'
var $children = array();
function Node($name, $parent) {
$this-__parent = $parent;
$this-name = $name;
}
}

. /* add the root and childrens */

print_r($rootNode);

will print now the corret tree.

Bellow you find the only modification that need to be done for this to work.

Best regards,

Emanuel Dejanu


File: Zend/zend.c

static void print_hash(HashTable *ht, int indent)
{
zval **tmp;
char *string_key;
HashPosition iterator;
unsigned long num_key, str_len;
int i, key_type;  /** HERE */

for (i=0; iindent; i++) {
ZEND_PUTS( );
}
ZEND_PUTS((\n);
indent += PRINT_ZVAL_INDENT;
zend_hash_internal_pointer_reset_ex(ht, iterator);
while (zend_hash_get_current_data_ex(ht, (void **) tmp, iterator) ==
SUCCESS) {


/ HERE **/

key_type = zend_hash_get_current_key_ex(ht, string_key, str_len,
num_key, 0, iterator);
if (key_type == HASH_KEY_IS_STRING)
if (string_key[0] == '_'  string_key[1] == '_') continue;


/*** HERE **/


for (i=0; iindent; i++) {
ZEND_PUTS( );
}
ZEND_PUTS([);
switch (key_type) {
case HASH_KEY_IS_STRING:
ZEND_PUTS(string_key);
break;
case HASH_KEY_IS_LONG:
zend_printf(%ld,num_key);
break;
}
ZEND_PUTS(] = );
zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT);
ZEND_PUTS(\n);
zend_hash_move_forward_ex(ht, iterator);
}
indent -= PRINT_ZVAL_INDENT;
for (i=0; iindent; i++) {
ZEND_PUTS( );
}
ZEND_PUTS()\n);
}


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]