OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 21 Feb 2008 17:01:19 -0000 Issue 5306

php-general-digest-helplists.php.net
Date: Thu Feb 21 2008 - 11:01:19 CST


php-general Digest 21 Feb 2008 17:01:19 -0000 Issue 5306

Topics (messages 269761 through 269797):

Re: Sending SMS via PHP
        269761 by: Nick Stinemates
        269762 by: Leonard Burton
        269763 by: Paul Scott
        269770 by: Per Jessen

fail on preg_match_all
        269764 by: Hamilton Turner
        269765 by: Chris
        269766 by: Jim Lucas
        269768 by: Paul Scott
        269769 by: Hamilton Turner
        269776 by: Stut
        269777 by: Nathan Rixham
        269781 by: Robin Vickery
        269795 by: Richard Lynch

Re: What community software package gets your vote? PHPfox etc...
        269767 by: TS

Re: www. not working
        269771 by: Richard Heyes
        269772 by: Richard Heyes
        269773 by: Sándor Tamás (HostWare Kft.)
        269778 by: Jason Pruim
        269783 by: Børge Holen

Re: Session destruction problem
        269774 by: Nathan Rixham
        269775 by: Nathan Rixham
        269782 by: tedd

All Survey leading to PHP
        269779 by: Allan Fernandes
        269780 by: Thiago Pojda
        269793 by: Jim Lucas
        269794 by: Richard Lynch

temporary error
        269784 by: Mirco Soderi
        269785 by: Paul Scott
        269786 by: Daniel Brown
        269787 by: Mirco Soderi
        269789 by: Shawn McKenzie
        269790 by: Robert Cummings
        269791 by: Andrés Robinet

APC & __autoload & webclusters
        269788 by: Jochem Maas
        269792 by: Richard Lynch
        269797 by: Jochem Maas

Re: Php warning message
        269796 by: Richard Lynch

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


johnlin wrote:
> Let me try and answer your questions.
>
> Do you need to receive SMS? If you need to receive SMS, you will need to
> host your own GSM device or modem so that people can send you SMS.
>
> If not, you can just use internet SMS gateways like clickatell to do the
> work, and post to them by HTTP, XML or email. The cost is about 6-8 cents
> per SMS. There are cheaper services, but not always reliable. If you need to
> host your own GSM device, you can use software like http://www.kannel.org
> (GPL Open Source) or http://www.visualgsm.com.
>
> Regards,
> SMS Gateway Expert
> http://www.visualtron.com
>
>
> AmirBehzad Eslami-3 wrote:
>
>> Hi,
>>
>> How can i send SMS messages via PHP? How can i set SMS-headers (UDH)?
>> Does anyone know some article/class/package about this issue?
>>
>> Thank you in advance,
>> -b
>>
>>
>>
>
>
I know of an open source package which uses services hosted by VeriSign
and MBlox. These cost a pretty penny, though, and may not be what you're
after.
The services give you a private channel for your users to interact with
you, and for you to (potentially) respond to them.

You're looking for SMPP packages.

--
==================
Nick Stinemates (nickstinemates.org)
http://nick.stinemates.org

AIM: Nick Stinemates
MSN: nickstinemateshotmail.com
Yahoo: nickstinematesyahoo.com
==================

attached mail follows:


HI,

The vast majority of carriers have a free to use email to sms gateway for
their clients phones.

There is a list of each carriers format for the email address. Have someone
select the carrier in the form when entering the phone number then you have
it sent to the email as specified by the carrier.

On Thu, Feb 21, 2008 at 12:01 AM, Nick Stinemates <nickstinemates.org>
wrote:

> johnlin wrote:
> > Let me try and answer your questions.
> >
> > Do you need to receive SMS? If you need to receive SMS, you will need to
> > host your own GSM device or modem so that people can send you SMS.
> >
> > If not, you can just use internet SMS gateways like clickatell to do the
> > work, and post to them by HTTP, XML or email. The cost is about 6-8
> cents
> > per SMS. There are cheaper services, but not always reliable. If you
> need to
> > host your own GSM device, you can use software like
> http://www.kannel.org
> > (GPL Open Source) or http://www.visualgsm.com.
> >
> > Regards,
> > SMS Gateway Expert
> > http://www.visualtron.com
> >
> >
> > AmirBehzad Eslami-3 wrote:
> >
> >> Hi,
> >>
> >> How can i send SMS messages via PHP? How can i set SMS-headers (UDH)?
> >> Does anyone know some article/class/package about this issue?
> >>
> >> Thank you in advance,
> >> -b
> >>
> >>
> >>
> >
> >
> I know of an open source package which uses services hosted by VeriSign
> and MBlox. These cost a pretty penny, though, and may not be what you're
> after.
> The services give you a private channel for your users to interact with
> you, and for you to (potentially) respond to them.
>
> You're looking for SMPP packages.
>
> --
> ==================
> Nick Stinemates (nickstinemates.org)
> http://nick.stinemates.org
>
> AIM: Nick Stinemates
> MSN: nickstinemateshotmail.com
> Yahoo: nickstinematesyahoo.com
> ==================
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
Leonard Burton, N9URK
http://www.jiffyslides.com
servicejiffyslides.com
leonardburtongmail.com

