Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Alan Knowles

 Ok, had a slight play with it again..

I did eventually find the perl code for threading although without an 
lxr server it's pretty much impossible to decipher all the macros they 
use..

The reality is I'm waving in the dark a bit - I've got a bit of spare 
time to play with it, but not really that sure whats going on all the 
time ;)

Working on the premise of thread creation starting another interpreter..
php compiled with --enable-experimental-zts, & debug. the code below 
manages to fire up the thread and run it.. - although it segfaults the 
main process after doing it.

This is a little supprising - I expected it to be the otherway round - 
as the logic kind of said that the new threads 'enviroment' (eg. vars) 
would not be initiated properly and it would fail.. , which could be the 
zval used in the callback causing issues..

The code for this stuff is pretty simple at the moment.. - so i'ts down 
the bottom..

As I said - if you can think of what needs doing, I've got a bit of time 
to play with it - although a little direction/hints do help..

regards
alan



void phpthreads_create(void *ptr) {
zval *myretval; 
 
void  **args = *(void ***) &ptr;
zval *callback;
TSRMLS_FETCH();

php_request_startup(TSRMLS_C); 
callback   =  *(zval **) args[0] ;
EG(class_table)=  *(HashTable **) args[1] ;
EG(function_table) =  *(HashTable **) args[2] ;

if (!call_user_function( EG(function_table), NULL, callback,  myretval, 0, 
NULL TSRMLS_CC ))  { 
zend_error(E_ERROR, "Problem Starting thread with callback");
fflush(stdout);
}
/* runs this perfectly!*/
ts_free_thread( );

}
/* {{{ proto string phpthreads_thread(string function)
   Return a string to confirm that the module is compiled in */
PHP_FUNCTION(phpthreads_create)
{
void **args[2];  
zval *callback;
pthread_t thread;
phpthreads_flag = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callback) == 
FAILURE) {
return;
}
  
args[0] = (void *)  &callback;
args[1] = (void *)  &EG(class_table);
args[2] = (void *)  &EG(function_table);


pthread_create( &thread, NULL, (void *) phpthreads_create, (void*) &args);
  
printf("DONE CREATING THREAD\n"); fflush(stdout);
/* segfaults a little bit after this gets echoed */
RETURN_TRUE;
}



>>>  
>>>
>>Ouch.  While it's an interesting way to deal with the issue, I think 
>>this will be way too slow, and maintenance will be hard (keeping up with 
>>changes in the real zend_execute, and zend engine in general).  As in a 
>>couple other responses, the way this needs to be implemented has been 
>>hashed out, largely based on how the same problem is solved in Perl 
>>(there is a remarkable amount of simularity between PHP and Perl at some 
>>levels).  If you're interested, lets talk.
>>
>>Shane
>>
>>
>>-- 
>>PHP Development Mailing List 
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
>__
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
>  
>




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




[PHP-DEV] Re: mbstring and html encode/const structs

2002-07-31 Thread Yasuo Ohgaki

Interesting.

Marcus Boerger wrote:
> Anyone interested may download the patch: 
> http://marcus.boerger.de/php/ext/mbstring/mbstring-entities-const.patch
> And the additional file holding translation the table: 
> http://marcus.boerger.de/php/ext/mbstring/html_entities.c

but I cannot access to your web site


--
Yasuo Ohgaki


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




Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Alan Knowles


Shane Caraveo wrote:

> Alan Knowles wrote:
>
>> Im looking at adding threading to php, (for the cgi/cli stuff)..
>>
>> The story so far:
>>
>> I've created an extension which diverts all zend_execute calls into 
>> the extension -> phpthreads_execute.
>> this function is a copy of zend_execute with a few modifications
>> - to copy & restore things like  EG(active_symbol_table);
>> - to malloc lock and unlock the execute loop and release on each opcode.
>
>
> Ouch.  While it's an interesting way to deal with the issue, I think 
> this will be way too slow, and maintenance will be hard (keeping up 
> with changes in the real zend_execute, and zend engine in general). 

Plan A was just to get something that worked - even if it was crude and 
nasty... :)
Agreed - there are lots of issues with this method.. timesliceing and 
yeilding if the application is locked most of the time is problematic.

> As in a couple other responses, the way this needs to be implemented 
> has been hashed out, largely based on how the same problem is solved 
> in Perl (there is a remarkable amount of simularity between PHP and 
> Perl at some levels).  If you're interested, lets talk.

- do we have to do it based on perl - their web site is as easy to 
comprehend as the language - I spent 1/2 hour trying to find any source 
code or CVS server and failed :)
ok - hints would be good.. - pythons source for threading has a url...

I'm guessing this generaly means
a) turning on php's tsrm stuff.
b)on the
pthread_create():
copy the memory address of the function/class tables between threads. 
(eg. so they share the same data).
malloc lock any changes to the function/class table = eg. the compiler 
calls..
do the call_user_func_ex roughly as per before...

c) work out a sharing method for variables...

regards
alan




>
>
> Shane
>
>




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




Re: [PHP-DEV] imap quota broken

2002-07-31 Thread Dan Kalowsky

Yes it did.  Mainly because the old compatibility was wrong.

In the case when a server would respond with multiple resources like so:

C: A003 GETQUOTA ""
S: * QUOTA "" (STORAGE 10 512 MESSAGE 5 256)

The imap_get_quota() function would set the usage and limit values to that
of the last resource.  If there is more than one resource, the last value
is NEVER the STORAGE value.  The current functionality reflects the proper
usage and limit values for all resources, and conforms to RFC 2087.

On Thu, 1 Aug 2002, Jan Schneider wrote:

> One of the lasts commits to the imap quota functions broke backward
> compatibility with the old imap_get_quota() behaviour.
>
> It used to return an array like:
> array ( 'usage' => 83090, 'limit' => 10, )
> but now returns an array like:
> array ( 'STORAGE' => array ( 'usage' => 83090, 'limit' => 10, ), )
>
> Jan.
>
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - discover your knowledge
> http://www.tip4all.de - Deine private Tippgemeinschaft
>
>

