php-general Digest 21 Oct 2008 18:32:56 -0000 Issue 5748

2008-10-21 Thread php-general-digest-help

php-general Digest 21 Oct 2008 18:32:56 - Issue 5748

Topics (messages 282173 through 282209):

Re: Mass email
282173 by: Richard Heyes

Re: Remote Developer Wanted
282174 by: Brennon Bortz
282183 by: Daniel Brown
282184 by: Jay Moore
282186 by: Daniel Brown
282188 by: Rene Veerman
282191 by: Robert Cummings
282192 by: Daniel Brown
282193 by: Jay Moore
282194 by: Jay Moore
282196 by: Jochem Maas
282197 by: Jochem Maas
282199 by: Daniel Brown
282201 by: Jochem Maas
282208 by: Nitsan Bin-Nun

Re: Securing AJAX requests with PHP?
282175 by: Yeti
282200 by: Eric Butera

Re: Accessibility problem with delegates
282176 by: Jochem Maas

Re: what's the difference in the following code?
282177 by: Yeti
282180 by: Jochem Maas
282181 by: tedd

Politics
282178 by: Amy
282179 by: Chrome
282189 by: Jim Lucas
282190 by: Robert Cummings
282195 by: Nathan Rixham
282198 by: Wolf
282202 by: Jochem Maas

Re: How to Execute Exe File from PHP
282182 by: Alice Wei
282203 by: Paulo Sousa

table and class
282185 by: Alain Roger
282187 by: Nathan Rixham

display_errors in DEV
282204 by: ceo.l-i-e.com
282206 by: Robert Cummings
282207 by: Eric Butera
282209 by: Boyd, Todd M.

ZendOptimizer + APC
282205 by: Jochem Maas

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]


--
---BeginMessage---
 I have a client who wants to send out mass emails to 37,000+ opt-in members
 (i.e., not spam).

 Any suggestions as to the best way to do this?

Outsource it.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org
---End Message---
---BeginMessage---
Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...

Brennon Bortz

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 21, 2008 2:32 AM
To: Andy Dyble
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Remote Developer Wanted

Andy Dyble schreef:
 Hi
 
 I am looking for a remote developer for small add hoc jobs.  Usually
 only a few hours at a time. Basic stuff, listing data from SQL and text
 files. Mainly work on existing systems.

personally I'd run in the other direction based on that description,
I mean who decides what's simple, how long something should take, etc.

my experience of working on 'existing systems' is usually akin to wading
neckdeep through crap you wouldn't wish on your worst enemy. really well
thought out, well written code usually has competent people working on it
already ... code that stinks generally gets no attention because nobody
wants to work on/with it which is people end up scouring the net looking
for someone desperate enough to take a shot at it.

 $10-$15 per hour depending on location.

Im sure there is an indian outsourcing solution to fit your needs, your from
the UK and quoting dollars ... your low-end is just over 5 pound sterling an
hour,
I can flip burgers at Macdonalds for more.

there are plenty of market places on the net where tenders can be placed for
this
kind of thing.

just so you know ... at lot of the regular people doling out free advice on
this
list command somewhere in the region of 8 to 10 times what your willing to
pay ...
if not more.

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


---End Message---
---BeginMessage---
On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:
 Actually, speaking as someone now living in the UK, your low end is LESS
 than minimum wage here.  Rather insulting, if you ask me...

Simple advice then: delete the message and don't reply.

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]
---End Message---
---BeginMessage---

Daniel Brown wrote:

On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:

Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...


Simple advice then: delete the message and don't reply.



Striker
Surely you can't be serious.
/Striker
---End Message---
---BeginMessage---
On Tue, Oct 21, 2008 at 10:20 AM, Jay Moore [EMAIL PROTECTED] wrote:

 Striker
 Surely you can't be serious.
 /Striker

I am serious.  And don't call me Shirley.

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]
---End Message---
---BeginMessage---

Daniel Brown wrote:

On Tue, Oct 21, 2008 at 4:26 

[PHP] Accessibility problem with delegates

2008-10-21 Thread Dave Kok

Hi Everyone,

I have a class with some callback functions and a class that should call 
them. The class with the callback functions initializes the array with the 
callbacks and hands it down to the other class that should call them. PHP 
however forces the callback functions to be public, so the other class can 
call them. This seems rather strange as the callback functions have no 
meaning when invoked arbitrarily. So I was wondering whether I am doing 
something wrong. Could someone comment?


Regards,
Dave 



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



Re: [PHP] Mass email

2008-10-21 Thread Richard Heyes
 I have a client who wants to send out mass emails to 37,000+ opt-in members
 (i.e., not spam).

 Any suggestions as to the best way to do this?

Outsource it.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

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



RE: [PHP] Remote Developer Wanted

2008-10-21 Thread Brennon Bortz
Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...

Brennon Bortz

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 21, 2008 2:32 AM
To: Andy Dyble
Cc: php-general@lists.php.net
Subject: Re: [PHP] Remote Developer Wanted

Andy Dyble schreef:
 Hi
 
 I am looking for a remote developer for small add hoc jobs.  Usually
 only a few hours at a time. Basic stuff, listing data from SQL and text
 files. Mainly work on existing systems.

personally I'd run in the other direction based on that description,
I mean who decides what's simple, how long something should take, etc.

my experience of working on 'existing systems' is usually akin to wading
neckdeep through crap you wouldn't wish on your worst enemy. really well
thought out, well written code usually has competent people working on it
already ... code that stinks generally gets no attention because nobody
wants to work on/with it which is people end up scouring the net looking
for someone desperate enough to take a shot at it.

 $10-$15 per hour depending on location.

