[PHP-DEV] Refreshing pages after HTTP redirects

2003-03-07 Thread Daniel Joyce
Well, I've gone on to the next step of my project.

I've finally moved to a more structured development approach, treating 
web pages as forms as having them call a central cgi script that 
dispatchs calls to other scripts, and then redirects the client to the 
next step Basically, a mini servlet idea.

So, in my pages, the forms call a central script, say 'foo.php'.

foo.php redirects the client to a webpage that shows a Please wait, 
processing your request' page, using http header rediracts.

When processing completes, foo.php sends another http redirect header to 
the client to redirect it to the next step. The problem is the following...

Say the client is on a.php, which renders a form that calls foo.php when 
submitted. After processing, foo.php redirects the client back to a.php. 

( a.php has a search form, and displays query results from the DB ).

The problem is that a.php is not refreshed, it shows the last value. 
I've tried various http caching headers, and other items, and I can't 
seem to force a refresh when redirecting back to a.php.

Is there a header that says Go to a, but refresh it too.?

-Daniel

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


[PHP-DEV] Threads in PHP5?

2003-03-06 Thread Daniel Skrach
Hello, php-dev mailing list members,

Just one short question: Are threads a planned feature for ZE2 / PHP5?

thanks for your answers. 

Daniel Skrach
[EMAIL PROTECTED]
2003-03-07



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



Re: [PHP-DEV] Of string constants, bytecode, and concatenation

2003-02-26 Thread Daniel Cowgill
On Wed, 26 Feb 2003, David Brown wrote:

 Okay. Makes complete sense. I was thinking more along the lines of
 wouldn't it be nice if...?. I hadn't quite made it to where would
 that belong?. :)
 
 I'll check out the optimizers. I noticed that the new CVS version of APC
 seems to have a configuration option for optimization as well, though
 I'm not sure how far along it is.

That configuration option doesn't do anything right now (see the INSTALL file
for details)--the plan is to integrate the PEAR optimizer with APC (since
having separate extensions isn't particularly user-friendly), but I've been
too busy to get to it. It's on the to-do list...




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



Re: [PHP-DEV] give me advice

2003-02-23 Thread Daniel Lorch
hi,

 I have built a small daemon which is able to manage a neural network
 I have built a php-module php-module (in c/c++)  to communicate with the
 previous server.
  
 Do you think it could be interesting to do improve this things ?
 Sylvain Becker

If it is generic enough, why not try contributing it to PECL?

-daniel

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



[PHP-DEV] CVS Account Request: luisdaniel

2003-02-23 Thread Luis Daniel Ribeiro Louro
Help translate documentation to portuguese (PORTUGAL) and mantain it (if you need).

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



Re: [PHP-DEV] [PATCH][NEW FEATURE][HELP NEEDED] Forcing -f via mail() (ext/standard/mail.c)

2003-02-22 Thread Daniel Lorch
hi,

 I don't really know to start. I've made a patch and want to ask for
 the offical way to bring this patch into the php engine (if this is
 possible). [..]

This has been done several times now. Once by me, once by someone else,
and once by you. The decision was: No. Rationale: PHP should not fix
other applications' bugs. I disagree, but probably there have to be
a couple of more people writing such patches until someone understands
that this IS a serious problem.

-daniel

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



Re: [PHP-DEV] [PATCH][NEW FEATURE][HELP NEEDED] Forcing -f via mail() (ext/standard/mail.c)

2003-02-22 Thread Daniel Lorch
hi,

 - is it a good idea to 'fake' the '-f' parameter?

This can also be done with php_admin_value in the VirtualHost. No need to
patch PHP if you only want THIS behaviour.

-daniel

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



[PHP-DEV] CVS Account Request: dcowgill

2003-02-11 Thread Daniel Cowgill
Maintain apc, apd and optimizer in PECL

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




Re: [PHP-DEV] Database Abstraction

2003-02-05 Thread Daniel Lorch
hi,

 There are millions of PHP-scripts using MySQL. Most of them probably doesn't
 use an Database Abstraction Layer (DBAL) in order to support other databases.
 [..]

There are (too) many parallel efforts trying to create yet another database
abstraction layer. We all know it's necessary, but we also know that by ab-
stracting you have to either reduce the available features to the least
common denominator (not so good), or emulate stuff within the abstration
layer. 

Check out the existing ones, first:

  http://pear.php.net/packages.php?catpid=7catname=Database
  http://phplib.sf.net/
  http://freshmeat.net/projects/metabase/

-daniel

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




Re: [PHP-DEV] Question on bug list

2003-01-31 Thread Daniel Lorch
hi,

 I had two questions: One to assign to all NEW messages and one
 feature request to assign to selective bugs...I wanted to avoid reading
 all messages on any bug. Thats overkill...
 
 Get a mail client that can handle threading..

PHP-Bugs doesn't have In-Reply-To and References, does it?

-daniel

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




Re: [PHP-DEV] Question on bug list

2003-01-30 Thread Daniel Lorch
hi,

  Wouldn't it be nice if one could attach himself to a bug and receive an 
  email
  on every new message to that bug?
  
  And then how am i informed about new bugs? Is there a mailing list for 
  that?
  Currently i read the bug-summary-list..
  
 
 [EMAIL PROTECTED]

Empty mail to [EMAIL PROTECTED] should do it.

-daniek

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




Re: [PHP-DEV] Patch for #21330 - socket_select()

2003-01-02 Thread Daniel Lorch
hi,

 Well it was attached it looks the mailing list is dening them.

The mailinglist will only let you get through text/plain Attachements.

-daniel

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




Re: [PHP-DEV] emalloc() troubles

2002-12-26 Thread Daniel Lorch
hi,

 Hi there, I'm trying to hack mail.c to automatically pass a -f argument 
 to qmail with a return address, so that the Return-path of the message 
 is not always root@blah. Anyway, I seem to have been successful in this 
 endeavor, but I have a slight problem - whenever my code gets executed, 
 I get two errors output:

And people were laughing at me, when I suggested that, right?

@Ari

I could give you my patch, If you'd like to have a look at it. Not very
nicely written, though, but works fine.

-daniel

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




Re: [PHP-DEV] emalloc() troubles

2002-12-26 Thread Daniel Lorch
hi,

 This works perfectly, there's just a single memory leak that keeps 
 happening that I can't get rid of.

My version doesn't leak :) At least I think it doesn't. If you're bored, have
a look at it:

  http://marc.theaimsgroup.com/?l=php-devm=103927629711494w=2

But your version has the advantage of introducing the ini-parameter
qmail_compat. After some investigations, I believe that this IS truly
a bug in qmail (uh-oh, bug in qmail? impossible? no!):

  4.7. Mail sent from anonymous, particularly by daemons.
  http://www-dt.e-technik.uni-dortmund.de/~ma/qmail-bugs.html

Although this is quite low-priority, someone of the Dev-Team might want to
reconsider adding this (Ari's) patch to the main branch? Appears to be a
common problem. I could name you several people on PHP-De and qmail
who were asking the same thing.

-daniel

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




Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-08 Thread Daniel Lorch
hi,

Somehow this is starting to annoy me -- sorry for the unnecessary noise I
am causing on this list. I just thought people who are having the same problem
would be looking on marc.theaimsgroup.com or google and find a possible fix.
I'm not forcing anyone to use it.

 Setting Return-Path is useless. It's stripped by sendmail, unless it's allowed
 in the cf file explicetely. Same for postfix version of sendmail.

This also applies to qmail-smtpd, however, I'm talking about qmail-inject.

 You simply need to setup your mailserver correctly and php accordingly, ie:
 let the webserver user be allowed to use the '-f' sendmail flag and provide
 this in the arguments of mail() or via ini_set.

I'm not using mod_php. And the -f switch is a nice quick-fix, but it would
force me to hardcode a Return-Path and how can I be sure that
[EMAIL PROTECTED] really exists? It is just more intuitive that
if a user supplies a From header, not only human-generated responses
will get back to him, but also machine-generated bounces.

 In no way, should mail() by default equal the RCPT TO user to the From: 
 header - if I would host users,

And I'm sure my users don't want me to read their mails. But I HAVE to
read bounces. I never touch people's personal stuff otherwise.

 I would like to know, if they start spammin' or have buggy scripts. 

That's why logfiles exist.

 What ever the reason - the final control of this option should
 remain with the mailserver administrator, not the mail user.

I'm not hardcoding Return-Path. 

-daniel

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




Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
hi,

Here's an improved version of this patch, which doesn't SEGFAULT on invalid
input. Someone just brought up this topic on php-de and qmail, so I thought
there is some interest in this patch .. Everbody else just ignore me :)

-daniel

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


Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
--- php-4.2.3/ext/standard/mail.c   Sat Aug 24 13:38:13 2002
+++ php-4.2.3-daniel/ext/standard/mail.cMon Dec  2 01:24:35 2002
@@ -21,6 +21,7 @@
 #include stdlib.h
 #include ctype.h
 #include stdio.h
+#include string.h
 #include php.h
 #include ext/standard/info.h
 #if !defined(PHP_WIN32)
@@ -124,6 +125,84 @@
 }
 /* }}} */
 
+char *get_header_value(char *line)
+{
+   while(*line  *line != ':')
+   line++;
+
+   if(!*line)
+   return NULL;
+
+   line++;
+   
+   while(isspace(*line))
+   line++;
+
+   return strdup(line);
+}
+
+char *get_header(char *header_name, char *headers)
+{
+   char *line, *value=NULL;
+   int header_name_len = strlen(header_name);
+   int len=0;
+   
+   do {
+   if(*headers == '\n' || *headers == '\0') {
+   if(len  header_name_len) {
+   len = 0;
+   continue;
+   }
+   
+   if((line = (char *)malloc(len + 1)) == NULL)
+   return NULL;
+   
+   headers -= len;
+
+   strncpy(line, headers, len);
+   line[len] = '\0';
+
+   headers += len;
+   
+   if(strncmp(line, header_name, header_name_len) == 0) {
+   value = get_header_value(line);
+   }
+   
+   free(line);
+   
+   len = 0;
+   } else {
+   ++len;
+   }
+   } while(*headers++  value == NULL);
+   
+   return value;
+}
+
+char *extract_address(char *address)
+{
+   char *start, *stop, *tmp;
+   
+   if((start = stop = strchr(address, '@')) == NULL)
+   return NULL;
+   
+   while(start = address  !isspace(*start)  *start != '')
+   start--;
+   
+   start++;
+   
+   while(*stop  !isspace(*stop)  *stop != '')
+   stop++;
+   
+   if((tmp = (char *)malloc(stop - start + 1)) == NULL)
+   return NULL;
+   
+   strncpy(tmp, start, stop - start);
+   tmp[stop-start] = '\0';
+   
+   return tmp;
+}
+
 /* {{{ php_mail
  */
 PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char 
*extra_cmd)
@@ -135,6 +214,8 @@
int ret;
char *sendmail_path = INI_STR(sendmail_path);
char *sendmail_cmd = NULL;
+   char *return_path;
+   char *address;
 
if (!sendmail_path) {
 #ifdef PHP_WIN32
@@ -169,6 +250,25 @@
fprintf(sendmail, To: %s\n, to);
fprintf(sendmail, Subject: %s\n, subject);
if (headers != NULL) {
+
+   /* Existing Return-Path should not be overwritten */
+   if((return_path = get_header(Return-Path, headers)) != NULL) 
+{
+   free(return_path);
+   }
+   else {
+
+   if((return_path = get_header(From, headers)) != 
+NULL) {
+   
+   if((address = extract_address(return_path)) != 
+NULL) {
+   fprintf(sendmail, Return-Path: 
+%s\n, address);
+   free(address);
+   }
+
+   free(return_path);
+
+   }
+   }
+
fprintf(sendmail, %s\n, headers);
}
fprintf(sendmail, \n%s\n, message);

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




[PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
Hi Andi,

 Are you sure you should be using malloc()/free() and not emalloc()/efree()?
 Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice 
 in one day :)
 http://www.courtesan.com/todd/papers/strlcpy.html

Probably there are even more things broken in my patch :) I'm quite new to C
and I'm happy it works without segfaulting. strlcpy looks interesting and
I'll read through the link as soon as I find some free time.

Oh, this patch is explicitly *NOT* meant to go into the main branch. It's
just an additional patch for whoever needs it, sorry for not pointing this
out more explicitly.

-daniel

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




Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail

2002-12-07 Thread Daniel Lorch
hi,

 Good because I havn't seen any positive responses to this and I'm still
 negative on it.

You don't have to use it.

 Apart from disagreement with the prinicipal here I'd also ask: Where is
 the portion of the patch to support Win32 SMTP via the MAPI interface?
 ((as opposed to sendmail_path interface which you've covered on all
 platforms))