>---<
Dan Kalowsky"A little less conversation,
http://www.deadmime.org/~danka little more action."
[EMAIL PROTECTED]- "A Little Less Conversation",
[EMAIL PROTECTED]Elvis Presley


-- 
PHP Development Mailing List 
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 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] imap quota broken

2002-07-31 Thread Jan Schneider

One of the lasts commits to the imap quota functions broke backward
compatibility with the old imap_get_quota() behaviour.

It used to return an array like:
array ( 'usage' => 83090, 'limit' => 10, )
but now returns an array like:
array ( 'STORAGE' => array ( 'usage' => 83090, 'limit' => 10, ), )

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft

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




[PHP-DEV] mbstring and html encode/const structs

2002-07-31 Thread Marcus Boerger

Hi,

i have changed two things in ext/mbstring:

1) i changed all structs to be const to prevent compiler warnings and 
programming errors.

2) i implemented a html encoding.

at this time i have input decoding simply as a pass by and output encoding 
that produces
named or numeric entities for html output. This way i can enforce the 
engine to deliver
entities in output.

At this point it only works with characters < 256. I guess the problem has 
something
to do with internal handling of characters > 255.

Anyone interested may download the patch: 
http://marcus.boerger.de/php/ext/mbstring/mbstring-entities-const.patch
And the additional file holding translation the table: 
http://marcus.boerger.de/php/ext/mbstring/html_entities.c

If the idea finds friends i will check this in and invent some more work in 
decoding and encoding.

Example script:
--


ext/mbstring HTML Encoding Test Page








--

The above script will output the first php line just as the second one:
--
~~äöü
~~äöü
--

regards
marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-



Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Brad LaFountain

Shane,

 I was in the Parrot session at OSCON and parrot is going to implement threads
in the exact same way. One interp per thread with sharing memory.

 - brad
--- Shane Caraveo <[EMAIL PROTECTED]> wrote:
> Alan Knowles wrote:
> > Im looking at adding threading to php, (for the cgi/cli stuff)..
> > 
> > The story so far:
> > 
> > I've created an extension which diverts all zend_execute calls into the 
> > extension -> phpthreads_execute.
> > this function is a copy of zend_execute with a few modifications
> > - to copy & restore things like  EG(active_symbol_table);
> > - to malloc lock and unlock the execute loop and release on each opcode.
> 
> Ouch.  While it's an interesting way to deal with the issue, I think 
> this will be way too slow, and maintenance will be hard (keeping up with 
> changes in the real zend_execute, and zend engine in general).  As in a 
> couple other responses, the way this needs to be implemented has been 
> hashed out, largely based on how the same problem is solved in Perl 
> (there is a remarkable amount of simularity between PHP and Perl at some 
> levels).  If you're interested, lets talk.
> 
> Shane
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




Re: [PHP-DEV] Weird?!?!

2002-07-31 Thread Stefan Esser

On Wed, Jul 31, 2002 at 07:24:05PM +0200, [EMAIL PROTECTED] wrote:
> On Wed, 31 Jul 2002, Stefan Esser wrote:
> 
> > should that be replaced with:
> > 
> > result->value.lval = (long)dval;
> > 
> > instead of calculating the multiplication again???
> 
> I think this is because of precision and the circumvention of rounding 
> errors.

Precision is questionable but rounding errors cannot be. Two integers
multiplied will always have .00 ... Infact i am nearly sure that double
precision is enough...

Stefan


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




Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Shane Caraveo

Alan Knowles wrote:
> Im looking at adding threading to php, (for the cgi/cli stuff)..
> 
> The story so far:
> 
> I've created an extension which diverts all zend_execute calls into the 
> extension -> phpthreads_execute.
> this function is a copy of zend_execute with a few modifications
> - to copy & restore things like  EG(active_symbol_table);
> - to malloc lock and unlock the execute loop and release on each opcode.

Ouch.  While it's an interesting way to deal with the issue, I think 
this will be way too slow, and maintenance will be hard (keeping up with 
changes in the real zend_execute, and zend engine in general).  As in a 
couple other responses, the way this needs to be implemented has been 
hashed out, largely based on how the same problem is solved in Perl 
(there is a remarkable amount of simularity between PHP and Perl at some 
levels).  If you're interested, lets talk.

Shane


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




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

2002-07-31 Thread Robinson, Mike
Title: RE: [PHP-DEV] Re: [PHP-QA] Congratulations.





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


Mike Robinson
IT/Developer - Torstar Media Group Television
Phone: 416.945.8786 Fax: 416.869.4566
Email: [EMAIL PROTECTED]




To find out more about what we can do for you, please visit us at:
http://www.tmgtv.ca/ and http://www.thestar.com/



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


[PHP-DEV] Re: [PHP] mcrypt

2002-07-31 Thread J Smith


