Re: [PHP] Class not used as an object (Scope Resolution Operator)

2011-06-13 Thread George Langley
Thanks all. Assuming is best then to add the static in this case. But 
it isn't required if I birthed an object first and referenced the object, 
correct? Am wanting to add some variables to the class so not calling the same 
query so many times...
Thanks again.

George

On 2011-06-09, at 5:23 PM, David Harkness wrote:

> All of the above with a clarification: they are instance methods which you
> are calling statically. The object is not instantiated in this case. PHP
> allows this but will issue an E_STRICT warning. To remove the warning just
> add "static" before each of them, assuming they are only ever called
> statically:
> 
> class myClass {
>   static function &doThis($passedVar) {
>   doSomething;
>   }
> 
>   static function &doThat($anotherVar) {
>   doSomethingElse;
>   }
> }
> 
> David


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



Re: [PHP] Re: Getting File Owner Name

2011-06-13 Thread Kranthi Krishna
this might be of use
http://php.net/posix-getpwnam
 

Kranthi.
http://goo.gl/e6t3


[PHP] Suggestion needed: Internet store script

2011-06-13 Thread Andre Polykanine
Hi everyone,
I'm  making  a  website  for a small company. The site itself is quite
easy to accomplish, but there are two problems: i18n and the store. So
I would like to have your suggestions about the store.
Here are the requirements:
1. Basic functionality (possibility to purchase without authorization,
maybe no basket).
2.  Accessibility  and  usability  by visually impaired persons, for the
admin  part included (that means, no complicated flash content and such
features).
3. I18n capabilities (unicode of course). We need it to be in English,
Russian, and Swedish since it's a Swedish company.
4.  It  should  be  freeware  (or,  if  it's  really  impossible,  not
expensive).
5. It should be Php+MySql.
Thanks!
  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



Re: [PHP] date.timezone set and still getting strict warnings.

2011-06-13 Thread Daniel Brown
On Mon, Jun 13, 2011 at 16:25, Tamara Temple  wrote:
> I have date.timezone set, as shown in the phpinfo() output:
>
> portfolio:Downloads tamara$ php -r 'phpinfo();' | grep 'timezone'
> Default timezone => America/Chicago
> date.timezone => 'America/Chicago' => 'America/Chicago'

That's the CLI version of PHP

> Yet, when I call a function like strtotime(), i still get the Strict warning
> about not having date.timezone set. (Yes, I have restarted the server,
> twice, and the correct value shows up if I invoke phpinfo() via the server.)

 and you're referencing the web version here.

> Any clues?

Check the web version of PHP's phpinfo() output and see if it and
the CLI are using the same php.ini file.  My guess is that they're
not, and - while the CLI one is set with the timezone - its web
counterpart is missing the flag.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Uncatchable errors

2011-06-13 Thread David Harkness
On Mon, Jun 13, 2011 at 12:52 PM, Paul M Foster 
wrote:
>
> There's certain class of errors which happen before any error-handler
> (set_error_handler) can catch them, like parse errors and such. Is there
> a way to have these generate the same type of response as the errors
> handled by set_error_handler()?

You can use register_shutdown_function() [1] and error_get_last() [2] to
check if the last error type is one of the fatal errors. Here's a simple
example:

function shutdown() {
$error = error_get_last();
if ($error['type'] === E_ERROR) {
// fatal error has occured
}
}

register_shutdown_function('shutdown');

There are at least four fatal error types to check for. See [3] and [4] for
the list and links to more examples.

Peace,
David

[1] http://php.net/manual/en/function.register-shutdown-function.php
[2] http://php.net/manual/en/function.error-get-last.php
[3]
http://stackoverflow.com/questions/3108361/php-is-there-a-way-to-redirect-to-an-error-page-in-register-shutdown-function
[4]
http://stackoverflow.com/questions/4410632/handle-fatal-errors-in-php-using-register-shutdown-function


[PHP] date.timezone set and still getting strict warnings.

2011-06-13 Thread Tamara Temple

I have date.timezone set, as shown in the phpinfo() output:

portfolio:Downloads tamara$ php -r 'phpinfo();' | grep 'timezone'
Default timezone => America/Chicago
date.timezone => 'America/Chicago' => 'America/Chicago'

Yet, when I call a function like strtotime(), i still get the Strict  
warning about not having date.timezone set. (Yes, I have restarted the  
server, twice, and the correct value shows up if I invoke phpinfo()  
via the server.)


Any clues?



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



Re: [PHP] Uncatchable errors

2011-06-13 Thread Stuart Dallas
On Mon, Jun 13, 2011 at 8:52 PM, Paul M Foster wrote:

> There's certain class of errors which happen before any error-handler
> (set_error_handler) can catch them, like parse errors and such. Is there
> a way to have these generate the same type of response as the errors
> handled by set_error_handler()? In my case, the error handler emails me
> a summary and trace of the error. Any way to have things like parse
> errors do the same thing?
>
> Pointers to prior threads would do fine.
>

The only way to do this is to run your PHP script inside another process
(PHP or otherwise), piping the output accordingly so you can detect errors
that cannot be caught by the error handler.

However, statically detectable issues such as parse errors should never get
as far as a dynamic environment outside of your development machine, so I
would question why you have this requirement.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


[PHP] Uncatchable errors

2011-06-13 Thread Paul M Foster
There's certain class of errors which happen before any error-handler
(set_error_handler) can catch them, like parse errors and such. Is there
a way to have these generate the same type of response as the errors
handled by set_error_handler()? In my case, the error handler emails me
a summary and trace of the error. Any way to have things like parse
errors do the same thing?

Pointers to prior threads would do fine.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