"The prolonged evacuation would have dramatically affected the survivability
of the occupants."

attached mail follows:


On Wed, 2008-02-20 at 21:01 -0800, Nick Stinemates wrote:
> > Do you need to receive SMS? If you need to receive SMS, you will need to
> > host your own GSM device or modem so that people can send you SMS.
> >
> > If not, you can just use internet SMS gateways like clickatell to do the
> > work, and post to them by HTTP, XML or email. The cost is about 6-8 cents
> > per SMS. There are cheaper services, but not always reliable. If you need to
> > host your own GSM device, you can use software like http://www.kannel.org
> > (GPL Open Source) or http://www.visualgsm.com.
> >

The thing with SMS is volume. Most commercial (bulk SMS) service
providers do provide a return path at a price, but this can get really
expensive especially at low volumes.

What you need to do is ask yourself whether you are going to do high
volume SMS or not, and look at when do the commercial providers become
more economical? What a lot of people do, is sign up for an account and
end up sending only 50 or so SMS a month, which is silly, when for the
same price as a month or two's subscription, you could buy your own GSM
modem and a prepaid SIM card and do it for half the price yourself.

--Paul

All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm

attached mail follows:


Paul Scott wrote:

> What you need to do is ask yourself whether you are going to do high
> volume SMS or not, and look at when do the commercial providers become
> more economical? What a lot of people do, is sign up for an account
> and end up sending only 50 or so SMS a month, which is silly, when for
> the same price as a month or two's subscription, you could buy your
> own GSM modem and a prepaid SIM card and do it for half the price
> yourself.

Or use sms_client and only pay per individual SMS. No subscription
needed.

/Per Jessen, Zürich

attached mail follows:


Does anyone know why a server would simply fail on this line?

$num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);

if i know the file handle is valid (i grabbed it using 'or die'), and
the regex is valid

hamy

attached mail follows:


Hamilton Turner wrote:
> Does anyone know why a server would simply fail on this line?
>
> $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
>
> if i know the file handle is valid (i grabbed it using 'or die'), and
> the regex is valid

What file handle? preg_match doesn't work on resources, it works on data.

What do you mean by die? return no results? segfaults the server? .... ?

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Hamilton Turner wrote:
> Does anyone know why a server would simply fail on this line?
>
> $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
>
> if i know the file handle is valid (i grabbed it using 'or die'), and
> the regex is valid
>
> hamy
>

Wow, what a lack of information! If I was holding an Easter Egg basket
right now, could you tell me how many eggs I had in it?

Why don't you provide some useful code examples!

Namely:
1. Show us some context
2. What is in $regex
3. Show us the code that generates "the data" in $theData

attached mail follows:


On Wed, 2008-02-20 at 23:34 -0600, Hamilton Turner wrote:
> if i know the file handle is valid (i grabbed it using 'or die'), and
               ^^^^^^^^^^^^^

This is probably your problem, you are trying to match on a resource
handle, not a string or something.

Check out http://www.php.net/preg_match_all

> the regex is valid

Won't really matter if the data is in the wrong format!

--Paul
--
------------------------------------------------------------.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za |
:------------------------------------------------------------:

All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm

attached mail follows:


Just a follow-up on this, the problem was 'Fatal error: Allowed memory
size of 8388608 bytes exhausted'

After some nice help, I found that this is actually a common problem
with intense regexes in php. Quick fix is using ini_set() to increase
your memory_limit to something massive, like '400M'. This gives your
script access to that much memory for its life-time. If you have this
problem, then you probably also have to do this

set_time_limit(0); //remove any max execution time

Hamilton

PS - for anyone confused, here was the script . . . i didnt think it was
that confusing, sorry guys!

function parse_access($file_name)
{
    // read file data into variable
    $fh = fopen($file_name, 'r') or die("cant open file for reading");
    $theData = fread($fh, filesize($file_name));
    fclose($fh);
 
    // perform regex
    $regex = '!(\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}) - -
\[(\d{2})/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Aug|Oct|Nov|Dec)/(\d{4}):(\d{2}):(\d{2}):(\d{2})
-\d+] {1,4}"GET ([._0-9\-%a-zA-Z/,?=]+) ([.0-9a-zA-Z%/\-,_?]+)" (\d{3})
(\d+) \[(.+?)] \[(.+?)] \[(.+?)] (\d+) (\d+) (\d+) (\d+) (\d+) (\d+)!';
    //echo $regex . '<br><br><hr><br>';
    $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
    //echo "after regex - we are still alive!";

    //go on to do some boring stuff, like write this to an array,
perform stuff, graph stuff, blah blah
}

attached mail follows:


Hamilton Turner wrote:
> Just a follow-up on this, the problem was 'Fatal error: Allowed memory
> size of 8388608 bytes exhausted'
>
> After some nice help, I found that this is actually a common problem
> with intense regexes in php. Quick fix is using ini_set() to increase
> your memory_limit to something massive, like '400M'. This gives your
> script access to that much memory for its life-time. If you have this
> problem, then you probably also have to do this
>
> set_time_limit(0); //remove any max execution time
>
> Hamilton
>
> PS - for anyone confused, here was the script . . . i didnt think it was
> that confusing, sorry guys!
>
> function parse_access($file_name)
> {
> // read file data into variable
> $fh = fopen($file_name, 'r') or die("cant open file for reading");
> $theData = fread($fh, filesize($file_name));
> fclose($fh);
>
> // perform regex
> $regex = '!(\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}) - -
> \[(\d{2})/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Aug|Oct|Nov|Dec)/(\d{4}):(\d{2}):(\d{2}):(\d{2})
> -\d+] {1,4}"GET ([._0-9\-%a-zA-Z/,?=]+) ([.0-9a-zA-Z%/\-,_?]+)" (\d{3})
> (\d+) \[(.+?)] \[(.+?)] \[(.+?)] (\d+) (\d+) (\d+) (\d+) (\d+) (\d+)!';
> //echo $regex . '<br><br><hr><br>';
> $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
> //echo "after regex - we are still alive!";
>
> //go on to do some boring stuff, like write this to an array, perform
> stuff, graph stuff, blah blah
> }

Increasing the memory limit is the worst possible solution to this
"problem".

It's a giant file, and your regex is basically pulling out each line.
For the love of $DEITY learn about fgets and process each line one by
one rather than loading in the whole file. It'll be a lot faster and
won't suck your memory dry while it runs.

-Stut

--
http://stut.net/

attached mail follows:


Hamilton Turner wrote:
> Just a follow-up on this, the problem was 'Fatal error: Allowed memory
> size of 8388608 bytes exhausted'
>
> After some nice help, I found that this is actually a common problem
> with intense regexes in php. Quick fix is using ini_set() to increase
> your memory_limit to something massive, like '400M'. This gives your
> script access to that much memory for its life-time. If you have this
> problem, then you probably also have to do this
>
> set_time_limit(0); //remove any max execution time
>
> Hamilton
>
>
> PS - for anyone confused, here was the script . . . i didnt think it was
> that confusing, sorry guys!
>
> function parse_access($file_name)
> {
> // read file data into variable
> $fh = fopen($file_name, 'r') or die("cant open file for reading");
> $theData = fread($fh, filesize($file_name));
> fclose($fh);
>
> // perform regex
> $regex = '!(\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}) - -
> \[(\d{2})/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Aug|Oct|Nov|Dec)/(\d{4}):(\d{2}):(\d{2}):(\d{2})
> -\d+] {1,4}"GET ([._0-9\-%a-zA-Z/,?=]+) ([.0-9a-zA-Z%/\-,_?]+)" (\d{3})
> (\d+) \[(.+?)] \[(.+?)] \[(.+?)] (\d+) (\d+) (\d+) (\d+) (\d+) (\d+)!';
> //echo $regex . '<br><br><hr><br>';
> $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
> //echo "after regex - we are still alive!";
>
> //go on to do some boring stuff, like write this to an array, perform
> stuff, graph stuff, blah blah
> }
>
>
>
>

Can you also post a few lines from your access log so we've got
something to test against.

The regex looks incorrect to me in a few places:
-\d+] {1,4}
for example.

How to debug your script:

make a copy of the log file and trim it down to say 20 lines; run the
script on it to verify it's doing what you want it to.

check the size of the "real" log file, then multiply it by 2.5 and see
if the total is greater than your php max memory setting. (exp: $theData
will hold the full file, matches will also hold another copy of most of
the file, then a bit extra for php to use)

Regards

Nathan

attached mail follows:


On 21/02/2008, Nathan Rixham <nrixhamgmail.com> wrote:
> The regex looks incorrect to me in a few places:
> -\d+] {1,4}
> for example.

That's ok, albeit confusing:

* The ']' is a literal ']' not the closing bracket of a character class.
* The {1,4} applies to the space character.

-robin

attached mail follows:


On Wed, February 20, 2008 11:34 pm, Hamilton Turner wrote:
> Does anyone know why a server would simply fail on this line?
>
> $num = preg_match_all($regex, $theData, $match, PREG_SET_ORDER);
>
> if i know the file handle is valid (i grabbed it using 'or die'), and
> the regex is valid

Define "fail"...

There are any number of things that could be going wrong.

Check your logs, dump out the data, etc

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hey party people. I have to say I’m a little surprised no hooting and hollering on this topic. I don’t think I heard a single positive comment which worries me. I’m jealous of myspace and facebook too but, someone has to have good news for one of these not so mainstream community appz.

 

W3RD ^ PEOPLE

 

 

 

From: Nathan Nobbe [mailto:quickshiftingmail.com]
Sent: Wednesday, February 20, 2008 1:51 PM
To: TS
Cc: php-generallists.php.net
Subject: Re: [PHP] What community software package gets your vote? PHPfox etc...

 

On Tue, Feb 19, 2008 at 9:41 PM, TS <sunnrunnergmail.com> wrote:

Hello everyone. I'm not sure what the budget is but, obviously inexpensive
would be nice. Someone turned me on to PHPfox. Yet I don't have any others
to compare it to. If you all would be so kind as to put a shout out and vote
on your favorite, I'd be very grateful.

Extendability would also be nice along with customization in terms of
design.

Much Appreciation,

dude, you gotta scope this out;

http://cmsmatrix.org/

-nathan

 

attached mail follows:


>>> "A form" of the web existing long before that depending on your
>>> definition of the web. To me it's a way for people to share
>>> information. That would cover the BBS world which pre-dates LANs by
>>> some distance.
>>
>> Spider webs have existed for many a year...
>
> Yeah, but when was the last time you saw porn on one of them?!!

Now that would be telling. :-)

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new features automatic and free

attached mail follows:


>>> Spider webs have existed for many a year...
>
> Not long before the eggs hatched.

Debatable.

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new features automatic and free

attached mail follows:


>>>> "A form" of the web existing long before that depending on your
>>>> definition of the web. To me it's a way for people to share
>>>> information. That would cover the BBS world which pre-dates LANs by
>>>> some distance.
>>>
>>> Spider webs have existed for many a year...
>>
>> Yeah, but when was the last time you saw porn on one of them?!!

Do you know Black Widow? :-)

attached mail follows:


On Feb 21, 2008, at 5:13 AM, Richard Heyes wrote:

>>>> Spider webs have existed for many a year...
>> Not long before the eggs hatched.
>
>
> Debatable.

Are we about to go into another chicken/egg then? Or in this case,
spider porn/egg

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruimraoset.com

attached mail follows:


On Thursday 21 February 2008 13:41:20 Jason Pruim wrote:
> On Feb 21, 2008, at 5:13 AM, Richard Heyes wrote:
> >>>> Spider webs have existed for many a year...
> >>
> >> Not long before the eggs hatched.
> >
> > Debatable.
>
> Are we about to go into another chicken/egg then? Or in this case,
> spider porn/egg

this bestiality shouldn't even exist as a topic

>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 3251 132nd ave
> Holland, MI, 49424
> www.raoset.com
> japruimraoset.com

--
---
Børge Holen
http://www.arivene.net

attached mail follows:


Adil Drissi wrote:
> thank you tedd,
>
> I understood what you explained to me last time. I was
> wondering if there is another method to prevent that.
>
> Thanks
>
> --- tedd <tedd.sperlinggmail.com> wrote:
>
>> At 2:45 PM -0800 2/19/08, Adil Drissi wrote:
>>> Hi,
>>>
>>> Below you'll find my code. I think now that the
>>> problem is in my algorithm, because the is created
>>> anytime the page is refreshed. But i don't know how
>> to
>>> check if the client was logged out or it is a real
>> new
>>> connexion to the page. As you will see one can
>> click
>>> on logout, then press the back button of the
>> browser,
>>> and then refresh the page, but he is still
>> connected.
>>> I would like to help me fixe that. Here is the
>> code:
>>
>> You received an answer, but fail to understand.
>>
>> Unless you use javascript to manipulate the
>> browser's history you are
>> going to continue to have "problems" with the user
>> browser's back
>> button.
>>
>> But, explain why the user using the back button is a
>> problem. If he
>> logs in, he's in. If he logs out, he's out. If he
>> hits the back
>> button after logging out and cancels his log out --
>> so what? What
>> problems does that present?
>>
>> Cheers,
>>
>> tedd
>>
>>
>> --
>> -------
>> http://sperling.com http://ancientstones.com
>> http://earthstones.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> ____________________________________________________________________________________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs

Looks like your on an old 4.x version of php; try the following.

<?php
session_start();
unset($_SESSION["sessioname"]);
session_destroy();
session_write_close();
sleep(1);
header("location: index.php");
?>

Regards

Nathan

attached mail follows:


Adil Drissi wrote:
> thank you tedd,
>
> I understood what you explained to me last time. I was
> wondering if there is another method to prevent that.
>
> Thanks
>
> --- tedd <tedd.sperlinggmail.com> wrote:
>
>> At 2:45 PM -0800 2/19/08, Adil Drissi wrote:
>>> Hi,
>>>
>>> Below you'll find my code. I think now that the
>>> problem is in my algorithm, because the is created
>>> anytime the page is refreshed. But i don't know how
>> to
>>> check if the client was logged out or it is a real
>> new
>>> connexion to the page. As you will see one can
>> click
>>> on logout, then press the back button of the
>> browser,
>>> and then refresh the page, but he is still
>> connected.
>>> I would like to help me fixe that. Here is the
>> code:
>>
>> You received an answer, but fail to understand.
>>
>> Unless you use javascript to manipulate the
>> browser's history you are
>> going to continue to have "problems" with the user
>> browser's back
>> button.
>>
>> But, explain why the user using the back button is a
>> problem. If he
>> logs in, he's in. If he logs out, he's out. If he
>> hits the back
>> button after logging out and cancels his log out --
>> so what? What
>> problems does that present?
>>
>> Cheers,
>>
>> tedd
>>
>>
>> --
>> -------
>> http://sperling.com http://ancientstones.com
>> http://earthstones.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> ____________________________________________________________________________________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs

apologies, I completely forgot that your using session_destroy ammend to..

<?php
session_start();
session_destroy();
unset($_SESSION);
session_write_close();
sleep(1);
header("location: /index.php");
?>

attached mail follows:


At 10:47 AM +0000 2/21/08, Nathan Rixham wrote:
>apologies, I completely forgot that your using session_destroy ammend to..
>
><?php
>session_start();
>session_destroy();
>unset($_SESSION);
>session_write_close();
>sleep(1);
>header("location: /index.php");
>?>