If all you need is some generic encryption that doesn't require mcrypt, you 
might want to take a look at a crypto extension I wrote called 
cryptopp-php. It does everything that the mcrypt extension does and might 
be a touch easier to use as far as syntax and such goes. (Plus, it works on 
Windows if you're into that sort of thing.) It's fairly stable at the 
moment, and doesn't have the memory allocation problems.

See http://www.tutorbuddy.com/software/, and 
http://www.tutorbuddy.com/software/cryptopp/ for the manual.

(I hate the shameless plugging, but the more people who use my extension the 
easier it is for me to debug...)

J


Purushotham Komaravolu wrote:

> Hi,
>  Thanks for the prompt answer. But I am still getting the same error.
> 
> /
> original: meet at secret place
> encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0
> 
> Warning: mcrypt_generic_init: Memory allocation error in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 29
> 
> Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 30
> 
> Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in
> 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
> tml/time/cancelsubscription/new.php on line 31
> decrypted:
> 
> 
> ///
> 
> 
> Regards,
> 
> Purushotham Komaravolu
> Software Engineer
> Yaga, Inc. - "advanced payment services"
> Direct: 415-901-7343
> Fax: 415-901-1586
> http://www.yaga.com
> 
> 
> 
> - Original Message -
> From: "Tech Support" <[EMAIL PROTECTED]>
> To: "Purushotham Komaravolu" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 30, 2002 11:34 AM
> Subject: Re: [PHP] mcrypt
> 
> 
>> Rather than tease you with hints I'll give you some working code ;-)
>>
>> Documentation for practical usage of mcrypt is weak. I agree.
>>
>> > // crypto.inc
>> $key = "secret key crap";
>>
>> function hex2bin($data)
>> {
>> $len = strlen($data);
>> return pack("H" . $len, $data);
>> }
>>
>> function encrypt($string, $key)
>> {
>>  // version 2.4.x of lib mcrypt
>>  $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
>>  ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
>>  MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv);
>>  $crypted = mcrypt_generic ($td, $string);
>>  mcrypt_generic_end ($td);
>>  return bin2hex($crypted);
>> }
>>
>> function decrypt($string, $key)
>> {
>>  //version 2.4.x of lib mcrypt
>>  $string = hex2bin($string);
>>  $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
>>  ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
>>  MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv);
>>  $decrypted = mdecrypt_generic ($td, $string);
>>  mcrypt_generic_end ($td);
>>  return trim($decrypted);
>> }
>> ?>
>>
>>
>> usage:
>> > include ("path/to/crypto.inc");
>> $secret = "meet at secret place";
>> $encrypted = encrypt($secret, $key);
>> print "original: " . $secret . "";
>> print "encrypted: " . $encrypted . "";
>> $decrypted = decrypt($encrypted, $key);
>> print "decrypted: " . $decrypted . "";
>> ?>
>>
>> Note: if you are encrypting really secret crap like credit card numbers
>> or something of that nature then NEVER include the key anywhere in your
>> code. Make a form where you have to type it in or something in order to
>> display the results.
>>
>>
>> Jim Grill
>> Support
>> Web-1 Hosting
>> http://www.web-1hosting.net
>> - Original Message -
>> From: "Purushotham Komaravolu" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>> Sent: Tuesday, July 30, 2002 12:52 PM
>> Subject: [PHP] mcrypt
>>
>>
>> Hello,
>>   I am getting some odd errors trying to get an encrypt/decrypt
>> process to
>>   work. Looking at the manual examples and some other literature, I
> have
>> tried
>>   the two approaches listed below. For each, I get a sometimes-works,
>>   sometimes fails result. The manual entry has a string of user notes
>> with
>>   problem like mine, but I still have problems.
>>
>>
>>
>>   Server API Apache
>>
>>
>>
>>   mcrypt
>> mcrypt support enabled
>> version 2.4.x
>> Supported ciphers twofish rijndael-128 rijndael-192
> rijndael-256
>>   saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
> gost
>>   threeway cast-128 des tripledes enigma arcfour panama wake
>> Supported modes ofb cfb nofb cbc ecb stream
>>
>>
>>   --]
>>
>>
>>
>>   The first attempt used the following code:
>>
>>
>>   -->
>>   >   $key = "this is a secret key";
>>   $input = "Let us meet at 9 o'clock at the secret place.";
>>
>>

Re: [PHP-DEV] Weird?!?!

2002-07-31 Thread derick

On Wed, 31 Jul 2002, Stefan Esser wrote:

> should that be replaced with:
> 
> result->value.lval = (long)dval;
> 
> instead of calculating the multiplication again???

I think this is because of precision and the circumvention of rounding 
errors.


Derick

---
 Did I help you?   http://www.derickrethans.nl/link.php?url=giftlist
 Frequent ranting: http://www.derickrethans.nl/
---
 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 
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] Moving away from ASP to PHP

2002-07-31 Thread Preston L. Bannister

By "as many platforms as possible" do you mean different web servers on
Windows (in which case using ActiveX components is viable), or different
operating systems (Linux? Apple's OS? Sun? z/OS?)?

Which specific platforms do you have in mind?

I would not ordinarily recommend writing code in C unless absolutely
necessary.  What skills currently exist within your programming group?
Which of those people are interested in learning new technologies, and which
will resist?

All the above will influence your choices.

BTW - some portable equivalent to COM/ActiveX components would be great.
The Mozilla project has XPCOM but I have no opinion on how well this was
done.  If XPCOM has any legs outside Mozilla then building XPCOM support
into PHP could be a big win.


-Original Message-
From: Anthony Kauffmann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 2:26 AM

I've recently joined a new company and we're doing all of our web
development (server-side) in ASP at the moment.  We have to create a rather
large scale application that will run on as many platforms as possible, so
you can see how IIS can be restrictive to us at this point.  The one thing
that is imperative that we do, is to be able to hide the code of the
application.  In ASP, we would simple make a DLL and then create the COM
object from the ASP scripts.

I'm not the best with the Unix/Linux flavours of this sort of thing, so I'm
not quite sure how we'd accomplish something of the same sort.  I've been a
PHP programmer for over a year at my old job, and I -definitely- prefer it
over ASP or JSP as a scripting language of choice.  I looked into making
modules (binaries?) and then re-compiling them with the code to hide them.
I assume this would mean we would have to write our code in C and then
recompile from there?


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




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

2002-07-31 Thread Andrey Hristov

http://php.net
 
- Original Message - 
From: "Sebastian Nohn" <[EMAIL PROTECTED]>
To: "Xavier Spriet" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 7:22 PM
Subject: RE: [PHP-QA] Congratulations.


> Hi,
> 
> 
> > Well this may not be the appropriate place for this but
> > congratulations to Derick and Jani for their recent award,
> > you really deserved it.
> 
> Did I miss anything? WHat award?
> 
> 
> Regards,
>Sebastian Nohn
> -- 
> +49 170 471 8105 - [EMAIL PROTECTED] - http://www.nohn.net/
> PGP Key Available - Did I help you? Consider a gift:
> http://www.amazon.de/exec/obidos/wishlist/3HYH6NR8ZI0WI/
> 
> -- 
> PHP Quality Assurance Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP-DEV] Session variables