Im sure there is an indian outsourcing solution to fit your needs, your from
the UK and quoting dollars ... your low-end is just over 5 pound sterling an
hour,
I can flip burgers at Macdonalds for more.

there are plenty of market places on the net where tenders can be placed for
this
kind of thing.

just so you know ... at lot of the regular people doling out free advice on
this
list command somewhere in the region of 8 to 10 times what your willing to
pay ...
if not more.

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



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



Re: [PHP] Securing AJAX requests with PHP?

2008-10-21 Thread Yeti
 True, but then my permission / auth / workflow schema defines all that. the
 user won't like have that permission, the request will be logged and nothing
 is ever deleted from the app in any case since I only allow soft (record
 level flag ) deletes to ensure data integrity

I agree with Bastien here. If you can't trust your authorized users
then don't authorize them to delete entries. I would also recommend
some kind of access control to lower the risk of a complete data loss.
Use HTTPS to prevent man in the middle attacks.

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



Re: [PHP] Accessibility problem with delegates

2008-10-21 Thread Jochem Maas
Dave Kok schreef:
 Hi Everyone,
 
 I have a class with some callback functions and a class that should call
 them. The class with the callback functions initializes the array with
 the callbacks and hands it down to the other class that should call
 them. PHP however forces the callback functions to be public, so the
 other class can call them. This seems rather strange as the callback
 functions have no meaning when invoked arbitrarily. So I was wondering
 whether I am doing something wrong. Could someone comment?

callbacks run from the global scope so whatever is called must be available
i.e. public in the case of methods. so your not doing anything wrong.

if the methods are not static you might consider making the ctor of the
'callback class' private so that only the class itself can create an instance
of itself ... which it then does when creating the callback definitions that
it passes to the class using the callbacks ... so the second class then has
an object on which it can call the relevant functions but no other code
is able to create an instance of the callback class and thereby screw with the
functions designed only to be used in the callback situation.

but that's all probably overkill ... make them public, document their usage, 
done.

 
 Regards,
 Dave
 


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



Re: [PHP] what's the difference in the following code?

2008-10-21 Thread Yeti
OP = original poster (in this case I guess)
http://acronyms.thefreedictionary.com/OP

So it's all about making code readable and probably easier to maintain
(even people unfamiliar with the script).
Doesn't that render the ternary operator IF-statement unnecessary?
Have I been totally wrong using it in countless scripts of mine
(always thought it's a neat way to do if )?
Somebody please tell me that I do not have to rewrite my code base
now, since I care about security.

Btw. PHP's ternary inconsistency here ..
http://en.wikipedia.org/wiki/%3F:#Inconsistency_of_implementations

And how about this ..
switch(isset($_GET['search'])) {
case true:
$search = $_GET['search'];
break 1;

default:
$search = '';
}

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



[PHP] Politics

2008-10-21 Thread Amy

representations emphasizing leksr matching thirds painfully wakesleep 
ekswiezeezeewie accompanied

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



RE: [PHP] Politics

2008-10-21 Thread Chrome
 -Original Message-
 From: Amy [mailto:[EMAIL PROTECTED]
 Sent: 21 October 2008 11:58
 To: php-general@lists.php.net
 Subject: [PHP] Politics
 
 
 representations emphasizing leksr matching thirds painfully wakesleep
 ekswiezeezeewie accompanied

Have you tried restarting Apache? :)

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


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



Re: [PHP] what's the difference in the following code?

2008-10-21 Thread Jochem Maas
tedd schreef:
 At 6:37 AM -0700 10/20/08, Lamp Lists wrote:
 - Original Message 

 From: tedd [EMAIL PROTECTED]
 To: Lamp Lists [EMAIL PROTECTED]; php-general@lists.php.net
 Sent: Monday, October 20, 2008 8:25:50 AM
 Subject: Re: [PHP] what's the difference in the following code?

 At 10:58 AM -0700 10/17/08, Lamp Lists wrote:
  I'm reading Essential PHP Security by Chris Shiflett.

  on the very beginning, page 5  6, if I got it correct, he said this
  is not good:
 
 NO, you did not get it correct.
 
 
 how it's so obvious? I can't see it either?

 -ll
 
 
 Re-read those paragraphs.
 
 He was not telling you that one way was better than the other. He WAS
 saying that one way showed the tainted variable more obvious than the
 other -- that's all.
 
 I hate it when people take things out of context and misquote others.
 Chris did not say that one way was better, or different, than the other.
 But rather he used two sets of code to illustrate a point.

seems to me the point being illustrates is not at all objective in it's
premise. I find the the ternary syntax easier to read/grok than the 3 liner.

in both cases you need to understand the 'if' context to see when the
variable is tainted.

all that can be said is that one way is more obvious that the other to *Chris*,
which doesn't do anybody but Chris much good ... obviously it's a rather silly
point ... the useful parts of Chris' work revolve around where he explains
*how* to validate/cleanse the tainted value ... extracting the goodness is a
matter of evaluating and possibly disregarding statements/information which are
secondary and/or irrelevant.

 
 Again, re-read those paragraphs.
 
 Cheers,
 
 tedd
 


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



Re: [PHP] what's the difference in the following code?

2008-10-21 Thread tedd

At 2:44 AM -0700 10/21/08, Yeti wrote:

Somebody please tell me that I do not have to rewrite my code base
now, since I care about security.


You do not have to rewrite your code because you use ternary 
operators! Nobody said that.


Again, Chris was not saying that it was the use of the operator that 
was a security issue, but rather its use could obscure the fact that 
the operator, as in the case he provided, could produce a tainted 
variable.


Perhaps I've confused what Chris tried to say -- so, I suggest that 
everyone who is interested in arguing this point further buy Chris' 
book and read it for themselves.


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



RE: [PHP] How to Execute Exe File from PHP

2008-10-21 Thread Alice Wei



Hi, Guys:  Sorry about bothering everyone about this problem.  It seems strange 
that now I try to create some arguments after what I tried to execute, it does 
not give me a thing. 
  I get no error messages. No output file, and only a blank screen when I put 
the following snippet into the PHP file. 
 $a= shell_exec(./test.exe -m$market -d$length);
  echo $a;
 What is odd is, I tired doing this by using a dos command prompt, it works 
entirely. Could anyone please give me a hint on what problem I am having now? 
Thanks for the heads up. 

Alice
 CC: php-general@lists.php.net
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Date: Mon, 20 Oct 2008 21:51:23 +0100
 Subject: Re: [PHP] How to Execute Exe File from PHP
 
 On 20 Oct 2008, at 21:47, Alice Wei wrote:
   Has anyone tried to execute an .exe file from PHP? I am
  currently stuck in a situation where I cannot execute the script, and
  all I am getting is a blank screen.
 
  This is my code snippet used to execute the file:
 
   //execute program
  $a = @shell_exec(C:\Inetpub\wwwroot\test/test.exe);
  echo $a;
 
  The
  program above is supposed to generate a file, so I can read from it. I
  have previously set up a file, and I have no problems with reading the
  file.
  Can anyone please help me with the possible command to
  execute the script? I tried CURL too, but it does not seem to be
  working either.
 
 1) Remove the @ before the function call, it's hiding the error message!
 
 2) \ needs to be escaped within double quotes, try replacing each one  
 with \\
 
 3) Why are you mixing \'s and /'s? Dunno whether it matters, but it's  
 definitely better to stick to one or the other.
 
 4) There is no 4!
 
 -Stut
 
 -- 
 http://stut.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