This is not necessary, at least not with qmail. qmail-smtpd DOES already
use the From-Header to write the Return-Path -- compared to qmail-inject,
which DOESN'T, and instead uses a default address (such as
Return-Path: [EMAIL PROTECTED]).

 A more generalized fix would be to append the Return-Path to the headers
 string at the top of the php_mail function so that it's caught by both the
 sendmail block and by the TSendMail call (MAPI).
 
 Any modification to behavior which effects one platform should affect all
 platforms equally.  While Win32/sendmail is kept equal, Win32/MAPI (used
 by the majority of Win32 users) is not.

I'm just providing a working solution to a more or less common problem. I
know there are others who are having the same problem, so I am providing
a solution to everyone interested.

Feel free to post an improved version of my patch. Andi kindly did some
code auditing, so there are many things that can be rewritten much nicer :)

-daniel

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




[PHP-DEV] SQL Error

2002-12-06 Thread Daniel
Please help. I have a basic scipt:

$connection_id=odbc_connect($DSN,$user,$pass);
$sql=select * from whatever;
$stmt=odbc_prepare($connection_id,$sql);
$result=odbc_execute($connection_id,$stmt);

this script used to work on RH-7.3 with php-4.1.2
the script will not work anymore when i installed RH-8 using php-4.2.2
the connection IS successful, but when i try anything after that i get this
error:

Warning: SQL error: [unixODBC][IBM][iSeries Access ODBC Driver]Error in host
server data stream., SQL state S1000 in SQLPrepare

i can connect,prepare and execute statements from c++ so it must be php
specific?
please help!!





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




Re: [PHP-DEV] Zend fast cache

2002-11-30 Thread Daniel Cowgill

On Saturday, November 30, 2002, at 07:17 PM, Sterling Hughes wrote:


The problem I see with an array approach from an api perspective is 
simply when a bucket
is free'd, in order to have efficient memory usage, we'd need a second 
level array scan
for every ALLOC_ZVAL().

Perhaps a linked list would be a better choice for this, as we can 
just be smart about bucket
access, and eliminate the need for a scan (could be possible I'm 
missing something?)

I agree, a singly linked list seems like a no-brainer; it's an ideal 
memory-pool data structure because inserts and deletes occur only at 
the front of the list (so they're constant-time), the links are free, 
and the implementation is straightforward.


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



Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-11-29 Thread Daniel Lorch
hi,

 I'm a big -1 on this.  The patch will not actually solve the root problem.

 On Unix systems, the MTA needs to know that the webserver user is
 'trusted' to masquerade as another user.  In exim this would be the
 'trusted-users' directive, sendmail, qmail, and postfix have similar
 directives.

Thanks for pointing this out. I was pretty sure there was something un-RFC-ish
about my patch. However, I think the patch creates a more intuitive behaviour:
If the user supplies a From:  header, he expects all replies coming back to
this address -- be it human generated responses or bounce messages.

In contrast to qmail-inject (handling local mails), qmail-smtp (the SMTP-daemon)
DOES use the From header (of the mail envelope, not header) for the
Return-Path. I would call this inconsistent behaviour. However, I'm currently
discussing this on the qmail mailing list, please don't be bothered by this
here :)

 You might consider recommending a configuration setting like the following 
 in each VirtualHost block on a multi-domain Apache server.  This sends 
 bounces and replies to the webmaster of the domain if no attempt is made to 
 set the From: and Reply-to: headers when mail() is used.
 
 VirtualHost www.mydomain.com
 pph_admin_value sendmail_path /usr/sbin/sendmail -t [EMAIL PROTECTED]

That's actually a good proposition. The documentation team might want to
catch this up. Unfortunately, this doesn't work with my setup, as I'm
(mod_cgi-)wrapping all scripts. 

-daniel

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




[PHP-DEV] Default Return-Path with mail() and qmail

2002-11-28 Thread Daniel Lorch
hi,

I was fed up with getting a lot of bounce mails of users on my host, who
apparently just have discovered the mail() function in PHP and are writing
mails to bogus recipients.

Apparently, the default Return-Path that is being set by our MTA (qmail)
is Return-Path: anonymous@myhost, even if the user has set a From:
header. I thought this was quite counter-intuitive, as any error messages,
such as not available mailboxes etc.. were bouncing back to me instead of
the users. 

Instead of documenting this behaviour and telling all users that they
should also add a Return-Path to their mail() commands, I decided to
write a patch which, if no Return-Path header was set, would use the
From header instead (if it existed, of course). 

I'm pretty sure this is not the right thing (tm) to do, as I should
rather fix this problem with my MTA. However, I am currently too dumb
to understand qmail's sources (DJB should have really commented his
sourcecode), therefore I just did this quick fix. I posted it here
because I heard others having the same problem. All others please
just ignore this posting :)

Warning(s):
  - This is NOT a general-purpose patch (do not apply to main branch)
  - This patch probably breaks all rules on coding style and consistency
(malloc instead of emalloc etc..)
  - I know C for only a couple of weeks. Don't blame me if everything
crashes and your machine burns down.

-daniel


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


Re: [PHP-DEV] Default Return-Path with mail() and qmail

2002-11-28 Thread Daniel Lorch
--- php-4.2.3/ext/standard/mail.c   Thu Nov 28 11:37:12 2002
+++ php-4.2.3-daniel/ext/standard/mail.cFri Nov 29 01:50:09 2002
@@ -21,6 +21,7 @@
 #include stdlib.h
 #include ctype.h
 #include stdio.h
+#include string.h
 #include php.h
 #include ext/standard/info.h
 #if !defined(PHP_WIN32)
@@ -124,6 +125,66 @@
 }
 /* }}} */
 
+char *get_header(char *header_name, char *headers)
+{
+   char *tmp;
+   char *header_value = NULL;
+   int len=0, i;
+   
+   do {
+   if(*headers == '\n' || *headers == '\0') {
+   if(len  strlen(header_name)) {
+   len = 0;
+   continue;
+   }
+   
+   if((tmp = (char *)malloc(strlen(header_name) + 1)) == NULL)
+   return NULL;
+
+   /* rewind pointer */
+   for(i = 0; i  len; ++i)
+   --headers;
+
+   /* copy data */
+   for(i = 0; i  strlen(header_name); ++i) {
+   tmp[i] = *headers++;
+   }
+   
+   tmp[i] = '\0';
+
+   /* compare */
+   if(strcasecmp(header_name, tmp) == 0) {
+   header_value = (char *)malloc(len - 
+strlen(header_name) - 2 /* colon and space */ + 1);
+   
+   *headers++; /* colon */
+   *headers++; /* space */
+   
+   for(i = 0; i  len - strlen(header_name) - 2 /* colon 
+and space */; ++i) {
+   header_value[i] = *headers++;
+   }
+   
+   header_value[i] = '\0';
+   }
+   else {
+   /* fast foward pointer :) */
+   for(i = strlen(header_name); i  len; ++i) {
+   headers++;
+   }
+   }
+
+   free(tmp);
+   
+   len = 0;
+   }
+   else {
+   ++len;
+   }
+   }
+   while(*headers++  header_value == NULL);
+
+   return header_value;
+}
+
 /* {{{ php_mail
  */
 PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char 
*extra_cmd)
@@ -135,6 +196,7 @@
int ret;
char *sendmail_path = INI_STR(sendmail_path);
char *sendmail_cmd = NULL;
+   char *return_path;
 
if (!sendmail_path) {
 #ifdef PHP_WIN32
@@ -169,6 +231,21 @@
fprintf(sendmail, To: %s\n, to);
fprintf(sendmail, Subject: %s\n, subject);
if (headers != NULL) {
+
+   if((return_path = get_header(Return-Path, headers)) == NULL) 
+{
+   if((return_path = get_header(From, headers)) != 
+NULL) {
+   if(strchr(return_path, ''))
+   fprintf(sendmail, Return-Path: %s\n, 
+return_path);
+   else
+   fprintf(sendmail, Return-Path: 
+%s\n, return_path);
+
+   free(return_path);
+   }
+   }
+   else {
+   free(return_path);
+   }
+
fprintf(sendmail, %s\n, headers);
}
fprintf(sendmail, \n%s\n, message);

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-26 Thread Daniel Lorch
hi,

 I fired off a mail to PHP-DE asking the average PHP user about localization
 of error messages. My mail might be a bit biased, so if you have something to
 say, do it now. I will summarize the results here. 

Ok, here's the summary of my NON-representative poll to PHP-De about localization
of error messages in PHP:

  Pro: 1
  Contra: 8

Some thoughts that were brought up:

  - PHP developers should not waste their time on localization, instead focus 
on increasing verbosity of existing error messages (a meaningless error
message in english will be meaningless in every other language as well).

  - The english used in error messages is only a small subset of the whole
language (come on, everyone knows enough MTV-english to understand error
messages). However, other countries might have more problems as their
languages don't come from the same language family.

-daniel

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-26 Thread Daniel Lorch
hi,

 Some thoughts that were brought up:

Oh, another one:

  - Localization is stupid and we might lose our existing userbase, namely
more proficient PHP developers- 

-daniel

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




[PHP-DEV] Re: [Zend Engine 2] RFC: Conversion patch

2002-11-26 Thread Daniel Cowgill
So why do the conversion in arithmetic? This seems bizarrely inconsistent to
me:

?
print (int)  0xA + 0;   // prints 0
print (int) (0xA + 0);  // prints 10
?

I think it's reasonable to expect those expressions to return the same value.


On Tue, 26 Nov 2002, Andi Gutmans wrote:

 http://marc.theaimsgroup.com/?l=php-devm=90279104406264w=2
 
 There's more...
 
 Andi
 
 At 10:21 PM 11/26/2002 +0100, Derick Rethans wrote:
 On Tue, 26 Nov 2002, Andi Gutmans wrote:
 
   I remember having a long conversation on this issue quite a long time ago.
   I think it was on php-dev. The bottom line was that we only want 
  conversion
   in the scanner and not within PHP.
 
 Too bad, because the following thing is totally uninituitive:
 
 echo (int)0x200;
 
 (prints 0)
 
 And I searched for a discussion on this, but couldnt' find it. I wonder
 why it was decided to be like this.
 
 Derick
 
 --
 
 -
   Derick Rethans http://derickrethans.nl/
   JDI Media Solutions http://www.jdimedia.nl/
   PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
 -
 
 



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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-25 Thread Daniel Lorch
hi,

 What you're missing is that currently to program PHP, you need a reasonable
 understanding of english. [..]

I agree with Sterlin. I mean, what's next? Also localize language constructs?

  ?php

  während (EUR i=0; EUR i5; ++EUR i) {
ausgabe(Hallo);
wenn (EUR i % 5) {
  [..]
}
  }

Uah.. terrible.

-daniel

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-25 Thread Daniel Lorch
hi,

 Daniel, Sterling is arguing in favor of having localized
 error messages.

s/agree/disagree/ :)

Do what you think is right. However, I think it just adds another level of
unnecessary complexity. We can safely assume a certain level of intelligence
when dealing with php developers (developers as in developing IN PHP).
PHP is not a application as in Windows XP or Media Player, but it's a
development environment where the users necessarily has to be confronted
with a couple of error messages. For the sake of brevity, these are kept
in english and this shouldn't change, IMAO. 

Developers don't have to be spoon-fed. Really.

-daniel

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-25 Thread Daniel Lorch
hi,

 I'm not really arguing for or against this, but since when did speaking 
 english become a corollary of being intelligent?  And even if we accept 
 the rather ridiculous hypotheis that all php developers can comprehend 
 english, what if they don't want to, or are more confident using their 
 native tongue in day-to-day work?  Why deny that to them on prinicple?

I wasn't trying to equate intelligence with the knowledge of a language
(ok, I did, but that wasn't my point, really). We are arguing about
implementing localized error messages, because we think it will
  
  a) attract more people to PHP
  b) faciliate their (and our) lives

While I think that localization can bring SOME advantages, the
disadvantages will overweigh. Error messages are really very brief and
only consist of a few words, which can be quickly looked up. However,
what about the maintenance headache when you are assigned to a project
written in a foreign language?

I would prefer to have the developers getting used (yes, meaning
educate them) to english being a universal language, for both the
language constructs, error messages, documentation. This will be
more advantageous in the long run. 

-daniel

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-25 Thread Daniel Lorch
hi,

 Don't.
 You shouldn't think of PHP-users as developers in this sense.
 Read my other mail. I mean the don't even want to program and least amount 
 of effort-part.

You're right. We should think about writing a colorful GUI for PHP, so scripts just
can be clicked together. Oh, and it definitively should support skins..

I can absolutely understand your argumentation (which you forgot to CC to the list,
by the way) and being a regular to PHP-DE (german PHP users mailinglist), I am also
in touch with people you described. But what's wrong about just HREF'ing to the
manual, which is localized anyway? The only thing we are endlessly quarrelling^H^H
^H^H^H^H^H discussing about is whether we want to add localized error messages,
yes?

Ok, simple question: Who would be (theoretically) willing to write AND maintain
the appropriate code?

-daniel

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




