php-general Digest 17 Jan 2009 20:10:35 -0000 Issue 5907
Topics (messages 286541 through 286567):
libphp5.so error
286541 by: Merlin Morgenstern
286542 by: Merlin Morgenstern
php5 with apache 1.x -> white page
286543 by: Merlin Morgenstern
286544 by: Merlin Morgenstern
286548 by: Nathan Rixham
286549 by: Ashley Sheridan
286551 by: Merlin Morgenstern
Re: Server cannot send emails
286545 by: Ashley Sheridan
286546 by: Morris
Re: What's the best way to rotate, resize, and thumbnail?
286547 by: Ashley Sheridan
Opinions / Votes Needed
286550 by: Nathan Rixham
286553 by: Tony Marston
286556 by: Skip Evans
286557 by: Jochem Maas
286558 by: Daniel Brown
286559 by: Jochem Maas
286560 by: Jochem Maas
286561 by: Per Jessen
286562 by: Eric Butera
286563 by: Nathan Rixham
286564 by: Nathan Rixham
286566 by: Per Jessen
286567 by: Jochem Maas
PMA_List_Database
286552 by: Merlin Morgenstern
Cookie Question
286554 by: PHP
286555 by: Török Alpár
286565 by: PHP
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 ---
Hi there,
I have installed php5.2.8 successfully on my suse test system. Now I
want to reproduce it on my prod system, but there is an error I can't
find a solution for.
I compiled php and the I did run configtest on apache 1.x
/etc/init.d/apachectl configtest
Syntax error on line 223 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp5.so into server:
/usr/local/apache/libexec/libphp5.so: symbol mysql_set_character_set,
version libmysqlclient_14 not defined in file libmysqlclient.so.14 with
link time reference
Any ideas? I do not want to upgrade to apache 2.x. I am kind of lost
right now. Thank you for any help!
Best regards, Merlin
--- End Message ---
--- Begin Message ---
Hi there,
I could solve this error. It was due to not compiling php with mdo which
is needed for mysql 3.x
Now I am running into a new strange error :-( Will post into a new topic.
Best regards,
Merlin
Merlin Morgenstern schrieb:
Hi there,
I have installed php5.2.8 successfully on my suse test system. Now I
want to reproduce it on my prod system, but there is an error I can't
find a solution for.
I compiled php and the I did run configtest on apache 1.x
/etc/init.d/apachectl configtest
Syntax error on line 223 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp5.so into server:
/usr/local/apache/libexec/libphp5.so: symbol mysql_set_character_set,
version libmysqlclient_14 not defined in file libmysqlclient.so.14 with
link time reference
Any ideas? I do not want to upgrade to apache 2.x. I am kind of lost
right now. Thank you for any help!
Best regards, Merlin
--- End Message ---
--- Begin Message ---
Hi there,
after strugling a while with the installation of php5 on an older suse
system with mysql 3.x and apache 1.x I got it compiled and installed.
Apache starts and there are processes running, even the access log shows
access to it. Response is 500 (internal error). The page itself does
not load and it shows only a white page. I can not find any entry inside
a log that show unnormal hints.
Any idea where I could look for the error? I tried php error log file
and var/log/messages.
Thank you for any help.
Merlin
--- End Message ---
--- Begin Message ---
got it :-) Both are needed!
--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql/'
Merlin Morgenstern schrieb:
Hi there,
after strugling a while with the installation of php5 on an older suse
system with mysql 3.x and apache 1.x I got it compiled and installed.
Apache starts and there are processes running, even the access log shows
access to it. Response is 500 (internal error). The page itself does
not load and it shows only a white page. I can not find any entry inside
a log that show unnormal hints.
Any idea where I could look for the error? I tried php error log file
and var/log/messages.
Thank you for any help.
Merlin
--- End Message ---
--- Begin Message ---
Merlin Morgenstern wrote:
got it :-) Both are needed!
--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql/'
Merlin Morgenstern schrieb:
Hi there,
after strugling a while with the installation of php5 on an older suse
system with mysql 3.x and apache 1.x I got it compiled and installed.
Apache starts and there are processes running, even the access log
shows access to it. Response is 500 (internal error). The page
itself does not load and it shows only a white page. I can not find
any entry inside a log that show unnormal hints.
Any idea where I could look for the error? I tried php error log file
and var/log/messages.
Thank you for any help.
Merlin
nice to see somebody answering there own questions - you should just
email them to yourself :p
--- End Message ---
--- Begin Message ---
On Sat, 2009-01-17 at 15:31 +0000, Nathan Rixham wrote:
> Merlin Morgenstern wrote:
> >
> >
> > got it :-) Both are needed!
> > --with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql/'
> >
> > Merlin Morgenstern schrieb:
> >> Hi there,
> >>
> >> after strugling a while with the installation of php5 on an older suse
> >> system with mysql 3.x and apache 1.x I got it compiled and installed.
> >>
> >> Apache starts and there are processes running, even the access log
> >> shows access to it. Response is 500 (internal error). The page
> >> itself does not load and it shows only a white page. I can not find
> >> any entry inside a log that show unnormal hints.
> >>
> >> Any idea where I could look for the error? I tried php error log file
> >> and var/log/messages.
> >>
> >> Thank you for any help.
> >>
> >> Merlin
>
> nice to see somebody answering there own questions - you should just
> email them to yourself :p
>
But you'd have to have some sort of if($question == 'really complex')
just to make sure you don't get stuck in an infinite loop of recursive
answering ;)
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Ashley Sheridan schrieb:
On Sat, 2009-01-17 at 15:31 +0000, Nathan Rixham wrote:
Merlin Morgenstern wrote:
got it :-) Both are needed!
--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql/'
Merlin Morgenstern schrieb:
Hi there,
after strugling a while with the installation of php5 on an older suse
system with mysql 3.x and apache 1.x I got it compiled and installed.
Apache starts and there are processes running, even the access log
shows access to it. Response is 500 (internal error). The page
itself does not load and it shows only a white page. I can not find
any entry inside a log that show unnormal hints.
Any idea where I could look for the error? I tried php error log file
and var/log/messages.
Thank you for any help.
Merlin
nice to see somebody answering there own questions - you should just
email them to yourself :p
But you'd have to have some sort of if($question == 'really complex')
just to make sure you don't get stuck in an infinite loop of recursive
answering ;)
Ash
www.ashleysheridan.co.uk
yeah...sorry guys :-) I just wanted to answer since I thought it might
be helpful for somebody else.
Merlin
--- End Message ---
--- Begin Message ---
On Fri, 2009-01-16 at 15:25 +0100, Sergio Jovani wrote:
> Hi,
>
> Thanks for replying. Adding "From" header did not solve the problem.
> I'm thinking is a server limitation. Could it be?
>
> 2009/1/16 Thiago H. Pojda <[email protected]>:
> > On Fri, Jan 16, 2009 at 10:36 AM, Sergio Jovani <[email protected]> wrote:
> >>
> >> Hi!
> >>
> >> I have working at SourceForge.net project web space Drupal as CMS. I
> >> have many modules installed related with email like Contact, Notify...
> >> This modules never worked and I tried send an email from email php
> >> function. I did it with:
> >>
> >> <?php
> >> $to = "[email protected]";
> >> $subject = "Hi!";
> >> $body = "Hi,\n\nHow are you?";
> >> if (mail($to, $subject, $body)) {
> >> echo("<p>Message successfully sent!</p>");
> >> } else {
> >> echo("<p>Message delivery failed...</p>");
> >> }
> >> ?>
> >>
> >> This does not work too. Is there any issue with email sending from
> >> SourceForge.net?
> >
> >
> > Looks like you're missing the "From: " part of the email. That's probably
> > your issue. I never used sourceforge, but I know many hostings require you
> > to specify a sender.
> >
> > from http://php.net/manual/en/function.mail.php
> >
> > <?php
> > $to = '[email protected]';
> > $subject = 'the subject';
> > $message = 'hello';
> > $headers = 'From: [email protected]' . "\r\n" .
> > 'Reply-To: [email protected]' . "\r\n" .
> > 'X-Mailer: PHP/' . phpversion();
> >
> > mail($to, $subject, $message, $headers);
> > ?>
> >
> >
> > Thiago Henrique Pojda
> > http://nerdnaweb.blogspot DOT com
> >
> >
> >
>
What's the return code you get from your mail() call?
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
If you are using apache + php, check php.in your server is able to support
the mail() function and you have correctly set up the send and return
address.
2009/1/17 Ashley Sheridan <[email protected]>
> On Fri, 2009-01-16 at 15:25 +0100, Sergio Jovani wrote:
> > Hi,
> >
> > Thanks for replying. Adding "From" header did not solve the problem.
> > I'm thinking is a server limitation. Could it be?
> >
> > 2009/1/16 Thiago H. Pojda <[email protected]>:
> > > On Fri, Jan 16, 2009 at 10:36 AM, Sergio Jovani <[email protected]>
> wrote:
> > >>
> > >> Hi!
> > >>
> > >> I have working at SourceForge.net project web space Drupal as CMS. I
> > >> have many modules installed related with email like Contact, Notify...
> > >> This modules never worked and I tried send an email from email php
> > >> function. I did it with:
> > >>
> > >> <?php
> > >> $to = "[email protected]";
> > >> $subject = "Hi!";
> > >> $body = "Hi,\n\nHow are you?";
> > >> if (mail($to, $subject, $body)) {
> > >> echo("<p>Message successfully sent!</p>");
> > >> } else {
> > >> echo("<p>Message delivery failed...</p>");
> > >> }
> > >> ?>
> > >>
> > >> This does not work too. Is there any issue with email sending from
> > >> SourceForge.net?
> > >
> > >
> > > Looks like you're missing the "From: " part of the email. That's
> probably
> > > your issue. I never used sourceforge, but I know many hostings require
> you
> > > to specify a sender.
> > >
> > > from http://php.net/manual/en/function.mail.php
> > >
> > > <?php
> > > $to = '[email protected]';
> > > $subject = 'the subject';
> > > $message = 'hello';
> > > $headers = 'From: [email protected]' . "\r\n" .
> > > 'Reply-To: [email protected]' . "\r\n" .
> > > 'X-Mailer: PHP/' . phpversion();
> > >
> > > mail($to, $subject, $message, $headers);
> > > ?>
> > >
> > >
> > > Thiago Henrique Pojda
> > > http://nerdnaweb.blogspot DOT com
> > >
> > >
> > >
> >
> What's the return code you get from your mail() call?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Fri, 2009-01-16 at 20:38 -0500, Al wrote:
>
> port23user wrote:
> > I have a site (done in CodeIgniter) where users can upload pictures. When
> > they upload a picture, I want to rotate it (rotating is optional, depending
> > on how much cpu/ram I end up needing), resize it, and create a thumbnail.
> > Right now I'm doing it all in that order using GD, but I'm not sure if it's
> > as efficient as it could be. What's the best way to make this process
> > faster?
>
> Imagick class. Has more image manipulating functions than you'll ever use.
> You
> name, and there's function to do it.
>
GD is faster than ImageMagik, so if you can do it with that, keep on.
ImageMagick is only useful for the extra functionality it brings to the
table.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Afternoon all,
I'd love to get some votes from my fellow developers on the following,
and indeed some opinions (especially from those who disagree).
Recently I've been running in to a lot of frustrations with PHP when
dealing with Classes and Objects. Personally I strongly feel that these
need added in to PHP 6, for multiple reasons.
I don't think the scope of this discussion covers the syntax of any
implementation, just if it needs implemented or not.
a: Optional Static Typing
I'm finding an ever increasingly need to be able to staticly type
properties, parameters, return types etc (in classes) I know there is
type hinting but it's just not enough to do what one needs. Additionally
support for staticly typing primatives. Here's an example:
<?php
class Example {
private ClassName $obj; // class typed property
public bool $primativeBool; // primative typed property
// typed returns
public function getObj() ClassName {
return $this->obj;
}
// already implemented
public function setObj(ClassName $obj) {
$this->obj = $obj;
}
// privative type hint (not implemented)
public function setPrimativeBool(bool $primativeBool) {
$this->primativeBool = $primativeBool;
}
public function someMethod() {
// also for variables
VariableType $variable = new VariableType();
}
}
?>
b: Object superclass
A base class type which all objects automagically extend, with (if
nothing else) a unique id / hashcode for each object (much like the Java
Object class). Failing this some form of function to get a unique
reference string for any variable. Example
<?php
$someClassInstance = new SomeClass();
// method on all objects that returns a unique
// id for that object
$objectId = $someClassInstance->hashCode();
// or by a function
$objectId = get_hashcode($someClassInstance);
// and for variables
$aString = 'some string';
$stringId = get_hashcode($aString);
?>
c: Method overloading
TBH it's something I could live without, whereas a/b aren't, but it
would be an ideal addition to php?
<?php
class Example {
public function someMethod(ClassType $arg0) {
}
public function someMethod(ClassType $arg0, bool $arg1) {
}
}
?>
Thoughts, Opinions, Votes? would love to hear from you guys on this
Regards!
--- End Message ---
--- Begin Message ---
"Nathan Rixham" <[email protected]> wrote in message
news:[email protected]...
> Afternoon all,
>
> I'd love to get some votes from my fellow developers on the following, and
> indeed some opinions (especially from those who disagree).
>
> Recently I've been running in to a lot of frustrations with PHP when
> dealing with Classes and Objects. Personally I strongly feel that these
> need added in to PHP 6, for multiple reasons.
>
> I don't think the scope of this discussion covers the syntax of any
> implementation, just if it needs implemented or not.
>
> a: Optional Static Typing
> I'm finding an ever increasingly need to be able to staticly type
> properties, parameters, return types etc (in classes) I know there is type
> hinting but it's just not enough to do what one needs. Additionally
> support for staticly typing primatives. Here's an example:
If you really *need* to used a staticly typed language then don't use PHP,
and don't try to change PHP to match your needs.
> b: Object superclass
> A base class type which all objects automagically extend, with (if nothing
> else) a unique id / hashcode for each object (much like the Java Object
> class). Failing this some form of function to get a unique reference
> string for any variable. Example
Why should each class automaticaly extend a base class? For what purpose?
For what benefit? I can achieve what I want without this *feature*, so I
don't need it.
Why does each object need a unique id/hashcode? I have been using objects
for years without this so it is not necessary, and does not provide any
additional functionality.
Why do you need a unique reference string for each variable? WTF!
> c: Method overloading
> TBH it's something I could live without, whereas a/b aren't, but it would
> be an ideal addition to php?
PHP does not need method overloading as is found in other languages as it
has optional parameters with defaults. It is also possible to cast each
parameter into wahetever type is necessary. It achieves the same result but
using a different method.
>
> Thoughts, Opinions, Votes? would love to hear from you guys on this
>
> Regards!
Absolute rubbish! You have obviously been used to a different language and
have recently moved to PHP, but cannot get used to the fact that it *IS* a
different language, therefore it has different syntax and achieves similar
things in different ways. If your feeble brain can't handle the differences
then I suggest you stick with your previous language and LEAVE PHP ALONE!
That's just my opinion, of course.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
--- End Message ---
--- Begin Message ---
Wow, Tony, do you think in the future you could try to express
yourself with just a bit more civility and in a less
condescending tone?
Nathan expressed some thoughts he had, politely, and when out
of his way to come across in a non-critical and
non-confrontational manner.
Tony Marston wrote:
Absolute rubbish!
There's just no need to insult other list members like this.
Frankly, it's this kind of treatment that make these lists
less productive than they could be. It intimidates less
experienced programmers from asking good questions, lest they
get treated the way Nathan was. And isn't helping out less
experienced coders one of the reasons this list exists?
And it also makes others less inclined to participate, or drop
off the list entirely.
It's NOT just so we can blast each other and show off our
highly dubiously assumed superiority.
With all the frustrations we put up with in our daily lives, I
would hope a list like this, especially since we are among
colleagues, could be a place we could at least cautiously
expect to be treated with respect.
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
Nathan Rixham schreef:
> Afternoon all,
>
> I'd love to get some votes from my fellow developers on the following,
> and indeed some opinions (especially from those who disagree).
>
> Recently I've been running in to a lot of frustrations with PHP when
> dealing with Classes and Objects. Personally I strongly feel that these
> need added in to PHP 6, for multiple reasons.
>
> I don't think the scope of this discussion covers the syntax of any
> implementation, just if it needs implemented or not.
>
> a: Optional Static Typing
> I'm finding an ever increasingly need to be able to staticly type
> properties, parameters, return types etc (in classes) I know there is
> type hinting but it's just not enough to do what one needs. Additionally
> support for staticly typing primatives. Here's an example:
>
> <?php
> class Example {
>
> private ClassName $obj; // class typed property
an object should know and be able to control what goes into a
private property - no need to type it.
>
> public bool $primativeBool; // primative typed property
don't really see much use in public properties on the whole,
of an object is supposed to be self-sufficient blackboxy in nature
have the innards hanging out is rather counter-productive.
-1
>
> // typed returns
> public function getObj() ClassName {
> return $this->obj;
> }
>
this would only be useful if your doing some really heavy meta-programming,
which
essentially means shed-loads of reflection. not exactly performant in php.
besides how does the engine uphlod such a contract, it would be a beast
performance
wise to track each and every returned value from each call of such a method if
it's
even possible ... and then what happens if something other than ClassName was
returned?
do we get a fatal error as we do with typehinted parameters? that wouldn't
really help in terms of graceful error handling.
> // already implemented
> public function setObj(ClassName $obj) {
> $this->obj = $obj;
> }
I don't see much use for this given the fatal error you get if you pass in
the wrong thing, some code does benefit by being able to contract this stuff
and fix any mistakes at development time ... I use it sometimes.
> // privative type hint (not implemented)
> public function setPrimativeBool(bool $primativeBool) {
> $this->primativeBool = $primativeBool;
> }
doesn't really buy me anything. I'm merely offloading the responsibility
of casting paramter $X to the calling code rather than have the method just
deal with whatever it's given. this increases the developer burden and
the amount of code needed when using said method. I'd rather just do
something like:
class Foo {
function setBool($bVal) {
if (!is_bool($bVal) && !is_numeric($bVal)
throw new InputException("your sh** stinks!");
$this->myBool = (bool)$bVal;
}
}
> public function someMethod() {
> // also for variables
> VariableType $variable = new VariableType();
> }
this is nuts, they're zvals under the hood. if your code is so unclear
and unmaintainable that you can't manage to track/control a variable inside
a single method then something else is wrong.
again what happens when I stick something different in $variable, do
I get a fatal error ... not very helpful ... especially given the
interpreted nature of the language.
-1
-1
-1
> }
> ?>
>
> b: Object superclass
> A base class type which all objects automagically extend, with (if
> nothing else) a unique id / hashcode for each object (much like the Java
> Object class). Failing this some form of function to get a unique
> reference string for any variable. Example
http://php.net/manual/en/function.spl-object-hash.php
>
> <?php
> $someClassInstance = new SomeClass();
> // method on all objects that returns a unique
> // id for that object
> $objectId = $someClassInstance->hashCode();
>
> // or by a function
> $objectId = get_hashcode($someClassInstance);
> // and for variables
> $aString = 'some string';
> $stringId = get_hashcode($aString);
> ?>
I don't understand why you would need this. given that variables
only exist within the current scope such an id would be useless beyond
request boundaries. sharing [serialized] data between requests, users and/or
machines requires a somewhat more refined strategy (e.g. see how memcache
is used)
>
> c: Method overloading
> TBH it's something I could live without, whereas a/b aren't, but it
> would be an ideal addition to php?
>
> <?php
> class Example {
>
> public function someMethod(ClassType $arg0) {
>
> }
>
> public function someMethod(ClassType $arg0, bool $arg1) {
>
> }
-1
> }
> ?>
>
> Thoughts, Opinions, Votes? would love to hear from you guys on this
pretty much all of the above are adhoc wishes that are not well thought
out, with regard to functionality details or BC (the devil is in the details,
case in point being the namespace implementation ... if you followed it's
development you knoe about that ... I think your suggestion are much more
far reaching that namespaces).
php is dynamically typed it's counter intuitive to try and force it to behave
in a
statically typed manner. maybe a new compiled language using php syntax as basis
could do such things and if it was all implemented consistly then maybe it
would fly, but I don't think the php ecosystem is capable of supporting the
introduction of such stuff.
I guess it kind of comes down to 'use java' if that's what you prefer,
either way there is a snowballs chance in hell of this lot getting any serious
attention from php devs.
that lot was JMHO, no offence intended Nate :-).
> Regards!
>
--- End Message ---
--- Begin Message ---
Well, since Nathan asked especially for the opinions of those who
would disagree with him, I thought all was well....
On Sat, Jan 17, 2009 at 13:33, Tony Marston
<[email protected]> wrote:
>
> If your feeble brain can't handle the differences
> then I suggest you stick with your previous language and LEAVE PHP ALONE!
.... until this line. Can't quite tell if it's a joke or what it
was. Kinda' killed the validity of the rest of the message.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
--- End Message ---
--- Begin Message ---
Skip Evans schreef:
> Wow, Tony, do you think in the future you could try to express yourself
> with just a bit more civility and in a less condescending tone?
going on past experience ... I doubt it.
> Nathan expressed some thoughts he had, politely, and when out of his way
> to come across in a non-critical and non-confrontational manner.
Yeah, Nate's one of the good guys ... even though his idea's suck ;-)
> Tony Marston wrote:
>> Absolute rubbish!
>
> There's just no need to insult other list members like this.
You haven't been doing this very long have you? :-P
> Frankly, it's this kind of treatment that make these lists less
> productive than they could be. It intimidates less experienced
> programmers from asking good questions, lest they get treated the way
> Nathan was. And isn't helping out less experienced coders one of the
> reasons this list exists?
There's me thinking it was for comic relief and the occasional pissing
contest. must make a mental note of the above.
> And it also makes others less inclined to participate, or drop off the
> list entirely.
sometimes that's a good thing ... booing Crayon off stage was a community
service if you ask me.
> It's NOT just so we can blast each other and show off our highly
> dubiously assumed superiority.
If I was Robbert Cummings I'd nail you on your grammar at this point,
I don't want to steal his thunder so I won't.
> With all the frustrations we put up with in our daily lives, I would
> hope a list like this, especially since we are among colleagues, could
> be a place we could at least cautiously expect to be treated with respect.
Paris Hilton .... because it's everything to do with hope and just as
likely to happen.
PS - nothing serious about this mail, except maybe the first line, judge
for youself :-)
--- End Message ---
--- Begin Message ---
Daniel Brown schreef:
> Well, since Nathan asked especially for the opinions of those who
> would disagree with him, I thought all was well....
>
> On Sat, Jan 17, 2009 at 13:33, Tony Marston
> <[email protected]> wrote:
>> If your feeble brain can't handle the differences
>> then I suggest you stick with your previous language and LEAVE PHP ALONE!
>
> .... until this line. Can't quite tell if it's a joke or what it
> was. Kinda' killed the validity of the rest of the message.
I guess it's the old adage: "it's not what you say, it's the way that you say
it"
It's a pity his brain is wired directly to his arse, as opposed to his mouth,
because I believe his brain is actually quite sharp ... unfortunately it all
comes
out covered in ****.
PS - I must be bored, I've sent more posts in the last ten minutes than I have
in the last 6 months ;)
>
--- End Message ---
--- Begin Message ---
Tony Marston wrote:
> If you really *need* to used a staticly typed language then don't use
> PHP, and don't try to change PHP to match your needs.
+1
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
On Sat, Jan 17, 2009 at 2:42 PM, Daniel Brown <[email protected]> wrote:
> Well, since Nathan asked especially for the opinions of those who
> would disagree with him, I thought all was well....
>
> On Sat, Jan 17, 2009 at 13:33, Tony Marston
> <[email protected]> wrote:
>>
>> If your feeble brain can't handle the differences
>> then I suggest you stick with your previous language and LEAVE PHP ALONE!
>
> .... until this line. Can't quite tell if it's a joke or what it
> was. Kinda' killed the validity of the rest of the message.
Yea even I thought feeble was a bit over the top. ;)
--- End Message ---
--- Begin Message ---
Tony Marston wrote:
"Nathan Rixham" <[email protected]> wrote in message
a: Optional Static Typing
I'm finding an ever increasingly need to be able to staticly type
properties, parameters, return types etc (in classes) I know there is type
hinting but it's just not enough to do what one needs. Additionally
support for staticly typing primatives. Here's an example:
If you really *need* to used a staticly typed language then don't use PHP,
and don't try to change PHP to match your needs.
why not? php fills 95% of my needs in most instances, I'm as much a
valid user of php as you and php *could* change to fit my needs and
others, not without some appreciated work mind you, but it could (and
without affecting anybody else in this case)
it's a simple need: if I can type that my variable can only contain an
int, then I know it's always an int without tonnes of checks to check it
actually contains an int / is getting set with an int throughout the
rest of the app (especially when multiple dev's are working on it).
additionally this functionality would open the door to the creation of a
lot more apps and frameworks, not least the ability to create decent
ORM's. Further, it would allow people to contribute proper developers
classes that can be re-used time and time again (for instance a full set
of collections [class, hashmap, map, list, set etc etc]). Once they're
made and open source we all benefit, not only that but they could be
made by users instead of the internals team ;)
b: Object superclass
A base class type which all objects automagically extend, with (if nothing
else) a unique id / hashcode for each object (much like the Java Object
class). Failing this some form of function to get a unique reference
string for any variable. Example
Why should each class automaticaly extend a base class? For what purpose?
For what benefit? I can achieve what I want without this *feature*, so I
don't need it.
2 reasons:
1: it would allow all objects to have this uniqueid/hashcode i need
2: it would allow one to type hint Object in methods (you currently
can't) - you can method(array $var) but not method(object $var) see:
<?php
class Example {
public function someMethod(object $arg0) {
}
}
$e = new Example();
$e->someMethod( (object)'y' );
?>
returns: Catchable fatal error: Argument 1 passed to
Example::someMethod() must be an instance of object
Why does each object need a unique id/hashcode? I have been using objects
for years without this so it is not necessary, and does not provide any
additional functionality.
for comparison of equality, so you can make indexed arrays quickly using
the hashcode (you know like a hash table) so you can quickly tell the
difference between two instances of the same object with the same values
that are infact different, makes persisting data a 100 times easier...
Why do you need a unique reference string for each variable? WTF!
well because $a = 's'; $b = 's'; both are unique, internally php must
hold a reference of some sort to each variable and where it's stored
that is entirely unique; it would simply be a case of exposing this
functionality /or/ adding functionality based on this.
c: Method overloading
TBH it's something I could live without, whereas a/b aren't, but it would
be an ideal addition to php?
PHP does not need method overloading as is found in other languages as it
has optional parameters with defaults. It is also possible to cast each
parameter into wahetever type is necessary. It achieves the same result but
using a different method.
the same functionality can be achieved, however not without a lot of
additional code to test variable types using conditional blocks with
lots of is_ and instanceof comparisons; adding method overloading is by
no means needed but would majorly simplify the code of scripts which
need this functionality.
Absolute rubbish! You have obviously been used to a different language and
have recently moved to PHP, but cannot get used to the fact that it *IS* a
different language, therefore it has different syntax and achieves similar
things in different ways. If your feeble brain can't handle the differences
then I suggest you stick with your previous language and LEAVE PHP ALONE!
actually I've been a senior php dev for 5 years and muddled along trying
to help people out on this list for a long time too - it is my primary
language, PHP always changes and the beauty of the language is that it
tries to allow people to program the way they want, hence it being both
procedural and object orientated, obviously there's a need for this
otherwise Type Hinting would never have been introduced.
PHP could easily be a one for all language and AFAIK the only major
functionality missing is static typing..? I'm not trying to knock PHP,
simply expand it's functionality and scope by having additional
*optional* functionality implemented - like namespaces, if you don't
like 'em don't use 'em.
That's just my opinion, of course.
and really thanks! gives me the chance to explain a bit more :p
ps: feeble lol
--- End Message ---
--- Begin Message ---
Per Jessen wrote:
Tony Marston wrote:
If you really *need* to used a staticly typed language then don't use
PHP, and don't try to change PHP to match your needs.
+1
I do.. mainly Java when I need it (can you tell)
point is..
Java let's me easily do 70% of what I need to
PHP let's me easily do 95% of what I need to
If we could get that 5% added then PHP would be perfect, not only that
but me and the rest of the team at work would be able to make our
multi-million pound enterprise projects in PHP instead of java; as would
so many others (that can't be a bad thing for PHP)
Additionally, rather sure you'd see a mass influx of people moving to
php, and applications created for it - even down to design tools such as
reverse and forward engineering between uml and php.
ack.. there's a tonne of amazing tools and frameworks for java, and I'm
sure that a vast majority of them are possible because of this static
typing (from orms to web service frameworks and all in between) - am I
so bad for wanting that for php and my fellow devs?
:p
--- End Message ---
--- Begin Message ---
Nathan Rixham wrote:
> Tony Marston wrote:
>>
>> If you really *need* to used a staticly typed language then don't use
>> PHP, and don't try to change PHP to match your needs.
>
> why not?
Because your desired functionality is already satisfied by other
programming languages. PHP is an interpreted language with all the
strengths and weaknesses that come with it. A need for static or
compile-time typing is a need for a different language, honestly.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
Nathan Rixham schreef:
> Tony Marston wrote:
>> "Nathan Rixham" <[email protected]> wrote in message
>>>
>>> a: Optional Static Typing
>>> I'm finding an ever increasingly need to be able to staticly type
>>> properties, parameters, return types etc (in classes) I know there is
>>> type hinting but it's just not enough to do what one needs.
>>> Additionally support for staticly typing primatives. Here's an example:
>>
>> If you really *need* to used a staticly typed language then don't use
>> PHP, and don't try to change PHP to match your needs.
>
> why not? php fills 95% of my needs in most instances, I'm as much a
> valid user of php as you and php *could* change to fit my needs and
> others, not without some appreciated work mind you, but it could (and
> without affecting anybody else in this case)
>
> it's a simple need: if I can type that my variable can only contain an
> int, then I know it's always an int without tonnes of checks to check it
> actually contains an int / is getting set with an int throughout the
> rest of the app (especially when multiple dev's are working on it).
there are other ways of tackling this, but the biggest problem is handling
the case when such a placeholder has something other than the given type
stuffed into it ... typehint currently give a fatal error, not condusive
to elegant error handling.
>
> additionally this functionality would open the door to the creation of a
> lot more apps and frameworks, not least the ability to create decent
> ORM's. Further, it would allow people to contribute proper developers
> classes that can be re-used time and time again (for instance a full set
> of collections [class, hashmap, map, list, set etc etc]). Once they're
> made and open source we all benefit, not only that but they could be
> made by users instead of the internals team ;)
gotta say that I think array() covers hashmap, map and list pretty well :-P
>>> b: Object superclass
>>> A base class type which all objects automagically extend, with (if
>>> nothing else) a unique id / hashcode for each object (much like the
>>> Java Object class). Failing this some form of function to get a
>>> unique reference string for any variable. Example
>>
>> Why should each class automaticaly extend a base class? For what
>> purpose? For what benefit? I can achieve what I want without this
>> *feature*, so I don't need it.
>
> 2 reasons:
> 1: it would allow all objects to have this uniqueid/hashcode i need
okay ... why do you need it. I don't grok the use personally but I'd
like to hear your use case.
> 2: it would allow one to type hint Object in methods (you currently
> can't) - you can method(array $var) but not method(object $var) see:
try this snippet on for size:
function test(stdClass $o) { var_dump($o); } $o = (object)1; test($o);
> <?php
> class Example {
> public function someMethod(object $arg0) {
> }
> }
>
> $e = new Example();
> $e->someMethod( (object)'y' );
> ?>
> returns: Catchable fatal error: Argument 1 passed to
> Example::someMethod() must be an instance of object
here in lies a big problem, it would involve a *major* change to
the way php works because you effectively would have to have the
engine start throwing exceptions ... that's unprecendented and
will most definitely break BC. not too mention there is a general
stance AFAICT in internals that forcing people to use exceptions
is a no-no.
>> Why does each object need a unique id/hashcode? I have been using
>> objects for years without this so it is not necessary, and does not
>> provide any additional functionality.
>
> for comparison of equality, so you can make indexed arrays quickly using
> the hashcode (you know like a hash table) so you can quickly tell the
> difference between two instances of the same object with the same values
> that are infact different, makes persisting data a 100 times easier...
>> Why do you need a unique reference string for each variable? WTF!
>
> well because $a = 's'; $b = 's'; both are unique, internally php must
> hold a reference of some sort to each variable and where it's stored
> that is entirely unique; it would simply be a case of exposing this
> functionality /or/ adding functionality based on this.
why do you need this at the userland level?
>
>>> c: Method overloading
>>> TBH it's something I could live without, whereas a/b aren't, but it
>>> would be an ideal addition to php?
>>
>> PHP does not need method overloading as is found in other languages as
>> it has optional parameters with defaults. It is also possible to cast
>> each parameter into wahetever type is necessary. It achieves the same
>> result but using a different method.
>
> the same functionality can be achieved, however not without a lot of
> additional code to test variable types using conditional blocks with
> lots of is_ and instanceof comparisons; adding method overloading is by
> no means needed but would majorly simplify the code of scripts which
> need this functionality.
>
>> Absolute rubbish! You have obviously been used to a different language
>> and have recently moved to PHP, but cannot get used to the fact that
>> it *IS* a different language, therefore it has different syntax and
>> achieves similar things in different ways. If your feeble brain can't
>> handle the differences then I suggest you stick with your previous
>> language and LEAVE PHP ALONE!
>
> actually I've been a senior php dev for 5 years and muddled along trying
> to help people out on this list for a long time too - it is my primary
> language, PHP always changes and the beauty of the language is that it
> tries to allow people to program the way they want, hence it being both
> procedural and object orientated, obviously there's a need for this
> otherwise Type Hinting would never have been introduced.
>
> PHP could easily be a one for all language and AFAIK the only major
> functionality missing is static typing..? I'm not trying to knock PHP,
> simply expand it's functionality and scope by having additional
> *optional* functionality implemented - like namespaces, if you don't
> like 'em don't use 'em.
>
>>
>> That's just my opinion, of course.
>>
>
> and really thanks! gives me the chance to explain a bit more :p
>
> ps: feeble lol
>
--- End Message ---
--- Begin Message ---
Hi guys..
here comes the last question for today :-)
Everything works fine. My Apps run beautiful with php5. The only thing
now left which does not work ist phpmyadmin. I googled the error msg,
but could only find servers which had the same problem. No solution to
find. Config looks fine. Maybe somebody has an idea. This is the msg:
Fatal error: Class 'PMA_List_Database' not found in
/home/www/tools/mysqladmin/libraries/common.inc.php on line 862
I have not changed the installation of phpmyadmin. Just went from 5.2.6
to 5.2.8 with a re-compile.
Merlin
--- End Message ---
--- Begin Message ---
Hi,
I am trying to get a cookie to set in Internet Explorer 7, I have tried several
different setcookie() configurations, this is the latest.
Yes, I read the manual and the user notes, but can't find anything specific
about the different security levels in IE.
$szCookieName = "MyCookie";
$nID = 2;
$expireTime = 60*60;
setcookie($szCookieName, $nID, time()-$expireTime,"/",www.mysite.com,false);
However, they all work, only if I have the Privacy slider set to low in IE's
options.
As soon as I go up to medium, it will not work.
And it works fine with firefox.
The only difference I can see is that Medium Security adds the rule:
Restricts first-party cookies that save information that can be used to contact
you without your implicit consent.
All I am storing is an integer value, why is IE seeing that as information that
can contact you?
Thanks for any help.
Chris
--- End Message ---
--- Begin Message ---
2009/1/17 PHP <[email protected]>
> Hi,
> I am trying to get a cookie to set in Internet Explorer 7, I have tried
> several different setcookie() configurations, this is the latest.
> Yes, I read the manual and the user notes, but can't find anything specific
> about the different security levels in IE.
>
> $szCookieName = "MyCookie";
> $nID = 2;
> $expireTime = 60*60;
>
> setcookie($szCookieName, $nID, time()-$expireTime,"/",www.mysite.com
> ,false);
is there any reason that you set the expire in the past? That is usually
used to delete a cookie, not set it. I had many problems with IE in general,
but cookies were never a problem.
>
>
> However, they all work, only if I have the Privacy slider set to low in
> IE's options.
> As soon as I go up to medium, it will not work.
>
> And it works fine with firefox.
>
> The only difference I can see is that Medium Security adds the rule:
>
> Restricts first-party cookies that save information that can be used to
> contact you without your implicit consent.
>
> All I am storing is an integer value, why is IE seeing that as information
> that can contact you?
>
> Thanks for any help.
>
> Chris
--
Torok, Alpar Istvan
--- End Message ---
--- Begin Message ---
Oops, copy and paste error, that is the cookie I was using to delete.
The one I am using to set is acutally:
setcookie($szCookieName, $nID,
time()+$expireTime,"/","www.mysite.com",false);
2009/1/17 PHP <[email protected]>
Hi,
I am trying to get a cookie to set in Internet Explorer 7, I have tried
several different setcookie() configurations, this is the latest.
Yes, I read the manual and the user notes, but can't find anything
specific
about the different security levels in IE.
$szCookieName = "MyCookie";
$nID = 2;
$expireTime = 60*60;
setcookie($szCookieName, $nID, time()-$expireTime,"/",www.mysite.com
,false);
is there any reason that you set the expire in the past? That is usually
used to delete a cookie, not set it. I had many problems with IE in
general,
but cookies were never a problem.
However, they all work, only if I have the Privacy slider set to low in
IE's options.
As soon as I go up to medium, it will not work.
And it works fine with firefox.
The only difference I can see is that Medium Security adds the rule:
Restricts first-party cookies that save information that can be used to
contact you without your implicit consent.
All I am storing is an integer value, why is IE seeing that as
information
that can contact you?
Thanks for any help.
Chris
--
Torok, Alpar Istvan
--- End Message ---