[PHP-DEV] ext_skel

2003-01-05 Thread Andi Gutmans
Hi,

Someone seems to have changed ext_skel to create the ZEND_FETCH_RESOURCE() 
call to be inside an if() statement to check the resource is non-zero, i.e.:
if (myresource) {
	ZEND_FETCH_RESOURCE();
}

What is the reason this was added? The resource mechanism checks for this 
automatically and handles relevant errors in a consistent way. I think this 
if() should be removed.
Also does anyone object to ZEND_FETCH_RESOURCE() being commented. I think 
it's beneficial for newly generated extensions to be able to compile right 
away so that ppl can see that their setup, buildconf, config.m4 and so on 
is OK for development.

Andi


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



Re: Fwd: Re: [PHP-DEV] ext_skel

2002-12-25 Thread Leon Mergen
Hello,

David Gillies [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 OK, how about a much-expanded version for 4.3.1, say?
 I'm a big fan of self-documenting code (use the
 source, Luke). Perhaps a default function with all the
 bells and whistles (checking for references, grabbing
 a resource, etc, all documented up the wazoo).

Being a complete newbie at extending PHP (I started yesterday as we speak) ,
I must say that that first function helped me a lot. It gave me a general
idea how the things worked, and also how argument passing works.

And, like you stated, I think it would be a great idea to demonstrate all
major functions that people use...

Just my $0.02 worth

Regards,

Leon Mergen
http://www.antrophia.com/



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




Fwd: Re: [PHP-DEV] ext_skel

2002-12-23 Thread Andi Gutmans


To: David Gillies [EMAIL PROTECTED]
From: Andi Gutmans [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] ext_skel

Yeah but then it might make sense to print something like Argument passed 
= , no?

Andi

At 08:56 AM 12/23/2002 -0800, David Gillies wrote:
Well, if nothing else, for the novice extension
developer it gives an example of how to retrieve an
argument, without having to go to the Zend API docs.

Best Wishes

David Gillies
San Jose
Costa RIca

--- Andi Gutmans [EMAIL PROTECTED] wrote:
 Hey,

 What's the reason that
 confirm_myextension_compiled(..) takes a string as
 an argument? Why doesn't it just use the string
 myextension in it's message?
 For those who don't remember it prints out
 Congratulations! You have
 successfully modified ext/myextension/config.m4.
 Module myextension is now
 compiled into PHP..
 The second appearance of myextension is the
 parameter passed to the function.

 Andi


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



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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




Re: Fwd: Re: [PHP-DEV] ext_skel

2002-12-23 Thread David Gillies
OK, how about a much-expanded version for 4.3.1, say?
I'm a big fan of self-documenting code (use the
source, Luke). Perhaps a default function with all the
bells and whistles (checking for references, grabbing
a resource, etc, all documented up the wazoo).

Best Wishes

David Gillies
San Jose
Costa Rica

--- Andi Gutmans [EMAIL PROTECTED] wrote:
 
 To: David Gillies [EMAIL PROTECTED]
 From: Andi Gutmans [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] ext_skel
 
 Yeah but then it might make sense to print
 something like Argument passed 
 = , no?
 
 Andi
 
 At 08:56 AM 12/23/2002 -0800, David Gillies wrote:
 Well, if nothing else, for the novice extension
 developer it gives an example of how to retrieve
 an
 argument, without having to go to the Zend API
 docs.
 
 Best Wishes
 
 David Gillies
 San Jose
 Costa RIca
 
 --- Andi Gutmans [EMAIL PROTECTED] wrote:
   Hey,
  
   What's the reason that
   confirm_myextension_compiled(..) takes a string
 as
   an argument? Why doesn't it just use the string
   myextension in it's message?
   For those who don't remember it prints out
   Congratulations! You have
   successfully modified
 ext/myextension/config.m4.
   Module myextension is now
   compiled into PHP..
   The second appearance of myextension is the
   parameter passed to the function.
  
   Andi
  
  
   --
   PHP Development Mailing List
 http://www.php.net/
   To unsubscribe, visit:
 http://www.php.net/unsub.php
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up
 now.
 http://mailplus.yahoo.com
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: Fwd: Re: [PHP-DEV] ext_skel