Nathan:

I don't think it's that simple.

For example, go here:

http://www.webbytedd.com/bbbb/destroy-sessions/index.php

Login using anything.

Log out.

Click the browser back button.

I think this is what the OP was talking about.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

attached mail follows:


Hi,

I have been doing a survey on which development environment will be the best
to move on to. PHP is most highly recommended. I have following doubts
though.
1) Is there any method to protect source code of my applications even when
deployed at the clients Server.
2) Can I call Delphi Dll's

Regards
Allan

attached mail follows:


Point 1 I can answer, not sure about 2.

1) Yes there is, there are many tools for that on the Web. First one that
comes to my mind is Zend Guard, it generates .class-like files. But this one
requires some extra stuff on the web server which some others don't.

-----Mensagem original-----
De: Allan Fernandes [mailto:techssmiths.com]
Enviada em: quinta-feira, 21 de fevereiro de 2008 09:29
Para: php-generallists.php.net
Assunto: [PHP] All Survey leading to PHP

Hi,

I have been doing a survey on which development environment will be the best
to move on to. PHP is most highly recommended. I have following doubts
though.
1) Is there any method to protect source code of my applications even when
deployed at the clients Server.
2) Can I call Delphi Dll's

Regards
Allan

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

attached mail follows:


Thiago Pojda wrote:
> Point 1 I can answer, not sure about 2.
>
> 1) Yes there is, there are many tools for that on the Web. First one that
> comes to my mind is Zend Guard, it generates .class-like files. But this one
> requires some extra stuff on the web server which some others don't.

But, unfortunately, where there is a will, there is a way.

Anything you do, someone can undo.

>
> -----Mensagem original-----
> De: Allan Fernandes [mailto:techssmiths.com]
> Enviada em: quinta-feira, 21 de fevereiro de 2008 09:29
> Para: php-generallists.php.net
> Assunto: [PHP] All Survey leading to PHP
>
> Hi,
>
> I have been doing a survey on which development environment will be the best
> to move on to. PHP is most highly recommended. I have following doubts
> though.
> 1) Is there any method to protect source code of my applications even when
> deployed at the clients Server.
> 2) Can I call Delphi Dll's
>
> Regards
> Allan
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>

--
Jim Lucas

    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
     by William Shakespeare

attached mail follows:


On Thu, February 21, 2008 6:29 am, Allan Fernandes wrote:
> 1) Is there any method to protect source code of my applications even
> when
> deployed at the clients Server.

Have a good, clear contract and relationship with the client.

You can also attempt to "encode" them with any number of PHP encoders,
all of which have been and can be cracked by a determined user.

> 2) Can I call Delphi Dll's

You may be able to use COM objects.
http://php.net/com

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Consider the following code:

$sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc
...."
$queryInserimentoDatiAllenamentoCalciPiazzati =
mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
if($queryInserimentoDatiAllenamentoCalciPiazzati) {
    $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
into log ... etc etc ...");
    if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
}
if($queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }

1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
conditional statement, evaluates to false even if both queries are correctly
executed.

I modify as follows:

$sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc
...."
$queryInserimentoDatiAllenamentoCalciPiazzati =
mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else
echo("error message 1");
if($queryInserimentoDatiAllenamentoCalciPiazzati) {
    $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
into log ... etc etc ...");
    if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
else echo("error message 2");
}
if($queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }

2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
conditional statement, evaluates to true.

Now, I modify again, back to the original version:

$sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc
...."
$queryInserimentoDatiAllenamentoCalciPiazzati =
mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
if($queryInserimentoDatiAllenamentoCalciPiazzati) {
    $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
into log ... etc etc ...");
    if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
}
if($queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }

3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
$logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
conditional statement, evaluates to true.

Do you know any reason for that?

attached mail follows:


On Thu, 2008-02-21 at 14:54 +0100, Mirco Soderi wrote:
> Consider the following code:
>
> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc

How long does it take you to write a single line of code with variable
names like that?

--Paul

All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm

attached mail follows:


On Thu, Feb 21, 2008 at 8:54 AM, Mirco Soderi <m.soderialice.it> wrote:
> Consider the following code:
>
> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc
> ...."
> $queryInserimentoDatiAllenamentoCalciPiazzati =
> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
[snip!]

    Holy crap, so much for compact and clean code. It must take you
days to write a script! ;-P

    In any case, there are a ton of syntax errors in your second block
of code. Missing closing brackets, semicolons, et cetera. It
shouldn't even compile (fatal errors).

    Also, after rewriting all three blocks of code so that I could
