php-general Digest 25 Jan 2004 04:43:51 -0000 Issue 2550

Topics (messages 175633 through 175669):

Re: what PHP really needs
        175633 by: Mark Charette
        175638 by: Marlon Moyer
        175639 by: John Nichel
        175642 by: Mark Charette
        175646 by: John W. Holmes
        175655 by: Marlon Moyer
        175657 by: Marlon Moyer
        175658 by: Marlon Moyer
        175660 by: Mark Charette
        175661 by: Mike Migurski
        175664 by: Chris Shiflett
        175665 by: Chris Shiflett
        175666 by: John Nichel

Re: Why we love Microsoft (0t)
        175634 by: Stuart
        175636 by: Freedomware

Re: "Additional Features for working with linked Tables have been deactivated."
        175635 by: Raditha Dissanayake

RewriteRule REGEX ?
        175637 by: Monty
        175640 by: DvDmanDT
        175641 by: Monty
        175644 by: Paul Chvostek

Re: Using templates (Code & User Interface)
        175643 by: Robert Cummings

Message rejected
        175645 by: Piers Lauder

Can we make .exe programs with php?
        175647 by: pehepe php
        175648 by: Mark Charette
        175653 by: Evan Nemerson
        175659 by: DvDmanDT

Form variables + sessions, is this how it is supposed to work?
        175649 by: Paul
        175656 by: Jason Wong
        175669 by: Paul

Threading & PHP
        175650 by: Galen
        175651 by: Lucas Gonze
        175652 by: Mark Charette
        175654 by: Evan Nemerson
        175663 by: Chris Shiflett

Re: AFter the URL in PHP
        175662 by: Chris Shiflett

binary code, unreadable code etc
        175667 by: Ryan A
        175668 by: John Nichel

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> -----Original Message-----
> From: Hamid Hossain [mailto:[EMAIL PROTECTED]
> As a ColdFusion Certified Developer I can say: You are right!
>
> In CF you can fire a sql statment and store its result in a
> variable which
> is not going to be removed from the server's memory after
> responding to the
> user. That variable will be available for sometime declared by
> you when you
> created the query.

Perhaps you weren't aware that every modern database does the same thing (or
can if you turn it on): the results of query sets are cached at the db
server and are available if the same query is used without involving a file
read. If any update changes any of the underlying result sets then the
corresponding cache entry is invalidated and the momeory released for
another cache entry.

Let the db server handle query/cache consistency ... why put yet another
server in the way that will have to be triggered by the underlying db to
clear ITS cache?

Mark C,

--- End Message ---
--- Begin Message ---
Like Hamid Said, if the ColdFusion server has the query already in memory.
It doesn't need to send traffic to another server to get the information
again.  Most systems I've worked on have the db and the web server on
different areas of a firewall, so you're going through a lot of excess steps
if you're hitting the db every time for something that won't change.

Plus, you have a granular control on what is being cached.  The sql server
will only cache what it has room for.  So if enough queries are run against
it, the original query won't be cached anymore regardless.

But I think the original question was about a tree that took a long time to
create, and application variables would be a plus in this situation.....

Marlon
(another certified cf developer)