2002-07-31 Thread Pierre-Alain Joye

On Wed, 31 Jul 2002 08:57:36 -0700 (PDT)
Brad LaFountain <[EMAIL PROTECTED]> wrote:

>  You are suggesting using srm for session handling? Thats a little mis-guided.
> php's built in session handling would do the job.


Yes, mis-reading, I read the usual application data request :), sorry :)

pa

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




Re: [PHP-DEV] Session variables

2002-07-31 Thread Brad LaFountain


--- Pierre-Alain Joye <[EMAIL PROTECTED]> wrote:
> On Wed, 31 Jul 2002 16:53:59 +0200
> "Diana Castillo" <[EMAIL PROTECTED]> wrote:
> 
> > 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?
> 
> 
> Take a look at http://www.vl-srm.net/
> 

 You are suggesting using srm for session handling? Thats a little mis-guided.
php's built in session handling would do the job.

 -brad


__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP-DEV] Re: Bus Error again

2002-07-31 Thread Zeev Suraski

It's gone for me.

At 18:05 31/07/2002, Dan Kalowsky wrote:
>Zeev,
>
>It's still there... same bt, same spot.  That crazy Bus Error... on debug.
>
> >---<
>Dan Kalowsky"A little less conversation,
>http://www.deadmime.org/~dank   a little more action."
>[EMAIL PROTECTED]   - "A Little Less Conversation",
>[EMAIL PROTECTED]Elvis Presley


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




Re: [PHP-DEV] Session variables

2002-07-31 Thread Pierre-Alain Joye

On Wed, 31 Jul 2002 16:53:59 +0200
"Diana Castillo" <[EMAIL PROTECTED]> wrote:

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


Take a look at http://www.vl-srm.net/


hth

pa

-- 
PHP Development Mailing List 
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 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Session variables

2002-07-31 Thread Diana Castillo

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
--
http://www.nvtechnologies.com/hgh



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




[PHP-DEV] Bus Error again

2002-07-31 Thread Dan Kalowsky

Zeev,

It's still there... same bt, same spot.  That crazy Bus Error... on debug.

>---<
Dan Kalowsky"A little less conversation,
http://www.deadmime.org/~danka little more action."
[EMAIL PROTECTED]- "A Little Less Conversation",
[EMAIL PROTECTED]Elvis Presley


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




Re: [PHP-DEV] Bus error on CVS Head

2002-07-31 Thread Zeev Suraski

Fixed (it had nothing to do with the script).

Zeev

At 04:14 31/07/2002, Dan Kalowsky wrote:
>Hi,
>
>Building PHP and running a test script with the CGI or CLI on my MacOSX
>machine results in a a Bus Error upon script completion.
>
>I have made a fresh checkout, built clean (with a cvsclean and buildconf),
>yet the problem continues.  Find a backtrace below, and the error.  Any
>suggestions/ideas are welcome to be heard.
>
>./configure --enable-debug --without-mysql
>--with-imap=/Users/dank/Development/imap-2001a
>
>Script (but it's really any script):
>if (!is_dir("/tmp/reports")) mkdir("/tmp/reports", 0777);
>
>if (touch("/tmp/reports/test.txt")) {
> print "file modification time has been updated \n";
>} else {
> print "could not modify time \n";
>}
>
>$fp = fopen("/tmp/reports/test.txt", "w");
>fwrite($fp, "some stuff\n");
>fclose($fp);
>
>print "end of script \n";
>?>
>
>backtrace:
>
>Program received signal EXC_BAD_ACCESS, Could not access memory.
>0x0017dba4 in _zval_dtor (zvalue=0x664f78, __zend_filename=0x2015f4
>"/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c",
>__zend_lineno=277) at
>/Users/dank/Development/php4-cvs/Zend/zend_variables.c:43
>43  CHECK_ZVAL_STRING_REL(zvalue);
>
>(gdb) bt
>#0  0x0017dba4 in _zval_dtor (zvalue=0x664f78, __zend_filename=0x2015f4
>"/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c",
>__zend_lineno=277) at
>/Users/dank/Development/php4-cvs/Zend/zend_variables.c:43
>#1  0x001704dc in _zval_ptr_dtor (zval_ptr=0x667d84,
>__zend_filename=0x2019f0
>"/Users/dank/Development/php4-cvs/Zend/zend_variables.c",
>__zend_lineno=158) at
>/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:277
>#2  0x0017e0bc in _zval_ptr_dtor_wrapper (zval_ptr=0x667d84) at
>/Users/dank/Development/php4-cvs/Zend/zend_variables.c:158
>#3  0x001881dc in zend_hash_destroy (ht=0x667cc8) at
>/Users/dank/Development/php4-cvs/Zend/zend_hash.c:543
>#4  0x0017dc5c in _zval_dtor (zvalue=0x667c88, __zend_filename=0x2015f4
>"/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c",
>__zend_lineno=277) at
>/Users/dank/Development/php4-cvs/Zend/zend_variables.c:51
>#5  0x001704dc in _zval_ptr_dtor (zval_ptr=0x667de4,
>__zend_filename=0x2019f0
>"/Users/dank/Development/php4-cvs/Zend/zend_variables.c",
>__zend_lineno=158) at
>/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:277
>#6  0x0017e0bc in _zval_ptr_dtor_wrapper (zval_ptr=0x667de4) at
>/Users/dank/Development/php4-cvs/Zend/zend_variables.c:158
>#7  0x001881dc in zend_hash_destroy (ht=0x290004) at
>/Users/dank/Development/php4-cvs/Zend/zend_hash.c:543
>#8  0x0016ffa8 in shutdown_executor () at
>/Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:173
>#9  0x0017f6d8 in zend_deactivate () at
>/Users/dank/Development/php4-cvs/Zend/zend.c:596
>#10 0x00139e38 in php_request_shutdown (dummy=0x0) at
>/Users/dank/Development/php4-cvs/main/main.c:788
>#11 0x0019f8e8 in main (argc=2, argv=0xb9fc) at
>/Users/dank/Development/php4-cvs/sapi/cgi/cgi_main.c:1100
>#12 0x244c in _start ()
>#13 0x227c in start ()
>(gdb)
>
>
> >---<
>Dan Kalowsky"A little less conversation,
>http://www.deadmime.org/~dank   a little more action."
>[EMAIL PROTECTED]   - "A Little Less Conversation",
>[EMAIL PROTECTED]Elvis Presley
>
>
>
>--
>PHP Development Mailing List 
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Jason T. Greene