read them without having a seizure, it looks like it's a problem with
your database. Unless you're actually trying to see if
$sqlQueryInserimentoDatiAllenamentoCalciPiazzati is true (in block
#2), which you just defined as an SQL statement, whereas you're trying
to see if $queryInserimentoDatiAllenamentoCalciPiazzati is true (in
block #3), which you just defined as a resource identifier.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

attached mail follows:


In my opinion, variable names are a personal choice, I think the time you
loose when writing the name (about a second is long less than the time you
gain when, months later, you go and modify the code and you have clear the
content and meaning of each variable.

In the original code there were no sintax errors, I added some errors when
pasting here. Sorry.

I have found that in the first execution, it was the
$logQueryInserimentoDatiAllenamentoCalciPiazzati that evaluated to false.
After having removed the two-field key that I had originally defined for
that table and having added an autoincrement key, the problem seems to be
solved.

Do you find any reason for that?

""Mirco Soderi"" <m.soderialice.it> ha scritto nel messaggio
news:39.96.21621.F728DB74pb1.pair.com...
> Consider the following code:
>
> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc
> etc ...."
> $queryInserimentoDatiAllenamentoCalciPiazzati =
> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
> into log ... etc etc ...");
> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> something }
> }
> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
>
> 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
> conditional statement, evaluates to false even if both queries are
> correctly executed.
>
> I modify as follows:
>
> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc
> etc ...."
> $queryInserimentoDatiAllenamentoCalciPiazzati =
> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else
> echo("error message 1");
> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
> into log ... etc etc ...");
> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> something } else echo("error message 2");
> }
> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
>
> 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
> conditional statement, evaluates to true.
>
> Now, I modify again, back to the original version:
>
> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc
> etc ...."
> $queryInserimentoDatiAllenamentoCalciPiazzati =
> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert
> into log ... etc etc ...");
> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> something }
> }
> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something }
>
> 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last
> conditional statement, evaluates to true.
>
> Do you know any reason for that?

attached mail follows:


Mirco Soderi wrote:
> In my opinion, variable names are a personal choice, I think the time
> you loose when writing the name (about a second is long less than the
> time you gain when, months later, you go and modify the code and you
> have clear the content and meaning of each variable.
>
> In the original code there were no sintax errors, I added some errors
> when pasting here. Sorry.
>
> I have found that in the first execution, it was the
> $logQueryInserimentoDatiAllenamentoCalciPiazzati that evaluated to
> false. After having removed the two-field key that I had originally
> defined for that table and having added an autoincrement key, the
> problem seems to be solved.
>
> Do you find any reason for that?
>
>
> ""Mirco Soderi"" <m.soderialice.it> ha scritto nel messaggio
> news:39.96.21621.F728DB74pb1.pair.com...
>> Consider the following code:
>>
>> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
>> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
>> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query("insert into log ... etc etc ...");
>> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
>> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> }
>>
>> 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
>> last conditional statement, evaluates to false even if both queries
>> are correctly executed.
>>
>> I modify as follows:
>>
>> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
>> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
>> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> } else echo("error message 1");
>> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query("insert into log ... etc etc ...");
>> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
>> something } else echo("error message 2"); }
>> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> }
>>
>> 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
>> last conditional statement, evaluates to true.
>>
>> Now, I modify again, back to the original version:
>>
>> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
>> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
>> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
>> mysql_query("insert into log ... etc etc ...");
>> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
>> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
>> }
>>
>> 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
>> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
>> last conditional statement, evaluates to true.
>>
>> Do you know any reason for that?

Glad to see that you found your problem. Variables may be easier to read
with some underscores.

Personally, here is what I use as a counter in most all of my code,
instead of $i++; which isn't always clear.

$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
($Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter /
$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter);

If you wan to shorten a bit you can use a constant as the counter
increment like so:

define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1);

$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter;

-Shawn

attached mail follows:


On Thu, 2008-02-21 at 09:35 -0600, Shawn McKenzie wrote:
> Mirco Soderi wrote:
> > In my opinion, variable names are a personal choice, I think the time
> > you loose when writing the name (about a second is long less than the
> > time you gain when, months later, you go and modify the code and you
> > have clear the content and meaning of each variable.
> >
> > In the original code there were no sintax errors, I added some errors
> > when pasting here. Sorry.
> >
> > I have found that in the first execution, it was the
> > $logQueryInserimentoDatiAllenamentoCalciPiazzati that evaluated to
> > false. After having removed the two-field key that I had originally
> > defined for that table and having added an autoincrement key, the
> > problem seems to be solved.
> >
> > Do you find any reason for that?
> >
> >
> > ""Mirco Soderi"" <m.soderialice.it> ha scritto nel messaggio
> > news:39.96.21621.F728DB74pb1.pair.com...
> >> Consider the following code:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to false even if both queries
> >> are correctly executed.
> >>
> >> I modify as follows:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } else echo("error message 1");
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } else echo("error message 2"); }
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to true.
> >>
> >> Now, I modify again, back to the original version:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to true.
> >>
> >> Do you know any reason for that?
>
> Glad to see that you found your problem. Variables may be easier to read
> with some underscores.
>
> Personally, here is what I use as a counter in most all of my code,
> instead of $i++; which isn't always clear.
>
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
> ($Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter /
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter);
>
> If you wan to shorten a bit you can use a constant as the counter
> increment like so:
>
> define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1);
>
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
> Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter;

When keeping track of patients at the local hospital we like to indicate
whether they have certain afflications.

$patient->pneumonoultramicroscopicsilicovolcanoconiosis = false;