> -----Original Message-----
> From: Mark Charette [mailto:[EMAIL PROTECTED]
> Sent: Saturday, January 24, 2004 9:35 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] what PHP really needs
> 
> 
> > -----Original Message-----
> > From: Hamid Hossain [mailto:[EMAIL PROTECTED]
> > As a ColdFusion Certified Developer I can say: You are right!
> >
> > In CF you can fire a sql statment and store its result in a
> > variable which
> > is not going to be removed from the server's memory after
> > responding to the
> > user. That variable will be available for sometime declared by
> > you when you
> > created the query.
> 
> Perhaps you weren't aware that every modern database does the same thing
> (or
> can if you turn it on): the results of query sets are cached at the db
> server and are available if the same query is used without involving a
> file
> read. If any update changes any of the underlying result sets then the
> corresponding cache entry is invalidated and the momeory released for
> another cache entry.
> 
> Let the db server handle query/cache consistency ... why put yet another
> server in the way that will have to be triggered by the underlying db to
> clear ITS cache?
> 
> Mark C,
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message --- Marlon Moyer wrote:

Like Hamid Said, if the ColdFusion server has the query already in memory.
It doesn't need to send traffic to another server to get the information
again.  Most systems I've worked on have the db and the web server on
different areas of a firewall, so you're going through a lot of excess steps
if you're hitting the db every time for something that won't change.

The problem I have with this is where the database DOES change, and not on any set interval. I used to work at Insight, and our product database changed constantly, at any give moment to account for pricing changes, stock changes, specials, updates from places like TechData, etc. If I'm caching the results of my query, I miss those updates, and have a customer placing an order for a product at the wrong price, out of stock, etc.


Now I can somewhat understand the use of this on a db that rarely changes, depending on how often rare is. Or in a case where the db is updated at a set time. Still, if rare is a time period of months, why have a db anyway? Static HTML would be faster than php, cold fussion, etc. And if the db is updated at a set time, what happens when I have to push a change out that is outside of the set time?

Maybe it's just me, but I feel that the db is supposed to handle the dynamic data, not the web server.

Plus, you have a granular control on what is being cached.  The sql server
will only cache what it has room for.  So if enough queries are run against
it, the original query won't be cached anymore regardless.

But I think the original question was about a tree that took a long time to
create, and application variables would be a plus in this situation.....

Marlon
(another certified cf developer)

-- By-Tor.com It's all about the Rush http://www.by-tor.com

--- End Message ---
--- Begin Message ---
On Sat, 24 Jan 2004, Marlon Moyer wrote:

> Like Hamid Said, if the ColdFusion server has the query already in memory.
> It doesn't need to send traffic to another server to get the information
> again.  Most systems I've worked on have the db and the web server on
> different areas of a firewall, so you're going through a lot of excess steps
> if you're hitting the db every time for something that won't change.

You missed the point. If you have to connect to a server anyway, whjat's 
the difference between going to a cached queryset on a CF server or going 
to a cached queryset on a db server? It's a wire transaction in any case.
 
> Plus, you have a granular control on what is being cached.  The sql server
> will only cache what it has room for.  So if enough queries are run against
> it, the original query won't be cached anymore regardless.

And this won;t happen on the CF server when you run out of memory to cache
a transaction? Yeah, right.

Does CF have to query the db server to stay in sync? Of course it does. 
Now there's multiple transactions to coordinate & synchronize.
 
> But I think the original question was about a tree that took a long time to
> create, and application variables would be a plus in this situation.....

That remains to be seen. Getting the data in an optimal way can be a 
non-trivial operation.
 
-- 
"Half the people know what they're talking about, and the 
other half are writing code."

--- End Message ---
--- Begin Message --- Marlon Moyer wrote:

But I think the original question was about a tree that took a long time to
create, and application variables would be a plus in this situation.....

Again, if you're just talking about reading, how hard is it to just do this to save:


$save_data = '<?php $array = ' . var_export($array) . '; ?>';

Now save that to a RAM disk and include() it whenever you need it recreated. You can do the same thing with objects, too.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---

> 
> > Like Hamid Said, if the ColdFusion server has the query already in
> memory.
> > It doesn't need to send traffic to another server to get the information
> > again.  Most systems I've worked on have the db and the web server on
> > different areas of a firewall, so you're going through a lot of excess
> steps
> > if you're hitting the db every time for something that won't change.
> 
> You missed the point. If you have to connect to a server anyway, whjat's
> the difference between going to a cached queryset on a CF server or going
> to a cached queryset on a db server? It's a wire transaction in any case.

[Marlon Moyer] 
Because most CF servers are installed on the same web server, no wire is
required between the web server and cf server.
> 
> > Plus, you have a granular control on what is being cached.  The sql
> server
> > will only cache what it has room for.  So if enough queries are run
> against
> > it, the original query won't be cached anymore regardless.
> 
> And this won;t happen on the CF server when you run out of memory to cache
> a transaction? Yeah, right.
> 
[Marlon Moyer] 
You don't have much control over what a db server caches, but considering I
can tell CF exactly what I want it to save the chances are less likely, but
still possible, that it will flush from memory.  It's the same with session
variables.  I could keep saving data in session variables until I ran out of
memory also.

> Does CF have to query the db server to stay in sync? Of course it does.
> Now there's multiple transactions to coordinate & synchronize.
> 
[Marlon Moyer] 
I'm not talking about queries that require constant refreshing.  That would
be a bad use of an application variable.  What I'm talking about are queries
that maybe refresh once or twice a day.  I can schedule this easily.  

> > But I think the original question was about a tree that took a long time
> to
> > create, and application variables would be a plus in this situation.....
> 
> That remains to be seen. Getting the data in an optimal way can be a
> non-trivial operation.
> 
> --
> "Half the people know what they're talking about, and the
> other half are writing code."
> 

--- End Message ---
--- Begin Message ---
I don't have a problem with this method.  It would be nice though to be able
just set 1 application variable and be done with it.


> -----Original Message-----
> From: John W. Holmes 
> 
> Marlon Moyer wrote:
> 
> > But I think the original question was about a tree that took a long time
> to
> > create, and application variables would be a plus in this situation.....
> 
> Again, if you're just talking about reading, how hard is it to just do
> this to save:
> 
> $save_data = '<?php $array = ' . var_export($array) . '; ?>';
> 




> Now save that to a RAM disk and include() it whenever you need it
> recreated. You can do the same thing with objects, too.
> 
[Marlon Moyer] 
This is something I wish CF had the ability to do.  

> --
> ---John Holmes...
> 
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> 
> php|architect: The Magazine for PHP Professionals - www.phparch.com
> 
> 

--- End Message ---
--- Begin Message ---

> -----Original Message-----
> From: John Nichel [mailto:[EMAIL PROTECTED]
> 
> 
> The problem I have with this is where the database DOES change, and not
> on any set interval.  I used to work at Insight, and our product
> database changed constantly, at any give moment to account for pricing
> changes, stock changes, specials, updates from places like TechData,
> etc.  If I'm caching the results of my query, I miss those updates, and
> have a customer placing an order for a product at the wrong price, out
> of stock, etc.

[Marlon Moyer] 
This isn't a situation that you would use a cached query. You would only use
it when something doesn't change that often, or you have control of when it
changes. 

> 
> Now I can somewhat understand the use of this on a db that rarely
> changes, depending on how often rare is.  Or in a case where the db is
> updated at a set time.  Still, if rare is a time period of months, why
> have a db anyway?  Static HTML would be faster than php, cold fussion,
> etc.  And if the db is updated at a set time, what happens when I have
> to push a change out that is outside of the set time?
> 
> Maybe it's just me, but I feel that the db is supposed to handle the
> dynamic data, not the web server.
> 
[Marlon Moyer] 
My time frame is usually once or twice a day.  I've set up admin pages that
will refresh the queries on demand, or the pages themselves update the db
and then refresh the query.

--- End Message ---
--- Begin Message ---
f stock, etc.
>
> [Marlon Moyer]
> This isn't a situation that you would use a cached query. You
> would only use
> it when something doesn't change that often, or you have control
> of when it
> changes.

Hell, I have stuff like that - it's called generate an include file with a
cron job. Trivial. All my web pages include it. The variables are all set by
an outside process.

Re CF server & Web server. It's "on the wire" (using sockets). You're going
up & down the stacks just as if you're using a wire except for the last 2
levels (ip & above stacks are used).

And only the smallest shops would consider having a web server and CF (or
db) server on the same box. No scalability or easy recovery from failure.
Heck, I run a tiny little ISP out of my basement, and have all major
services segregated onto different machinery with 1000baseT private net
between the different boxes (db & search services, DNS resolvers, web
servers, mail server, and backup array).

--- End Message ---
--- Begin Message ---
>Let the db server handle query/cache consistency ... why put yet another
>server in the way that will have to be triggered by the underlying db to
>clear ITS cache?

Very true, but tests I've done in the past with PostgreSQL and
MySQL-driven PHP sites show that adding a simple static file cache (for
data that changes rarely) can make a world of difference on a
heavily-loaded site, trimming response times by 90% in some cases.

A database server by nature must assume that all data is equally mutable.
An application developer, however, knows by design how "fresh" any one
piece of data needs to be and can cache accordingly. E.g., don't hit the
database for your site's navigational structure or news articles every
single time, if these things don't change more than a few times per week.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

--- End Message ---
--- Begin Message ---
--- Mark Charette <[EMAIL PROTECTED]> wrote:
> And only the smallest shops would consider having a web server and
> CF (or db) server on the same box. No scalability or easy recovery
> from failure.

This is incorrect. The recommended Web architecture for ColdFusion is to
have the Web server and the CF server on the same physical box and to have
many of these nodes running on small servers.

As for the ColdFusion versus PHP discussion, I'm not really interested.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

--- End Message ---
--- Begin Message ---
--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> Marlon Moyer wrote: 
> > But I think the original question was about a tree that took a
> > long time to create, and application variables would be a plus
> > in this situation...
> 
> Again, if you're just talking about reading, how hard is it to
> just do this to save:
> 
> $save_data = '<?php $array = ' . var_export($array) . '; ?>';
> 
> Now save that to a RAM disk and include() it whenever you need it 
> recreated. You can do the same thing with objects, too.

Wow, the simplicity of logic at its best. :-)

Nice one, John.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:
<snip>
As for the ColdFusion versus PHP discussion, I'm not really interested.

What about a Godzilla versus the Shrek dragon discussion? ;)


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- Ryan A wrote:
Anyway, a 17yr old kid by the name of Mike Rowe opens up a webdesigning
company and names
it MikeRoweSoft (say it out loud..if you're really daft not to get it just
be reading it)..then registers
mikerowesoft.com...a couple of days later he gets an email from microsoft's
lawyers to hand over the
domain for 10$...he refuses and says no way, how about 10,000? a couple of
days later he gets
a legal document of around 25 pages from the lawyers!! They are going after
him extortion!!