Instead of mutexing the entire interpreter to death, why don't you try
creating multiple interpreters (each in a thread), and then come up with
a sharing mechanism.

-Jason


On Wed, 2002-07-31 at 03:57, Alan Knowles wrote:
> Im looking at adding threading to php, (for the cgi/cli stuff)..
> 
> The story so far:
> 
> I've created an extension which diverts all zend_execute calls into the 
> extension -> phpthreads_execute.
> this function is a copy of zend_execute with a few modifications
> - to copy & restore things like  EG(active_symbol_table);
> - to malloc lock and unlock the execute loop and release on each opcode.
> 
> I've started testing the phpthreads_create($callback); - it appears to 
> work ok, execept it segfaults on completion.. - trying to reduce 
> refcounts somewhere.
> 
> The fireup code looks something like this..
> 
> void phpthreads_create(void *ptr) {
> zval myretval;
> zval *callback = (zval *) ptr;
>   
> if (!call_user_function( EG(function_table), NULL, callback, 
> &myretval, 0, NULL TSRMLS_CC ))  {
> zend_error(E_ERROR, "Problem Starting thread with 
> callback");
> }
>
> pthread_exit(NULL);
>
>
> }
> /* {{{ proto string phpthreads_thread(string function)
>Return a string to confirm that the module is compiled in */
> PHP_FUNCTION(phpthreads_create)
> {
>  
> zval *callback;
> pthread_t thread;
>
>   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", 
> &callback) == FAILURE) {
>   return;
>   }
> pthread_create( &thread, NULL, (void *) phpthreads_create, 
> (void*) callback);
> RETURN_TRUE;
> }
> 
> and the backtrace of the simple threaded test looks like this..
> 0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> 275 (*zval_ptr)->refcount--;
> (gdb) bt
> #0  0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> #1  0x424ceba2 in ?? ()
> #2  0x424c7c92 in ?? ()
> #3  0x08130588 in zend_execute_scripts (type=8, retval=0x0, 
> file_count=3) at /usr/src/php/php4/Zend/zend.c:810
> #4  0x08110abd in php_execute_script (primary_file=0x40006c71) at 
> /usr/src/php/php4/main/main.c:1398
> #5  0x08110138 in php_module_shutdown () at 
> /usr/src/php/php4/main/main.c:1058
> #6  0x2e325f43 in ?? ()
> 
> does anyone want to suggest what might be missing - is it worth putting 
> this into pecl - and does someone what to lend a hand??
> 
> regards
> alan
> 
> 
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Brad LaFountain

This is interesting Shane and I started talking about php threads at OSCON.

But baiscally your soulition won't work. I can't remember the specfic reason. I
think i tried the same thing along time ago. If it were that simple it probally
would have been done already :).

For threading php you will need to have each php thread have a seprate
interperter. So then you would need some way to share variables between php
interperters ($_SHARED[] possibly). The $_SHARED (or equiv) would need
read/write locks around the access to the variable. Shane and a few other
hashed some ideas at the confrence and with stealing some ideas from perl we
came up with a decent soulition. You might want to get ahold of him and see
what he is going to do with it.

 -brad
  
--- Alan Knowles <[EMAIL PROTECTED]> wrote:
> Im looking at adding threading to php, (for the cgi/cli stuff)..
> 
> The story so far:
> 
> I've created an extension which diverts all zend_execute calls into the 
> extension -> phpthreads_execute.
> this function is a copy of zend_execute with a few modifications
> - to copy & restore things like  EG(active_symbol_table);
> - to malloc lock and unlock the execute loop and release on each opcode.
> 
> I've started testing the phpthreads_create($callback); - it appears to 
> work ok, execept it segfaults on completion.. - trying to reduce 
> refcounts somewhere.
> 
> The fireup code looks something like this..
> 
> void phpthreads_create(void *ptr) {
> zval myretval;
> zval *callback = (zval *) ptr;
>   
> if (!call_user_function( EG(function_table), NULL, callback, 
> &myretval, 0, NULL TSRMLS_CC ))  {
> zend_error(E_ERROR, "Problem Starting thread with 
> callback");
> }
>
> pthread_exit(NULL);
>
>
> }
> /* {{{ proto string phpthreads_thread(string function)
>Return a string to confirm that the module is compiled in */
> PHP_FUNCTION(phpthreads_create)
> {
>  
> zval *callback;
> pthread_t thread;
>
>   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", 
> &callback) == FAILURE) {
>   return;
>   }
> pthread_create( &thread, NULL, (void *) phpthreads_create, 
> (void*) callback);
> RETURN_TRUE;
> }
> 
> and the backtrace of the simple threaded test looks like this..
> 0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> 275 (*zval_ptr)->refcount--;
> (gdb) bt
> #0  0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> #1  0x424ceba2 in ?? ()
> #2  0x424c7c92 in ?? ()
> #3  0x08130588 in zend_execute_scripts (type=8, retval=0x0, 
> file_count=3) at /usr/src/php/php4/Zend/zend.c:810
> #4  0x08110abd in php_execute_script (primary_file=0x40006c71) at 
> /usr/src/php/php4/main/main.c:1398
> #5  0x08110138 in php_module_shutdown () at 
> /usr/src/php/php4/main/main.c:1058
> #6  0x2e325f43 in ?? ()
> 
> does anyone want to suggest what might be missing - is it worth putting 
> this into pecl - and does someone what to lend a hand??
> 
> regards
> alan
> 
> 
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP-DEV] CVS Account Request: sebastian.picklum