Re: [PHP-DEV] [PATCH] Redirect on Error

2002-11-25 Thread Daniel Lorch
hi,

  You're right. We should think about writing a colorful GUI for PHP, so
  scripts just can be clicked together. Oh, and it definitively should
  support skins..
 
 I don't think this would work.
 But if it did, it's place wouldn't be inside the language. Either in an IDE or 
 in a PHP-application. PHP often is used for skinning a website, btw. [..]

Oh, it was meant to be a joke. 

I fired off a mail to PHP-DE asking the average PHP user about localization
of error messages. My mail might be a bit biased, so if you have something to
say, do it now. I will summarize the results here. 

-daniel

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




Re: [PHP-DEV] Re: ODBTP, a possible solution for MS-SQL and other databases

2002-11-13 Thread Daniel Swarbrick
The reason for not installing the ODBC drivers on the webserver is that the
database referenced by the drivers are simply on-disk files (ie, no socket
communication involved). We would need to allow SMB traffic through our
firewall if we were to use the ODBC drivers on the webserver, which is
something I'm not prepared to do. I don't mind allowing a single, non-MS TCP
port through the firewall tho.

Robert Twitty [EMAIL PROTECTED] wrote in message
news:Pine.GSO.4.44.0211131557230.8398-10;neutron...
 In some ways it is similar to an ODBC to ODBC bridge.  Typically bridges
 are used for UNIX to Win32 connectivity.  In your case it appears that the
 client and server are both Win32 platforms.  Is there a reason why you
 cannot install the required ODBC drivers on the machine running IIS?  We
 are using ODBTP on an Apache / PHP / Solaris server to access databases
via
 ODBC drivers on a Win2K server.  However, I am certain that the PHP
 extension should work on the Win32 platform.  Unfortunately I do not
 possess the knowledge on how to compile and install extensions for
 Win32-based PHP.

 The ODBTP software is not quite ready for prime time (primarily due to a
 lack of documentation).  If you like I can give you the URL to what's
 available now.

 -- bob

 On Wed, 13 Nov 2002, Daniel Swarbrick wrote:

  Could this provide the functionality of an ODBC to ODBC bridge, if one
used
  the Win32 client library?
 
  We have a requirement for an IIS webserver in a DMZ to talk to an ODBC
  database on a Windows 2000 server in the trusted network.
 
  I know there is already an ODBC-ODBC bridge commercial package, but it's
a
  tad expensive.
 
  Robert Twitty [EMAIL PROTECTED] wrote in message
  news:00aa01c28296$aeb10fe0$9b00a8c0;bobawa...
   Hello
  
   ODBTP consists of a Windows NT / 2000 service application, an ODBTP
client
   library that can be used to create  Win32 or UNIX clients,  and a PHP
   extension module that was created with the library.   ODBTP has the
   following features:
  
 
 
 
  --
  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] Re: ODBTP, a possible solution for MS-SQL and other databases

2002-11-12 Thread Daniel Swarbrick
Could this provide the functionality of an ODBC to ODBC bridge, if one used
the Win32 client library?

We have a requirement for an IIS webserver in a DMZ to talk to an ODBC
database on a Windows 2000 server in the trusted network.

I know there is already an ODBC-ODBC bridge commercial package, but it's a
tad expensive.

Robert Twitty [EMAIL PROTECTED] wrote in message
news:00aa01c28296$aeb10fe0$9b00a8c0;bobawa...
 Hello

 ODBTP consists of a Windows NT / 2000 service application, an ODBTP client
 library that can be used to create  Win32 or UNIX clients,  and a PHP
 extension module that was created with the library.   ODBTP has the
 following features:




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




Re: [PHP-DEV] PHP Snaps

2002-11-11 Thread Daniel T. Gorski
Ilia A. wrote:

 Well there are a number of issues. First of all current snapshot listing
 is a regular apache directory listing, which causes files with names
 longer then X amount of characters to be cut off.

Please learn to configure apache:

  http://httpd.apache.org/docs/mod/mod_autoindex.html#indexoptions
  Keyword: NameWidth

 If we decide to add any readable timestamp to the file we'd need to use
 some PHP script to display the files. In this case it would be trivial to
 make the script sort the files by their creation date.

Beware. For every task the appropriate tool.

regards dtg

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




[PHP-DEV] CVS Account Request: jaenecke

2002-10-29 Thread Daniel Jaenecke
I am mainly interested in working on the manual; completing the german version (I am 
german, never mind the email .li), clearing unclear passages etc.
But I also could imagine to do a little debugging 


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




Re: [PHP-DEV] Thread Reading

2002-09-19 Thread Daniel Lorch

hi,

   And sensitive cleartext data like SQL passwords can always be passed
 through environment variables. For instance, Apache has the 'Setenv'
 directive to set this, and the httpd.conf file can be made only readable by
 root.

Correct me if I'm wrong, but the documentation to mod_auth_external reads
like this:

  By default, mod_auth_external passes the user's login and password to the external
  authentication program by putting them in environment variables called USER and PASS.
  On some versions of Unix (including SunOS and IRIX) any user logged onto the server
  can see these values by doing a ps -e command.

  http://www.unixpapa.com/mod_auth_external.html

Maybe this is out of context, but according to that documentation, using environment
variables for sensitive data is not a good idea -- although I cannot confirm this,
as I do not have access to SunOS or IRIX.

-daniel

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




[PHP-DEV] RE: configure patch for Solaris

2002-09-11 Thread Daniel Parks

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

FWIW, the patch is backwards. patch -R should take care of it.

Daniel Parks

 diff -u configure.php configure.php.orig
 --- configure.php   Tue Aug  6 16:14:20 2002
 +++ configure.php.orig  Sun Jul 21 05:56:20 2002
  -66529,11 +66529,7 
  JS_GetRuntime()
  ; return 0; }
  EOF
 -###verinform: redefine to include -G
 -ac_link='${CC-cc} -G -o conftest${ac_exeext} $CFLAGS $CPPFLAGS
 $LDFLAGS conftest.$ac_ext $LIBS 15'
  if { (eval echo configure:66533: \$ac_link\) 15; (eval
 $ac_link) 25; }  test -s conftest${ac_exeext}; then
 -###verinform: now put it back like it was:
 -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS
 $LDFLAGS conftest.$ac_ext $LIBS 15'
rm -rf conftest*
eval ac_cv_lib_$ac_lib_var=yes
  else

-BEGIN PGP SIGNATURE-
Version: PGP 7.1

iQA/AwUBPX+UkOtGBZSgTte3EQKR7QCfU0+MfEIkzqhqZs3A4z+peMfo/nwAoJMq
PsZqvBlhy81G4arTqHsKyEVa
=ggFH
-END PGP SIGNATURE-


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




Re: [PHP-DEV] Re: cgi and mod_php

2002-08-28 Thread Daniel Lorch

hi,

  Yes, it would look like this:
 
  1. ./configure appropiate stuff
  2. make
  3. make clean
  4. goto 1
 
  - Sascha
 
 So we do not have the possibility to build all three without
 make clean in one go. I would very much appreciate that
 since it would make developers life much easier...

Use the force, luke.

  #!/bin/bash

  for mode in apache cli cgi; do
./configure --with-${mode}
make
make clean
  done

Maybe this script doesn't work, but you get the idea :)

-daniel

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




Re: [PHP-DEV] trans-sid warning?

2002-08-14 Thread Daniel Lorch

hi,

I absolutely agree with Stefan here. It is *not* PHP's job to secure
a connection. SSL does this. 

-daniel

- Original Message -
From: Stefan Esser [EMAIL PROTECTED]
Sent: Wed, 14 Aug 2002 16:23:16 +0200
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] trans-sid warning?

 I do not understand the sense of this whole discussion.
 HTTP is a plaintext protocol. So nothing transfered over HTTP can be secure.
 No urls, no session no anything.
 
 Stefan
 
 
 -- 
 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] Session variables

2002-07-31 Thread Daniel Lorch

hi,

 Hi, with ASP I use session variables to keep a variable alive between one
 page and another.  What is the comparable way to do it with php?
 Thank you,
 Diana

believe it or not - using session variables:

  http://php.net/session

-daniel

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




Re: [PHP-DEV] Re: [PHP-QA] Congratulations.

2002-07-31 Thread Daniel Lorch

hi,

 Congratulations Derick.
 Most deserving recognition for a terrific job.
 I will add to that my humble thanks.

No offense, but I think other developers should be mentioned as well. I very
much like wez' work on innovative ideas - even though his results might not be
suitable for the masses (such as having PHP client-sided embedded into redmond's
browser etc.).

But generally, I think honoring hard working developers is a good idea, as they
only seldomly get positive feedback on their work (what they certainly deserve).

-daniel

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




Re: [PHP-DEV] Re: User-space functionality of apache2filter

2002-06-03 Thread Daniel BODEA

 On Sun, Jun 02, 2002 at 11:33:08AM -0700, Aaron Bannert wrote:
  I really wish people would stop quoting artificial dates for when the
  apache2filter will magically become stable, and just start using it
  and identifying problems. A few of us have put some great effort into
  making it usable, and I have been using it on my site for the last few
  weeks with no problems. It will become stable when it has been used in
  production, not when it's been sitting stale in CVS for 6 months.

 To add my two cents:

 I have been using apache2filter in production for quite a few months
 with no user-visible problems with a threaded MPM.  All segfaults
 that I have seen are now fixed in CVS.  -- justin

I use apache2filter in production myself so it's really not a deployment
problem at all. I think the previous discussion was referring to the time
needed to gather a critical mass of production installations in order to get
a substantial amount of feedback, feature requests, bug reports and
successful tests on different platforms and configurations as to brand the
module successfully deployed on a large scale and feature consistent.

.02
D


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




[PHP-DEV] Re: User-space functionality of apache2filter

2002-06-02 Thread Daniel BODEA

 There's a great difference here, apache2filter misses many of
 the functions provided by the apache sapi. The question is,
 is someone working on adding them or are they silently
 dropped?

 I'm asking for two reasons: consistency and documentation.

apache2filter is a long way from production status. A previous thread stated
it's some 6 months away from real beta quality due to the lack of time from
developers familiar with the apache 2 API. I plan on doing some work on this
myself but that only means that I'll get to dig into the code in a couple of
weeks or so.

D


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




[PHP-DEV] fopen zend wrapper and relative paths

2002-05-31 Thread Daniel BODEA

The bug #11326 was closed after Zeev added the current executing file's
directory to the search path, which solved half of the problem. The original
bug #9673 though is still open, and the last comment is pointing to the
other half of the problem, dot relative paths.

Right now, in main/streams.c/_php_stream_fopen_with_path the dot case is
dealt with right from the start and no other paths get expanded.

What I propose in order to conclude this matter, to get an intuitive
behavior and to remain fully compatible with older versions is to add only
the current executing file's directory _after_ the cwd of the main file for
dot path expansion.