_
Use Messenger to talk to your IM friends, even those on Yahoo!
http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe

Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Daniel Brown
On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:
 Actually, speaking as someone now living in the UK, your low end is LESS
 than minimum wage here.  Rather insulting, if you ask me...

Simple advice then: delete the message and don't reply.

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jay Moore

Daniel Brown wrote:

On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:

Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...


Simple advice then: delete the message and don't reply.



Striker
Surely you can't be serious.
/Striker

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



[PHP] table and class

2008-10-21 Thread Alain Roger
Hi,

in my web application (as quite all web applications) i have a lot of
tables. I mean by table the table tag with for sure some data displayed in
it from SQL requests.
To not have to write the whole code every time i was thinking to make a
class that :
- will manage the whole design (color, images, width, height of cells,...)
- will manage the paging (to limit the data transfer from DB server to
client browser)
- will manage the sorting and search (classic and advanced) of data based on
some online built query (user should be able to do something like field1 =
value 1 OR field 1 = value2 AND field4 = a)

therefore i would like to know if to encapsulate everything in PHP classes
(integrating javascript and css) will be the best approach or not ?
because i would like to keep it as simple as possible in order to
redistribute later this package.

or should i mix javascript classes and PHP classes ?

thx.

-- 
Alain

Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Daniel Brown
On Tue, Oct 21, 2008 at 10:20 AM, Jay Moore [EMAIL PROTECTED] wrote:

 Striker
 Surely you can't be serious.
 /Striker

I am serious.  And don't call me Shirley.

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



[PHP] Re: table and class

2008-10-21 Thread Nathan Rixham

Alain Roger wrote:

Hi,

in my web application (as quite all web applications) i have a lot of
tables. I mean by table the table tag with for sure some data displayed in
it from SQL requests.
To not have to write the whole code every time i was thinking to make a
class that :
- will manage the whole design (color, images, width, height of cells,...)
- will manage the paging (to limit the data transfer from DB server to
client browser)
- will manage the sorting and search (classic and advanced) of data based on
some online built query (user should be able to do something like field1 =
value 1 OR field 1 = value2 AND field4 = a)

therefore i would like to know if to encapsulate everything in PHP classes
(integrating javascript and css) will be the best approach or not ?
because i would like to keep it as simple as possible in order to
redistribute later this package.

or should i mix javascript classes and PHP classes ?

thx.



I'd suggest two classes; one(php) which controls the data and outputting 
it as a table, the other (clientside) which controls the display of the 
table. Everything directly relating to CSS should be in CSS with an 
optional 3rd php class/app for generating or controlling the css.


Maybe something like YUI Tables would help you in your quest.

(dare I say it (as always) - Flex 3 is great for this kind of thing..)

Regards

--
nathan ( [EMAIL PROTECTED] )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Rene Veerman

Daniel Brown wrote:

On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:
  

Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...



Simple advice then: delete the message and don't reply.

  

Andy deserves to know his current offer is kinda insulting :D

Consider plz that if a job is easy, i'd be done sooner. So i'd make even 
less..

The offer really only is fair to a noob php-er ;-)

So you might get a 15 year old to do it, if its an easy of a job with a 
technical director giving him coding guidelines..

They might be happy with the $15/h.
A talented 17 year old would want $20 at least, or he aint talented :)

If you plan to do many of these type of tasks, and will do them for 
years to come, it might be cheaper to have a $50/h programmer take a 
look at building something re-usable, with an interface for non-techies 
to describe your forms and databases.
With something re-usable, if properly written and self-documented, you 
have a more solid base for your business operations, and can distribute 
improvements to all your clients when they become available.
I've gotta add that there might be many hours involved depending on the 
complexity of the data and ways of displaying it. I guess you could 
start with the types of operations that happen a lot, grouped by similarity.
Give us a few examples and i can tell you if it's possible to create 
something re-usable in a short time..



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