Read the whole thing at mikerowesoft.com its pretty amusing, gives a totally
new meaning to
scumbags, sons of bitches and cheap bastards...oops, hope i dont get sued
for saying that.

Another case of hearing only one side of the story. The following was posted in the forums at mikerowesoft.com (now removed, unsurprisingly)...


"I listened to your interview on CBC radio. You said, on live radio, that you did choose the domain name because of Microsoft's public profile. Then, less than a minute later, you claimed to have been surprised that Microsoft was suing you. But, you had admitted everything in the first minute of your interview. Then, you went on to say that you didn't expect you would be able to keep the domain. This sounds suspicious and I think Microsoft has every right to say that you were looking for a pay off at a later date -- not to mention, the publicity."

His case fell apart the moment he admitted that that was the reason he chose that domain name. I see now that he has settled with MS which is a shame because I think he should be made an example of. MS are only doing this to save their public face.

As for the argument that he's only 17, what the hell does that matter? His motivation was clearly to cash in on either the similarity or the publicity from the action MS would take. The lucky fscker got the latter.

--
Stuart

--- End Message ---
--- Begin Message --- Stuart wrote:

As for the argument that he's only 17, what the hell does that matter? His motivation was clearly to cash in on either the similarity or the publicity from the action MS would take. The lucky fscker got the latter.