2002-07-31 Thread Sebastian-Hendrik Picklum

phpdoc
phpdoc-de
phpdoc-fr
phpdoc-es
phpdoc-nl
Translating/Maintaining Documentation (German,English,French,Spanish,Dutch)

/phpweb
/portal
Maintain php.net, if help is needed there... =:-)



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




[PHP-DEV] gc impossible if session.save_path depth > 2 ?

2002-07-31 Thread Giancarlo Pinerolo

Many hosted sites would like to keep their session.save_path separate, within their 
home dir, but are somehow prevented by the fact that gc wouldn't take place if the 
path depth is > 2.

Because they obviously see a problem in implementing their own garbage collection, as 
most hosting sites  do not offer a shell nor the possibility to set up cron jobs to do 
that, most give up that, and decide to drop their session in the common cauldron.

I went through php code, and it seems that this limit is just hardcoded in there.

I mean, is there a valid technical reason for this limit to be there or...

gian

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




[PHP-DEV] CVS Account Request: dexter

2002-07-31 Thread Piotr Roszatycki

pear/DB_ldap
as the co-maintainer (with the consent of Ludovico Magnocavallo <[EMAIL PROTECTED]>)


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




[PHP-DEV] Weird?!?!

2002-07-31 Thread Stefan Esser

Hi,

Could someone tell me why the Zend Engine calculates every multiplication
2 times???

zend_operators.c:

ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
...
if (op1->type == IS_LONG && op2->type == IS_LONG) {
double dval = (double) op1->value.lval * (double) op2->value.lval;

if ((dval > (double) LONG_MAX) || (dval < (double) LONG_MIN)) {
result->value.dval = dval;
result->type = IS_DOUBLE;
} else {
result->value.lval = op1->value.lval * op2->value.lval;
result->type = IS_LONG;
}
return SUCCESS;

...

should that be replaced with:

result->value.lval = (long)dval;

instead of calculating the multiplication again???


Stefan Esser


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




[PHP-DEV] RE: [PHP] Re: [PHP-DEV] [CROSS POST] PHP Meetup & Texas PHP Users

2002-07-31 Thread Jay Blanchard

[snip]
First of all, sorry for the additional cross post. MeetUp.com lacks the
ability to let you contact other folks who have signed up. In my general
area, Massachusetts, there are a bunch of tiny groups scattered about,
and I'd like a chance to get all of them to converge in one place to make
the meetup worth it for all of us. I know there's only a few days before the
meetup is to take place, but if folks from the following areas could email
me, then we can try and work out somewhere we can all meet, instead of there
being 5 groups of 2 or 3 people.
[/snip]

Agreed Gabriel, meetup.com, while a nice idea, does not work well at all due
to the lack of contact information provided. But look what it may have
started!

I encourage PHP developers to seek each other and form their own groups. But
even the PHP lists barely scratch the surface of developers who are out
there. Contact other computer users groups in your area and you may be
surprised at what pops-up.

Jay

LOTTERY: A tax on people who are bad at math

***
* *
* Texas PHP Developers Meeting*
* Spring 2003 *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* Interested? Contact;*
* [EMAIL PROTECTED] *
* *
***



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




RE: [PHP-DEV] Scripts running on two different browsers crashes the server

2002-07-31 Thread James Cox


> Please note that I am using the PHP development version 4.0.8.
> 
Ananth,
 
Can I ask why you guys are using such an old version of PHP?

Thanks,

 James

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




[PHP-DEV] Scripts running on two different browsers crashes the server

2002-07-31 Thread Ananth Kesari

Hi All,

I am porting PHP for NetWare. I have run into a problem during unit
testing and I seek inputs from you on this.

I am using two scripts:
1. In one, I am using a simple while loop:
";
}
?>

2. In the other, I am just displaying the PHP info using


If I run these scripts individually, it is fine.
Even if run the while loop script simultaneously on two different
browsers, it works fine on both the browsers.

But if I run the first script (while loop) in one browser and while it
is running, if I run the second script from another brower, then my
NetWare server crashes. Strangely, the PHP info output from the second
browser is getting displayed on the first browser (!) where only the
loop numbers are supposed to be displayed. The font and size of the
display also changes. The server abends before the loop is completed.
Nothing is getting displayed on the second brower.

When I walk through the stack, I find that the abend seems to be
happening in the "_zval_ptr_dtor" function that is called after the
function, "zend_stack_apply_with_argument" is called which in turn is
called by the "execute" function.

I feel this may be due to data corruption between different threads in
some specific cases. Is it due to the usage of global variable or the
usage of static variables that are shared across threads?

I would greatly appreciate if anyone can throw some light on this.

Please note that I am using the PHP development version 4.0.8.

Thanks,
Ananth.


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




Re: [PHP-DEV] Addition to the openssl ext

2002-07-31 Thread Thomas Langås

Wez Furlong:
> Just so you know who I am, I'm the openssl extension maintainer :-)

:)

> So, I don't think we will integrate your patch as-is, but do think
> we can implement the same functionality using a function something
> like this:
> mixed openssl_cipher_encrypt(int cipher, string key, string plaindata);
> mixed openssl_cipher_decrypt(int cipher, string key, string cryptdata);

Fair enough :)  As long as I get the functionality I want, I'm happy :)