Re: [PHP] Politics

2008-10-21 Thread Jim Lucas
Chrome wrote:
 -Original Message-
 From: Amy [mailto:[EMAIL PROTECTED]
 Sent: 21 October 2008 11:58
 To: php-general@lists.php.net
 Subject: [PHP] Politics


 representations emphasizing leksr matching thirds painfully wakesleep
 ekswiezeezeewie accompanied
 
 Have you tried restarting Apache? :)

no, no, no, she said painfully, she must be using IIS... :)

Try upgrading all your drivers and then restarting...

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


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



Re: [PHP] Politics

2008-10-21 Thread Robert Cummings
On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
 Chrome wrote:
  -Original Message-
  From: Amy [mailto:[EMAIL PROTECTED]
  Sent: 21 October 2008 11:58
  To: php-general@lists.php.net
  Subject: [PHP] Politics
 
 
  representations emphasizing leksr matching thirds painfully wakesleep
  ekswiezeezeewie accompanied
  
  Have you tried restarting Apache? :)
 
 no, no, no, she said painfully, she must be using IIS... :)
 
 Try upgrading all your drivers and then restarting...

Hmmm, I'm not so sure. I think it's a php.ini problem where
register_globals=on is required to make the code work.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Robert Cummings
On Tue, 2008-10-21 at 10:23 -0400, Daniel Brown wrote:
 On Tue, Oct 21, 2008 at 10:20 AM, Jay Moore [EMAIL PROTECTED] wrote:
 
  Striker
  Surely you can't be serious.
  /Striker
 
 I am serious.  And don't call me Shirley.

You must be new around here... Shirley!

:D

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Daniel Brown
On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings [EMAIL PROTECTED] wrote:

 You must be new around here... Shirley!

Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







;-P

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jay Moore

Daniel Brown wrote:

On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings [EMAIL PROTECTED] wrote:

You must be new around here... Shirley!


Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







;-P



Standing up.

*stang*

(look it up)

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jay Moore

Jay Moore wrote:

Daniel Brown wrote:
On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings 
[EMAIL PROTECTED] wrote:

You must be new around here... Shirley!


Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







;-P



Standing up.

*stang*

(look it up)


Actually, moron, it's called a sting; not a stang.

http://www.nationmaster.com/encyclopedia/Sting-%28percussion%29

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



Re: [PHP] Politics

2008-10-21 Thread Nathan Rixham

Robert Cummings wrote:

On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:

Chrome wrote:

-Original Message-
From: Amy [mailto:[EMAIL PROTECTED]
Sent: 21 October 2008 11:58
To: php-general@lists.php.net
Subject: [PHP] Politics


representations emphasizing leksr matching thirds painfully wakesleep
ekswiezeezeewie accompanied

Have you tried restarting Apache? :)

no, no, no, she said painfully, she must be using IIS... :)

Try upgrading all your drivers and then restarting...


Hmmm, I'm not so sure. I think it's a php.ini problem where
register_globals=on is required to make the code work.

Cheers,
Rob.


I think they need a new dictionary / word list or at least some form of 
lexicographic analysis.


Oh yeah and a point.

--
nathan ( [EMAIL PROTECTED] )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jochem Maas
Daniel Brown schreef:
 On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED] wrote:
 Actually, speaking as someone now living in the UK, your low end is LESS
 than minimum wage here.  Rather insulting, if you ask me...
 
 Simple advice then: delete the message and don't reply.

and rob myself of the sport? your no fun since your married Shirley ;-)

 


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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jochem Maas
Jay Moore schreef:
 Jay Moore wrote:
 Daniel Brown wrote:
 On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings
 [EMAIL PROTECTED] wrote:
 You must be new around here... Shirley!

 Yes, brand new.  This is only my second post --- and only the
 third email I've ever sent in my life.  How do you PHP?







 ;-P


 Standing up.

 *stang*

 (look it up)
 
 Actually, moron, it's called a sting; not a stang.
 
 http://www.nationmaster.com/encyclopedia/Sting-%28percussion%29

I love the way you talk down to yourself :-P

you want one of these (more fun with the sound on):

http://instantrimshot.com/

 


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



Re: [PHP] Politics

2008-10-21 Thread Wolf

 Nathan Rixham [EMAIL PROTECTED] wrote: 
 Robert Cummings wrote:
  On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
  Chrome wrote:
  -Original Message-
  From: Amy [mailto:[EMAIL PROTECTED]
  Sent: 21 October 2008 11:58
  To: php-general@lists.php.net
  Subject: [PHP] Politics
 
 
  representations emphasizing leksr matching thirds painfully wakesleep
  ekswiezeezeewie accompanied
  Have you tried restarting Apache? :)
  no, no, no, she said painfully, she must be using IIS... :)
 
  Try upgrading all your drivers and then restarting...
  
  Hmmm, I'm not so sure. I think it's a php.ini problem where
  register_globals=on is required to make the code work.
  
 I think they need a new dictionary / word list or at least some form of 
 lexicographic analysis.
 
 Oh yeah and a point.
 

http://www.youtube.com/watch?v=IF2RYhNhBdwfeature=related

And...

http://www.youtube.com/watch?v=B_kvgD_Mv-M

:)


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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Daniel Brown
On Tue, Oct 21, 2008 at 12:03 PM, Jochem Maas [EMAIL PROTECTED] wrote:

 and rob myself of the sport? your no fun since your married Shirley ;-)

Coincidentally, that's exactly what my wife says.

-- 
/Daniel P. Brown
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



Re: [PHP] Securing AJAX requests with PHP?