Gee, like Microsoft is such a tough sucker to hook. Frankly, I don't think a scumbag who abuses the law (not to mention consumers, public schools, etc.) as much as Bill Gates does deserves its protection.

* * * * * * * * * *

> Another case of hearing only one side of the story. The following was
> posted in the forums at mikerowesoft.com (now removed, unsurprisingly)...
>
> "I listened to your interview on CBC radio. You said, on live radio,
> that you did choose the domain name because of Microsoft's public
> profile. Then, less than a minute later, you claimed to have been
> surprised that Microsoft was suing you. But, you had admitted everything
> in the first minute of your interview. Then, you went on to say that you
> didn't expect you would be able to keep the domain. This sounds
> suspicious and I think Microsoft has every right to say that  you were
> looking for a pay off at a later date -- not to mention, the publicity."

* * * * * * * * * *

So, he's sort of a modern day Robin Hood, blackmailing the world's richest thief...

> His case fell apart the moment he admitted that that was the reason he
> chose that domain name. I see now that he has settled with MS which is a
> shame because I think he should be made an example of. MS are only doing
> this to save their public face.


Huh? Microsoft's public face is as far gone as Michael Jackson's!

--- End Message ---
--- Begin Message --- I do belive you may want to read the list newbie guide before making any more off topic posts. Please search the archives for it.