> Could you log your patch as a feature request using bugs.php.net so
> that I can find it when I get around to implementing this?

I might make a patch that implements what you suggests over, if
that's ok with you? 


-- 
Thomas

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




[PHP-DEV] Re: Moving away from ASP to PHP

2002-07-31 Thread Brian McGarvie

to make 'modules' you could look into PHP Pear...

"Anthony Kauffmann" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I've recently joined a new company and we're doing all of our web
> development (server-side) in ASP at the moment.  We have to create a
rather
> large scale application that will run on as many platforms as possible, so
> you can see how IIS can be restrictive to us at this point.  The one thing
> that is imperative that we do, is to be able to hide the code of the
> application.  In ASP, we would simple make a DLL and then create the COM
> object from the ASP scripts.
>
> I'm not the best with the Unix/Linux flavours of this sort of thing, so
I'm
> not quite sure how we'd accomplish something of the same sort.  I've been
a
> PHP programmer for over a year at my old job, and I -definitely- prefer it
> over ASP or JSP as a scripting language of choice.  I looked into making
> modules (binaries?) and then re-compiling them with the code to hide them.
> I assume this would mean we would have to write our code in C and then
> recompile from there?
>
> Any help or suggestions would be greatly appreciated.  Thanks.
>
> Anthony
>
>



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




Re: [PHP-DEV] Moving away from ASP to PHP

2002-07-31 Thread John Wards

If you don't know

http://www.zend.com

also get the optimiser it rocks! or server is loving it!

John Wards
Sportnetwork.net
- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Anthony Kauffmann" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 11:11 AM
Subject: Re: [PHP-DEV] Moving away from ASP to PHP


> AFAIK, you can look at Zend Encoder, or ionCube Encoder (coupled with
PHPA).
>
> Regard,s
> Andrey
>
> - Original Message -
> From: "Anthony Kauffmann" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 31, 2002 12:26 PM
> Subject: [PHP-DEV] Moving away from ASP to PHP
>
>
> > Hi all,
> >
> > I've recently joined a new company and we're doing all of our web
> > development (server-side) in ASP at the moment.  We have to create a
> rather
> > large scale application that will run on as many platforms as possible,
so
> > you can see how IIS can be restrictive to us at this point.  The one
thing
> > that is imperative that we do, is to be able to hide the code of the
> > application.  In ASP, we would simple make a DLL and then create the COM
> > object from the ASP scripts.
> >
> > I'm not the best with the Unix/Linux flavours of this sort of thing, so
> I'm
> > not quite sure how we'd accomplish something of the same sort.  I've
been
> a
> > PHP programmer for over a year at my old job, and I -definitely- prefer
it
> > over ASP or JSP as a scripting language of choice.  I looked into making
> > modules (binaries?) and then re-compiling them with the code to hide
them.
> > I assume this would mean we would have to write our code in C and then
> > recompile from there?
> >
> > Any help or suggestions would be greatly appreciated.  Thanks.
> >
> > Anthony
> >
> >
> >
> > --
> > PHP Development Mailing List 
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DEV] Addition to the openssl ext

2002-07-31 Thread Wez Furlong

Hi Thomas,

Just so you know who I am, I'm the openssl extension maintainer :-)

I'd like to see your patch integrated into a more generic encryption
function call, where the cipher is passed as a parameter.

So, I don't think we will integrate your patch as-is, but do think
we can implement the same functionality using a function something
like this:

mixed openssl_cipher_encrypt(int cipher, string key, string plaindata);
mixed openssl_cipher_decrypt(int cipher, string key, string cryptdata);

The functions would return false on error or the (de)crypted string
on success.
The ciphers would be registered as constants like this:
OPENSSL_CIPHER_BF_CFB64
OPENSSL_CIPHER_X

Could you log your patch as a feature request using bugs.php.net so
that I can find it when I get around to implementing this?

If you are able, it would be really, really appreciated if you could
help with the groundwork for this: if you can find out how to do this
generic encryption using C code (it doesn't have to work with PHP; it
can be a small hacked up C program) and post it along with your original
patch, it would help a great deal!
I tend to use the source for the openssl command line program as a guide,
so that's where to check first.

To get the idea of what I talking about we want something like this:

CIPHER_METHOD cipher; // This is a pointer to the cipher method

switch(cipher_number) {
case OPENSSL_CIPHER_BF_CFB64:
  cipher = CIPHER_BLOWFISH;
}

CIPHER_Encrypt(cipher, key, data);

So we just need to find out the names and types of the ciphers and
related functions.

Thanks for your contribution!

--Wez.

[Stuff about blowfish encrypt/decrypt was eaten by my MTA]

PS: I've Cc'd this to Derick who is working on a generic encryption
extension for PHP and who might have some comments on the API,
although he is on vacation at the moment.



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




Re: [PHP-DEV] Moving away from ASP to PHP

2002-07-31 Thread Andrey Hristov

AFAIK, you can look at Zend Encoder, or ionCube Encoder (coupled with PHPA).

Regard,s
Andrey

- Original Message -
From: "Anthony Kauffmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 12:26 PM
Subject: [PHP-DEV] Moving away from ASP to PHP


> Hi all,
>
> I've recently joined a new company and we're doing all of our web
> development (server-side) in ASP at the moment.  We have to create a
rather
> large scale application that will run on as many platforms as possible, so
> you can see how IIS can be restrictive to us at this point.  The one thing
> that is imperative that we do, is to be able to hide the code of the
> application.  In ASP, we would simple make a DLL and then create the COM
> object from the ASP scripts.
>
> I'm not the best with the Unix/Linux flavours of this sort of thing, so
I'm
> not quite sure how we'd accomplish something of the same sort.  I've been
a
> PHP programmer for over a year at my old job, and I -definitely- prefer it
> over ASP or JSP as a scripting language of choice.  I looked into making
> modules (binaries?) and then re-compiling them with the code to hide them.
> I assume this would mean we would have to write our code in C and then
> recompile from there?
>
> Any help or suggestions would be greatly appreciated.  Thanks.
>
> Anthony
>
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP-DEV] Moving away from ASP to PHP