2002-12-23 Thread Andi Gutmans
Actually I think we should keep it as simple as it is today. I'd just 
change what the function prints out :)

Andi

At 12:43 PM 12/23/2002 -0800, David Gillies wrote:
OK, how about a much-expanded version for 4.3.1, say?
I'm a big fan of self-documenting code (use the
source, Luke). Perhaps a default function with all the
bells and whistles (checking for references, grabbing
a resource, etc, all documented up the wazoo).

Best Wishes

David Gillies
San Jose
Costa Rica

--- Andi Gutmans [EMAIL PROTECTED] wrote:

 To: David Gillies [EMAIL PROTECTED]
 From: Andi Gutmans [EMAIL PROTECTED]
 Subject: Re: [PHP-DEV] ext_skel
 
 Yeah but then it might make sense to print
 something like Argument passed
 = , no?
 
 Andi
 
 At 08:56 AM 12/23/2002 -0800, David Gillies wrote:
 Well, if nothing else, for the novice extension
 developer it gives an example of how to retrieve
 an
 argument, without having to go to the Zend API
 docs.
 
 Best Wishes
 
 David Gillies
 San Jose
 Costa RIca
 
 --- Andi Gutmans [EMAIL PROTECTED] wrote:
   Hey,
  
   What's the reason that
   confirm_myextension_compiled(..) takes a string
 as
   an argument? Why doesn't it just use the string
   myextension in it's message?
   For those who don't remember it prints out
   Congratulations! You have
   successfully modified
 ext/myextension/config.m4.
   Module myextension is now
   compiled into PHP..
   The second appearance of myextension is the
   parameter passed to the function.
  
   Andi
  
  
   --
   PHP Development Mailing List
 http://www.php.net/
   To unsubscribe, visit:
 http://www.php.net/unsub.php
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up
 now.
 http://mailplus.yahoo.com


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



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
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] ext_skel

2002-12-21 Thread Andi Gutmans
Hey,

What's the reason that confirm_myextension_compiled(..) takes a string as 
an argument? Why doesn't it just use the string myextension in it's message?
For those who don't remember it prints out Congratulations! You have 
successfully modified ext/myextension/config.m4. Module myextension is now 
compiled into PHP..
The second appearance of myextension is the parameter passed to the function.

Andi


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



Re: [PHP-DEV] EXT_SKEL for Win32

2001-08-23 Thread David Eriksson

On Wed, 22 Aug 2001, Chris Gardner wrote:

 i was noticing a slight problem with the whole EXT_SKEL shell script.  it
 works great for getting a new package up and running, but only if your'
 doing all your using basically the gcc compiler.  well, i've been trying to
 create an extension library for php, and i am mainly using visual c++ 6 sp 3
 on win2k.  i can run the EXT_SKEL in my cygwin prompt, and it makes the
 files, fixes the build scripts, and the configure options, etc.  but, it
 doesn't fix the win32 projects to add the new library.  has anyone else
 looked at this, or thied to look at this?

 if nobody else has burned this bridge before, let me know, i'll come up with
 something you guys can use.

I just copied the .dsp file from some other project and modified it for my
Universe PHP extension. No perfect solution but it seems like I got it
right:

  http://universe.2good.nu/

If you contribute with autmatic generation of a visual studio project
file in ext_skel, that would be great!

Regards,

-\- David Eriksson -/-

An expert in a particular computer language is really an expert
in the work-arounds necessary to use this language to perform
useful work. - Richard B. Johnson


-- 
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] EXT_SKEL for Win32

2001-08-22 Thread Chris Gardner

i was noticing a slight problem with the whole EXT_SKEL shell script.  it
works great for getting a new package up and running, but only if your'
doing all your using basically the gcc compiler.  well, i've been trying to
create an extension library for php, and i am mainly using visual c++ 6 sp 3
on win2k.  i can run the EXT_SKEL in my cygwin prompt, and it makes the
files, fixes the build scripts, and the configure options, etc.  but, it
doesn't fix the win32 projects to add the new library.  has anyone else
looked at this, or thied to look at this?