This way the include and live parts of a project get fully decoupled,
nested includes work as expected (from everyone's perspective), no longer
the need to carry arround a root variable (anticipating that the user may
disregard the DOCUMENT_ROOT and install the product relative to something
else), and the language scales a little bit better.

I'm gonna start doing this right now if no one digs up any security problems
that refused to cross my mind.

D


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




[PHP-DEV] $_FILES, is there ant bug?

2002-05-27 Thread Daniel CAstro

My code is much more extense than this, but I guess this is the source of my
problem.
arquivo is a member of a form, it is a file type, declared like input
type=file name=arquivo...
I need to know if there is a file selected or not, that is the reason of the
bug.
When I run this code, through the form it does not print anything, even when
I choose a file on the previous html (html with a form, with an action
calling this script...)  My version of PHP is 4.x
?php
 $nome = $_POST['nome'];
 $des = $_POST['des'];
 $eng = $_POST['eng'];
 $id  = $_POST['id'];
 $tabela= $_POST['tabela'];
 $tabela_nova  = $_POST['dd_tipo'];
 $arquivo  = $_FILES['arquivo']['name'];
 //Conexao com BD...
 printf(%s,$arquivo);
?

Why it is happenig???
_
Daniel Castro ICQ#: 12919017
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_


---
O email enviado não tem Vírus
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.365 / Virus Database: 202 - Release Date: 24/5/2002



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




Re[2]: [PHP-DEV] PHP web farms (i.e. why msession or something like it)

2002-05-25 Thread Daniel Lorch

Hi,

 Chris Shiflett:
 The regular session implementation in PHP is extremely flexible, right? 
 Sure, since you can write your own functions to do things such as store 
 session data in a database, etc. However, there is *nothing* to help the 
 average developer implement a professional-grade state management system 
 out of the box. [..]

Let's make it a documentation problem, then:

  Using PHP in web farms or the like.

Having msession in PHP's Core doesn't mean people understand what it's
good for. Moving it into PECL doesn't keep people, who *KNOW* what it
does still using it.
  
-daniel



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




Re: [PHP-DEV] PHP as an ActiveScript Engine

2002-05-25 Thread Daniel Lorch

Hi,

this is pretty amazing. Making PHP available on the client side could
make it more popular among developers to create portable applications
while still using known tools (such as HTML and PHP - and not having to
move to GTK).

I could imagine a starter application which launches a browser
window and then displays the PHP application - for example as an
application/presentation distributed on CD which requires interactive
elements (such as connecting to a remote MySQL server to download an
up-to-date price list etc..).

Good work, wez.

-daniel



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




Re[3]: [PHP-DEV] PHP web farms (i.e. why msession or something like it)

2002-05-25 Thread Daniel Lorch

Hi,

 Let's make it a documentation problem, then:
   Using PHP in web farms or the like.

I'd like to make a suggestion here: What do you think of splitting up
the current PHP Manual into three major parts:

  1. Developing in PHP (for PHP users)
  2. Extending PHP
  3. PHP for System Administrators

Part 3 would cover all topics interesting only to a system
administrator, such as installing PHP, security issues (open_basedir,
safe_mode, alternatives such as fastcgi, tweaking the configuration on
a vhost basis, ..), installing PHP on web farms etc..

These topics usually don't interest the average PHP developer - why
keep it in the same manual, then?

What do you think about this?
  
-daniel



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




[PHP-DEV] opendir security hole

2002-05-23 Thread daniel

hi i am creating a webbased filemanager for uploading files to the database,
to determin which dir i upload to i have the directory in the query string
ie ?dir=blah , i have found a security flaw where if you type
dir=../../../../ it will show you the root dir of the server , how can i
lock into a directory when using opendir ? please let me know thanks



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




[PHP-DEV] CVS Account Request: dali

2002-05-22 Thread Daniel BODEA

Generic bug fixing, feature completion, cosmetic and more bug fixing hopefully (as I 
continue to work on large and complex PHP based projects, and as it seems there's a 
lack of developers - and dedicated time - in this area)

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




[PHP-DEV] [PATCH] add lchown as a third parameter to chown and chgrp

2002-05-17 Thread Daniel BODEA

No reaction the first time so this is a repost.

Diffed against the stable 4.2.0 source tree. Adds an optional third bool to
chown and chgrp that makes use of the lchown system call to change the owner
and group of the symlink itself, and not the final target. The default
behavior is unchanged.

D


--- TSRM/tsrm_virtual_cwd.h.origTue Dec 11 16:16:20 2001
+++ TSRM/tsrm_virtual_cwd.h Wed May  8 01:32:47 2002
 -132,6 +132,7 
 CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
 #ifndef TSRM_WIN32
 CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC);
+CWD_API int virtual_lchown(const char *filename, uid_t owner, gid_t group TSRMLS_DC);
 #endif
 
 CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func 
verify_path);
 -181,6 +182,7 
 #define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC)
 #ifndef TSRM_WIN32
 #define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group TSRMLS_CC)
+#define VCWD_LCHOWN(path, owner, group) virtual_lchown(path, owner, group TSRMLS_CC)
 #endif
 
 #else
 -214,6 +216,7 
 #define VCWD_CHMOD(path, mode) chmod(path, mode)
 #ifndef TSRM_WIN32
 #define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
+#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group)
 #endif
 
 #endif
--- TSRM/tsrm_virtual_cwd.c.origTue Dec 11 16:16:20 2001
+++ TSRM/tsrm_virtual_cwd.c Tue May  7 19:09:04 2002
 -538,6 +538,20 
CWD_STATE_FREE(new_state);
return ret;
 }
+
+CWD_API int virtual_lchown(const char *filename, uid_t owner, gid_t group TSRMLS_DC)
+{
+   cwd_state new_state;
+   int ret;
+
+   CWD_STATE_COPY(new_state, CWDG(cwd));
+   virtual_file_ex(new_state, filename, NULL);
+
+   ret = lchown(new_state.cwd, owner, group);
+
+   CWD_STATE_FREE(new_state);
+   return ret;
+}
 #endif
 
 CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
--- ext/standard/filestat.c.origThu Feb 28 09:26:45 2002
+++ ext/standard/filestat.c Wed May  8 03:42:11 2002
 -331,7 +331,7 
 }
 /* }}} */
 
-/* {{{ proto bool chgrp(string filename, mixed group)
+/* {{{ proto bool chgrp(string filename, mixed group [, bool no_dereference])
Change file group */
 PHP_FUNCTION(chgrp)
 {
 -340,10 +340,23 
gid_t gid;
struct group *gr=NULL;
int ret;
+   zval **no_dereference = NULL;
 
-   if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, filename, 
group)==FAILURE) {
+   switch (ZEND_NUM_ARGS()) {
+   case 2:
+   if (zend_get_parameters_ex(2, filename, group) == FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+
+   case 3:
+   if (zend_get_parameters_ex(3, filename, group, no_dereference) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+
+   default:
WRONG_PARAM_COUNT;
}
+
convert_to_string_ex(filename);
if (Z_TYPE_PP(group) == IS_STRING) {
gr = getgrnam(Z_STRVAL_PP(group));
 -367,7 +380,12 
RETURN_FALSE;
}
 
-   ret = VCWD_CHOWN(Z_STRVAL_PP(filename), -1, gid);
+   if (no_dereference  Z_BVAL_PP(no_dereference)) {
+   ret = VCWD_LCHOWN(Z_STRVAL_PP(filename), -1, gid);
+   } else {
+   ret = VCWD_CHOWN(Z_STRVAL_PP(filename), -1, gid);
+   }
+
if (ret == -1) {
php_error(E_WARNING, chgrp failed: %s, strerror(errno));
RETURN_FALSE;
 -379,7 +397,7 
 }
 /* }}} */
 
-/* {{{ proto bool chown (string filename, mixed user)
+/* {{{ proto bool chown (string filename, mixed user [, bool no_dereference])
Change file owner */
 PHP_FUNCTION(chown)
 {
 -388,10 +406,23 
int ret;
uid_t uid;
struct passwd *pw = NULL;
+   zval **no_dereference = NULL;
 
-   if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, filename, 
user)==FAILURE) {
+   switch (ZEND_NUM_ARGS()) {
+   case 2:
+   if (zend_get_parameters_ex(2, filename, user) == FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+
+   case 3:
+   if (zend_get_parameters_ex(3, filename, user, no_dereference) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+
+   default:
WRONG_PARAM_COUNT;
}
+   
convert_to_string_ex(filename);
if (Z_TYPE_PP(user) == IS_STRING) {
pw = getpwnam(Z_STRVAL_PP(user));
 -415,7 +446,12 
RETURN_FALSE;
}
 
-   ret = VCWD_CHOWN(Z_STRVAL_PP(filename), uid, -1);
+   if (no_dereference  Z_BVAL_PP(no_dereference)) {
+   ret = VCWD_LCHOWN(Z_STRVAL_PP(filename), uid, -1);
+   } else {
+   ret = VCWD_CHOWN(Z_STRVAL_PP(filename), uid, -1);
+   }
+
if (ret == -1) {
php_error(E_WARNING, chown failed: %s, strerror(errno));
   

[PHP-DEV] [PATCH] add PATH_INFO and PATH_TRANSLATED to apache 2 sapi ... RE

2002-05-13 Thread Daniel BODEA

Would this be a good moment to re post this patch a 2nd time? :)

 Diff'ed against the stable 4.2.0 source package.

Adds the same behavior as the CGI and ISAPI modules with regard to PATH_INFO
and PATH_TRANSLATED variables to the Apache 2 filter interface. If the user
does not specifically set the AcceptPathInfo configuration variable to
off, the patch passes the accepted state to the core module who makes them
available to the PHP output filter.

As the default PHP content handler is no longer among us, it would probably
be a good idea to put all this in the fixup phase. Still for now I think it
gets the job done.

D


--- sapi/apache2filter/sapi_apache2.c.orig  Thu Apr 18 18:34:49 2002
+++ sapi/apache2filter/sapi_apache2.c   Sat May 11 03:27:07 2002
 -477,6 +477,13 
strcmp(r-content_type, application/x-httpd-php) == 0) {
php_add_filter(r, r-output_filters);
php_add_filter(r, r-input_filters);
+
+   /* Accept PATH_INFO and PATH_TRANSLATED if not specifically
+* set by the user. (mimic the CGI module behavior) */
+
+   if ((r-used_path_info == AP_REQ_DEFAULT_PATH_INFO) 
+r-path_info  *r-path_info)
+r-used_path_info = AP_REQ_ACCEPT_PATH_INFO;
}
 }
 



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


Re: [PHP-DEV] [PATCH] add PATH_INFO and PATH_TRANSLATED to apache 2 sapi ... RE

2002-05-13 Thread Daniel BODEA

1 - consistency with previous versions
2 - cgi behavior (like in mod_cgi)

D

- Original Message -
From: Aaron Bannert [EMAIL PROTECTED]
To: Daniel BODEA [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 9:01 PM
Subject: Re: [PHP-DEV] [PATCH] add PATH_INFO and PATH_TRANSLATED to apache 2
sapi ... RE


 On Mon, May 13, 2002 at 08:57:35PM +0200, Daniel BODEA wrote:
  Would this be a good moment to re post this patch a 2nd time? :)
 
   Diff'ed against the stable 4.2.0 source package.
 
  Adds the same behavior as the CGI and ISAPI modules with regard to
PATH_INFO
  and PATH_TRANSLATED variables to the Apache 2 filter interface. If the
user
  does not specifically set the AcceptPathInfo configuration variable to
  off, the patch passes the accepted state to the core module who makes
them
  available to the PHP output filter.

 I apologise if this was discussed before, but why do we want to default
 to having AcceptPathInfo enabled for a PHP resource? This seems like we
 are taking the conservative approach in having this disabled unless the
 admin knows what they're doing.

 -aaron



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




[PHP-DEV] [PATCH] add PATH_INFO and PATH_TRANSLATED to apache 2 sapi

2002-05-11 Thread Daniel BODEA

Diff'ed against the stable 4.2.0 source package.

Adds the same behavior as the CGI and ISAPI modules with regard to PATH_INFO
and PATH_TRANSLATED variables to the Apache 2 filter interface. If the user
does not specifically set the AcceptPathInfo configuration variable to
off, the patch passes the accepted state to the core module who makes them
available to the PHP output filter.

As the default PHP content handler is no longer among us, it would probably
be a good idea to put all this in the fixup phase. Still for now I think it
gets the job done.

D


--- sapi/apache2filter/sapi_apache2.c.orig  Thu Apr 18 18:34:49 2002
+++ sapi/apache2filter/sapi_apache2.c   Sat May 11 03:27:07 2002
 -477,6 +477,13 
strcmp(r-content_type, application/x-httpd-php) == 0) {
php_add_filter(r, r-output_filters);
php_add_filter(r, r-input_filters);
+
+   /* Accept PATH_INFO and PATH_TRANSLATED if not specifically
+* set by the user. (mimic the CGI module behavior) */
+
+   if ((r-used_path_info == AP_REQ_DEFAULT_PATH_INFO) 
+r-path_info  *r-path_info)
+r-used_path_info = AP_REQ_ACCEPT_PATH_INFO;
}
 }
 



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


Re: [PHP-DEV] config.w32.h

2002-05-01 Thread Daniel Beulshausen

At 17:44 01.05.2002 +0200, Sebastian Bergmann wrote:
Daniel Beulshausen wrote:
  what's the reason to rename the file?

   As I pointed out in a previous posting, this way we could put
   config.w32.h into .cvsignore and let it be created from a
   config.w32.h.in file if it doesn't exist.

   This way, people can configure their Win32 build.

do you mean constants like PHP_EXTENSION_DIR?
they should be changed to use the windows registry anyway...
for any other compile time configuration option i don't think that's wise 
to do.

daniel

/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com


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




Re: [PHP-DEV] config.w32.h

2002-05-01 Thread Daniel Beulshausen

At 18:35 01.05.2002 +0200, Sebastian Bergmann wrote:
Daniel Beulshausen wrote:
  do you mean constants like PHP_EXTENSION_DIR?

   For instance, yes.

  they should be changed to use the windows registry anyway...

   Feel free to do it :)

this isn't going to be a big task, i'll put it onto my todo.

  for any other compile time configuration option i don't think that's
  wise to do.

   Well, not everyone needs all of the extensions we're currently building
   per default.

as the built-in extensions don't require you to fetch external libraries, 
it doesn't hurt to build them.
i find it much more annoying if you can't be sure wether the 
distributed/used build supports extension x or y per default.

daniel

/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com


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




Re: [PHP-DEV] config.w32.h

2002-05-01 Thread Daniel Beulshausen

At 11:19 01.05.2002 -0700, Shane Caraveo wrote:


  they should be changed to use the windows registry anyway...

   Feel free to do it :)

this isn't going to be a big task, i'll put it onto my todo.