2002-07-31 Thread Anthony Kauffmann

Hi all,

I've recently joined a new company and we're doing all of our web
development (server-side) in ASP at the moment.  We have to create a rather
large scale application that will run on as many platforms as possible, so
you can see how IIS can be restrictive to us at this point.  The one thing
that is imperative that we do, is to be able to hide the code of the
application.  In ASP, we would simple make a DLL and then create the COM
object from the ASP scripts.

I'm not the best with the Unix/Linux flavours of this sort of thing, so I'm
not quite sure how we'd accomplish something of the same sort.  I've been a
PHP programmer for over a year at my old job, and I -definitely- prefer it
over ASP or JSP as a scripting language of choice.  I looked into making
modules (binaries?) and then re-compiling them with the code to hide them.
I assume this would mean we would have to write our code in C and then
recompile from there?

Any help or suggestions would be greatly appreciated.  Thanks.

Anthony



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




Re: [PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Sterling Hughes


> Im looking at adding threading to php, (for the cgi/cli stuff)..
>
> The story so far:
>
> I've created an extension which diverts all zend_execute calls into the
>  extension -> phpthreads_execute.
> this function is a copy of zend_execute with a few modifications
> - to copy & restore things like  EG(active_symbol_table);
> - to malloc lock and unlock the execute loop and release on each
> opcode.
>
> I've started testing the phpthreads_create($callback); - it appears to
> work ok, execept it segfaults on completion.. - trying to reduce
> refcounts somewhere.
>
> The fireup code looks something like this..
>
> void phpthreads_create(void *ptr) {
>zval myretval;
>zval *callback = (zval *) ptr;
>
>if (!call_user_function( EG(function_table), NULL, callback,
> &myretval, 0, NULL TSRMLS_CC ))  {
>zend_error(E_ERROR, "Problem Starting thread with
> callback");
>}
>
>pthread_exit(NULL);
>
>
> }
> /* {{{ proto string phpthreads_thread(string function)
>   Return a string to confirm that the module is compiled in */
> PHP_FUNCTION(phpthreads_create)
> {
>
>zval *callback;
>pthread_t thread;
>
>  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z",
> &callback) == FAILURE) {
>  return;
>  }
>pthread_create( &thread, NULL, (void *) phpthreads_create,
> (void*) callback);
>RETURN_TRUE;
> }
>
> and the backtrace of the simple threaded test looks like this..
> 0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> 275 (*zval_ptr)->refcount--;
> (gdb) bt
> #0  0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at
> /usr/src/php/php4/Zend/zend_execute_API.c:275
> #1  0x424ceba2 in ?? ()
> #2  0x424c7c92 in ?? ()
> #3  0x08130588 in zend_execute_scripts (type=8, retval=0x0,
> file_count=3) at /usr/src/php/php4/Zend/zend.c:810
> #4  0x08110abd in php_execute_script (primary_file=0x40006c71) at
> /usr/src/php/php4/main/main.c:1398
> #5  0x08110138 in php_module_shutdown () at
> /usr/src/php/php4/main/main.c:1058
> #6  0x2e325f43 in ?? ()
>
> does anyone want to suggest what might be missing - is it worth putting
>  this into pecl - and does someone what to lend a hand??
>

well, not until it doesn't segfault after every request, no. :)

I'd also think you'd need a quite larger subset of Pthreads, and perhaps
focus on an OO solution (like what Perl does), but that's all surrounding
elements.

Good luck with threading the Zend Engine :P

-Sterling

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




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




[PHP-DEV] phpthreads - hints anyone...

2002-07-31 Thread Alan Knowles

Im looking at adding threading to php, (for the cgi/cli stuff)..

The story so far:

I've created an extension which diverts all zend_execute calls into the 
extension -> phpthreads_execute.
this function is a copy of zend_execute with a few modifications
- to copy & restore things like  EG(active_symbol_table);
- to malloc lock and unlock the execute loop and release on each opcode.

I've started testing the phpthreads_create($callback); - it appears to 
work ok, execept it segfaults on completion.. - trying to reduce 
refcounts somewhere.

The fireup code looks something like this..

void phpthreads_create(void *ptr) {
zval myretval;
zval *callback = (zval *) ptr;
  
if (!call_user_function( EG(function_table), NULL, callback, 
&myretval, 0, NULL TSRMLS_CC ))  {
zend_error(E_ERROR, "Problem Starting thread with 
callback");
}
   
pthread_exit(NULL);
   
   
}
/* {{{ proto string phpthreads_thread(string function)
   Return a string to confirm that the module is compiled in */
PHP_FUNCTION(phpthreads_create)
{
 
zval *callback;
pthread_t thread;
   
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", 
&callback) == FAILURE) {
  return;
  }
pthread_create( &thread, NULL, (void *) phpthreads_create, 
(void*) callback);
RETURN_TRUE;
}

and the backtrace of the simple threaded test looks like this..
0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
/usr/src/php/php4/Zend/zend_execute_API.c:275
275 (*zval_ptr)->refcount--;
(gdb) bt
#0  0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at 
/usr/src/php/php4/Zend/zend_execute_API.c:275
#1  0x424ceba2 in ?? ()
#2  0x424c7c92 in ?? ()
#3  0x08130588 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/src/php/php4/Zend/zend.c:810
#4  0x08110abd in php_execute_script (primary_file=0x40006c71) at 
/usr/src/php/php4/main/main.c:1398
#5  0x08110138 in php_module_shutdown () at 
/usr/src/php/php4/main/main.c:1058
#6  0x2e325f43 in ?? ()

does anyone want to suggest what might be missing - is it worth putting 
this into pecl - and does someone what to lend a hand??

regards
alan






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