[PHP-DEV] New FTP extension functionality

2002-07-26 Thread Stefan Esser

Hi,

yesterday I did several commits to the FTP extension. Due to the fact that
I do not know how I can document the stuff myself and right now am lacking
the time here is a brief instruction:

Stefan Esser

---
5 new constants
---

FTP_AUTOSEEK new option for get/set_option: when enabled (which is default)
 get/put requests with a resumepos/startpos will first seek
 to the wanted position within the stream
 
FTP_AUTORESUME   automaticly determine resumepos/startpos for get/put request
 (does only work if AUTOSEEK is enabled)

FTP_FAILED   asynchronous transfer has failed
FTP_FINISHED asynchronous transfer has finished
FTP_MOREDATA asynchronous transfer is still active

New optional 5th parameter
--

Added optional "startpos" to ftp_put/ftp_fput (works like in the async examples)
Added optional "resumepos" to ftp_get/ftp_fget (works like in the async examples)

New asynchronous FTP functions
--

int ftp_async_get(resource ftp_stream, string local_file, string remote_file, int 
mode[, int resumepos])
int ftp_async_fget(resource ftp_stream, resource fp, string remote_file, int mode[, 
int resumepos])
int ftp_async_put(resource ftp_stream, string remote_file, string local_file, int 
mode[, int startpos])
int ftp_async_fput(resource ftp_stream, string remote_file, resource fp, int mode[, 
int startpos])
int ftp_async_continue(resource ftp_stream)


Example (Downloading a file):
-

...
// Initate the Download
$ret = ftp_async_get ($my_connection, "test", "README", FTP_BINARY);
while ($ret == FTP_MOREDATA) {
   
   // Do whatever you want
   echo ".";

   // Continue downloading...
   $ret = ftp_async_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "There was an error downloading the file...";
   exit(1);
}
...

Example (Uploading a file):
-

...
// Initiate the Upload
$ret = ftp_async_put ($my_connection, "test.remote", "test.local", FTP_BINARY);
while ($ret == FTP_MOREDATA) {
   
   // Do whatever you want
   echo ".";

   // Continue uploading...
   $ret = ftp_async_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "There was an error uploading the file...";
   exit(1);
}
...


Example (Resume downloading a file):


...
// Initate 
$ret = ftp_async_get ($my_connection, "test", "README", FTP_BINARY, 
  filesize("test"));
// OR: $ret = ftp_async_get ($my_connection, "test", "README", 
//   FTP_BINARY, FTP_AUTORESUME);
while ($ret == FTP_MOREDATA) {
   
   // Do whatever you want
   echo ".";

   // Continue downloading...
   $ret = ftp_async_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "There was an error downloading the file...";
   exit(1);
}
...

Example (Resume uploading a file):
--

...
// Initiate
$ret = ftp_async_put ($my_connection, "test.remote", "test.local", 
  FTP_BINARY, ftp_size("test.remote"));
// OR: $ret = ftp_async_put ($my_connection, "test.remote", "test.local", 
//   FTP_BINARY, FTP_AUTORESUME);

while ($ret == FTP_MOREDATA) {
   
   // Do whatever you want
   echo ".";

   // Continue uploading...
   $ret = ftp_async_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "There was an error uploading the file...";
   exit(1);
}
...

Example (Resume downloading at position 100 to a new file):
---
...
// Disable Autoseek
ftp_set_option ($my_connection, FTP_AUTOSEEK, FALSE);

// Initiate
$ret = ftp_async_get ($my_connection, "newfile", "README", FTP_BINARY, 100);
while ($ret == FTP_MOREDATA) {

   ...
   
   // Continue downloading...
   $ret = ftp_async_continue ($my_connection);
}
...

newfile is now 100 bytes smaller than README on the ftp because
we started reading at offset 100. If we have not have disabled
AUTOSEEK the first 100 bytes of newfile will be '\0'...



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




[PHP-DEV] finishing strtok() implementation

2002-07-26 Thread Edin Kadribasic

Hi Markus,

Do you have time to look into http://bugs.php.net/bug.php?id=17353
before 4.3.0 is released?

Edin


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




[PHP-DEV] Re: [PEAR-DEV] Binary extensions via PECL

2002-07-26 Thread Martin Jansen

On Fri Jul 26, 2002 at 06:2117PM +0300, Marko Karppinen wrote:
>  1. Someone from the PHP Group will be designated the PHP
> Certificate Authority. This person will, on a mostly
> non-connected system, grant certificates for all
> PEAR/PECL package maintainers. He will also maintain
> a Certificate Revocation List on www.php.net.
> The PHP CA public key will be distributed with
> all copies of PHP.
> 
>  2. Package maintainers will prepare their packages like before.
> In addition to the package, they will prepare an S/MIME
> message that contains the SHA1 (RFC3174) hash of the
> package in question. The maintainers will cryptographically
> sign this message and send it to the repository along
> with the package.
>  
>  3. The PEAR/PECL installer will fetch both the package and
> the accompanying S/MIME message, verifying that the
> signatory has been certified by the PHP CA. The installer
> will also check that the signatory has not been placed
> on the php.net CRL. Finally, the installer will determine
> whether the SHA1 hash in the message matches with the
> hash of the downloaded package. If not, the installation
> is aborted.
> 