2008-10-21 Thread Eric Butera
On Tue, Oct 21, 2008 at 5:12 AM, Yeti [EMAIL PROTECTED] wrote:
 True, but then my permission / auth / workflow schema defines all that. the
 user won't like have that permission, the request will be logged and nothing
 is ever deleted from the app in any case since I only allow soft (record
 level flag ) deletes to ensure data integrity

 I agree with Bastien here. If you can't trust your authorized users
 then don't authorize them to delete entries. I would also recommend
 some kind of access control to lower the risk of a complete data loss.
 Use HTTPS to prevent man in the middle attacks.

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



That is a bit overkill going https for everything.  If you just make
ajax requests behave the same way as a normal direct hit, you'll be
fine.  One of the problems with ajax stuff is that sometimes we forget
to validate each request validating the user making the request and
the action they're performing.  It's quite easy to just assume the
request hasn't been changed at all since it is buried behind code.
Everyone's guilty of this at one point or another.  Just look at this
google docs example. [1]

I'd recommend reading up on the concepts of authentication and
authorization.  Authentication just makes sure you're logged in.
Authorization makes sure you can perform a specific action.  Once you
have that you'll be able to answer the original question.

Of course you can also go into other types of things like creating
signatures for each request and tokens (which should be done), but
start at the beginning and work at it.  I'd also recommend installing
something like httplive headers or firebug just to get an idea of what
is going over the wire.  It might make things more obvious.

[1] http://xs-sniper.com/blog/2007/09/28/all-your-google-docs-are-belong-to-us/

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Jochem Maas
Daniel Brown schreef:
 On Tue, Oct 21, 2008 at 12:03 PM, Jochem Maas [EMAIL PROTECTED] wrote:
 and rob myself of the sport? your no fun since your married Shirley ;-)
 
 Coincidentally, that's exactly what my wife says.

your wife calls you Shirley? your definitely doing *something* wrong ... maybe 
take off the
dress. :-P

 


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



Re: [PHP] Politics

2008-10-21 Thread Jochem Maas
Amy schreef:
 representations emphasizing leksr matching thirds painfully wakesleep 
 ekswiezeezeewie accompanied
 

incidently. the word politics ... seemingly a combination of 'poli' (aka many)
and 'tics' (aka 'bloodsucking wotsits') ... all too apt.


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



Re: [PHP] How to Execute Exe File from PHP

2008-10-21 Thread Paulo Sousa
Hi Alice

First, make sure about the value on $market and $length. Yeah, it's simple.

 echo $market;
 echo $length;
 $a= shell_exec(./test.exe -m$market -d$length);
 echo $a;

Second: http://www.chipmunkninja.com/Program-Execution-in-PHP:-exec-m@@;
A good explanation to use external commands (thanks chip!)

Third: give us more information: PHP version, OS. Maybe this time can be
useless, but important for future questions.

(sorry about my poor english)




2008/10/21 Alice Wei [EMAIL PROTECTED]




 Hi, Guys:  Sorry about bothering everyone about this problem.  It seems
 strange that now I try to create some arguments after what I tried to
 execute, it does not give me a thing.
  I get no error messages. No output file, and only a blank screen when I
 put the following snippet into the PHP file.
  $a= shell_exec(./test.exe -m$market -d$length);
  echo $a;
  What is odd is, I tired doing this by using a dos command prompt, it works
 entirely. Could anyone please give me a hint on what problem I am having
 now?
 Thanks for the heads up.

 Alice
  CC: php-general@lists.php.net
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Date: Mon, 20 Oct 2008 21:51:23 +0100
  Subject: Re: [PHP] How to Execute Exe File from PHP
 
  On 20 Oct 2008, at 21:47, Alice Wei wrote:
Has anyone tried to execute an .exe file from PHP? I am
   currently stuck in a situation where I cannot execute the script, and
   all I am getting is a blank screen.
  
   This is my code snippet used to execute the file:
  
//execute program
   $a = @shell_exec(C:\Inetpub\wwwroot\test/test.exe);
   echo $a;
  
   The
   program above is supposed to generate a file, so I can read from it. I
   have previously set up a file, and I have no problems with reading the
   file.
   Can anyone please help me with the possible command to
   execute the script? I tried CURL too, but it does not seem to be
   working either.
 
  1) Remove the @ before the function call, it's hiding the error message!
 
  2) \ needs to be escaped within double quotes, try replacing each one
  with \\
 
  3) Why are you mixing \'s and /'s? Dunno whether it matters, but it's
  definitely better to stick to one or the other.
 
  4) There is no 4!
 
  -Stut
 
  --
  http://stut.net/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 _
 Use Messenger to talk to your IM friends, even those on Yahoo!

 http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe


[PHP] display_errors in DEV

2008-10-21 Thread ceo

Until recently, I've thought that display_errors in DEV was good



But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.



You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and the 
whole thing might just work but you'll have plenty of buggy code.



I think it's time for the PHP team to recommend log_errors across the board.



What do you think?



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



[PHP] ZendOptimizer + APC

2008-10-21 Thread Jochem Maas
anyone know whether running ZendOptimizer + APC simultaneously still causes 
allsorts
of problems ... I know it did in the past but I can't find any very recent 
stuff about the
issues online.

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



Re: [PHP] display_errors in DEV

2008-10-21 Thread Robert Cummings
On Tue, 2008-10-21 at 16:33 +, [EMAIL PROTECTED] wrote:
 Until recently, I've thought that display_errors in DEV was good
 
 But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.
 
 You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and 
 the whole thing might just work but you'll have plenty of buggy code.
 
 I think it's time for the PHP team to recommend log_errors across the board.
 
 What do you think?