Freedomware wrote:

Jason Wong wrote:

> It makes even more sense to ask on the phpmyadmin list/forum?



I thought this was a general purpose PHP list and some people who frequent this list had used phpMyAdmin. My mistake.




--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

--- End Message ---
--- Begin Message ---
My server runs Apache 2.0. I am trying to do a simple URL rewrite so that
old URLs will map to our new style of URLS...

    From This:  articles.php?id=999
    To This:    articles/999

In the .htaccess file for the htdocs folder that contains the web files, I
put the following:

    RewriteEngine on
    RewriteRule ^articles\.php\?id=([0-9]+)$ articles/$1 [R]

I've also tried this (no slash in front of ?):

    RewriteEngine on
    RewriteRule ^articles\.php?id=([0-9]+)$ articles/$1 [R]

But I keep getting a 404 error for articles.php, which means that something
must be wrong with my RewriteRule because it's not matching. I've tried
various tweaks and just can't get it to work.

What am I doing wrong??

Thanks.

--- End Message ---
--- Begin Message ---
Did you try to remove that '^' ? That means start.. In other words you are
saying that the uri starts with articles, when I would think it starts with
/articles... Yes, that could really matter...

-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Monty" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> My server runs Apache 2.0. I am trying to do a simple URL rewrite so that
> old URLs will map to our new style of URLS...
>
>     From This:  articles.php?id=999
>     To This:    articles/999
>
> In the .htaccess file for the htdocs folder that contains the web files, I
> put the following:
>
>     RewriteEngine on
>     RewriteRule ^articles\.php\?id=([0-9]+)$ articles/$1 [R]
>
> I've also tried this (no slash in front of ?):
>
>     RewriteEngine on
>     RewriteRule ^articles\.php?id=([0-9]+)$ articles/$1 [R]
>
> But I keep getting a 404 error for articles.php, which means that
something
> must be wrong with my RewriteRule because it's not matching. I've tried
> various tweaks and just can't get it to work.
>
> What am I doing wrong??
>
> Thanks.


--- End Message ---
--- Begin Message ---
Yes, I did try removing both the ^ and the $, and adding a / in front of
articles.php, but it made no difference.


> From: [EMAIL PROTECTED] (Dvdmandt)
> Reply-To: "DvDmanDT" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Date: Sat, 24 Jan 2004 19:06:09 +0100
> To: [EMAIL PROTECTED]
> Subject: Re: RewriteRule REGEX ?
> 
> Did you try to remove that '^' ? That means start.. In other words you are
> saying that the uri starts with articles, when I would think it starts with
> /articles... Yes, that could really matter...
> 
> -- 
> // DvDmanDT
> MSN: dvdmandtâhotmail.com
> Mail: dvdmandtâtelia.com
> "Monty" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
>> My server runs Apache 2.0. I am trying to do a simple URL rewrite so that
>> old URLs will map to our new style of URLS...
>> 
>> From This:  articles.php?id=999
>> To This:    articles/999
>> 
>> In the .htaccess file for the htdocs folder that contains the web files, I
>> put the following:
>> 
>> RewriteEngine on
>> RewriteRule ^articles\.php\?id=([0-9]+)$ articles/$1 [R]
>> 
>> I've also tried this (no slash in front of ?):
>> 
>> RewriteEngine on
>> RewriteRule ^articles\.php?id=([0-9]+)$ articles/$1 [R]
>> 
>> But I keep getting a 404 error for articles.php, which means that
> something
>> must be wrong with my RewriteRule because it's not matching. I've tried
>> various tweaks and just can't get it to work.
>> 
>> What am I doing wrong??
>> 
>> Thanks.
> 