if nobody else has burned this bridge before, let me know, i'll come up with
something you guys can use.


Chris Gardner
Book Systems, Inc.
[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]




Re: [PHP-DEV] EXT_SKEL for Win32

2001-08-22 Thread Zeev Suraski

At 21:42 22-08-01, Chris Gardner wrote:
i was noticing a slight problem with the whole EXT_SKEL shell script.  it
works great for getting a new package up and running, but only if your'
doing all your using basically the gcc compiler.  well, i've been trying to
create an extension library for php, and i am mainly using visual c++ 6 sp 3
on win2k.  i can run the EXT_SKEL in my cygwin prompt, and it makes the
files, fixes the build scripts, and the configure options, etc.  but, it
doesn't fix the win32 projects to add the new library.  has anyone else
looked at this, or thied to look at this?

if nobody else has burned this bridge before, let me know, i'll come up with
something you guys can use.

I think the guys who worked on ext_skel were mostly UNIX oriented.  At any 
rate, no work has been done to automate Windows builds - so if you can 
contribute in this area, it would be cool!

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]




[PHP-DEV] EXT_SKEL question

2001-08-21 Thread md

Hello Rasmus and Zeev and all the others:

Back in March, I attempted to get to the bottom
self contained extensions.  I never succeeded at
doing that, but I was able to get embedded extensions
compiled and working.

Unfortunately, I lost a hard drive last week and my PHP development
environment went crash...  No source code lost, just environment.

In trying to rebuild my PHP dev environment, I have come across a sticky
issue
that you guys may be able to help me with.  I cannot remember how I
solved it
last time.

I am still using PHP 4.0.4.pl1 (not 4.0.6).  

After running: /php/ext/EXT_SKEL --extname=addmod, I discover
in the ext/ directory another directory named addmod.  This 
extension compiles as embedded code into libphp4.so using:

../php/configure --with-mysql --with-apxs --with-addmod

Now, when I want to add code to addmod.c that would call functions
stored
in shared library /lib/libwhat.so, I find the compilation process
generates definition
errors for functions that reside with /lib/libwhat.so.

The important question is, what file and where within it do I add a
reference so that the linker can 
resolve the unknown definitions that are inside of /lib/libwhat.so or
any other shared library for that matter.

The syntax you would use to make the unresolved reference go away would
be very help as well.

Inside the addmod directory, there is addmod.c  php_addmod.h, Makefile,
Makefile.in
and config.m4.  It is not clear where I add the reference to allow the
linker to know
that unresolved references are in /lib/libm.so or other shared libraries

Any response appreciated.

Mark Diener


-- 
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] ext_skel and php_extname.c vs. extname.c

2001-07-21 Thread Stig S. Bakken

Jon Parise wrote:
 
 On Thu, Jul 19, 2001 at 05:50:42PM -0600, Joey Smith wrote:
 
  I had thought the decision was that php_extname.c was the correct way
  to name the .c file for an extension, so that we are less likely to
  conflict with any files from the package itself?
 
  ext_skel creates a .c file using the bare extname.
 
 I thought that convention only applied to the header files.

So did I, but practices seem to differ.  I find it very handy for
auto-completion that the header file name always starts with php_
(unless the extension is called P-something of course).

 - Stig

-- 
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] ext_skel and php_extname.c vs. extname.c

2001-07-19 Thread Joey Smith

I had thought the decision was that php_extname.c was the correct way
to name the .c file for an extension, so that we are less likely to
conflict with any files from the package itself?

ext_skel creates a .c file using the bare extname.


-- 
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] ext_skel and php_extname.c vs. extname.c

2001-07-19 Thread Jon Parise

On Thu, Jul 19, 2001 at 05:50:42PM -0600, Joey Smith wrote:

 I had thought the decision was that php_extname.c was the correct way
 to name the .c file for an extension, so that we are less likely to
 conflict with any files from the package itself?
 
 ext_skel creates a .c file using the bare extname.

I thought that convention only applied to the header files.

-- 
Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member

-- 
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]