[PHP] Re: Getting File Owner Name

2011-06-13 Thread Jim Giner
fileowner returns the username OF the file's OWNER.  Isn't that what you 
want?  You don't think you're going to get their first and last name do you?
"Floyd Resler"  wrote in message 
news:693f2104-a45d-403f-9c1d-13ad6e4fc...@adex-intl.com...
Is there a way I can get the name of a file's owner.  I know I can get the 
username by doing this:
posix_getpwuid(fileowner($filename));

How can I get the actual name of the owner?

Thanks!
Floyd



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



[PHP] Getting File Owner Name

2011-06-13 Thread Floyd Resler
Is there a way I can get the name of a file's owner.  I know I can get the 
username by doing this:
posix_getpwuid(fileowner($filename));

How can I get the actual name of the owner?

Thanks!
Floyd


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



Re: [PHP] Re: [pmwiki-users] debugging using error_log stuff

2011-06-13 Thread Tamara Temple


On Jun 13, 2011, at 11:59 AM, Tamara Temple wrote:



On Jun 13, 2011, at 4:05 AM, Richard Quadling wrote:


On 12 June 2011 22:57, Tamara Temple  wrote:


On Jun 12, 2011, at 4:32 PM, Peter Bowers wrote:

On Sun, Jun 12, 2011 at 3:18 PM, Tamara Temple >

wrote:


function sms($text,$switch=0){
 global $MessagesFmt;
 error_log(date(DATE_RFC822)." Entered sms. text=$text.
switch=$switch\n",3,"/var/log/pmwiki/error.log");
 if ($switch == true || is_array($text)) {
 $MessagesFmt[] = "" . print_r($text,true) .
"\n";
 } else {
 $MessagesFmt[] = $text . "\n";
 }


#   error_log(date(DATE_RFC822)." Exit sms.\n");
error_log(date(DATE_RFC822)." Exit
sms.\n",3,"/var/log/pmwiki/error.log");


}


Missing arguments #2 and #3 -- try as modified above.

-Peter


D'oh. Sometimes you stare and stare and stare at something and you  
still

don't see it. Thanks a bunch.



Would the use of ...

error_reporting(-1);
ini_set('display_errors', 1);

have helped during your development?


I'm not sure it would have in this case, as there were no errors  
from the PHP side of things -- what I had done was perfectly  
acceptable to PHP. error_log doesn't require the last 2 arguments  
and did send the message to the PHP error log with no problems. I  
just wasn't looking there...


I do set those values when I'm developing and testing an application  
typically, though, so that is good advice in general.




It's not Friday, but a general discussion of testing and debugging PHP  
might be a good thing, no?



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



Re: [PHP] Re: [pmwiki-users] debugging using error_log stuff

2011-06-13 Thread Tamara Temple


On Jun 13, 2011, at 4:05 AM, Richard Quadling wrote:


On 12 June 2011 22:57, Tamara Temple  wrote:


On Jun 12, 2011, at 4:32 PM, Peter Bowers wrote:

On Sun, Jun 12, 2011 at 3:18 PM, Tamara Temple >

wrote:


function sms($text,$switch=0){
  global $MessagesFmt;
  error_log(date(DATE_RFC822)." Entered sms. text=$text.
switch=$switch\n",3,"/var/log/pmwiki/error.log");
  if ($switch == true || is_array($text)) {
  $MessagesFmt[] = "" . print_r($text,true) .
"\n";
  } else {
  $MessagesFmt[] = $text . "\n";
  }


#   error_log(date(DATE_RFC822)." Exit sms.\n");
 error_log(date(DATE_RFC822)." Exit
sms.\n",3,"/var/log/pmwiki/error.log");


}


Missing arguments #2 and #3 -- try as modified above.

-Peter


D'oh. Sometimes you stare and stare and stare at something and you  
still

don't see it. Thanks a bunch.



Would the use of ...

error_reporting(-1);
ini_set('display_errors', 1);

have helped during your development?


I'm not sure it would have in this case, as there were no errors from  
the PHP side of things -- what I had done was perfectly acceptable to  
PHP. error_log doesn't require the last 2 arguments and did send the  
message to the PHP error log with no problems. I just wasn't looking  
there...


I do set those values when I'm developing and testing an application  
typically, though, so that is good advice in general.



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



Re: [PHP] Re: [pmwiki-users] debugging using error_log stuff

2011-06-13 Thread Richard Quadling
On 12 June 2011 22:57, Tamara Temple  wrote:
>
> On Jun 12, 2011, at 4:32 PM, Peter Bowers wrote:
>
>> On Sun, Jun 12, 2011 at 3:18 PM, Tamara Temple 
>> wrote:
>>>
>>> function sms($text,$switch=0){
>>>       global $MessagesFmt;
>>>       error_log(date(DATE_RFC822)." Entered sms. text=$text.
>>> switch=$switch\n",3,"/var/log/pmwiki/error.log");
>>>       if ($switch == true || is_array($text)) {
>>>               $MessagesFmt[] = "" . print_r($text,true) .
>>> "\n";
>>>       } else {
>>>               $MessagesFmt[] = $text . "\n";
>>>       }
>>
>> #       error_log(date(DATE_RFC822)." Exit sms.\n");
>>      error_log(date(DATE_RFC822)." Exit
>> sms.\n",3,"/var/log/pmwiki/error.log");
>>>
>>> }
>>
>> Missing arguments #2 and #3 -- try as modified above.
>>
>> -Peter
>
> D'oh. Sometimes you stare and stare and stare at something and you still
> don't see it. Thanks a bunch.
>

Would the use of ...

error_reporting(-1);
ini_set('display_errors', 1);

have helped during your development?


-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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