--- End Message ---
--- Begin Message ---
On Sat, Jan 24, 2004 at 12:18:36PM -0500, Monty wrote:
>
>     From This:  articles.php?id=999
>     To This:    articles/999
...
> What am I doing wrong??

I suspect you may not be looking at the problem the right way.

What exactly do you want to do?

Normally, you'd go the other direction; that is, you'd have mod_rewrite
recognize ^/articles/([0-9]+)$ and translate it to /articles.php?id=$1
... so that a request to the "pretty" URL gets served as an HTTP GET on
the PHP script.

I get the impression that you're expecting mod_rewrite to translate copy
from inside your HTML files, as well as recognize and reverse the
translation when the request comes back in.  Is that it?

>     RewriteEngine on
>     RewriteRule ^articles\.php\?id=([0-9]+)$ articles/$1 [R]

> But I keep getting a 404 error for articles.php, which means that something
> must be wrong with my RewriteRule because it's not matching. I've tried
> various tweaks and just can't get it to work.

I bet if you create an "articles" directory in your documentroot, with
with files named things like "999" in it, you'll stop seeing the 404's.
Check your apache error_log.

If what you're trying to achieve is to have existing HTML files get
their embedded URLs translated, you're going to have to do that with an
output filter.  You can do it with PHP, or use mod_sed ... lots of
options.  But a rewrite rule won't change page content, it'll only
rewrite the *requests* that come in.

Of course, if you know all this already, and really are trying to point
requests for /articles.php?id=123 to a file named "123" in the directory
"articles", then you'll still need to inspect your error_log.

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/

--- End Message ---
--- Begin Message ---
On Sat, 2004-01-24 at 01:53, Hamid Hossain wrote:
> Hi,
> 
> Always I have a problem that I don't know how to make my code away from the 
> user interface files.
> 
> I tried to use some template classes, but I did'nt like what I tired because 
> some if statments are used inside the template.
> 
> How can I prepare my code to be working in more that one template? Should I 
> use some methodology like FuseBox.org

A common misconception is that templates provide complete separation
from logic, this is untrue. Template frameworks (the best ones) provide
separation of business logic from presentation logic. So using an "if"
statement inside a template is completely normal if it pertains to the
display logic. So for instance the following is generally valid in a
template (using InterJinn's syntax since I'm writing this :):

<jinn:if name="userSummary" test="{jinn:getValue name=loginStatus}">
    <p class="userSummary"> Display information about the user in
    some template formatted fashion that will only be displayed if
    the user is logged in.</p>
</jinn:if>

Whereas something like the following would not be appropriate template
logic:

<notjinn:setValue name="timeLeft" expr="($age + 3) / 2" />
<jinn:echo value="{jinn:getValue name=timeLeft}" />

Since th calculation for timeLeft would almost certainly be business
logic.

HTH,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Hi!

Your have sent me a message from an address marked as being primarily
a source of SPAM (also known as "unsolicited commercial e-mail"),
and the message has been discarded.

If in fact this was a genuine non-SPAM message and you still wish
to contact me, then you need to re-send the message from a different
address. And please accept my apologies for the inconvenience.

--- End Message ---
--- Begin Message --- Can we make .exe programs with php? for example we can do it with delphi, vbasic.but can we do with php?

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
On Sat, 24 Jan 2004, pehepe php wrote:

> Can we make .exe programs with php? for example we can do it with delphi, 
> vbasic.but can we do with php?