Have a simple switch for ajax requests so errors to go into a file... or
send the errors along as part of the ajax request and have the ajax code
popup a warning that is readable. Or whatever :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] display_errors in DEV

2008-10-21 Thread Eric Butera
On Tue, Oct 21, 2008 at 12:33 PM,  [EMAIL PROTECTED] wrote:

 Until recently, I've thought that display_errors in DEV was good

 But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.

 You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and 
 the whole thing might just work but you'll have plenty of buggy code.

 I think it's time for the PHP team to recommend log_errors across the board.

 What do you think?


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



This has bit me in the bum several times.  What I do though is put a
try catch around my json response parsing and if something goes wrong
then I show some error to the user.  Then with firebug I can see the
raw php error.  So I guess I don't care either way since I'm covered.

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



Re: [PHP] Remote Developer Wanted

2008-10-21 Thread Nitsan Bin-Nun
I'm 16 years old and have a steady income for the last 3 month as PHP
developer company in Israel which pays me almost doubled then your high rate
(if you convert it from Israeli Shequl to $). I wouldn't work for less than
20$ per hour - that's for sure.

I don't think your will find a good programmer outside India in those rates.
Although on the other hand I know teenagers in Israel who would like to take
this project ;)

Wishing you luck in the journey after your desired 15$ programmer,
Nitsan

On Tue, Oct 21, 2008 at 4:46 PM, Rene Veerman [EMAIL PROTECTED] wrote:

 Daniel Brown wrote:

 On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz [EMAIL PROTECTED]
 wrote:


 Actually, speaking as someone now living in the UK, your low end is LESS
 than minimum wage here.  Rather insulting, if you ask me...



Simple advice then: delete the message and don't reply.



 Andy deserves to know his current offer is kinda insulting :D

 Consider plz that if a job is easy, i'd be done sooner. So i'd make even
 less..
 The offer really only is fair to a noob php-er ;-)

 So you might get a 15 year old to do it, if its an easy of a job with a
 technical director giving him coding guidelines..
 They might be happy with the $15/h.
 A talented 17 year old would want $20 at least, or he aint talented :)

 If you plan to do many of these type of tasks, and will do them for years
 to come, it might be cheaper to have a $50/h programmer take a look at
 building something re-usable, with an interface for non-techies to describe
 your forms and databases.
 With something re-usable, if properly written and self-documented, you have
 a more solid base for your business operations, and can distribute
 improvements to all your clients when they become available.
 I've gotta add that there might be many hours involved depending on the
 complexity of the data and ways of displaying it. I guess you could start
 with the types of operations that happen a lot, grouped by similarity.
 Give us a few examples and i can tell you if it's possible to create
 something re-usable in a short time..



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




RE: [PHP] display_errors in DEV

2008-10-21 Thread Boyd, Todd M.
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 21, 2008 11:33 AM
 To: php-general@lists.php.net
 Subject: [PHP] display_errors in DEV
 
 
 Until recently, I've thought that display_errors in DEV was good
 
 But as soon as you move into Ajax Web 2.0 world, it really doesn't cut
 it.
 
 You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably,
 and the whole thing might just work but you'll have plenty of buggy
 code.
 
 I think it's time for the PHP team to recommend log_errors across the
 board.
 
 What do you think?

Report via Javascript exceptions. If you're debugging with your browser
(i.e., Web Developer plug-in for Firefox, or even the plain, built-in
debuggers will do) you should be able to view the exception's message
and maybe even a stack trace if you set it up right.

Todd Boyd
Web Programmer

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



[PHP] class and inheritance

2008-10-21 Thread Alain Roger
Hi,

I'm trying to create a class that has as public members some other class
object.
for that i use almost the same syntax as under C# or C++.

header class:

 ?php
 class CARMainHeader
 {
 // title of the main table header
 private $mTitle = null;

 // holds the height of the table header
 private $mHeight = null;

 // constructor
 public function __construct()
 {
 $this-mHeight = 15;
 $this-mTitle = Title;
 }

 // set the title of the main table
 public function SetTitle($name)
 {
 $this-mTitle = $name;
 }

 // return the title of the main table
 public function GetTitle()
 {
 return $this-mTitle;
 }

 // set the height of the header
 public function SetHeight($height)
 {
 $this-mHeight = $height;
 }

 // return the height of the header
 public function GetHeight()
 {
 return $this-mHeight;
 }
 }
 ?


main class code :

 ?php
 include_once 'CARMainHeader.php';

 class CARTable
 {
 // holds the main table header object
 public $mTableHeader = null;

 // store the amount of columns in table
 private $mColumnsCount = null;

 // constructor
 public function __construct()
 {
 $this-mTableHeader = new CARMainHeader();
 }

 // rendering of table
 public function Render()
 {
 echo table;
 echo tr /;
 echo td class=''.$this-mTableHeader-;
 echo /td;
 echo td class='';
 echo /td;
 echo /table;
 }
 }
 ?


in the CARTable, i'm not able in the Render function to write
$this-mTableHeader-GetTitle();
why ?

-- 
Alain

Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


[PHP] Re: class and inheritance

2008-10-21 Thread Maciek Sokolewicz

Alain Roger wrote:

Hi,

I'm trying to create a class that has as public members some other class
object.
for that i use almost the same syntax as under C# or C++.

header class:


?php
class CARMainHeader
{
// title of the main table header
private $mTitle = null;

// holds the height of the table header
private $mHeight = null;

// constructor
public function __construct()
{
$this-mHeight = 15;
$this-mTitle = Title;
}

// set the title of the main table
public function SetTitle($name)
{
$this-mTitle = $name;
}

// return the title of the main table
public function GetTitle()
{
return $this-mTitle;
}

// set the height of the header
public function SetHeight($height)
{
$this-mHeight = $height;
}

// return the height of the header
public function GetHeight()
{
return $this-mHeight;
}
}
?



