[PHP] XSLT processing DocBook files - FO

2003-03-25 Thread Colin Viebrock
I'm trying to automatically convert DocBook XML files into PDFs using
PHP and the XSLT extension.  First step is to convert them into FO, but
I'm running into trouble with this script:

  ?php

  $xslt = xslt_create();
  $xml = 'my_docbook_file.xml';
  $xsl = '/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/docbook.xsl';
  $args = array();
  $params = array(
'paper.type'= 'USletter',
'page.orientation'  = 'portrait',
  );
  $html = xslt_process($xslt, $xml, $xsl, NULL, $args, $params);
  if (!$html) {
die('XSLT processing error: '.xslt_error($xslt));
  }
  xslt_free($xslt);
  echo $html;

  ?

I get the following parse warnings, and the output error:

  Warning: Sablotron error on line 244: variable 'page.orientation' not
found in /home/cmv/www/doc/index.php on line 15
  Warning: Sablotron error on line 254: variable 'paper.type' not found
in /home/cmv/www/doc/index.php on line 15
  Warning: Sablotron error on line 322: variable 'paper.type' not found
in /home/cmv/www/doc/index.php on line 15
  Warning: Sablotron error on line 322: circular reference to variable
'page.width.portrait' in /home/cmv/www/doc/index.php on line 15
  Warning: Sablotron error on line 190: variable 'page.height' not found
in /home/cmv/www/doc/index.php on line 15

  XSLT processing error: variable 'page.height' not found

How do I pass those variables/parameters to the XSLT process?  Has
someone else had experience with this?

(Cc me offlist in your replies, please.)

-- 
colineasydns com
  at dot


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



[PHP] gettext()

2001-08-20 Thread Colin Viebrock

I am interested in speaking to anyone who has used PHP's gettext()
functionality on a fairly large website, preferably one that uses CVS for
development.

We are in the process of getting our site ready for i18n, and want to use
gettext().  However, I'm a bit unsure on how to set up the file structure.

Our site consists of about 400+ seperate PHP files, in about 5 levels of
subdirectories.  To generate and maintain one .po file for the entire site
would be unmanageable I think.  Ditto for maintaining 400+ .po files, one
per PHP file.

I'm wondering how other people have addressed this issue.  Feel free to
respond on- or off-list.

- Colin



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




Re: [PHP] array + checkbox

2001-08-08 Thread Colin Viebrock

 If( strcmp($voorraad[1],'on') == 0 )
 // it's checked
 else
 // it's not

Alternatively, fix your HTML by using quotes and a value attribute:

INPUT TYPE=checkbox name=voorraad value=something checked

Then:

if ($voorraad=='something') {
// checked
}


- Colin



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




Re: [PHP] associative arrays in html forms and javascript

2001-08-08 Thread Colin Viebrock

 html
   body onload=document.formname.arraystuff[inputfield].focus()
 form name=formname
   input type=text name=arraystuff[inputfield]
 /form
   /body
 /html

 and like that the text field won't focus and the parser tells me that
 arraystuff has no properties and that inputfield is undefined.


body onload=document.formname.elements['arraystuff[inputfield]'].focus()

... should work.

- Colin



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




Re: [PHP] array + checkbox

2001-08-08 Thread Colin Viebrock

 You will need some javascript to handle the checkbox'
 onchange event because when the user clicks the
 checkbox off and back on, the value will be 'on' - and
 your if-condition will not work!

Uh, no.

INPUT TYPE=checkbox name=voorraad value=something checked

When you submit the form, $voorraad will either be something or ,
depending on whether it was checked or not.

http://devel.easydns.com/~cmv/checkbox.php
http://devel.easydns.com/~cmv/checkbox.phps  (source)

onChange stuff is only if you want to do Javascript processing client-side.

- Colin



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




[PHP] Re: can't get gettext() to work!

2001-08-03 Thread Colin Viebrock