It's already done, been there for a long time.  php.ini values are 
configurable via registry, and can be done on a per-domain basis.  It is 
kind of a pain to deal with configuration that way though.

i'm not talking about the per directory stuff, these are mostly non php.ini 
settings.
things like PEAR_INSTALLDIR, PHP_BINDIR etc should be stored in the 
registry IMO.

daniel

/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com


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




Re: [PHP-DEV] config.w32.h...registry configuration

2002-05-01 Thread Daniel Beulshausen

At 11:41 01.05.2002 -0700, Shane Caraveo wrote:
Daniel Beulshausen wrote:
At 11:19 01.05.2002 -0700, Shane Caraveo wrote:

  they should be changed to use the windows registry anyway...

   Feel free to do it :)


this isn't going to be a big task, i'll put it onto my todo.


It's already done, been there for a long time.  php.ini values are 
configurable via registry, and can be done on a per-domain basis.  It is 
kind of a pain to deal with configuration that way though.

i'm not talking about the per directory stuff, these are mostly non 
php.ini settings.
things like PEAR_INSTALLDIR, PHP_BINDIR etc should be stored in the 
registry IMO.
daniel

Well, the specific example I saw was the extension dir, which is an ini 
setting.  I would argue that pear_installdir could also be an ini 
setting.  bindir does need some solution outside the ini file, maybe, but 
I think there could be some way to work around that.  The reason I am 
*kind of* arguing against using the registry for these is due to having 
multiple installations of PHP.  I currently have 6, 5 installs and my 
compiled version, so that I can test things.  Dealing with php.ini in that 
situation is bad enough, adding registry configuration on top of that will 
make it even a bigger pain.

one could use the version string as a subkey, this would enable you to use 
different php.inis for different versions.

daniel

/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com


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




Re[2]: [PHP-DEV] feature request

2002-04-25 Thread Daniel Lorch

Hi,

 Anyway. There were some discussions lately to implement
 something like word_count() and similar friends. Though I
 don't remember what has happened, you might want to look it
 up in the archive an join the discussion (It was just a week
 ago or so I think).

There were some concerns about performance. A function built-in to PHP
would be certainly faster, and as it was requested already twice,
maybe adding such functions natively to PHP wouldn't be a bad idea.

-daniel



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




Re: [PHP-DEV] Addition to session-module (patch included)

2002-04-25 Thread Daniel Lorch

Hi,

 right now the session module can only store one cookie (or
 one info in trans-sid) my patch extends that to one
 user-defined variable so that:

I am not quite sure whether I understood what you are trying to do,
but assumingly you have 2 frames:

  +---+
  |  foo  |
  +---+
  |  bar  |
  +---+

what's wrong about keeping all session-related data in an array?

  $data[foo][counter];
  $data[bar][counter];

and accordingly:

  foo.php
  ===

  ?php

  echo Counter is now . (++$_SESSION['foo']['counter']) . br\n;
  
  ?

  
  bar.php
  ===

  ?php

  echo Counter is now . (++$_SESSION['bar']['counter']) . br\n;
  
  ?

Or did I miss something?

Multiple session IDs only cause confusion. I'm -1.
  
-daniel



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




Re[2]: [PHP-DEV] Addition to session-module (patch included)

2002-04-25 Thread Daniel Lorch

Hi,

 I am not quite sure whether I understood what you are trying to do,
 but assumingly you have 2 frames:

 i'm talking about 2 or more windows!

 please reread.
 tc

Ups, sorry. I am having the same problem, but I'm solving it by giving
every window a 'key' (like a secondary session ID). But your patch
sounds like a good idea :)

-daniel



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




Re: [PHP-DEV] Recent mysql related connection problems with 4.2.0

2002-04-25 Thread Daniel Swarbrick

I just thought I'd post my results with doing this on a fairly bleeding edge
Slackware 8.1beta system, mainly because it has autoconf 2.53 on
it.Previously I tried running buildconf with autoconf 2.50, which didn't
generate any of the additional warnings.

Although the the 'make'ed binary libphp4.so was identical in size my
previous build, it was a different md5sum, so I thought I'd give it a shot.
The good news is that things seem to be working correctly, and MySQL
connects using sockets again!

buildconf: checking installation...
buildconf: autoconf version 2.53 (ok)
buildconf: automake version 1.5 (ok)
buildconf: libtool version 1.4.2 (ok)
rebuilding configure
configure.in:40: warning: do not use m4_patsubst: use patsubst or
m4_bpatsubst
configure.in:1259: warning: do not use m4_regexp: use regexp or m4_bregexp
rebuilding main/php_config.h.in
WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
WARNING: and `config.h.top', to define templates for `config.h.in'
WARNING: is deprecated and discouraged.

WARNING: Using the third argument of `AC_DEFINE' and
WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
WARNING: `acconfig.h':