main class code :


?php
include_once 'CARMainHeader.php';

class CARTable
{
// holds the main table header object
public $mTableHeader = null;

// store the amount of columns in table
private $mColumnsCount = null;

// constructor
public function __construct()
{
$this-mTableHeader = new CARMainHeader();
}

// rendering of table
public function Render()
{
echo table;
echo tr /;
echo td class=''.$this-mTableHeader-;

you're missing something here, don't you think? :)

echo /td;
echo td class='';
echo /td;
echo /table;
}
}
?



in the CARTable, i'm not able in the Render function to write
$this-mTableHeader-GetTitle();
why ?


you can, and it works. Once you actually call that method.

- Tul

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



Re: [PHP] 2 successive commands in one shell_exec?

2008-10-21 Thread Oscar Gosdinski
On Mon, Oct 20, 2008 at 9:16 PM, Govinda [EMAIL PROTECTED] wrote:
 I mean I need to do that, and so with my very newbie level of understanding
 I think I need to have that shell_exec essentially do 2 things at once:
 -goto the right dir, and then
 -fire the script in that dir.
 like these 2 successive commands in terminal:
 cd $MyPath
 ./MyOtherCGI.cgi

cd $MyPath  ./MyOtherCGI.cgi

or you maybe using full path:

$MyPath/MyOtherCGI.cgi

-- 
Saludos
Oscar

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



[PHP] Question about __destruct()

2008-10-21 Thread Dan Joseph
Hi,

I want to make sure I completely understand __destruct() and when its hit...

Understand that it will run if all references to a particular object are
removed, but is that also true when a page ends its execution?

Example, I call a database class.  It constructs, connects, then my page
pulls some stuff out of the database, and then the php script ends.  Does
this also cause the deconstruct to execute?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


[PHP] Re: display_errors in DEV

2008-10-21 Thread Mike van Riel

[EMAIL PROTECTED] wrote:

Until recently, I've thought that display_errors in DEV was good

But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.

You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and the whole 
thing might just work but you'll have plenty of buggy code.

I think it's time for the PHP team to recommend log_errors across the board.

What do you think?



You can also write a custom errorhandler which writes to a log file or 
to the syslog. I use a custom errorhandling class which registers itself 
and sends all errors (even fatals) there.
Thsi way you can have easy and quick access to errors but not the hassle 
of disruptive output.


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



[PHP] Re: Question about __destruct()

2008-10-21 Thread Mike van Riel

Dan Joseph wrote:

Hi,

I want to make sure I completely understand __destruct() and when its hit...

Understand that it will run if all references to a particular object are
removed, but is that also true when a page ends its execution?

Example, I call a database class.  It constructs, connects, then my page
pulls some stuff out of the database, and then the php script ends.  Does
this also cause the deconstruct to execute?



When a script ends everything is released (with some small exceptions), 
thus also all references to instances of classes.
Thus AFAIK a deconstructor will always be called at the end of script 
execution.



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



Re: [PHP] Re: Question about __destruct()

2008-10-21 Thread Jochem Maas
Mike van Riel schreef:
 Dan Joseph wrote:
 Hi,

 I want to make sure I completely understand __destruct() and when its
 hit...

 Understand that it will run if all references to a particular object are
 removed, but is that also true when a page ends its execution?

 Example, I call a database class.  It constructs, connects, then my page
 pulls some stuff out of the database, and then the php script ends.  Does
 this also cause the deconstruct to execute?

 
 When a script ends everything is released (with some small exceptions),
 thus also all references to instances of classes.
 Thus AFAIK a deconstructor will always be called at the end of script
 execution.
 

but you have no control over what order dtors are called and you can't make
any assumptions about state of file handles to STDIN/STDOUT and things like
that ... personally I find dtors run at end of script to be nigh on
useless.

 


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



Re: [PHP] Re: Question about __destruct()

2008-10-21 Thread Stut

On 21 Oct 2008, at 22:08, Jochem Maas wrote:

Mike van Riel schreef:

Dan Joseph wrote:

Hi,

I want to make sure I completely understand __destruct() and when  
its

hit...

Understand that it will run if all references to a particular  
object are

removed, but is that also true when a page ends its execution?

Example, I call a database class.  It constructs, connects, then  
my page
pulls some stuff out of the database, and then the php script  
ends.  Does

this also cause the deconstruct to execute?



When a script ends everything is released (with some small  
exceptions),

thus also all references to instances of classes.
Thus AFAIK a deconstructor will always be called at the end of script
execution.



but you have no control over what order dtors are called and you  
can't make
any assumptions about state of file handles to STDIN/STDOUT and  
things like

that ... personally I find dtors run at end of script to be nigh on
useless.


I use destructors to update dirty objects in memcache. I also use them  
in my template class to optionally automagically output the footer  
without needing an explicit call on each page.


They're far from useless.

-Stut

--
http://stut.net/

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



Re: [PHP] Re: Question about __destruct()

2008-10-21 Thread Jochem Maas
Stut schreef:
 On 21 Oct 2008, at 22:08, Jochem Maas wrote:
 Mike van Riel schreef:
 Dan Joseph wrote:
 Hi,

 I want to make sure I completely understand __destruct() and when its
 hit...

 Understand that it will run if all references to a particular object
 are
 removed, but is that also true when a page ends its execution?

 Example, I call a database class.  It constructs, connects, then my
 page
 pulls some stuff out of the database, and then the php script ends. 
 Does
 this also cause the deconstruct to execute?


 When a script ends everything is released (with some small exceptions),
 thus also all references to instances of classes.
 Thus AFAIK a deconstructor will always be called at the end of script
 execution.


 but you have no control over what order dtors are called and you can't
 make
 any assumptions about state of file handles to STDIN/STDOUT and things
 like
 that ... personally I find dtors run at end of script to be nigh on
 useless.
 
 I use destructors to update dirty objects in memcache. 