No (and .exe is a convention that isn't universal, btw). PHP is an
interpreted language, not a compiled one.

-- 
"Half the people know what they're talking about, and the 
other half are writing code."

--- End Message ---
--- Begin Message ---
On Saturday 24 January 2004 02:55 pm, Mark Charette wrote:
> On Sat, 24 Jan 2004, pehepe php wrote:
> > Can we make .exe programs with php? for example we can do it with delphi,
> > vbasic.but can we do with php?

Not recommended for production boxes, but...

http://pecl.php.net/bcompiler

Also, there's Pharrot, but I don't know if that's even past the planning 
stages.

If you're after encoding, try Turck MMCache. It's stable, IIRC.

>
> No (and .exe is a convention that isn't universal, btw). PHP is an
> interpreted language, not a compiled one.
>
> --
> "Half the people know what they're talking about, and the
> other half are writing code."

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"...the whole idea of revenge and punishment is a childish daydream. Properly 
speaking, there is no such thing as revenge. Revenge is an act which you want 
to commit when you are powerless and because you are powerless: as soon as 
the sense of impotence is removed, the desire evaporates also. "

-George Orwell

--- End Message ---
--- Begin Message ---
A while ago there was someone who announced a link to some program that
allowed you to make exe's (yes, it works)... Although, it's 100% uncompiled
(not even to bytecodes), so the only thing you gain is that it'll be easier
to run... :p

Also checkout this: http://binaryphp.sf.net
-- 
// DvDmanDT
MSN: dvdmandt€hotmail.com
Mail: dvdmandt€telia.com
"Pehepe Php" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Can we make .exe programs with php? for example we can do it with delphi,
> vbasic.but can we do with php?
>
> _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Thanks for any advice.

If I register a session variable, set its value with one form and then try
to change its value with another form, it seems to retain only the original
value and is not replaced with the newly posted one?

Is this how it is supposed to work and I have to unset the variable to do
this?

--- End Message ---
--- Begin Message ---
On Sunday 25 January 2004 04:02, Paul wrote:

> If I register a session variable, set its value with one form and then try
> to change its value with another form, it seems to retain only the original
> value and is not replaced with the newly posted one?
>
> Is this how it is supposed to work and I have to unset the variable to do
> this?

Please include some *concise* code illustrating your problem.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
"I am ready to meet my Maker.  Whether my Maker is prepared for the
great ordeal of meeting me is another matter."
                -- Winston Churchill
*/

--- End Message ---
--- Begin Message ---
OK thanks. I figured out my problem but I am not sure why this is.

I am trying to impliment a back button to allow the user to go back and
change form values.

If I uses sessions and register $test then this does not work, it sticks
does not change the value of $test if the user re-submits:

<input name="test" type="text" value="<?php echo $test;?>"/>

Thanks for any help!

--- End Message ---
--- Begin Message --- Hi,

This may be completely crazy, but let me tell you what I want to do: thread PHP.

My server is a dual-processor 2 GHz machine, and it's not very loaded. I have a few tasks that are huge and lengthy and would benefit from being placed in their own "thread" if you will. This would serve to either accelerate the process by splitting it among CPUs or allow the process to continue "in the background" for a few seconds after all pages have been loaded.

There are two areas where I'd use this:
1) To accelerate results in a relevancy ranking/fuzzy matching algorithm I have created, and although I've optimized the heck out of it, it can be slow when hundreds of thousands of items are thrown at it. It would be easy to split the array in half and run the algorithm on both halves, which would almost half processing time for returning results.


2) With image processing. When a user uploads an image to a few of my pages, the image is processed, re-compressed, and filed in the database or a file system. This can take several seconds, and I'd prefer that the user doesn't have to wait for the process to complete.

How might I be able to make some PHP code run as a "thread" that would serve these purposes?

-Galen
--- End Message ---
--- Begin Message --- One possibility is to have the code which first receives the request split it up into subrequests and do HTTP requests for the subrequests. Whether that makes sense depends on whether the overhead of an HTTP transaction is a big part of the execution time of the subrequests.

- Lucas


On Saturday, Jan 24, 2004, at 15:24 America/New_York, Galen wrote:


Hi,

This may be completely crazy, but let me tell you what I want to do: thread PHP.

My server is a dual-processor 2 GHz machine, and it's not very loaded. I have a few tasks that are huge and lengthy and would benefit from being placed in their own "thread" if you will. This would serve to either accelerate the process by splitting it among CPUs or allow the process to continue "in the background" for a few seconds after all pages have been loaded.

There are two areas where I'd use this:
1) To accelerate results in a relevancy ranking/fuzzy matching algorithm I have created, and although I've optimized the heck out of it, it can be slow when hundreds of thousands of items are thrown at it. It would be easy to split the array in half and run the algorithm on both halves, which would almost half processing time for returning results.