Richard Lynch [EMAIL PROTECTED] wrote in message
050001c11be5$c93a81c0$6401a8c0@Lynchux100">news:050001c11be5$c93a81c0$6401a8c0@Lynchux100...
  setlocale(LC_ALL, '');

  putenv('LANG=fr');/*  changed here */
  setlocale(LC_ALL, '');

 WILD GUESS ALERT!

 My gut says you need setlocale(LC_ALL, 'fr') or similar in the French
one...

After much fiddling, I found that, for some reason, I always need to use the
long version of the language codes.  LANG=fr didn't work, but
LANG=fr_FR did.

I then need to pass '' or 'fr_FR' to setlocale(), and all is working.

Thanks for the guess, though. :)

- Colin



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




Re: [PHP] software localization with PHP

2001-08-02 Thread Colin Viebrock

I was just looking through the mailing list archives for some help
with my gettext problem (basically, I can't get it to work).

Anyway, I came across your post:

 Thanks for the reply.  This will not solve my problem.  The problem is,
for some
 languages the sentence structure may be different.  For example, the
sentence
 may need to be,
 $greeting = $first_name, welcome!
 as opposed to,
$greeting = Welcome, $first_name!

This can be handled by gettext.  Change your english code to something like:

$greeting = sprintf( gettext(Welcome, %s!), $first_name );

Once you run xgettext to extract all the strings, you'll end up with

msgid Welcome, %s!
msgstr 

So just convert it into whatever language, and move the %s as needed, eg:

msgstr %s, bonjour!

This even works with multiple %s's, in later versions of PHP where you can
rearrange the arguments in the format string, but not the way they are
passed
to sprintf():

msgid %s is %d years old
msgstr $2%d Jahrs habe $1%s

Check www.php.net/sprintf for details.

Hope that helps.

- Colin


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




Re: [PHP-CVS] cvs: php4 /ext/mcrypt mcrypt.c

2001-04-10 Thread Colin Viebrock

 Hello Guys,

 do you think this should be merged to the 4.0.5 branch? Otherwise Blowfish
 (and others) encrypted get initialised with a too long key. That caused
 them to be not compatible with encryptions/decryptions made by other
 programs.

As the poster of the original bug report, I strongly suggest this be merged
into 4.0.5.  As it stands, PHP's blowfish encryption isn't compatible with
any other blowfish-encrypted programs, and should be fixed sooner rather
than later.

Of course, it will require a big note in the NEWS file ... :)

- Colin

P.S. Thank you Derick for figuring this out! :)


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




Re: [PHP-CVS] cvs: php4 / NEWS

2001-03-26 Thread Colin Viebrock

 +- Modified get_parent_class() to accept a class name as well as a class
 +  instance. (Andrei, Zend engine)

Can I make a request for get_class_methods() and get_class_vars() to 
accept class instances as well as a string?

- Colin


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




Re: [PHP-CVS] cvs: php4 /ext/midgard config.m4

2001-03-19 Thread Colin Viebrock

 I don't think it belongs in PEAR at all.  I could see the logic behind
 distributing it with PHP, but don't see any reason to distribute it in
 pear...


Except that isn't this what PEAR was for all along?  A collection of classes
and add-on modules to extend PHP's functionality?

I don't have anything against the Midguard folks personally, but isn't
distributing Midguard with the main PHP distribution implicitly saying PHP
supports/prefers the Midguard content management system over any other
similar system?  What happens when someone else wants *their* system to be
part of the main PHP distribution?  What criteria are we basing these
decisions on?

There is also the license issue (which I know has been discussed before).
But the first thing I read on the Midguard website is:

Midgard will always implement an OS development to publishing
solution, future releases will include APIs for implementing
commercial applications.

Are we going to run into trouble down the road when this happens (and end up
having to take Midguard out of PHP anyway)?

[There is also the fact that Midguard accepts donations and collects
membership fees ... how is that going to change if Midguard is part of the
main PHP distribution?]

And as for Alexander's comment:

Shouldn't that means that almost all extensions from ext/
directory could be classified as PEAR thing?