WARNING:   AC_DEFINE([NEED_MAIN], 1,
WARNING: [Define if a function `main' is needed.])

WARNING: More sophisticated templates can also be produced, see the
WARNING: documentation.
autoheader: `main/php_config.h.in' is created

Edin Kadribasic [EMAIL PROTECTED] wrote in message
09d901c1ec55$d53c2af0$[EMAIL PROTECTED]">news:09d901c1ec55$d53c2af0$[EMAIL PROTECTED]...
 Summary (mysql related connection problems) :

 4.2.0 was packed with configure script made by autoconf 2.52 which doesn't
 seem to work correcly.
 configure built with autoconf 2.13 works fine.

 Resolutions:
 * wait for 4.2.1 (due in a week or so)
 * if you have autoconf 2.13 on you system, delete configure and run
 ./buildconf
 * download configure script from http://www.edin.dk/php/configure.gz

 Edin




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




Re: [PHP-DEV] Recent mysql related connection problems with 4.2.0

2002-04-25 Thread Daniel Swarbrick

Ooops, sorry folks, jumped the gun on that one. Nope, still using TCP.

Daniel Swarbrick [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just thought I'd post my results with doing this on a fairly bleeding
edge
 Slackware 8.1beta system, mainly because it has autoconf 2.53 on
 it.Previously I tried running buildconf with autoconf 2.50, which didn't
 generate any of the additional warnings.

 Although the the 'make'ed binary libphp4.so was identical in size my
 previous build, it was a different md5sum, so I thought I'd give it a
shot.
 The good news is that things seem to be working correctly, and MySQL
 connects using sockets again!

 buildconf: checking installation...
 buildconf: autoconf version 2.53 (ok)
 buildconf: automake version 1.5 (ok)
 buildconf: libtool version 1.4.2 (ok)
 rebuilding configure
 configure.in:40: warning: do not use m4_patsubst: use patsubst or
 m4_bpatsubst
 configure.in:1259: warning: do not use m4_regexp: use regexp or m4_bregexp
 rebuilding main/php_config.h.in
 WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
 WARNING: and `config.h.top', to define templates for `config.h.in'
 WARNING: is deprecated and discouraged.

 WARNING: Using the third argument of `AC_DEFINE' and
 WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
 WARNING: `acconfig.h':

 WARNING:   AC_DEFINE([NEED_MAIN], 1,
 WARNING: [Define if a function `main' is needed.])

 WARNING: More sophisticated templates can also be produced, see the
 WARNING: documentation.
 autoheader: `main/php_config.h.in' is created

 Edin Kadribasic [EMAIL PROTECTED] wrote in message
 09d901c1ec55$d53c2af0$[EMAIL PROTECTED]">news:09d901c1ec55$d53c2af0$[EMAIL PROTECTED]...
  Summary (mysql related connection problems) :
 
  4.2.0 was packed with configure script made by autoconf 2.52 which
doesn't
  seem to work correcly.
  configure built with autoconf 2.13 works fine.
 
  Resolutions:
  * wait for 4.2.1 (due in a week or so)
  * if you have autoconf 2.13 on you system, delete configure and run
  ./buildconf
  * download configure script from http://www.edin.dk/php/configure.gz
 
  Edin
 





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




Re: [PHP-DEV] Recent mysql related connection problems with 4.2.0

2002-04-25 Thread Daniel Swarbrick

Yep, just configure'd and built using that script - looks good. MySQL is
connecting with unix socket when specifying simply 'localhost' as the host
to connect to.

The MySQL socket on Slackware 8.0+ systems is in /var/run/mysql/.

Well done...

Edin Kadribasic [EMAIL PROTECTED] wrote in message
133201c1ec9a$16144370$050a@master">news:133201c1ec9a$16144370$050a@master...
 Could you verify that configure script http://www.edin.dk/php/configure.gz
 works on your system. Also could you please tell us the location of
 mysql.sock on your system, so we can include it in the configure checks.

 Edin

 Daniel Swarbrick [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I just thought I'd post my results with doing this on a fairly bleeding
 edge
  Slackware 8.1beta system, mainly because it has autoconf 2.53 on
  it.Previously I tried running buildconf with autoconf 2.50, which didn't
  generate any of the additional warnings.
 
  Although the the 'make'ed binary libphp4.so was identical in size my
  previous build, it was a different md5sum, so I thought I'd give it a
 shot.
  The good news is that things seem to be working correctly, and MySQL
  connects using sockets again!
 
  buildconf: checking installation...
  buildconf: autoconf version 2.53 (ok)
  buildconf: automake version 1.5 (ok)
  buildconf: libtool version 1.4.2 (ok)
  rebuilding configure
  configure.in:40: warning: do not use m4_patsubst: use patsubst or
  m4_bpatsubst
  configure.in:1259: warning: do not use m4_regexp: use regexp or
m4_bregexp
  rebuilding main/php_config.h.in
  WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
  WARNING: and `config.h.top', to define templates for `config.h.in'
  WARNING: is deprecated and discouraged.
 
  WARNING: Using the third argument of `AC_DEFINE' and
  WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
  WARNING: `acconfig.h':
 
  WARNING:   AC_DEFINE([NEED_MAIN], 1,
  WARNING: [Define if a function `main' is needed.])
 
  WARNING: More sophisticated templates can also be produced, see the
  WARNING: documentation.
  autoheader: `main/php_config.h.in' is created
 
  Edin Kadribasic [EMAIL PROTECTED] wrote in message
  09d901c1ec55$d53c2af0$[EMAIL PROTECTED]">news:09d901c1ec55$d53c2af0$[EMAIL PROTECTED]...
   Summary (mysql related connection problems) :
  
   4.2.0 was packed with configure script made by autoconf 2.52 which
 doesn't
   seem to work correcly.
   configure built with autoconf 2.13 works fine.
  
   Resolutions:
   * wait for 4.2.1 (due in a week or so)
   * if you have autoconf 2.13 on you system, delete configure and run
   ./buildconf
   * download configure script from http://www.edin.dk/php/configure.gz
  
   Edin
  
 
 
 
  --
  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] Re: Bug #16768: mysql_connect(localhost, ...) doesn't connect to localhost! (fwd)

2002-04-24 Thread Daniel Swarbrick

I don't know whether this is related or not, but I've also found that since
upgrading to PHP 4.2.0 it is impossible to get mysql_connect() to connect
via a UNIX socket. No matter whether I specify a socket manually or not, it
always connects via TCP.

I have 4.1.2 running on a different server, and even just specifying
localhost for the database host, automatically connects via UNIX socket.

Derick Rethans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey Zak,

 I think this is a nice thing for 4.2.1. I can reproduce it. I hope
 somebody can investigate this before friday (RC1 of 4.2.1 is scheduled
 then).

 Derick

 -- Forwarded message --
 Date: 23 Apr 2002 19:50:29 -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Bug #16768: mysql_connect(localhost,
  ...) doesn't connect to localhost!

 From: [EMAIL PROTECTED]
 Operating system: Red Hat Linux 7.2
 PHP version:  4.2.0
 PHP Bug Type: MySQL related
 Bug description:  mysql_connect(localhost, ...) doesn't connect to
localhost!

 After upgrading from PHP 4.1.2 to PHP 4.2.0, MySQL connections fail with
 this error:

 Warning: Access denied for user: '[EMAIL PROTECTED]'

 Apparently, it is trying to connect to 'my.fully.qualified.name' instead
 of 'localhost' as before. This seems wrong because my mysql_connect() call
 uses 'localhost' as the host name:

 mysql_connect(localhost, username, password);

 I can work around this by changing all my MySQL grants from
 'username'@'localhost' to 'username'@'my.fully.qualified.name', but that
 seems unnecessary; this should be fixed in PHP.

 BTW, I've used the same above mysql_connect() call since the PHP 3.x days
 and it's always worked fine, until now.


 My PHP configure line:
 ./configure --with-apache=../apache_1.3.24 --enable-track-vars \
   --with-mysql --with-zlib --with-gd

 All PHP configuration settings are defaults. (i.e. php.ini =
 php.ini-dist)

 Apache version is 1.3.24. MySQL version is 3.23.49a.
 --
 Edit bug report at http://bugs.php.net/?id=16768edit=1
 --
 Fixed in CVS:http://bugs.php.net/fix.php?id=16768r=fixedcvs
 Fixed in release:http://bugs.php.net/fix.php?id=16768r=alreadyfixed
 Need backtrace:  http://bugs.php.net/fix.php?id=16768r=needtrace
 Try newer version:   http://bugs.php.net/fix.php?id=16768r=oldversion
 Not developer issue: http://bugs.php.net/fix.php?id=16768r=support
 Expected behavior:   http://bugs.php.net/fix.php?id=16768r=notwrong
 Not enough info: http://bugs.php.net/fix.php?id=16768r=notenoughinfo
 Submitted twice: http://bugs.php.net/fix.php?id=16768r=submittedtwice




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




Re: [PHP-DEV] Re: Bug #16768: mysql_connect(localhost, ...) doesn't connect to localhost! (fwd)

2002-04-24 Thread Daniel Swarbrick

I'm configuring with
'configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-mysql --with-pdfli
b --with-zlib --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf 
--with-imap --with-gettext --enable-cli'

The MySQL stuff from my config.log says
configure:39658: checking for MySQL support
configure:39698: result: yes
configure:39922: checking for MySQL UNIX socket
configure:39941: result: /tmp/mysql.sock

However this is incorrect - the socket is in fact
 /var/run/mysql/mysql.sock - as per default Slackware 8.0 install. I am also
specifying this manually in my php.ini

Edin Kadribasic [EMAIL PROTECTED] wrote in message
068b01c1eb70$553cd880$[EMAIL PROTECTED]">news:068b01c1eb70$553cd880$[EMAIL PROTECTED]...
 I don't know whether this is related or not, but I've also found that
since
 upgrading to PHP 4.2.0 it is impossible to get mysql_connect() to connect
 via a UNIX socket. No matter whether I specify a socket manually or not,
it
 always connects via TCP.

 I cannot reproduce this. Could you please give us some more info on your
 installation. Also please search for checking for MySQL UNIX socket in
 your config.log and tell us the result.

 Edin




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




Re: [PHP-DEV] Re: Bug #16768: mysql_connect(localhost, ...) doesn't connect to localhost! (fwd)

2002-04-24 Thread Daniel Swarbrick

Yes, I have MySQL running all the time. I noticed this in
ext/mysql/config.m4 :

  MYSQL_SOCK=/tmp/mysql.sock
  for i in  \
  /var/run/mysqld/mysqld.sock \
  /var/tmp/mysql.sock \
  /var/lib/mysql/mysql.sock \
  /var/mysql/mysql.sock \
  /Private/tmp/mysql.sock \
  ; do
if test -r $i; then
  MYSQL_SOCK=$i
fi
  done

...which doesn't quite match my socket at /var/run/mysql/mysql.sock -
defaulting to /tmp/mysql.sock.

I also noticed on a phpinfo() output that MYSQL_SOCK = /tmp/mysql.sock.
Immediately below that, both the local and master value of
mysql.default_socket is /var/run/mysql/mysql.sock - which is being picked up
from my php.ini. It's just not having any effect.

I am compiling 4.2.0 right now on the machine previously running 4.1.2, to
see if it works. That machine has a manually compiled MySQL on it though,
and the socket IS /tmp/mysql.sock

Cheers
[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 thanks! Do you know if MySQL was started during ./configure ?

 Derick

 On Wed, 24 Apr 2002, Daniel Swarbrick wrote:

  I'm configuring with
 
'configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-mysql --with-pdfli
 
b --with-zlib --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf
  --with-imap --with-gettext --enable-cli'
 
  The MySQL stuff from my config.log says
  configure:39658: checking for MySQL support
  configure:39698: result: yes
  configure:39922: checking for MySQL UNIX socket
  configure:39941: result: /tmp/mysql.sock
 
  However this is incorrect - the socket is in fact
   /var/run/mysql/mysql.sock - as per default Slackware 8.0 install. I am
also
  specifying this manually in my php.ini
 
  Edin Kadribasic [EMAIL PROTECTED] wrote in message
  068b01c1eb70$553cd880$[EMAIL PROTECTED]">news:068b01c1eb70$553cd880$[EMAIL PROTECTED]...
   I don't know whether this is related or not, but I've also found that
  since
   upgrading to PHP 4.2.0 it is impossible to get mysql_connect() to
connect
   via a UNIX socket. No matter whether I specify a socket manually or
not,
  it
   always connects via TCP.
  
   I cannot reproduce this. Could you please give us some more info on
your
   installation. Also please search for checking for MySQL UNIX socket
in
   your config.log and tell us the result.
  
   Edin
  
 
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 ---
  Did I help you? Consider a gift:
   http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
 ---
   PHP: Scripting the Web - [EMAIL PROTECTED]
 All your branches are belong to me!
 SRM: Script Running Machine - www.vl-srm.net
 ---




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




Re: [PHP-DEV] Re: Bug #16768: mysql_connect(localhost, ...) doesn't connect to localhost! (fwd)

2002-04-24 Thread Daniel Swarbrick

Just upgraded the 4.1.2 install, which has mysql socket in /tmp.
Unfortunately, this server now also refuses to connect via UNIX socket,
insisting on using TCP.

HUH? phpinfo() reports MYSQL_SOCKET to be /tmp/mysql.sock, which in this
case is correct!

Even with mysql_connect(localhost:/tmp/mysql.sock, $user, $pass), it still
uses TCP.

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 thanks! Do you know if MySQL was started during ./configure ?

 Derick

 On Wed, 24 Apr 2002, Daniel Swarbrick wrote:

  I'm configuring with
 
'configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-mysql --with-pdfli
 
b --with-zlib --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf
  --with-imap --with-gettext --enable-cli'
 
  The MySQL stuff from my config.log says
  configure:39658: checking for MySQL support
  configure:39698: result: yes
  configure:39922: checking for MySQL UNIX socket
  configure:39941: result: /tmp/mysql.sock
 
  However this is incorrect - the socket is in fact
   /var/run/mysql/mysql.sock - as per default Slackware 8.0 install. I am
also
  specifying this manually in my php.ini
 
  Edin Kadribasic [EMAIL PROTECTED] wrote in message
  068b01c1eb70$553cd880$[EMAIL PROTECTED]">news:068b01c1eb70$553cd880$[EMAIL PROTECTED]...
   I don't know whether this is related or not, but I've also found that
  since
   upgrading to PHP 4.2.0 it is impossible to get mysql_connect() to
connect
   via a UNIX socket. No matter whether I specify a socket manually or
not,
  it
   always connects via TCP.
  
   I cannot reproduce this. Could you please give us some more info on
your
   installation. Also please search for checking for MySQL UNIX socket
in
   your config.log and tell us the result.
  
   Edin
  
 
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 ---
  Did I help you? Consider a gift:
   http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
 ---
   PHP: Scripting the Web - [EMAIL PROTECTED]
 All your branches are belong to me!
 SRM: Script Running Machine - www.vl-srm.net
 ---




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




Re: [PHP-DEV] Re: Bug #16768: mysql_connect(localhost, ...) doesn't connect to localhost! (fwd)

2002-04-24 Thread Daniel Swarbrick

Dunno about you, but I'm starting to tear my hair out on this one. I even
resorted to copying the entire ext/mysql directory across from 4.1.2 and
compiling with that. Makes no difference.

Also tried loading MySQL with --skip-networking to disable TCP communication
with mysqld. Not surprisingly, the mysql_connect() call failed completely.
It just flat out refuses to use unix sockets.

Alright, who's broken it?

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Wed, 24 Apr 2002, Daniel Swarbrick wrote:

  Just upgraded the 4.1.2 install, which has mysql socket in /tmp.
  Unfortunately, this server now also refuses to connect via UNIX socket,
  insisting on using TCP.
 
  HUH? phpinfo() reports MYSQL_SOCKET to be /tmp/mysql.sock, which in this
  case is correct!
 
  Even with mysql_connect(localhost:/tmp/mysql.sock, $user, $pass), it
still
  uses TCP.

 Yeah... this is the main problem. It refuses to connect with the unix
 socket for some reason... but not always :I

 Derick

 
  [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hello,
  
   thanks! Do you know if MySQL was started during ./configure ?
  
   Derick
  
   On Wed, 24 Apr 2002, Daniel Swarbrick wrote:
  
I'm configuring with
   
 
'configure --with-apxs=/usr/sbin/apxs --with-pgsql --with-mysql --with-pdfli
   
 
b --with-zlib --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf
--with-imap --with-gettext --enable-cli'
   
The MySQL stuff from my config.log says
configure:39658: checking for MySQL support
configure:39698: result: yes
configure:39922: checking for MySQL UNIX socket
configure:39941: result: /tmp/mysql.sock
   
However this is incorrect - the socket is in fact
 /var/run/mysql/mysql.sock - as per default Slackware 8.0 install. I
am
  also
specifying this manually in my php.ini
   
Edin Kadribasic [EMAIL PROTECTED] wrote in message
068b01c1eb70$553cd880$[EMAIL PROTECTED]">news:068b01c1eb70$553cd880$[EMAIL PROTECTED]...
 I don't know whether this is related or not, but I've also found
that
since
 upgrading to PHP 4.2.0 it is impossible to get mysql_connect() to
  connect
 via a UNIX socket. No matter whether I specify a socket manually
or
  not,
it
 always connects via TCP.

 I cannot reproduce this. Could you please give us some more info
on
  your
 installation. Also please search for checking for MySQL UNIX
socket
  in
 your config.log and tell us the result.

 Edin

   
   
   
--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
 
 ---
Did I help you? Consider a gift:
 http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
 
 ---
 PHP: Scripting the Web - [EMAIL PROTECTED]
   All your branches are belong to me!
   SRM: Script Running Machine - www.vl-srm.net
 
 ---
  
 
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 ---
  Did I help you? Consider a gift:
   http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
 ---
   PHP: Scripting the Web - [EMAIL PROTECTED]
 All your branches are belong to me!
 SRM: Script Running Machine - www.vl-srm.net
 ---




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




Re: [PHP-DEV] feature request

2002-04-24 Thread Daniel Lorch

Hi,

 It would be great if there was a function in the filesystem family similar
 to the unix command wc.  It'd be nice to not have to write simple wrappers
 around system calls or creating arrays to get the number of words or lines
 in a file.

function line_count($string) {
  return count(preg_split(/\r?\n/, $string));
}

function word_count($string) {
  return count(preg_split(/\s+/, $string));
}

There will be a PEAR-string class, which includes functions similar to
this. I assigned it to me some days ago and I will be working on it as
soon as I have some time left :)

-daniel



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




Re[2]: [PHP-DEV] feature request

2002-04-24 Thread Daniel Lorch

Hi,

 $wc = strlen(preg_replace('/\W*\w*/', 'x', file_get_contents($file));
 Look, no arrays! :-)
  - Stig

is this faster than the array-based solution?

-daniel



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




Re[2]: [PHP-DEV] PHP and Threads

2002-04-22 Thread Daniel Lorch

Hi,

first of all, thanks for the bugfix. it will go into phpserv 0.02
along with a sf.net account, seperate mailinglists (to not bother php-dev
anymore :))

 Thanks Daniel for your excellent input. I have managed to create a forking
 socket handler, although I am now approched by a new issue. How do I get
 the sockets to communication to each other?

The question should be, how you get the _processes_ to communicate to
each other. Als already mentioned by Steve Meyers, you could use the
signals reserved for user space: SIGUSR1 and SIGUSR2. You can send
them to another process by using posix_kill: http://php.net/posix_kill

  posix_kill($pid, SIGUSR1);

unfortunately these signals provide only limited functionality.
Another approach to IPC (inter process communication) are named pipes.
I suggest you to have a look at Beej's Guide to Unix Interprocess
Communication, which provides an excellent hands-on introduction on
this topic:

  http://www.ecst.csuchico.edu/~beej/guide/

Beej's Guide to Network Programming ist worth reading, too :)

 I can process and parse the input from the children individually but when
 upon a certain command being sent by child 1, I want *all* the children to
 be issued a command.

you'd have to broadcast them to all child processes. I would use a

  child --[request]-- parent

  parent -- child 1 \
 -- child 2  |- broadcast
 -- child n /

... approach. Unfortunately my knowledge on this topic is limited.
Maybe there is someone more savvy on this list :)

-daniel



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




Re[2]: [PHP-DEV] Major Bug in multiple MySQL Connections?

2002-04-22 Thread Daniel Lorch

Hi,

 No, it doesn't satisfy me at all.  Your application design is broken and
 forcing multiple identical connections doesn't solve it at all.  You are
 trying to associate a selected DB with a database connection artificially.

a couple of years ago I was using PHPLIBs db-class and my own
db-class at the same time and I was wondering why these classes mixed
up result sets. After serveral nights of code-review I gave up and
rewrote most parts from scratch. I finally understand why it didn't
work (and don't ask me why I was using two different db-classes, I
can't remember).

What's the rationale behind this silly behaviour? Do you also enforce
people to reuse file-handles?

-daniel



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




Re[3]: [PHP-DEV] Major Bug in multiple MySQL Connections?

2002-04-22 Thread Daniel Lorch

hi,

this sounds reasonable. But why don't the connection aliases keep
the current db they are working on and if needed, switch back -
transparently to the user? The current implementation only confuses
people.

-daniel

- Original Message -
From   : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent   : Montag, 22. April 2002
Subject: [PHP-DEV] Major Bug in multiple MySQL Connections?

 It's not a silly behaviour. Database connections are a very limited
 resource, much more so than open files, and time after time we saw code
 that would open up multiple identical connections for no reason
 whatsoever. This is especially true of large apps that are able to swallow
 other apps. Like PHP-Nuke with various plug-in modules. If you patch 3 or
 4 different things together that all talk to a DB on localhost, you do not
 need to go through the code and unify the database handling to avoid
 having 4 separate connections per request. PHP automatically optimizes
 that for you. Opening a new connection is also extremely expensive, much
 more so than a simple db switch call on an existing one.

 -Rasmus



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




Re[4]: [PHP-DEV] Major Bug in multiple MySQL Connections?

2002-04-22 Thread Daniel Lorch

hi,

because this is causing troubles to many users.

$con1 = mysql_connect(..);
$con2 = mysql_connect(..);

mysql_select_db($con1, db1);
mysql_select_db($con2, db2);

mysql_query(SELECT * FROM .., $con1); /* this is applied to 'db2'.
   or am I wrong? */

The current DB should be part of the mysql handle. Also the mysql
result set (I remember my db-classes to use each others result sets).

-daniel

- Original Message -
From   : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent   : Montag, 22. April 2002
Subject: [PHP-DEV] Major Bug in multiple MySQL Connections?

 Because the current db is not a property specified in mysql_connect() so I
 don't see what you would be switching back and forth from/to.

 -Rasmus



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




Re: [PHP-DEV] [phpbugs@priorwebsites.com: Bug #16681 Updated: Request new words(), word(), wordindex(), wordlength() functions]

2002-04-19 Thread Daniel Lorch

hi,

 Well, I like the idea(s).

 I think returning (bool)false instead of NULL is more
 consistent though.

 Maybe the naming convention should be changed to:

..while paying attention to english orthography:

 word()
 word_count()
 word_index()
 word_lenght()

word_length()

common pitfall - maybe we should provide an alias? :)

 - Markus

word_* functions can be easily solved in userland, but nevertheless,
after thinking about it, it might be a good addition. At least it does
not hurt anyone, does it? :)

-daniel



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




Re[2]: [PHP-DEV] [phpbugs@priorwebsites.com: Bug #16681 Updated: Request new words(), word(), wordindex(), wordlength() functions]

2002-04-19 Thread Daniel Lorch

Hi,

Great idea. I could take care of this - how do I assign it to me?
Just start writing code?

-daniel

- Original Message -
From   : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent   : Freitag, 19. April 2002
Subject: [PHP-DEV] [[EMAIL PROTECTED]: Bug #16681 Updated: Request new 
words(), word(), wordindex(),  wordlength() functions]

 Hey,

 why not make a PEAR thingy for this?

 Derick

 On Fri, 19 Apr 2002, Daniel Lorch wrote:

 hi,
 
  Well, I like the idea(s).
 
  I think returning (bool)false instead of NULL is more
  consistent though.
 
  Maybe the naming convention should be changed to:
 
 ..while paying attention to english orthography:
 
  word()
  word_count()
  word_index()
  word_lenght()
 
 word_length()
 
 common pitfall - maybe we should provide an alias? :)
 
  - Markus
 
 word_* functions can be easily solved in userland, but nevertheless,
 after thinking about it, it might be a good addition. At least it does
 not hurt anyone, does it? :)
 
 -daniel
 
 
 
 -- 
 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[2]: [PHP-DEV] what does is happening to the list

2002-04-18 Thread Daniel Lorch

Hi,

 On Wednesday, 17. April 2002 22:11, Eduardo Melo wrote:
 htmldiv style='background-color:'DIV/DIV
 DIV/DIV
 PWhat is happening to the list .../P
 PNo body anwser .../P
 PInbsp;will be waiting for somenbsp;contact.BRBR--/P
 DIV/DIV
 H5Eduardonbsp;Melo/H5/divbr clear=allhrChegou o novo MSN
 Explorer. Instale já. É gratuito! a
 href='http://g.msn.com/1HM500201/N'http://explorer.msn.com.br/abr/htm
l

 Could someone ban this guy from php-dev?
 Georg

I wrote him a nice and friendly mail. I hope he understands us
finally as he appears to be having language problems.

-
Hi,

 I am not joking it is true. (maybe now the list is working very
 well) I need to know the right address to use the list, may i have
 it please

people are ignoring you, as you are repeatedly posting to the *wrong*
list :) PHP-Dev is about developing the language (in C), not about
solving problems in PHP.

you should consider posting to the General user list which can be
found on:

  http://www.php.net/mailing-lists.php

at the bottom of this page there are Local Mailing Lists. I think
you are brazilian (or am  I wrong?). The Portuguese mailinglist might
be the right place for you:

  http://groups.yahoo.com/group/php-pt

Good luck :)
  
Daniel Lorch
-

-daniel



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




Re: [PHP-DEV] Re: [PHP-EVANGELISM] RE: [PHP-DEV] The PHP Platform

2002-04-16 Thread Daniel Lorch

Hi,

 Just a note, that we also have a web server written in PHP ;)
 http://nanoweb.si.kz/

and a protocol-independent server framework (which includes a sample
webserver, too):

  http://daniel.lorch.cc/projects/phpserv/

SCNR :)