2) With image processing. When a user uploads an image to a few of my pages, the image is processed, re-compressed, and filed in the database or a file system. This can take several seconds, and I'd prefer that the user doesn't have to wait for the process to complete.

How might I be able to make some PHP code run as a "thread" that would serve these purposes?

-Galen

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


--- End Message ---
--- Begin Message ---
On Sat, 24 Jan 2004, Galen wrote:

> Hi,
> 
> This may be completely crazy, but let me tell you what I want to do: 
> thread PHP.

Can you set processor affinity on your system? If so, you can "pseudo 
thread" by assigning processes to different CPUs; e.g., run your main 
Webserver on one processor and a slave Web server or helper processes 
assigned to the other processor. This is a very common way of dividing 
tasks on multi-processor systems where code-rewrites to make things 
thread-safe are not cost effective.
 -- 
"Half the people know what they're talking about, and the 
other half are writing code."

--- End Message ---
--- Begin Message ---
php.net/pcntl
cvs.php.net/cvs.php/pecl/threads


On Saturday 24 January 2004 03:24 pm, Galen wrote:
> Hi,
>
> This may be completely crazy, but let me tell you what I want to do:
> thread PHP.
>
> My server is a dual-processor 2 GHz machine, and it's not very loaded.
> I have a few tasks that are huge and lengthy and would benefit from
> being placed in their own "thread" if you will. This would serve to
> either accelerate the process by splitting it among CPUs or allow the
> process to continue "in the background" for a few seconds after all
> pages have been loaded.
>
> There are two areas where I'd use this:
> 1) To accelerate results in a relevancy ranking/fuzzy matching
> algorithm I have created, and although I've optimized the heck out of
> it, it can be slow when hundreds of thousands of items are thrown at
> it. It would be easy to split the array in half and run the algorithm
> on both halves, which would almost half processing time for returning
> results.
>
> 2) With image processing. When a user uploads an image to a few of my
> pages, the image is processed, re-compressed, and filed in the database
> or a file system. This can take several seconds, and I'd prefer that
> the user doesn't have to wait for the process to complete.
>
> How might I be able to make some PHP code run as a "thread" that would
> serve these purposes?
>
> -Galen

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--- End Message ---
--- Begin Message ---
--- Galen <[EMAIL PROTECTED]> wrote:
> This may be completely crazy, but let me tell you what I want to do: 
> thread PHP.

If you use PHP as an Apache module, you can use Apache 2, which has
threading. Just make sure any extension you use is thread-safe.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

--- End Message ---
--- Begin Message ---
--- Randy  Johnson <[EMAIL PROTECTED]> wrote:
> I am not sure if this is a php thing or not but hope is...

It's more an Apache thing, but I think it's relevant.

> I see some sites like this:
> 
> www.domain.com/tree
> 
> where tree is not a directory
> 
> for example 
> www.domain.com/tree/   would not work

Actually, it would work. Just make tree a PHP script, and add something
like this to your .htaccess:

<Files tree>
     ForceType application/x-httpd-php
</Files>

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Hi,
I have been following the thread "Can we make .exe programs with php? " for
some time now and have been visiting the
URLs and examples that are being recomended to do this. Some of the
solutions are pretty good like
BinaryPHP and BCompiler...and I personally use Turck MMCache on our sites.

Am just curious to know what do you guys use when you dont want anybody to
be able to read your
source files...I like the Turck encoder but problem is that the client has
to have Turck installed on his
server to use the files..BCompiler seems good but is still too young, and I
dont know or have a C++
compiler to use BinaryPHP so I use codesecure instead...till now no
problems...but not as secure
(i think) as the others.

The others that come to mind are Zend and Ioncube...too expensive for me
(and quite a few here) , as
I was not born with a silver spoon up my ...or anywhere else.

Since PHP does not have any built in functions to do this, like for example
C...any ideas? or
recomendations?

Thanks,
-Ryan

--- End Message ---
--- Begin Message ---
Ryan A wrote:
<snip>
server to use the files..BCompiler seems good but is still too young, and I
dont know or have a C++
compiler to use BinaryPHP

gcc can be a C++ compiler.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---

Reply via email to