My opinion is that yes they *could* be classified that way, but it doesn't
make a lot of sense.  PHP users don't have a choice of which module they
want to use for Blowfish encryption, for example ... so mcrypt is part of
the standard distribution.  Perhaps the PDF modules should be, since we have
several.  I don't know.

But, to me at least, Midguard seems to be code that is a "layer above" what
I would feel belongs in the main PHP distribution.  In the same way the DB
abstraction class is (even the C version of it) ... and that they both
belong in PEAR.

Just my 2 cents (and given without intent to offend).


--
Colin Viebrock
Co-Founder, easyDNS Technologies Inc.
http://www.easyDNS.com/





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




[PHP-CVS] cvs: php4 /pear/Net Dig.php

2001-03-13 Thread Colin Viebrock

cmv Tue Mar 13 09:40:24 2001 EDT

  Modified files:  
/php4/pear/Net  Dig.php 
  Log:
  add capability to define server in the constructor
  
  
Index: php4/pear/Net/Dig.php
diff -u php4/pear/Net/Dig.php:1.1 php4/pear/Net/Dig.php:1.2
--- php4/pear/Net/Dig.php:1.1   Mon Mar 12 11:30:56 2001
+++ php4/pear/Net/Dig.php   Tue Mar 13 09:40:24 2001
@@ -16,7 +16,7 @@
 // | Authors: Colin Viebrock [EMAIL PROTECTED]  |
 // +--+
 //
-// $Id: Dig.php,v 1.1 2001/03/12 19:30:56 cmv Exp $
+// $Id: Dig.php,v 1.2 2001/03/13 17:40:24 cmv Exp $
 //
 // A nice friendly OO interface to dig
 //
@@ -91,20 +91,23 @@
 * The Net_Dig constructor
  * Called when a new Net_Dig object is initialized
 *
-* @param string   [$address] The address to dig (can be set 
-*using the $address property as well)
+* @param string [$address]  The address to dig (can be set 
+*   using the $address property as well)
 *
+* @param string [$server]   The server to dig at (can be set 
+*   using the $server property as well)
+*
 * @return object Net_Dig   $obj   A new Net_Dig object
 *
 * @access public
 * @author Colin Viebrock [EMAIL PROTECTED]
 * @since  PHP 4.0.5
 */