-daniel



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




Re[3]: [PHP-DEV] Let's fork GD!

2002-04-13 Thread Daniel Lorch

Hi,

 why not replace GD by imagemagick which is better anyway?

 Have you looked under the skirts of ImageMagick?  It is one of the
 poorest-written libraries I have seen.

Have you ever tried to do something productive with GD? It is one of
the poorest tools I have ever seen.

Seriously: imagemagick can do *ALOT* more than GD.

-daniel



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




Re[3]: [PHP-DEV] Let's fork GD!

2002-04-13 Thread Daniel Lorch

Hi,

 If you think that imagemagick is great, so don't you write an extention for it 
yourself.
 Other developers can deside on buildtime which image library they use.

Here are some additionals arguments:

  
http://www.menalto.com/projects/gallery/modules.php?op=modloadname=GalleryFAQfile=indexmyfaq=yesid_cat=3categories=3+-+Gallery+Graphics+Toolkitsparent_id=0

-daniel



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




Re[2]: [PHP-DEV] Let's fork GD!

2002-04-13 Thread Daniel Lorch

Hi,

 it's all nice and good but there's no production version of
 ext/imagick available. Until this isn't done, everything else
 is waste of time ;)
 - Markus

I didn't know imagemagick's sources were of *THAT* bad quality.
Rasmus' arguments convinced me not to move to imagemagick (yet).

P.S.: It's about imagemagick's *ITSELF*, not about ext/imagemagick
  which has bad quality.

-daniel



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




Re: [PHP-DEV] C++ Class Wrapping

2002-04-13 Thread Daniel Lorch

Hi,

 Is there a way to wrap existing c++ classes into a PHP class (via an 
 extension) ?

This usually happens by writing an extension for PHP, although C is
the common language to do this:

  http://www.php.net/manual/en/zend.php

-daniel



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




Re: [PHP-DEV] Copyright question

2002-04-13 Thread Daniel Lorch

Hi,

 I like the layout and i think php users/developers are useto the layout of the
 php site thats why i want to be consitistant.

I asked the same thing some time ago. It turned out to be ok:

  http://news.php.net/article.php?group=php.mirrorsarticle=8320
  http://news.php.net/article.php?group=php.mirrorsarticle=8332
  http://news.php.net/article.php?group=php.mirrorsarticle=8333

This is how it looks:

  http://daniel.lorch.cc/projects/disk_usage/
  
Either I'm blind or I still couldn't find out how to subscribe to
PHP-mirrors .. Any hints?

-daniel



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




Re[2]: [PHP-DEV] Let's fork GD!

2002-04-12 Thread Daniel Lorch

Hi,

 Yes, the intention was never to remove the ability to link against the
 system GD lib.
 -Rasmus

why not replace GD by imagemagick which is better anyway?

  http://www.imagemagick.org
  http://pear.php.net/manual/en/pecl.imagick.php

-daniel



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




Re: [PHP-DEV] Process/Thread question

2002-04-05 Thread Daniel Lorch

Hi,

 Eric Liedtke [EMAIL PROTECTED]
 [..] However, I am a little in the dark on what my options
 are for spawning off a new process/thread that will continue working in
 the background so the exported function can return in the script and go
 on it's merry way. I'm hoping  a more experienced crowd might have
 some suggestions for an implementation of this type. Any pointers to
 more info, modules that do something similiar or suggestions would be
 very welcome. [..]

The most reasonable way of doing this is to write a *seperate* daemon
which completes this task. Your PHP script would then connect to this
daemon via an interface (sockets).

There are Process Control Functions http://www.php.net/manual/en/ref.pcntl.php
which would allow you to fork a new process, but it is

1. experimental
2. only available for CGI/CLI and not mod_php

.. and overall not a good idea. Your script would anyway have to wait
for the PINGs to complete - whether it's in a seperate process or not.

daniel



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




Re: [PHP-DEV] Re-entrant PHP

2002-04-05 Thread Daniel Lorch

Hi,

 I mostly don't keep up with the bulk of the PHP threads; however, I
 did a pretty thorough scan of them to find information about re-entrancy
 and didn't find anything to answer my question. [..]

http://www.zend.com/
http://www.php-accelerator.co.uk/
http://apc.communityconnect.com/

Daniel



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




Re[2]: [PHP-DEV] webserver in PHP

2002-04-02 Thread Daniel Lorch

hi,

 A better way to do the method that you are trying to to do is to set a
 signal handler for SIGCHLD that waits on a pid of -1 (This means grab
 any child with a status change) [..]

thanks, I didn't know waitpid returned the child's PID.

A friend just pointed out this project:

  Nanoweb's main features are :
  - Decent performance
  - HTTP/1.1 compliant
  - CGI support
  - Name based virtual hosts
  - Authentication
  - Keep-alive connections
  - Server Side Includes
  - Apache combined and MySQL logging
  - gzip compression support
  http://nanoweb.si.kz/?p=root

it's basically what I'm trying to do - just in a more advanced stage :)

nanoweb's just incredible ...

daniel



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




[PHP-DEV] webserver in PHP

2002-04-01 Thread Daniel Lorch

Hi,

I know this mailinglist is not exactly the right place to ask user
questions (development WITH PHP etc..), but I am looking for some
skilled people (UNIX gurus?) as I am stuck with a problem and I couldn't
find the answer anywhere. And this is the place where the most skilled
people are, thus here I am :)

I am writing a server/daemon framework which should eventually allow
PHP developers to quickly create a server. You should look at the
quoted.php to see how easy this actually is. The framework does all
the dirty work in the background (forking off new children, managing
connections ..) and this is exactly the point where I have a problem:

how do I manage my child processes? My workaround is
to pcntl_signal(SIGCHLD, SIG_IGN); , but I actually want to keep track
of my childern (to limit the number of connections). Whenever I get a
SIGCHLD from a child process, how the hell should I know what PID
it came from? Should I just keep a list of processes and poll them
from time to time?

Any help would be appreciated.

sourcecode can be downloaded/viewed online at:

  http://daniel.lorch.cc/projects/phpserv/

there is a working demo for the next couple of hours (until I switch
off the machine):

  http://212.254.248.130/

Daniel Lorch



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




Re[2]: [PHP-DEV] codenames

2002-03-31 Thread Daniel Lorch

Hi,

 What came first woody or potatoe?  You can't tell from the name.  There
 is no doubt 4.2.0 is newer than 4.1.6.  Why introduce unneeded
 ambiguity for those who don't follow PHP closely.

how about codenames 'chicken' and 'egg' ?

nobody will ever know what came first :)

daniel



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




[PHP-DEV] DB Abstraction

2002-03-29 Thread Daniel Lorch

Hi,

I'm a bit confused about the ongoing projects aiming towards a
standard for database abstraction in PHP. There is DBA
[ http://php.net/dba ], PEAR DB and a project by l0t3k (and
many, many more).

So what is going to be the standard in PHP's future?

I think l0t3k is working on a C based solution, but there are several
reasons I'd like to see it written in PHP. PHP code could be easily
extended to handle mechanisms such as

- caching: only a SELECT? then read from cached file (serialized
   result set). INSERT/DELETE/UPDATE? then refresh cache.
   
- safety: server1 down? ok, move to backup server2.