Will this process only apply for PECL extensions (as your subejct
implies) or will it apply for PEAR packages also?

Generally, your proposal sounds fine for me.

>  - We need a volunteer for the PHP CA.

Stig sounds like the man for this.

>  - After this change the OpenSSL extension will be a significant
>enabler of the PEAR/PECL infrastructure. It should be
>on by default (if the host has OpenSSL installed).

What's with Windows? Does it support OpenSSL "by default"?

-- 
- Martin   Martin Jansen
http://martinjansen.com/

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




Re: [PHP-DEV] finishing strtok() implementation

2002-07-26 Thread Edin Kadribasic

> What does this have to do with strtok()? :) Am I missing
something?
>
> Andi

My bad :) I was thinking about glob() of course.

Edin


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




[PHP-DEV] CVS Account Request: analytik

2002-07-26 Thread Milan Brezovsky

Translating PHP MANUAL to Slovak and/or Czech language (these languages are 
'compactible' - our nations understand each other).

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




[PHP-DEV] CVS Account Request: outsider

2002-07-26 Thread Mitja Zivkovic

Translating the documentation to Slovenian language.

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




[PHP-DEV] usort() implementation in 4.1+

2002-07-26 Thread Phil Dier

I'm sure this has been discussed on here already, but I just discovered the usort() 
behaviour that was 
introduced in php 4.1.0 relating to "equal" values.  Consider this scenario:
id = $id;
$this->time = $time;
}
function do_sort($a,$b)
{
if($a->time == $b->time) return 0;
return ($a->time > $b->time) ? 1 : -1;
}
}
$a3 = new data_object(3, 400);
$a2 = new data_object(2, 400);
$a1 = new data_object(1, 400);
$o_array[0] = &$a1;
$o_array[1] = &$a2;
$o_array[2] = &$a3;
echo ""; 
print_r($o_array);  // the array is in the right order here...
echo "";
usort($o_array, array("data_object","do_sort"));
echo "";
print_r($o_array);  // here it's apparently in the order it is stored in memory...
echo "";
?>

There's obviously a couple workarounds in this simple case, but adding more member 
vars and defining 
objects in different places complicates things.  This behaviour is a bug IMO.  And yes 
I saw the note in 
the manual, but i still think this is counter-intuitive and has the chance to break 
people's code (it broke 
mine).

Phil Dier   <[EMAIL PROTECTED]>
gett communications  
gett labs, inc.  


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




Re: [PHP-DEV] Mail-Header in bug-list

2002-07-26 Thread Joerg Behrens

- Original Message -
From: "Georg Richter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 26, 2002 11:04 PM
Subject: [PHP-DEV] Mail-Header in bug-list


> Hi
>
> would it be possible to revert the headers, or put the status at the end
of
> the subject?! Its impossible to read the subjects in your mailclient, even
if
> you use a terminal.

+1

with best regards
Joerg Behrens



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




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] PHP 4.2.3 release process

2002-07-26 Thread Roman Neuhauser

> Date: Thu, 25 Jul 2002 10:56:12 +0200
> To: Sascha Schumann <[EMAIL PROTECTED]>
> From: Melvyn Sopacua <[EMAIL PROTECTED]>
> Cc: Derick Rethans <[EMAIL PROTECTED]>,
> PHP Developers Mailing List <[EMAIL PROTECTED]>,
> PHP Quality Assurance Team Mailing List <[EMAIL PROTECTED]>
> Subject: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] PHP 4.2.3 release process
> 
> At 09:43 7/25/2002 +0200, Sascha Schumann wrote:
> 
> 
> >> Maybe even comment on the MAKE env variable, I think it'll be OK.
> >
> >Why do you want to remove existing and working functionality?
> 
> Because it's only working, when using BSD make.
> The case statement in configure.in just plain assumes "when on BSD/OS
> we're using bsd make".

sure. that's how it usually is, no? BSD oses install GNU make as
gmake.

> I'm not, simply because php and apache are the only ones so considerate
> of BSD make so it makes no sence if you're installing and configuring 
> software, to use bsd make as your default.

I confess I'm not sure whether I parse the above sentence correctly.
If so, rest assured that much more software than just PHP and Apache
builds with the native FreeBSD make. In fact, whenever I build
something outside the ports system, I use make, and only if that
fails, gmake.

-- 
FreeBSD 4.6-STABLE
2:14PM up 10 days, 33 mins, 5 users, load averages: 0.03, 0.03, 0.00

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




[PHP-DEV] Re: [PEAR-DEV] Binary extensions via PECL

2002-07-26 Thread Marko Karppinen

on 26.7.2002 20:47, Martin Jansen at [EMAIL PROTECTED] wrote:
>>  - After this change the OpenSSL extension will be a significant
>>enabler of the PEAR/PECL infrastructure. It should be
>>on by default (if the host has OpenSSL installed).
> 
> What's with Windows? Does it support OpenSSL "by default"?

I'm pulling this out of my ass, but I'd say that 95% or more of
our Windows users are using the ready-made PHP binaries.
I guess this means that we can solve the issue on Windows also.

mk


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




[PHP-DEV] Mail-Header in bug-list

2002-07-26 Thread Georg Richter

Hi 

would it be possible to revert the headers, or put the status at the end of 
the subject?! Its impossible to read the subjects in your mailclient, even if 
you use a terminal.

Thx in advance

Georg

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