php-general Digest 25 Oct 2004 01:15:23 -0000 Issue 3072
Topics (messages 200189 through 200205):
Re: problem using error_reporting() PHP 5.0.2 (cli)
200189 by: Greg Donald
200192 by: Curt Zirzow
200194 by: Yashesh Bhatia
php_ftp.dll missing
200190 by: prgTW.poczta.onet.pl
200193 by: Frank M. Kromann
Re: PHP5 CLI Custom Error Reporting Doesn't Work as Expected
200191 by: Curt Zirzow
PHP5 Tutorials...?
200195 by: Michael Lauzon
200199 by: Matthew Sims
MySQL Scalability, part 2
200196 by: Kevin Grigorenko
overiding functions (constructors mostly)
200197 by: Walter Wojcik
200200 by: Daniel Schierbeck
200203 by: M Saleh EG
Classes and Interface tool
200198 by: Jonel Rienton
Is flock() necessary on a simple file append?
200201 by: Kevin Grigorenko
200202 by: Hristo Yankov
Rotating image using imagerotate creates large black area on image
200204 by: Brent Clements
200205 by: Matthew Weier O'Phinney
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Sun, 24 Oct 2004 16:41:16 +0530, Yashesh Bhatia <[EMAIL PROTECTED]> wrote:
> error_reporting(E_STRICT|E_ALL);
This does appear broken. I was unable to get E_STRICT to work at all
on my setup. PHP 5.02, and Apache 2.0.51.
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
--- End Message ---
--- Begin Message ---
* Thus wrote Yashesh Bhatia:
>
> My question is why is the funtion call
>
> error_reporting(E_ALL|E_STRICT);
>
> not enabling E_STRICT at runtime ?
<manual set_error_handler>
Note: The following error types cannot be handled with a user
defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING,
E_COMPILE_ERROR, E_COMPILE_WARNING, and E_STRICT.
</manual> ^^^^^^^^
Most E_STRICT errors occur during compile time, not at time of
execution.
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
thanks. anyplace i can find which errors are reported by E_STRICT at
runtime and which ones at compile time ?
thx.
yashesh bhatia.
On Sun, 24 Oct 2004 15:24:34 +0000, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> * Thus wrote Yashesh Bhatia:
> >
> > My question is why is the funtion call
> >
> > error_reporting(E_ALL|E_STRICT);
> >
> > not enabling E_STRICT at runtime ?
>
> <manual set_error_handler>
> Note: The following error types cannot be handled with a user
> defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING,
> E_COMPILE_ERROR, E_COMPILE_WARNING, and E_STRICT.
> </manual> ^^^^^^^^
>
> Most E_STRICT errors occur during compile time, not at time of
> execution.
>
> Curt
> --
> Quoth the Raven, "Nevermore."
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hello!
I don't have a file named php_ftp.dll, where can I find it?
I've added extension php_ftp.dll but Apache says I don't have this file :( Could You
send it to me in an attachment or tell me from where I can download this file.
Sorry for my bad English.
Best regards
Thomas from Poland
--- End Message ---
--- Begin Message ---
Hi Thomas,
What version of php are you using? Both PHP4 and PHP5 has the ftp
extension build-in so there is no need to load it.
- Frank
> Hello!
> I don't have a file named php_ftp.dll, where can I find it?
>
> I've added extension php_ftp.dll but Apache says I don't have this file
:( Could You send it to me in an attachment or tell me from where I can
download this file.
>
> Sorry for my bad English.
> Best regards
> Thomas from Poland
>
>
--- End Message ---
--- Begin Message ---
* Thus wrote Daniel Talsky:
>...
> The main problem is that when I try something like a failed require()
> statement, my custom error reporting function tells me it got an
> E_WARNING, but it stops program execution, which is not what the docs
> say it should do.
>
> When I try some other fatal error like trying to call an undefined
> function foobar(), then it doesn't run my custom error loggin function
> at all, just stops program execution.
>...
> function pv_shell_error_logger(
> $errno, $errstr, $errfile, $errline){
>
> switch ($errno){
>
> case E_ERROR:
> print('E_ERROR'."\n");
> break;
>
> case E_WARNING:
> print('E_WARNING'."\n");
> break;
>...
>
> error_reporting(0);
> // set to the user defined error handler
> set_error_handler("pv_shell_error_logger",
> (E_ALL));
>
> // FIRST TEST, PRINTS 'E_WARNING'
> // But also stops program execution even though I'm not doing anything.
> //require ('foo');
If you notice the warning, its complaining about a file not being
able to be opened, not that the required failed. If you dont have
your errror_handler defined, php suppresses that warning because
it's futile to display since php is exiting anyway.
>
> // FIRST TEST, PRINTS NOTHING
> // And also stops program execution even though I'm not doing anything.
> //foobar();
This is simply cause you can't capture a FATAL error. The reason
why you can't catch these errors is because it is illegal to
execute anymore php code if php is exiting.
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
Where can I find detailed PHP5 tutorials, but written for the
beginner...they must be online tutorials as I cannot afford any
computer books at the moment?!
--
Michael Lauzon
http://phantasyrpg.com/main.php?view=9898
--- End Message ---
--- Begin Message ---
You can't really get much better than php.net, the best online
documentation for PHP.
http://us2.php.net/tut.php
--
--Matthew Sims
--<http://killermookie.org>
> Where can I find detailed PHP5 tutorials, but written for the
> beginner...they must be online tutorials as I cannot afford any
> computer books at the moment?!
>
> --
> Michael Lauzon
> http://phantasyrpg.com/main.php?view=9898
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi,
First, sorry for posting an attachment. Second, I fixed my problem to use
files, but I just had a general question:
Is it really scalable to use MySQL on every page hit as compared to writing
to files? Is it true that it only has a certain number of connections it
can open at a time (20-30?), and the contention is larger?
Thanks,
Kevin
--- End Message ---
--- Begin Message ---
I want to override the constructor for a class i am writing but when i try it says i
cant redefine it. Is the a whay to have two (or more) functions with the same name
that accept different agrumants and calls the right one based on the arguments (it
would have to be based on number of args because of the loose typing of php.).
"Knowledge is power, Those who have it must share with those who don't"
-Walter Wojcik
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
--- End Message ---
--- Begin Message ---
Walter Wojcik wrote:
I want to override the constructor for a class i am writing but when i try it says i cant redefine it. Is the a whay to have two (or more) functions with the same name that accept different agrumants and calls the right one based on the arguments (it would have to be based on number of args because of the loose typing of php.).
"Knowledge is power, Those who have it must share with those who don't"
-Walter Wojcik
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
No. But you can use func_num_args() to decide how many arguments the
constructor (or any other function) was called with, and then make your
decisions.
class Foo
{
public function __construct ()
{
if (func_num_args() > 2) {
$this->one(func_get_args());
} else {
$this->two(func_get_args());
}
}
protected function one ($args)
{
// foo
}
protected function two ($args)
{
// bar
}
}
--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com):
http://www.spreadfirefox.com/?q=user/register&r=6584
--- End Message ---
--- Begin Message ---
OR you could control ur method and have optional arguments in ur
argument list and decide what to do according to that.
e.g. public function _construct($param1=0, $param2="", $param3=null)
{
if($param1)
....
if($param2)
....
if($param3)
....
}
$obj=new className(1);
//Or
$obj=new className(1,"hello");
//Or
$obj=new className(0,"","some_value");
Bottom Line:
Optional arguments might be a workaround lack of polymorphism sometimes !
On Sun, 24 Oct 2004 22:59:25 +0200, Daniel Schierbeck <[EMAIL PROTECTED]> wrote:
> Walter Wojcik wrote:
>
>
> > I want to override the constructor for a class i am writing but when i try it says
> > i cant redefine it. Is the a whay to have two (or more) functions with the same
> > name that accept different agrumants and calls the right one based on the
> > arguments (it would have to be based on number of args because of the loose typing
> > of php.).
> >
> >
> > "Knowledge is power, Those who have it must share with those who don't"
> >
> > -Walter Wojcik
> >
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > vote.yahoo.com - Register online to vote today!
> No. But you can use func_num_args() to decide how many arguments the
> constructor (or any other function) was called with, and then make your
> decisions.
>
> class Foo
> {
> public function __construct ()
> {
> if (func_num_args() > 2) {
> $this->one(func_get_args());
> } else {
> $this->two(func_get_args());
> }
> }
>
> protected function one ($args)
> {
> // foo
> }
>
> protected function two ($args)
> {
> // bar
> }
> }
>
> --
> Daniel Schierbeck
>
> Help spread Firefox (www.getfirefox.com):
> http://www.spreadfirefox.com/?q=user/register&r=6584
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
M.Saleh.E.G
97150-4779817
--- End Message ---
--- Begin Message ---
hi again guys, is there a tool that can allow you view the available
interfaces of a class, like an object/class browser that can help you view
the signatures of those interfaces?
thanks and regards,
Jonel
--- End Message ---
--- Begin Message ---
Hi,
I am appending to a file one line of text on every page hit, so there could
be many occurrences of this append simultaneously. I am not opening for
write ("w") but for append ("a"). Do I need to use flock() to be sure there
are no issues? I am running on Solaris.
Thanks,
Kevin
--- End Message ---
--- Begin Message ---
append is the same as write (it requires write access
for example), so if you are gonna use flock for "w",
use it for "a" too.
=====
Join the Dark Forces Of Evil Coders!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Hi Guys,
I am working on some images and I am having some problems with image rotate.
I am using imagerotate($im, "-90", 0); but when I display the image, the first 1/4 of
the image has a large black splotch from left/top to right/bottom
Help!!
It's causing me fits.
Thanks,
Brent
--- End Message ---
--- Begin Message ---
* Brent Clements <[EMAIL PROTECTED]>:
> I am working on some images and I am having some problems with image =
> rotate.
>
> I am using imagerotate($im, "-90", 0); but when I display the image, the =
> first 1/4 of the image has a large black splotch from left/top to =
> right/bottom
It might be because the second argument to imagerotate() is supposed to
be a floating decimal, not a string. Try:
imagerotate($im, -90, 0);
and see what happens.
--
Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
--- End Message ---