care to eloborate ... sounds interesting.

I also use them
 in my template class to optionally automagically output the footer
 without needing an explicit call on each page.

not sure if I find that of much use, I see the validity but 1 LOC to
eplicitly output a page footer seems to me to be less of a wtf than
an(other) bit of auto-magic to save what is probably a very short simple
method call.

 They're far from useless.

true. but they are limited, there is no garantee any other object
will still exist when a particular dtor is run [at shutdown] which means a 
heavy OO
codebase cannot have object automated object interaction at shutdown ... there
are other gotchas (e.g. closed file descriptors to STDIN/STDOUT)

interaction with memcache though is a really good example. and I'd like to
learn a little more :-D

 -Stut
 


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



RE: [PHP] How to Execute Exe File from PHP

2008-10-21 Thread Alice Wei

HI, 

  To answer your questions, I run this on Windows. What is so weird is that 
when I do 

$a= shell_exec(C:\Inetpub\wwwroot\/test.exe -m$market -d$length);
echo $a;

It works, and echoes everything as it is supposed to, and the file is also 
generated like I expected. However, the PHP file where I execute this from is 
in the same folder (which is why I thought using a . would work) 

Could anyone please tell me if this is only way Ito do this on a Windows 
machine? 

Thanks in advance, I think I am getting a little confused.

Alice



_
Search from any Web page with powerful protection. Get the FREE Windows Live 
Toolbar Today!
http://get.live.com/toolbar/overview
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] -help

2008-10-21 Thread devta singh
-- 
-
Devta Singh
http://yogakundalini.com/
http://devta.wordpress.com/
Nada hay como ver despertar a otros y verles expandir su conciencia, salvo
hacerlo uno mismo.


Re: [PHP] ZendOptimizer + APC

2008-10-21 Thread Nathan Nobbe
On Tue, Oct 21, 2008 at 10:35 AM, Jochem Maas [EMAIL PROTECTED] wrote:

 anyone know whether running ZendOptimizer + APC simultaneously still causes
 allsorts
 of problems ... I know it did in the past but I can't find any very recent
 stuff about the
 issues online.


never tried it, but 2 small things worth a mention;

1. supposedly eacellerator has some sort of optimizer
2. apc is getting optimization support, but im not sure when it will usable

-nathan


[PHP] Mysql search

2008-10-21 Thread Ryan S
Hey all,
I have two columns in my DB 
title varchar(254)
 and 
jtext text

which I would like to search, as the user might enter two or more words I am 
opting not to use LIKE %search_term% so started searching google, I came across 
this very promising class:
http://code.activestate.com/recipes/125901/

but when i tried to run it I am just getting a blank page, no errors or 
anything.

Am hoping someone out there can recommend a better script or maybe share some 
of your own code?

Any help would be appreciated.

Thanks,
Ryan

 --
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



  

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



Re: [PHP] Mysql search

2008-10-21 Thread Robert Cummings
On Tue, 2008-10-21 at 21:48 -0700, Ryan S wrote:
 Hey all,
 I have two columns in my DB 
 title varchar(254)
  and 
 jtext text
 
 which I would like to search, as the user might enter two or more words I am 
 opting not to use LIKE %search_term% so started searching google, I came 
 across this very promising class:
 http://code.activestate.com/recipes/125901/
 
 but when i tried to run it I am just getting a blank page, no errors or 
 anything.
 
 Am hoping someone out there can recommend a better script or maybe share some 
 of your own code?
 
 Any help would be appreciated.

Do it right... read up on MySQL's fulltext matching.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



[PHP] Re: class and inheritance

2008-10-21 Thread Alain Roger
basically i did this but Zend studio for eclipse does not show me the data
or methods members after one - :-(

On Tue, Oct 21, 2008 at 9:11 PM, Maciek Sokolewicz [EMAIL PROTECTED]wrote:

 Alain Roger wrote:

 Hi,

 I'm trying to create a class that has as public members some other class
 object.
 for that i use almost the same syntax as under C# or C++.

 header class:

  ?php
 class CARMainHeader
 {
// title of the main table header
private $mTitle = null;

// holds the height of the table header
private $mHeight = null;

// constructor
public function __construct()
{
$this-mHeight = 15;
$this-mTitle = Title;
}

// set the title of the main table
public function SetTitle($name)
{
$this-mTitle = $name;
}

// return the title of the main table
public function GetTitle()
{
return $this-mTitle;
}

// set the height of the header
public function SetHeight($height)
{
$this-mHeight = $height;
}

// return the height of the header
public function GetHeight()
{
return $this-mHeight;
}
 }
 ?


 main class code :

  ?php
 include_once 'CARMainHeader.php';

 class CARTable
 {
// holds the main table header object
public $mTableHeader = null;

// store the amount of columns in table
private $mColumnsCount = null;

// constructor
public function __construct()
{
$this-mTableHeader = new CARMainHeader();
}

// rendering of table
public function Render()
{
echo table;
echo tr /;
echo td class=''.$this-mTableHeader-;

 you're missing something here, don't you think? :)

echo /td;
echo td class='';
echo /td;
echo /table;
}
 }
 ?


 in the CARTable, i'm not able in the Render function to write
 $this-mTableHeader-GetTitle();
 why ?

  you can, and it works. Once you actually call that method.

 - Tul




-- 
Alain

Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008