- redundancy: randomly spread read-only queries (SELECT) to servers in
  a cluster.
  
(- extensibility (I put this in brackets, as it is only a vague idea):
   For example missing features in MySQL such as subselects could be
   simulated by using temporary HEAP tables. This would make this
   abstraction layer even more powerful than accessing the database
   directly)

Most important: this all works *transparently* to the user's script.
A system administrator could adjust this abstraction
layer to fit the system configuration. The users would
just include this file in their projects and never get in
touch with these things.

What do you think? Am I completely wrong/fantasising/talking too much?

Daniel



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




Re: [PHP-DEV] DB Abstraction

2002-03-29 Thread Daniel Lorch

Hi silly me,

 DBA [ http://php.net/dba ] [..]

I meant DBX http://php.net/dbx

Daniel



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




Re: [PHP-DEV] php generator

2002-03-20 Thread Daniel Lorch

Hi,

AFAIK there is nothing compareable (WYSIWYG-style).

But you could try something like the zend studio [ http://www.zend.com/ ]
or if syntax highlighting is enough for you, try ConTEXT
[ http://fixedsys.com/context/ ].

Daniel Lorch

- Original Message -
From   : W McCloud [mailto:[EMAIL PROTECTED]]
Sent   : Mittwoch, 20. März 2002
Subject: [PHP-DEV] php generator

 We are trying to find a php code generator like Macromedia Ultradelv to
 develope a web base app.  Can someone recommend a few.



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




[PHP-DEV] OCIError Patch, revised

2002-03-14 Thread Daniel Ceregatti

I should have taken the time to make 100% sure these patches were 
relatively bug free. I missed some obvious bugs in previous patches. 
Hopfully these will test well.

I've not been able to compile the PHP binary in the latest CVS, so that 
patch is untested, but it _seems_ ok, since the compile makes it past 
oci8.c with no warnings.

Attached are patches against 4.1.2 and the latest cvs.

Daniel


--- php-4.1.2/ext/oci8/oci8.c.orig  Wed Mar 13 14:51:19 2002
+++ php-4.1.2/ext/oci8/oci8.c   Thu Mar 14 09:29:44 2002
 -4090,15 +4090,34 
zval **arg;
oci_statement *statement;
oci_connection *connection;
-text errbuf[512];
-sb4 errcode = 0;
+   text errbuf[512];
+   sb4 errcode = 0;
sword error = 0;
dvoid *errh = NULL;
+   ub2 errorofs = 0;
+   text *sqltext = NULL;
 
if (zend_get_parameters_ex(1, arg) == SUCCESS) {
statement = (oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, 
NULL, NULL, 1, le_stmt);
if (statement) {
-   errh = statement-pError;
+
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (text *) sqltext,
+   (ub4 *)0,
+   OCI_ATTR_STATEMENT,
+   statement-pError));
+   
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (ub2 *)errorofs,
+   (ub4 *)0,
+   OCI_ATTR_PARSE_ERROR_OFFSET,
+   statement-pError));
+
+   errh = statement-pError;
error = statement-error;
} else {
connection = (oci_connection *) zend_fetch_resource(arg 
TSRMLS_CC, -1, NULL, NULL, 1, le_conn);
 -4134,6 +4153,8 
array_init(return_value);
add_assoc_long(return_value, code, errcode);
add_assoc_string(return_value, message, (char*) errbuf, 1);
+   add_assoc_long(return_value, offset, errorofs);
+   add_assoc_string(return_value, sqltext, sqltext ? (char *) sqltext : 
+, 1);
} else {
RETURN_FALSE;
}


--- php4/ext/oci8/oci8.c.orig   Thu Mar 14 09:33:06 2002
+++ php4/ext/oci8/oci8.cThu Mar 14 09:32:33 2002
 -4218,16 +4218,35 
zval **arg;
oci_statement *statement;
oci_connection *connection;
-text errbuf[512];
-sb4 errcode = 0;
+   text errbuf[512];
+   sb4 errcode = 0;
sword error = 0;
dvoid *errh = NULL;
+   ub2 errorofs = 0;
+   text *sqltext = NULL;
 
if (zend_get_parameters_ex(1, arg) == SUCCESS) {
statement = (oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, 
NULL, NULL, 1, le_stmt);
if (statement) {
errh = statement-pError;
error = statement-error;
+
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (text *) sqltext,
+   (ub4 *)0,
+   OCI_ATTR_STATEMENT,
+   statement-pError));
+
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (ub2 *)errorofs,
+   (ub4 *)0,
+   OCI_ATTR_PARSE_ERROR_OFFSET,
+   statement-pError));
+
} else {
connection = (oci_connection *) zend_fetch_resource(arg 
TSRMLS_CC, -1, NULL, NULL, 1, le_conn);
if (connection) {
 -4262,6 +4281,8 
array_init(return_value);
add_assoc_long(return_value, code, errcode);
add_assoc_string(return_value, message, (char*) errbuf, 1);
+   add_assoc_long(return_value, offset, errorofs);
+   add_assoc_string(return_value, sqltext, sqltext ? (char *) sqltext : 
+, 1);
} else {
RETURN_FALSE;
}



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


[PHP-DEV] OCIError patch, revised AGAIN (Only 4.1.2 patch)

2002-03-14 Thread Daniel Ceregatti

Sigh...I suck.

Foobared yet another patch.

Attached again.

Daniel


--- php-4.1.2/ext/oci8/oci8.c.orig  Wed Mar 13 14:51:19 2002
+++ php-4.1.2/ext/oci8/oci8.c   Thu Mar 14 10:02:48 2002
 -4090,16 +4090,35 
zval **arg;
oci_statement *statement;
oci_connection *connection;
-text errbuf[512];
-sb4 errcode = 0;
+   text errbuf[512];
+   sb4 errcode = 0;
sword error = 0;
dvoid *errh = NULL;
+   ub2 errorofs = 0;
+   text *sqltext = NULL;
 
if (zend_get_parameters_ex(1, arg) == SUCCESS) {
statement = (oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, 
NULL, NULL, 1, le_stmt);
if (statement) {
errh = statement-pError;
error = statement-error;
+   
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (text *) sqltext,
+   (ub4 *)0,
+   OCI_ATTR_STATEMENT,
+   statement-pError));
+   
+   CALL_OCI_RETURN(statement-error, OCIAttrGet(
+   (dvoid *)statement-pStmt,
+   OCI_HTYPE_STMT,
+   (ub2 *)errorofs,
+   (ub4 *)0,
+   OCI_ATTR_PARSE_ERROR_OFFSET,
+   statement-pError));
+
} else {
connection = (oci_connection *) zend_fetch_resource(arg 
TSRMLS_CC, -1, NULL, NULL, 1, le_conn);
if (connection) {
 -4134,6 +4153,8 
array_init(return_value);
add_assoc_long(return_value, code, errcode);
add_assoc_string(return_value, message, (char*) errbuf, 1);
+   add_assoc_long(return_value, offset, errorofs);
+   add_assoc_string(return_value, sqltext, sqltext ? (char *) sqltext : 
+, 1);
} else {
RETURN_FALSE;
}



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


Re: [PHP-DEV] OCIError patch

2002-03-13 Thread Daniel Ceregatti

Well, this leaves one question: Should I even bother passing the sql 
statement? Presumably, the developer will have access to the sql 
statement in the script/class already, so the offset _should_ suffice. 
This is actually what I originally implemented, but I thought I'd go the 
extra kilometer and add the sql with the bold red HTML/asterisk in it. :)

I'll grab the latest CVS and produce a unified diff that only adds the 
offset.

Daniel

Marcus Börger wrote:

 Agree! You could provide afunction for your html output and
 make it an examle in the documentations - then everyone
 knows how to make nice error messages and those needing
 correct ones can do it too.

 Besides that i often needed some time to see the asterix in
 long statements (multiple subselects). So one could insert
 something of more flashy...

 marcus

 At 07:11 13.03.2002, Markus Fischer wrote:

 Of course the offset is fine. But if I were you, I wouldn't
 put the asterisk into the sql statement; just provide the
 offset. _This_ is the greatest flexibility you can provide
 because all the information is passed unmodified to the
 developer.

 Serious environments need custom error handlers anyway.
 Putting HTML inside or modifying error messages this way is
 a bad thing [tm]. Just provide the raw components and
 everyone else can decide how he presents the data to the end
 user (that's the idea behind).

 And, for the patch, can you please make a unified diff
 against altest CVS ?

 - Markus

 On Tue, Mar 12, 2002 at 03:19:27PM -0800, Walter A. Boring IV wrote :
  I like the idea of having the sqltext in the return array, as well as
  the offset.  This is a very usefull tool for debugging oracle sql
  queries.  I believe its something that OCIError has been lacking.
  Anyone that uses Oracle along with sqlplus, you get the * under the
  broken portion of the query. I find it very usefull.
If there is a general rule of not putting html inside return values
  for php internal functions, thats fine.  But I still want an easy 
 way of
  showing this type of info, without having to create my own wrapper
  function call to OCIError, just so I can highlight the broken 
 portion of
  the query.
 
  my $0.02
  Walt
 
  On Tue, 2002-03-12 at 15:08, Daniel Ceregatti wrote:
   Yes. An example of what would be in the array returned by 
 OCIError would be:
  
   // Given the code below...
  
   $conn = OCILogon (bla bla bla);
  
   $sql = select t.foo, t.bar from table t where t.id = 1;
  
   $stmt = OCIParse ($conn, $sql);
  
   OCIExecute ($stmt, OCI_DEFAULT);
  
   $error = OCIError ($stmt);
  
   // What follows are the values of the elements of the array 
 returned by
   OCIError (presuming bar is an invalid column it the table):
  
   $error[code] = 904
   $error[message] = ORA-00904: invalid column name
   $error[sqltext] = select t.foo, t.*bar from table t where t.id 
 = 1
   $error[offset] = 16
  
   The PHP user then has the option of using either the sqltext 
 element
   directly, or using the offset element and the $sql variable to 
 create
   any output they see fit. I think this allows for the greatest
   felxibility, IMHO.
  
   Daniel
  
   Markus Fischer wrote:
  
   On Tue, Mar 12, 2002 at 02:26:24PM -0800, Daniel Ceregatti wrote :
   
   How about doing what sqlplus does and simply add an asterisk at 
 that
   point? I'm ok with rolling my own inside of the script by using 
 the
   offset element. I simply think it'll do PHP users a service to 
 have the
   sqltext in the array in _some_ form, even if only with an 
 asterisk.
   
   
   Asterisk at what point? Specified by offset?
   
  

 -- 
 Please always Cc to me when replying to me on the lists.
 GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

 -- 
 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] alternatives to mod_php

2002-03-13 Thread Daniel Lorch

Hi,

I hope this is not too off-topic - otherwise tell me and I'll post a
follow-up to whatever place you think would be more appropriate.

I never liked the idea of running mod_php in a virtual hosting
environment, thus I sought for alternatives. I stuck to the
PHP Patch for cgiwrap which now runs reliably for several month
on a production server.

  http://www.klaban.torun.pl/patches/cgiwrap/

Unfortunately, this patch was never approved by the cgiwrap dev team
(it was silently ignored).

Today I stumbled over mod_cgi / mod_phpcgiwrap which aims to do the
same thing: invoking the PHP binary transparent to the user, thus
being a real alternative to mod_php.

  http://steven.haryan.to/mod_cgiwrap/mod_cgiwrap.html

But the latter does not look very trustworthy, for example he suggests
the following:

  Q: HTTP Authentication with PHP does not work.
  A: Recompile Apache with -DSECURITY_HOLE_PASS_AUTHORIZATION

without even mentioning possible risks of activating a SECURITY_HOLE
(although I do not exactly know what this parameter does, the
programmer's credibility is not anymore very high).

Has anyone of you experiences with the aforementioned patches
(regarding security)? Yes, I know CGI is much slower than the module,
but I absolutely need the script running as user, as I'm calling
imagemagick.org from shell (and yes, I know there is a EXPERIMENTAL
php module for imagemagick).
  
Daniel



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




Re[2]: [PHP-DEV] alternatives to mod_php

2002-03-13 Thread Daniel Lorch

Hi,

 You might want to check mod_become, or even better mod_suid, which will 
 let apache run as the user you want it to run as.

mod_become which requires you to run apache as root (compile with
-DBIG_SECURITY_HOLE)?

  http://www.snert.com/Software/mod_become/index.shtml

doesn't sound very convincing to me :)

Daniel



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




Re[2]: [PHP-DEV] alternatives to mod_php

2002-03-13 Thread Daniel Lorch

hi,

 Derick:
 You might want to check mod_become, or even better mod_suid, which will 
 let apache run as the user you want it to run as.

in fact, some big hosters over here run PHP as CGI (such as
puretec.de), although I do not know whether they use a home-brewn
solution or depend on PHP patch for cgiwrap. I was interested
whether something more official was available.

Daniel



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




  1   2   3   4   >