Cheers,
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. |
`------------------------------------------------------------'

attached mail follows:


> -----Original Message-----
> From: Shawn McKenzie [mailto:nospammckenzies.net]
> Sent: Thursday, February 21, 2008 10:36 AM
> To: php-generallists.php.net
> Subject: [PHP] Re: temporary error
>
> Mirco Soderi wrote:
> > In my opinion, variable names are a personal choice, I think the time
> > you loose when writing the name (about a second is long less than the
> > time you gain when, months later, you go and modify the code and you
> > have clear the content and meaning of each variable.
> >
> > In the original code there were no sintax errors, I added some errors
> > when pasting here. Sorry.
> >
> > I have found that in the first execution, it was the
> > $logQueryInserimentoDatiAllenamentoCalciPiazzati that evaluated to
> > false. After having removed the two-field key that I had originally
> > defined for that table and having added an autoincrement key, the
> > problem seems to be solved.
> >
> > Do you find any reason for that?
> >
> >
> > ""Mirco Soderi"" <m.soderialice.it> ha scritto nel messaggio
> > news:39.96.21621.F728DB74pb1.pair.com...
> >> Consider the following code:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to false even if both queries
> >> are correctly executed.
> >>
> >> I modify as follows:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } else echo("error message 1");
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } else echo("error message 2"); }
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to true.
> >>
> >> Now, I modify again, back to the original version:
> >>
> >> $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ...
> >> etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati);
> >> if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> } if($queryInserimentoDatiAllenamentoCalciPiazzati) {
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati =
> >> mysql_query("insert into log ... etc etc ...");
> >> if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do
> >> something } } if($queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something
> >> }
> >>
> >> 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati &&
> >> $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of
> >> last conditional statement, evaluates to true.
> >>
> >> Do you know any reason for that?
>
> Glad to see that you found your problem. Variables may be easier to read
> with some underscores.
>
> Personally, here is what I use as a counter in most all of my code,
> instead of $i++; which isn't always clear.
>
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
> ($Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter /
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter);
>
> If you wan to shorten a bit you can use a constant as the counter
> increment like so:
>
> define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1);
>
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter =
> $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter +
> Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter;
>
> -Shawn
>

You forgot to add the project name you are working on to the counter, this way
you'll never confuse yourself at all.

define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project
_Spaghetti', 1);

$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghetti =
$Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghetti +
Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghet
ti;

LOL

attached mail follows:


hi people,

1. __autoload & APC

I have been STW to try and find a definitive answer as to whether using __autoload with APC
is a bad idea ... and if so why? ... I can't find that definitive answer, can anyone here
state whether this it's an absolutely bad idea to use __autoload with APC? (I need to
speed up an app that currently loads in pretty much everything on every request ... and it's
impossible to untangle the class interdependencies, in the time I have, and thereby load only
what is absolutely needed, when it's needed ... so I want to give __autoload() a shot in order
to minimize what classes are loaded.

2. webclusters & APC

I'm building a load-balanced cluster for the same app ... a certain times new data is imported
from a thirdparty system after which some APC cached data needs to be cleared, in the same vein
I occasionally roll out a new version and then the APC opcode cache needs to be cleared (each webserver
in the cluster has it's own APC cache obviously).

now I'm stuck with the problem of how to trigger the cache clearance on all servers ... Greg Donald
already mentioned the ruby based capistrano for executing commands on multiple remote servers and I'll
be using that to manage things like cache clearance, webserver restarting, etc on all the webservers

... BUT I have found that it is not possible to control the APC cache of php_mod from the CLI version of
php, they apparently use different APC caches. it seems that the only way to control the APC cache of
mod_php is via a web interface. APC ships with the very handy apc.php script but this is hardly a decent
way of controlling/clearing the APC cache of multiple machine programmatically.

Am I stuck with one of:

1. doing a graceful restart of all servers (which causes APCs cache to disappear)?
2. writing a cmdline script that performs a URL request to a copy of apc.php that is reachable via each
webserver in order to clear/manage the APC cache?

or is there another way that I can control the webserver's APC cache from the cmdline?

rgds,
Jochem

attached mail follows:


On Thu, February 21, 2008 9:27 am, Jochem Maas wrote:
> 1. __autoload & APC
>
> I have been STW to try and find a definitive answer as to whether
> using __autoload with APC
> is a bad idea ... and if so why? ... I can't find that definitive
> answer, can anyone here
> state whether this it's an absolutely bad idea to use __autoload with
> APC? (I need to
> speed up an app that currently loads in pretty much everything on
> every request ... and it's
> impossible to untangle the class interdependencies, in the time I
> have, and thereby load only
> what is absolutely needed, when it's needed ... so I want to give
> __autoload() a shot in order
> to minimize what classes are loaded.

If it's that inter-tangled, then I would hazard a WILD GUESS that the
__autoload will still end up loading everything...

> 2. webclusters & APC
>
> I'm building a load-balanced cluster for the same app ... a certain
> times new data is imported
> from a thirdparty system after which some APC cached data needs to be
> cleared, in the same vein
> I occasionally roll out a new version and then the APC opcode cache
> needs to be cleared (each webserver
> in the cluster has it's own APC cache obviously).
>
> now I'm stuck with the problem of how to trigger the cache clearance
> on all servers ... Greg Donald
> already mentioned the ruby based capistrano for executing commands on
> multiple remote servers and I'll
> be using that to manage things like cache clearance, webserver
> restarting, etc on all the webservers
>
> ... BUT I have found that it is not possible to control the APC cache
> of php_mod from the CLI version of
> php, they apparently use different APC caches. it seems that the only
> way to control the APC cache of
> mod_php is via a web interface. APC ships with the very handy apc.php
> script but this is hardly a decent
> way of controlling/clearing the APC cache of multiple machine
> programmatically.
>
> Am I stuck with one of:
>
> 1. doing a graceful restart of all servers (which causes APCs cache to
> disappear)?

Yes, that should work.

> 2. writing a cmdline script that performs a URL request to a copy of
> apc.php that is reachable via each
> webserver in order to clear/manage the APC cache?

Yes, but obviously password-protect it to avoid DOS.

> or is there another way that I can control the webserver's APC cache
> from the cmdline?

One would think there would be some kind of USR_* signal that can be
sent through Apache to APC to clear cache...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Richard Lynch schreef:
> On Thu, February 21, 2008 9:27 am, Jochem Maas wrote:
>> 1. __autoload & APC
>>
>> I have been STW to try and find a definitive answer as to whether
>> using __autoload with APC
>> is a bad idea ... and if so why? ... I can't find that definitive
>> answer, can anyone here
>> state whether this it's an absolutely bad idea to use __autoload with
>> APC? (I need to
>> speed up an app that currently loads in pretty much everything on
>> every request ... and it's
>> impossible to untangle the class interdependencies, in the time I
>> have, and thereby load only
>> what is absolutely needed, when it's needed ... so I want to give
>> __autoload() a shot in order
>> to minimize what classes are loaded.
>
> If it's that inter-tangled, then I would hazard a WILD GUESS that the
> __autoload will still end up loading everything...

but not on every request ;-) ... I do use output caching, and I know
not everything is actually used in every request.

I'm being optimistic and hoping it has a marginally positive effective on
average request processing time.

>
>> 2. webclusters & APC
>>
>> I'm building a load-balanced cluster for the same app ... a certain
>> times new data is imported
>> from a thirdparty system after which some APC cached data needs to be
>> cleared, in the same vein
>> I occasionally roll out a new version and then the APC opcode cache
>> needs to be cleared (each webserver
>> in the cluster has it's own APC cache obviously).
>>
>> now I'm stuck with the problem of how to trigger the cache clearance
>> on all servers ... Greg Donald
>> already mentioned the ruby based capistrano for executing commands on
>> multiple remote servers and I'll
>> be using that to manage things like cache clearance, webserver
>> restarting, etc on all the webservers
>>
>> ... BUT I have found that it is not possible to control the APC cache
>> of php_mod from the CLI version of
>> php, they apparently use different APC caches. it seems that the only
>> way to control the APC cache of
>> mod_php is via a web interface. APC ships with the very handy apc.php
>> script but this is hardly a decent
>> way of controlling/clearing the APC cache of multiple machine
>> programmatically.
>>
>> Am I stuck with one of:
>>
>> 1. doing a graceful restart of all servers (which causes APCs cache to
>> disappear)?
>
> Yes, that should work.

I know - but it's a rubbish solution because it offer no control as to what
is cleared from the APC cache, sometimes I want to clear opcodes, sometimes user-data,
sometimes both ... graceful means being forced to clear everything.

>
>> 2. writing a cmdline script that performs a URL request to a copy of
>> apc.php that is reachable via each
>> webserver in order to clear/manage the APC cache?
>
> Yes, but obviously password-protect it to avoid DOS.

yeah - think this is the route I have to take somehow .. I'm going to look into
running a seperate vhost only available via 127.0.0.1, with a pwd on it and then
write a little script that can control the apc cache via said vhost from the
cmdline ... the cmdline script would then be controlled remotely via ssh using
the coolness that is capistrano (http://www.capify.org/)

>
>> or is there another way that I can control the webserver's APC cache
>> from the cmdline?
>
> One would think there would be some kind of USR_* signal that can be
> sent through Apache to APC to clear cache...

One would think that there was something like this indeed - I cannot find it,
but then there must be something ... I assume, for instance, that Yahoo!** occassionally
see fit to clear APC caches on more than one machine and I doubt Rasmus sits there and
opens a browser to run apc.php on each one ;-)

** is it too early to say 'MicroHoo!' ?

>

attached mail follows:


On Wed, February 20, 2008 3:29 pm, Yuval Schwartz wrote:
> Hello and thank you,
>
> Another question, I get a message:
>
> *Warning*: feof(): supplied argument is not a valid stream resource in
> *
> /home/content/t/h/e/theyuv/html/MessageBoard.php* on line *52*
> **
> And I've tried troubleshooting for a while; I'm pretty sure I'm
> opening the
> file handle correctly and everything but I can't get feof or similar
> functions like fgets to work.
>
> Here is my code if you're interested (it's so that I color every 2nd
> line in
> the text):
>
> *$boardFile = "MessageBoard.txt";
> $boardFileHandle = fopen($boardFile,"r");

if (!$boardFileHandle){
  die("Unable to open $boardFile\n");
}

The fact that you are seeing zero error messages indicates that you
almost for sure aren't checking the right places to find error
messages...

Figure out what's in your php.ini and get it to use E_ALL and send the
errors to a log or something.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?