-   function Net_Dig($address = false)
+   function Net_Dig($address = false, $server = false )
{
 
$this-address = $address;
-   $this-server = false;
+   $this-server = $server;
$this-query_type = false;
 
$this-cmd = '';



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




[PHP-CVS] cvs: php4 /pear/Net Dig.php

2001-03-12 Thread Colin Viebrock

cmv Mon Mar 12 11:30:56 2001 EDT

  Added files: 
/php4/pear/Net  Dig.php 
  Log:
  A nice friendly OO interface to dig
  
  
  


Index: php4/pear/Net/Dig.php
+++ php4/pear/Net/Dig.php
?php
//
// +--+
// | PHP version 4.0  |
// +--+
// | Copyright (c) 1997-2001 The PHP Group|
// +--+
// | This source file is subject to version 2.02 of the PHP license,  |
// | that is bundled with this package in the file LICENSE, and is|
// | available at through the world-wide-web at   |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to  |
// | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
// +--+
// | Authors: Colin Viebrock [EMAIL PROTECTED]  |
// +--+
//
// $Id: Dig.php,v 1.1 2001/03/12 19:30:56 cmv Exp $
//
// A nice friendly OO interface to dig
//
require_once('PEAR.php');

class Net_Dig extends PEAR
{
// {{{ Public Properties

/**
 * The address to dig
 *
 * @var string $address
 * @access public
 */
var $address;

/**
 * The server to use for digging
 *
 * @var string $server
 * @access public
 */
var $server;

/**
 * The type of DNS records to dig for
 *
 * @var string $query_type
 * @access public
 */
var $query_type;

/**
 * The last system command executed (for debugging)
 *
 * @var string $cmd
 * @access public
 */
var $cmd;

/**
 * The raw output of the system command (for debugging)
 *
 * @var string $raw_data
 * @access public
 */
var $raw_data;

/**
 * The location of the system dig program
 *
 * @var string $dig_prg
 * @access public
 */
var $dig_prog;

/**
 * The parsed result of the last dig
 *
 * @var string $result
 * @access public
 */
var $result;

// }}}


// {{{ Net_Dig()

/**
 * The Net_Dig constructor
 * Called when a new Net_Dig object is initialized
 *
 * @param string   [$address] The address to dig (can be set 
 *using the $address property as well)
 *
 * @return object Net_Dig   $obj   A new Net_Dig object
 *
 * @access public
 * @author Colin Viebrock [EMAIL PROTECTED]
 * @since  PHP 4.0.5
 */
function Net_Dig($address = false)
{

$this-address = $address;
$this-server = false;
$this-query_type = false;

$this-cmd = '';
$this-raw_data = '';

$this-result = false;

$this-dig_prog = trim(`which dig`);
if (!$this-dig_prog) {
$this = new PEAR_Error("Couldn't find system dig program");
}

}

// }}}



// {{{ dig()

/**
 * Does a dig of the given address (or $this-address)
 *
 * @param string   [$address] The address to dig (can be set 
 *using the $address property as well)
 *
 * @return object Net_Dig_result$obj   A new Net_Dig_result object
 *
 * @access public
 * @author Colin Viebrock [EMAIL PROTECTED]
 * @since  PHP 4.0.5
 */
function dig($address=false)
{

if ($address) {
$this-address = $address;
}

if (!$this-address) {
return new PEAR_Error("No address specified");
}

if (!$this-_validate_type()) {
return new PEAR_Error($this-query_type." is an invalid query 
type");
}

$cmd = escapeshellcmd(
sprintf("%s %s %s %s",
$this-dig_prog,
($this-server  ? '@'.$this-server : ''),
 

[PHP-CVS] cvs: php4 /pear Makefile.in

2001-03-12 Thread Colin Viebrock

cmv Mon Mar 12 11:35:28 2001 EDT

  Modified files:  
/php4/pear  Makefile.in 
  Log:
  Forgot to add it here
  
  
Index: php4/pear/Makefile.in
diff -u php4/pear/Makefile.in:1.72 php4/pear/Makefile.in:1.73
--- php4/pear/Makefile.in:1.72  Thu Mar  1 23:52:56 2001
+++ php4/pear/Makefile.in   Mon Mar 12 11:35:28 2001
@@ -83,6 +83,7 @@
Math/Fraction.php \
Math/Util.php \
Net/Curl.php \
+   Net/Dig.php \
Net/SMTP.php \
Net/Socket.php \
Numbers/Roman.php \



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




[PHP] Session-based authentication and Netscape 6 problems

2001-03-07 Thread Colin Viebrock

Apologies in advance for the cross posting, but I imagine this issue affects
several users here.  I'm not on the general PHP mailing list, so please cc
me off-list if you have any comments.

So ...

I just spent the last 2 days tracking down a bug in my own authentication
class.  Since my class was kinda based on PHPLIB, this may affect PHPLIB
users too.

What happens is that when I go to one of my protected pages, the server
sends a "Location:" header to redirect to the login form.  The login form
then POSTS to the protected page again ... which includes the auth code, and
either redirects to the login form again (for failed user/pass combos) or
continues on for successful authentication.  Basically, your standard
session-based auth process.

What seemed to be happening if I visited the site using Netscape 6, was that
all the pages were being served by the server (logs verify this), but the
browser wasn't "refreshing" with the new location.  I say "refreshing",
because if I did a view source, I could actually see the source to the
protected page, and I was logged in (looking at the session files verified
this).  However, the browser still showed the login page.

Unfortunately, I tried to condense my code into something very simple that
reproduced the problem consistantly.  Simple code, however, seemed to work.

Anyway, to make a long story a bit shorter, a lot of searching on the web
revealed a few similar bugs, so I tried adding the following to my Apache
conf file, and all seems to be fixed:

BrowserMatch "Mozilla/5" nokeepalive

This seemed to have been a problem with Netscape 2.x browsers too.  I can
only guess that when doing a 302 redirect, i.e. Header("Location: ..."), if
the page to which you are redirecting is too big, then Netscape 6.x seems to
receive all the data but not refresh the browser window to display the new
data.

This is more of a NS6/Mozilla bug than anything else.  Just thought it might
affect anyone here using session-based authentication.


--
Colin Viebrock
Co-Founder, easyDNS Technologies Inc.
http://www.easyDNS.com/


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




Re: [PHP-CVS] cvs: php4 /ext/standard file.c file.h

2001-02-11 Thread Colin Viebrock

[Sun, 11 Feb 2001] Sterling Hughes said:

 
  elixer Sat Feb 10 18:38:40 2001 EDT
  
Modified files:  
  /php4/ext/standard file.c file.h 
Log:
Fix for bug #4556
# This is pretty much a total rewrite of get_meta_tags using a simple
# handwritten tokenizer.  It might be overkill, but it works.
 
 I'd say this is news worthy...
 
 Can you add an entry into the NEWS file.


I agree.  However, on first glance, it only seems to grab the meta-tags
that have the NAME/CONTENT attributes, not the HTTP-EQUIV/CONTENT
attributes.  This was a major drawback of the original code (IMHO).

I wrote my own get_metatags function in PHP.  Find the code below.  If
someone likes this and wants to convert it into C ...

?php
function get_metatags($url) {

if (substr($url,0,7)=='http://') {
$url = substr($url,7);
}

if( !($fp = fopen('http://'.$url, 'r')) ) {
return false;
} else {

$file = '';
while (!feof($fp)  !stristr($file,'/head') ) {
$file.= fgets($fp, 80);
}
fclose($fp);

$file = str_replace("\r", '', $file);
$file = str_replace("\n", '', $file);

$result = array();
preg_match_all('/meta(.+?)/i', $file, $temp);

if (is_array($temp[1])) {

foreach($temp[1] as $key=$match) {

$t = $n = $c = '';
if (preg_match('/name=("|\')(.*?)\\1/i', $match, $b)) {
$t = 'NAME';
$n = $b[2];
} else if (preg_match('/http-equiv=("|\')(.*?)\\1/i', $match, $b)) {
$t = 'HTTP-EQUIV';
$n = $b[2];
}

if (preg_match('/content=("|\')(.*?)\\1/i', $match, $b)) {
$c = $b[2];
}

if ($t  $n  $c) {
$result[] = array(
'type'  = $t,
'meta_name' = $n,
'meta_content'  = $c
);
}
}
}
return $result;
}
}
?


- Colin


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




[PHP-CVS] cvs: php4 /pear DB.php

2001-02-02 Thread Colin Viebrock

cmv Fri Feb  2 09:59:31 2001 EDT

  Modified files:  
/php4/pear  DB.php 
  Log:
  I think this should've been changed as well, right?
  
  
  
Index: php4/pear/DB.php
diff -u php4/pear/DB.php:1.46 php4/pear/DB.php:1.47
--- php4/pear/DB.php:1.46   Thu Feb  1 21:24:31 2001
+++ php4/pear/DB.phpFri Feb  2 09:59:30 2001
@@ -17,7 +17,7 @@
 // |  |
 // +--+
 //
-// $Id: DB.php,v 1.46 2001/02/02 05:24:31 chagenbu Exp $
+// $Id: DB.php,v 1.47 2001/02/02 17:59:30 cmv Exp $
 //
 // Database independent query interface.
 //
@@ -218,14 +218,14 @@
 }
 
 if (is_array($options)) {
-foreach ($persistent as $option = $value) {
+foreach ($options as $option = $value) {
 $test = $obj-setOption($option, $value);
 if (DB::isError($test)) {
 return $test;
 }
 }
 } else {
-$obj-setOption('persistent', $persistent);
+$obj-setOption('persistent', $options);
 }
 $err = $obj-connect($dsninfo, $obj-getOption('persistent'));
 



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




[PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

cmv Fri Feb  2 12:55:27 2001 EDT

  Modified files:  
/php4/ext/sockets   sockets.c 
  Log:
  Fix for http://bugs.php.net/bugs.php?id=9082
  
  I know switch() is expensive, so someone rewrite this "properly" if you
  want.
  
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.29 php4/ext/sockets/sockets.c:1.30
--- php4/ext/sockets/sockets.c:1.29 Thu Jan 18 12:49:12 2001
+++ php4/ext/sockets/sockets.c  Fri Feb  2 12:55:27 2001
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.29 2001/01/18 20:49:12 sterling Exp $ */
+/* $Id: sockets.c,v 1.30 2001/02/02 20:55:27 cmv Exp $ */
 
 #include "php.h"
 
@@ -857,10 +857,27 @@
int salen = sizeof(php_sockaddr_storage);
int ret;
 
+   switch (ZEND_NUM_ARGS()) {
+   case 3:
+   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), fd, addr, port) 
+== FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+   case 2:
+   if (zend_get_parameters_ex(ZEND_NUM_ARGS(), fd, addr) == 
+FAILURE)
+   WRONG_PARAM_COUNT;
+   break;
+   MAKE_STD_ZVAL((*port));
+   
+   default:
+   WRONG_PARAM_COUNT;
+   }
+
+/*
if (ZEND_NUM_ARGS()  2 || ZEND_NUM_ARGS()  3 || 
zend_get_parameters_ex(ZEND_NUM_ARGS(), fd, addr, port) == FAILURE) {
WRONG_PARAM_COUNT;
}
+*/
multi_convert_to_long_ex(ZEND_NUM_ARGS() - 1, fd, port);
convert_to_string_ex(addr);
 



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




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

  Well, isn't it slower?
 
 No, not really.

Ok.
 
  The goal is to make getpeername() not seg-fault and core dump when
  I only call it with 2 args. :)
 
 What should the value of 'port' be by default, then?

I dunno.  If I call the function with:

? getpeername($fd, $host); ?

I guess it doesn't matter what the port *is* ... it just won't return it.
Maybe just put if statements around any of the code that references port?

- Colin




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




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

 Ok, I fixed it.

Thanks ... although "bogus patch" is kinda harsh, don't you think?  :)

- Colin

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




[PHP-CVS] cvs: php4 /pear/Crypt CBC.php

2001-02-02 Thread Colin Viebrock

cmv Fri Feb  2 13:52:21 2001 EDT

  Modified files:  
/php4/pear/CryptCBC.php 
  Log:
  typo 
  
  
Index: php4/pear/Crypt/CBC.php
diff -u php4/pear/Crypt/CBC.php:1.4 php4/pear/Crypt/CBC.php:1.5
--- php4/pear/Crypt/CBC.php:1.4 Tue Jan 23 13:36:12 2001
+++ php4/pear/Crypt/CBC.php Fri Feb  2 13:52:21 2001
@@ -36,7 +36,7 @@
 * the author of libcrypt decides to name things internally.
 *
 *
-* @version  $Id: CBC.php,v 1.4 2001/01/23 21:36:12 cmv Exp $
+* @version  $Id: CBC.php,v 1.5 2001/02/02 21:52:21 cmv Exp $
 * @author   Colin Viebrock [EMAIL PROTECTED]
 * @author   Mike Glover [EMAIL PROTECTED]
 *
@@ -125,7 +125,7 @@
 
 /* initialize cipher */
 
-if (USING_24x) {
+if (CRYPT_CBC_USING_24x) {
 $this-blocksize = mcrypt_get_block_size($this-cipher,'cbc');
 $this-keysize = mcrypt_get_key_size($this-cipher,'cbc');
 $this-TD = mcrypt_module_open ($this-cipher, '', 'ecb', '');
@@ -185,7 +185,7 @@
 $start = 0;
 while ( $block = substr($clear, $start, $this-blocksize) ) {
 $start += $this-blocksize;
-if (USING_24x) {
+if (CRYPT_CBC_USING_24x) {
 mcrypt_generic_init($this-TD, $this-key, $iv);
 $cblock = mcrypt_generic($this-TD, $iv^$block );
 } else {
@@ -233,7 +233,7 @@
 
 while ( $cblock = substr($crypt, $start, $this-blocksize) ) {
 $start += $this-blocksize;
-if (USING_24x) {
+if (CRYPT_CBC_USING_24x) {
 mcrypt_generic_init($this-TD, $this-key, $iv);
 $block = $iv ^ mdecrypt_generic($this-TD, $cblock);
 } else {



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




RE: [PHP-CVS] cvs: php4 /ext/sockets sockets.c

2001-02-02 Thread Colin Viebrock

 Well, sorry if it seemed harsh, but you tried to fix one problem and
 introduced another without really understanding what needed to be done.

True.  I was relying on a fix somebody suggested.  This is also why I
noted in the CVS comments that somebody else should look at this.  I'll
be the first to admit that *I* don't always understand what needs to be
done.

Anyway ...

There is another problem in that (in my opinion at least) there are quite
a number of open bug reports that no one seems to be working on.  Maybe half
of them are  4.0.4 and should probably just be closed, telling the
submitter
to upgrade and resubmit if their problem persists.

I am willing to do this if people are too busy with other stuff.  But I'm
hoping that someone (or a few people) could start looking through the open
reports and (at least) closing the bogus or fixed ones.

- Colin

I for one would like to see #8839 fixed ... hint, hint Derick! ;)



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




[PHP-CVS] cvs: php4 /pear PEAR.php.in

2001-02-01 Thread Colin Viebrock

cmv Thu Feb  1 12:15:09 2001 EDT

  Modified files:  
/php4/pear  PEAR.php.in 
  Log:
  trigger_error() should be ($msg,$level), no?
  
  
  
Index: php4/pear/PEAR.php.in
diff -u php4/pear/PEAR.php.in:1.13 php4/pear/PEAR.php.in:1.14
--- php4/pear/PEAR.php.in:1.13  Tue Jan 30 17:27:09 2001
+++ php4/pear/PEAR.php.in   Thu Feb  1 12:15:08 2001
@@ -17,7 +17,7 @@
 // |  Stig Bakken [EMAIL PROTECTED]   |
 // +--+
 //
-// $Id: PEAR.php.in,v 1.13 2001/01/31 01:27:09 ssb Exp $
+// $Id: PEAR.php.in,v 1.14 2001/02/01 20:15:08 cmv Exp $
 //
 
 define('PEAR_ERROR_RETURN', 1);
@@ -185,12 +185,12 @@
  is_object($options[0])  is_string($options[1]))) {
 $setcallback = $options;
 } else {
-trigger_error(E_USER_WARNING, "invalid error callback");
+trigger_error("invalid error callback", E_USER_WARNING);
 }
 break;
 
 default:
-trigger_error(E_USER_WARNING, "invalid error mode");
+trigger_error("invalid error mode", E_USER_WARNING);
 break;
 }
 }



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




[PHP-CVS] cvs: php4 /pear/DB common.php

2001-02-01 Thread Colin Viebrock

cmv Thu Feb  1 12:16:53 2001 EDT

  Modified files:  
/php4/pear/DB   common.php 
  Log:
  fix here too
  
  
Index: php4/pear/DB/common.php
diff -u php4/pear/DB/common.php:1.35 php4/pear/DB/common.php:1.36
--- php4/pear/DB/common.php:1.35Tue Jan  9 17:01:53 2001
+++ php4/pear/DB/common.php Thu Feb  1 12:16:53 2001
@@ -242,13 +242,13 @@
  is_object($options[0])  is_string($options[1]))) {
 $this-error_callback = $options;
 } else {
-trigger_error(E_USER_WARNING, "invalid error callback");
+trigger_error("invalid error callback", E_USER_WARNING);
 }
 $this-error_level = PEAR_ERROR_RETURN;
 break;
 
 default:
-trigger_error(E_USER_WARNING, "invalid error mode");
+trigger_error("invalid error mode", E_USER_WARNING);
 break;
 }
 }



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




[PHP-CVS] CVS is down?

2001-01-30 Thread Colin Viebrock

Can't seem to update ...

- Colin

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




[PHP-CVS] cvs: php4 /pear Makefile.in

2001-01-23 Thread Colin Viebrock

cmv Tue Jan 23 13:08:13 2001 EDT

  Modified files:  
/php4/pear  Makefile.in 
  Log:
  Never added this ...
  
  
Index: php4/pear/Makefile.in
diff -u php4/pear/Makefile.in:1.64 php4/pear/Makefile.in:1.65
--- php4/pear/Makefile.in:1.64  Fri Jan 19 21:39:26 2001
+++ php4/pear/Makefile.in   Tue Jan 23 13:08:13 2001
@@ -34,6 +34,7 @@
Benchmark/Timer.php \
Cache/Function_Cache.php \
Console/Getopt.php \
+   Crypt/CBC.php \
Crypt/HCEMD5.php \
Date/Calc.php \
Date/Human.php \



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




[PHP-CVS] cvs: php4 /pear/Crypt CBC.php

2001-01-13 Thread Colin Viebrock

cmv Sat Jan 13 12:34:36 2001 EDT

  Modified files:  
/php4/pear/CryptCBC.php 
  Log:
  Credit
  
  
Index: php4/pear/Crypt/CBC.php
diff -u php4/pear/Crypt/CBC.php:1.2 php4/pear/Crypt/CBC.php:1.3
--- php4/pear/Crypt/CBC.php:1.2 Sat Jan 13 12:33:54 2001
+++ php4/pear/Crypt/CBC.php Sat Jan 13 12:34:35 2001
@@ -35,10 +35,8 @@
 * NOTE: the cipher names in this class may change depending on how
 * the author of libcrypt decides to name things internally.
 *
-* This code was based on work by Mike Glover [EMAIL PROTECTED]
 *
-*
-* @version  $Id: CBC.php,v 1.2 2001/01/13 20:33:54 cmv Exp $
+* @version  $Id: CBC.php,v 1.3 2001/01/13 20:34:35 cmv Exp $
 * @author   Colin Viebrock [EMAIL PROTECTED]
 * @author   Mike Glover [EMAIL PROTECTED]
 *



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




[PHP-CVS] cvs: php4 /ext/mcrypt mcrypt.c

2001-01-13 Thread Colin Viebrock

cmv Sat Jan 13 12:55:15 2001 EDT

  Modified files:  
/php4/ext/mcryptmcrypt.c 
  Log:
  Support for perl-compatible blowfish encryption (in libmcrypt CVS and
  versions later than 2.4.8)
  
  
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.43 php4/ext/mcrypt/mcrypt.c:1.44
--- php4/ext/mcrypt/mcrypt.c:1.43   Wed Nov 22 13:40:15 2000
+++ php4/ext/mcrypt/mcrypt.cSat Jan 13 12:55:15 2001
@@ -294,6 +294,7 @@
MCRYPT_ENTRY2_2_4(ARCFOUR_IV, "arcfour-iv");
MCRYPT_ENTRY2_2_4(ARCFOUR, "arcfour");
MCRYPT_ENTRY2_2_4(BLOWFISH, "blowfish");
+   MCRYPT_ENTRY2_2_4(BLOWFISH_COMPAT, "blowfish-compat");
MCRYPT_ENTRY2_2_4(CAST_128, "cast-128");
MCRYPT_ENTRY2_2_4(CAST_256, "cast-256");
MCRYPT_ENTRY2_2_4(CRYPT, "crypt");



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