[PHP] 100% CPU Usage somewhere in script - how to find it?

2009-01-18 Thread Alex Davies
Hi,

I use a (externally developed) library within my application which
used to work fine. However, after a recent update (which unfortunately
we can't roll back due to dependencies) I have crazy CPU loads - there
are ~20 cores in total on the webservers and they have gone from an
average utilization of ~5% to 99%. I am using lighttpd, and so I can
see the php-cgi processes using 99% all my CPU!

I have an extremely basic understanding of how to track this down, and
using XDebug and KCacheGrind I think that I have a pretty good idea
which area the problem lies in, but the problem is that because
whatever it is that has broken is using up the whole CPU everything
else slows down. Furthermore, it would appear that a large part of
what gets scheduled is luck because sometimes things are instant and
the same activity a short while later can take forever. However, based
on absolute CPU time's from this XDebug/KCacheGrind analysis and a gut
hunch based upon what has changed recently I think I know roughly what
it is. I do have a diff of the recent code change, and I have looked
at it to no avail.

My questions are:
- Is there a better way to see what is using up the CPU? There must be
a single loop or something talking to an external service, that is
using so much CPU user time. Is there a super-quick way to do to this?
I really need to know what function (or even line) is using all that
CPU time, because I can't spot it in the code. Perhaps this
information can be obtained from XDebug but I can't find it!
- If there is no such magic answer to this question, what is the
correct way to find such a phantom problem? Are there any other
applications that might be better?

If anyone has any personal recommendations for Consultants able to
look at and fix this sort of problem that would be much appreciated
too; I am now well out of my depth and sinking fast!

Many thanks for any help,

Alex

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Robert Cummings
On Sat, 2009-01-17 at 20:45 +0100, Jochem Maas wrote:
 Skip Evans schreef:
  Tony Marston wrote:
 
  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.

Hey dumbass... it's spelled Robert.

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] Re: Opinions / Votes Needed

2009-01-18 Thread Per Jessen
Nathan Rixham wrote:

 Per Jessen wrote:
 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
 
 
 why so strongly against having *optional* static typing?
 

You can't have your cake and eat it.  You can't/shouldn't have strong
and loose typing in the same language.  In my opinion.

 IMHO if it was to classify all the languages (specifically server side
 languages for web apps), PHP has 95% of the features i need, the rest
 come no where near, so it's the obvious candidate to get this
 remaining 5% that'd make it perfect and open it up to a whole set of
 new users and markets. 

_If_ the remaining 5% will really open it up to a whole set of new
users and markets, all you have to do is sit back and wait.  I'm not
so sure though. 

One of the great things about PHP is that it is easy and approachable
for beginners, also without formal computer science training.  Write
some code, bang it in a webserver, and bob's your uncle.
If we make PHP more complex, we might well lose that.  

By all means create a PHP++, but leave PHP as it is.  It has
enough feature-bloat already.



/Per Jessen, Zürich


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



Re: [PHP] 100% CPU Usage somewhere in script - how to find it?

2009-01-18 Thread Richard Heyes
 ...

This may be of some use, enabling you to find the areas that are
taking longer than others:

http://www.phpguru.org/downloads/Timer/Timer.phps

-- 
Richard Heyes

HTML5 Graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 17th)

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Per Jessen
Nathan Rixham wrote:

 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
 

I'm curious - can you list what the 25% are?

 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)

But why?  Why not use Java and J2EE and all that good stuff?  I'm not
much of a java fan myself, but you've got to give credit where credit
is due. 

 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?

No, you're not so bad :-) 

The point is - why not just use Java, when you really need the features?  


/Per Jessen, Zürich


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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Skip Evans s...@bigskypenguin.com wrote in message 
news:49723137.2010...@bigskypenguin.com...
 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.

Saying that someone's ideas are absolute rubbish is not an insult. Calling 
him a moron would be, but I did not.

 Frankly, it's this kind of treatment that make these lists less productive 
 than they could be.

And you think that his ideas for changing PHP to suit his particular 
programming style would be productive? I think not.

 It intimidates less experienced programmers from asking good questions,

What makes you think that he is an inexperienced programmer? What makes you 
think that these are good questions? He is saying that he doesn't like the 
way that PHP works and wants it changed to suit his personal needs.

 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.

If it stops feeble minded people from filling this forum with useless 
requests then surely that's a good thing? Personally I'm sick and tired from 
reading posts such as this which say I'm used to language X, and my feeble 
brain cannot cope with the differences, so why can't PHP be changed to 
behave like language X?

 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.

Then the OP should respect PHP for what it is, and not request changes that 
would make it unusable for 99.999% of  the millions of programmers who have 
already written millions of programs with it. PHP is successful because of 
the way it works, and changing the way it works, as suggested by the OP, 
would not make it more successful. On the contrary, I think that it would 
PHuck it up completely.

But that's just my opinion.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

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



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



[PHP] phpMailer Problem!

2009-01-18 Thread shahrzad khorrami
hi all,

I want to send email using SMTP Authentication with PHPMailer,
I searched more and more but I can't find anything of my problem

///
include_once('class.phpmailer.php');
include(class.smtp.php); // optional, gets called from within
class.phpmailer.php if not already loaded

$mail = new PHPMailer();
$mail-IsSMTP();

$mail-Host   = mail.xx.com;  // sets GMAIL as the SMTP
server
$mail-Port   = 80;

$mail-Username = webs...@xxx.com;  // SMTP username
$mail-Password = x; // SMTP password

$mail-From   = webs...@xx.com;
$mail-FromName   = First Last;

$mail-Subject= PHPMailer Test Subject via smtp;

$mail-AltBody= To view the message, please use an HTML compatible
email viewer!; // optional, comment out and test

$mail-MsgHTML(h);

$mail-AddAddress(xx...@gmail.com, John Doe);

//$mail-AddAttachment(images/phpmailer.gif); // attachment

if(!$mail-Send()) {
  echo Mailer Error:  . $mail-ErrorInfo;
} else {
  echo Message sent!;
}


result is nothing, no error but didn't send
then I remove Username   password, but didn't work!...



thanks,
shahrzad khorrami


[PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Nathan Rixham nrix...@gmail.com wrote in message 
news:49723749.4070...@gmail.com...
 Tony Marston wrote:
 Nathan Rixham nrix...@gmail.com 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)

ABSOLUTE RUBBISH! You cannot change PHP from being dynamicly typed to 
staticly typed without affecting 99% of the millions of programs which hav 
already been written.

Personally I love the idea that a function's argument can be either a string 
or an array (or whatever) as PHP makes it easy to detect what type it is, 
and I can easily cast it to another type and deal with it as I see fit. This 
to me is a GREAT ADVANTAGE and NOT a limitation.

 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 in my (not so humble) opinion.

 not least the ability to create decent ORM's.

Proper progammers do not need any steeenking ORMs.

 Further, it would allow people to contribute proper developers classes 
 that can be re-used time and time again

Your definition of proper obviously disagrees with mine.

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

I disagree.

 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 

Re: [PHP] phpMailer Problem!

2009-01-18 Thread Dmitrii Varvashenia
2009/1/18 shahrzad khorrami shahrzad.khorr...@gmail.com:
 $mail-Port   = 80;

Invalid mail port


-- 
WBR, Dmitrii
+375 29 40-LINUX
+375 29 60-LINUX
icq: 193-74-771
www.varvashenia.ru

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Jochem Maas joc...@iamjochem.com wrote in message 
news:4972365b.4060...@iamjochem.com...
 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
 t...@marston-home.demon.co.uk 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

I'll take that as a compliment.  :)

 ... unfortunately it all comes out covered in .

I'll take that as an insult.  :(

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 PS - I must be bored, I've sent more posts in the last ten minutes than I 
 have
 in the last 6 months ;)


 



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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Skip Evans

I will be brief. Tony is a dick.

Peace  Love,
Skip

Tony Marston wrote:
Skip Evans s...@bigskypenguin.com wrote in message 
news:49723137.2010...@bigskypenguin.com...
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.


Saying that someone's ideas are absolute rubbish is not an insult. Calling 
him a moron would be, but I did not.


Frankly, it's this kind of treatment that make these lists less productive 
than they could be.


And you think that his ideas for changing PHP to suit his particular 
programming style would be productive? I think not.



It intimidates less experienced programmers from asking good questions,


What makes you think that he is an inexperienced programmer? What makes you 
think that these are good questions? He is saying that he doesn't like the 
way that PHP works and wants it changed to suit his personal needs.


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.


If it stops feeble minded people from filling this forum with useless 
requests then surely that's a good thing? Personally I'm sick and tired from 
reading posts such as this which say I'm used to language X, and my feeble 
brain cannot cope with the differences, so why can't PHP be changed to 
behave like language X?


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.


Then the OP should respect PHP for what it is, and not request changes that 
would make it unusable for 99.999% of  the millions of programmers who have 
already written millions of programs with it. PHP is successful because of 
the way it works, and changing the way it works, as suggested by the OP, 
would not make it more successful. On the contrary, I think that it would 
PHuck it up completely.


But that's just my opinion.



--

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

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



[PHP] Project management systems

2009-01-18 Thread Skip Evans

Hey all (except Tony),

I've been using dotProject for a few years now and have been 
quite happy with it, and have written my own invoicing module, 
and a few other mods for the way I track hours for 
subcontractors, etc.


But it has trouble with MySQL 5 and from the Googling I've 
done it doesn't seem likely it will be fixed soon. Besides, 
I've hacked my install up quite a bit and if I were to upgrade 
there'd trouble 'a foot, ya'll.


I'm considering switching to something else, and the start of 
a new year would be a good time since my subs have all been 
given their 10-99s so I can start fresh.


Suggestions for a PHP based PM system? I'd like to be able to 
make mods so PHP is the logical choice since it's the language 
I know best, and as Tony will tell you, it's perfect and 
doesn't need no feeble minded Java guys trying to improve it.


Basic requirements are time tracking for multiple coders, 
generating invoices per project based on start and end date (I 
bill the 15th and last day of each month).


Gee, I guess that's the basics.

Thoughts, opinions, corrections to grammar?
--

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

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



Re: [PHP] 100% CPU Usage somewhere in script - how to find it?

2009-01-18 Thread Eric Butera
On Sun, Jan 18, 2009 at 3:16 AM, Alex Davies a...@davz.net wrote:
 Hi,

 I use a (externally developed) library within my application which
 used to work fine. However, after a recent update (which unfortunately
 we can't roll back due to dependencies) I have crazy CPU loads - there
 are ~20 cores in total on the webservers and they have gone from an
 average utilization of ~5% to 99%. I am using lighttpd, and so I can
 see the php-cgi processes using 99% all my CPU!

 I have an extremely basic understanding of how to track this down, and
 using XDebug and KCacheGrind I think that I have a pretty good idea
 which area the problem lies in, but the problem is that because
 whatever it is that has broken is using up the whole CPU everything
 else slows down. Furthermore, it would appear that a large part of
 what gets scheduled is luck because sometimes things are instant and
 the same activity a short while later can take forever. However, based
 on absolute CPU time's from this XDebug/KCacheGrind analysis and a gut
 hunch based upon what has changed recently I think I know roughly what
 it is. I do have a diff of the recent code change, and I have looked
 at it to no avail.

 My questions are:
 - Is there a better way to see what is using up the CPU? There must be
 a single loop or something talking to an external service, that is
 using so much CPU user time. Is there a super-quick way to do to this?
 I really need to know what function (or even line) is using all that
 CPU time, because I can't spot it in the code. Perhaps this
 information can be obtained from XDebug but I can't find it!
 - If there is no such magic answer to this question, what is the
 correct way to find such a phantom problem? Are there any other
 applications that might be better?

 If anyone has any personal recommendations for Consultants able to
 look at and fix this sort of problem that would be much appreciated
 too; I am now well out of my depth and sinking fast!

 Many thanks for any help,

 Alex

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



XDebug can produce a result showing time spent in each function across
an entire run.  So if you were somehow able to turn on xdebug and
reproduce this issue, it would indeed say what function/method this
was happening in.

http://xdebug.org/docs/profiler

Sounds like that'd be pretty tricky, so good luck.

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Skip Evans s...@bigskypenguin.com wrote in message 
news:49733d18.6080...@bigskypenguin.com...
I will be brief. Tony is a dick.

To quote your own words: There's just no need to insult other list members 
like this.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 Peace  Love,
 Skip

 Tony Marston wrote:
 Skip Evans s...@bigskypenguin.com wrote in message 
 news:49723137.2010...@bigskypenguin.com...
 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.

 Saying that someone's ideas are absolute rubbish is not an insult. 
 Calling him a moron would be, but I did not.

 Frankly, it's this kind of treatment that make these lists less 
 productive than they could be.

 And you think that his ideas for changing PHP to suit his particular 
 programming style would be productive? I think not.

 It intimidates less experienced programmers from asking good questions,

 What makes you think that he is an inexperienced programmer? What makes 
 you think that these are good questions? He is saying that he doesn't 
 like the way that PHP works and wants it changed to suit his personal 
 needs.

 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.

 If it stops feeble minded people from filling this forum with useless 
 requests then surely that's a good thing? Personally I'm sick and tired 
 from reading posts such as this which say I'm used to language X, and my 
 feeble brain cannot cope with the differences, so why can't PHP be 
 changed to behave like language X?

 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.

 Then the OP should respect PHP for what it is, and not request changes 
 that would make it unusable for 99.999% of  the millions of programmers 
 who have already written millions of programs with it. PHP is successful 
 because of the way it works, and changing the way it works, as suggested 
 by the OP, would not make it more successful. On the contrary, I think 
 that it would PHuck it up completely.

 But that's just my opinion.


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



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



Re: [PHP] Project management systems

2009-01-18 Thread Phpster

There are a number on sourceforge.net that are worth looking at

Bastien

Sent from my iPod

On Jan 18, 2009, at 9:43 AM, Skip Evans s...@bigskypenguin.com wrote:


Hey all (except Tony),

I've been using dotProject for a few years now and have been quite  
happy with it, and have written my own invoicing module, and a few  
other mods for the way I track hours for subcontractors, etc.


But it has trouble with MySQL 5 and from the Googling I've done it  
doesn't seem likely it will be fixed soon. Besides, I've hacked my  
install up quite a bit and if I were to upgrade there'd trouble 'a  
foot, ya'll.


I'm considering switching to something else, and the start of a new  
year would be a good time since my subs have all been given their  
10-99s so I can start fresh.


Suggestions for a PHP based PM system? I'd like to be able to make  
mods so PHP is the logical choice since it's the language I know  
best, and as Tony will tell you, it's perfect and doesn't need no  
feeble minded Java guys trying to improve it.


Basic requirements are time tracking for multiple coders, generating  
invoices per project based on start and end date (I bill the 15th  
and last day of each month).


Gee, I guess that's the basics.

Thoughts, opinions, corrections to grammar?
--

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

--
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] Re: Opinions / Votes Needed

2009-01-18 Thread Skip Evans
You're right, and as soon as you apologize to Nathan for 
calling him feeble minded (and promise to adjust your 
attitude) I will apologize to you.


I also think it would be a good idea for you to address the 
rest of the list and assure everyone you will try to be more 
polite in the future.


Skip

PS. And then adopt an abandoned puppy.

Tony Marston wrote:
Skip Evans s...@bigskypenguin.com wrote in message 
news:49733d18.6080...@bigskypenguin.com...

I will be brief. Tony is a dick.


To quote your own words: There's just no need to insult other list members 
like this.




--

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

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



Re: [PHP] Project management systems

2009-01-18 Thread Skip Evans

Hey Pfffster  all,

D'oh! Should have gone there first. Found this one that looks 
interesting.


IT Project Guide- Project Management

http://sourceforge.net/projects/itpgpm/

Web based Client and Team project management tool. Utilizes 
PHP, MySQL and JQuery. Has Company, Project, Task, Forum and 
Files modules and associated Gantt charts. Based on dotProject 
and Web2Project. Reduced complexity with the focus on ease of use.


I'll download it and give it a spin. Hope this baby handles 
good in town.


Skip


Phpster wrote:

There are a number on sourceforge.net that are worth looking at

Bastien

Sent from my iPod




--

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

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Per Jessen wrote:

Nathan Rixham wrote:


Per Jessen wrote:

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


why so strongly against having *optional* static typing?



You can't have your cake and eat it.  You can't/shouldn't have strong
and loose typing in the same language.  In my opinion.


Instead of providing programmers with a black or white choice between 
static or dynamic typing, we should instead strive for softer type 
systems. That is, static typing where possible, dynamic typing when 
needed. Unfortunately there is a discontinuity between contemporary 
statically typed and dynamically typed languages as well as a huge 
technical and cultural gap between the respective language communities.


The problems surrounding hybrid statically and dynamically typed 
languages are largely not understood, and both camps often use arguments 
that cut no ice. We argue that there is no need to polarize the 
differences, and instead we should focus on leveraging the strengths of 
each side. [1]



IMHO if it was to classify all the languages (specifically server side
languages for web apps), PHP has 95% of the features i need, the rest
come no where near, so it's the obvious candidate to get this
remaining 5% that'd make it perfect and open it up to a whole set of
new users and markets. 


_If_ the remaining 5% will really open it up to a whole set of new
users and markets, all you have to do is sit back and wait.  I'm not
so sure though. 


One of the great things about PHP is that it is easy and approachable
for beginners, also without formal computer science training.  Write
some code, bang it in a webserver, and bob's your uncle.
If we make PHP more complex, we might well lose that.  


completely agree; it would all be optional though (much like the already 
existing type hinting) - so I can't see it having any impact on anybody 
already using php or anybody learning (any negative imapact that is)



By all means create a PHP++, but leave PHP as it is.  It has
enough feature-bloat already.


you do have a good point, I've thought that myself often and indeed it 
was brought up in the namespace discussions - however if it's optional 
then why fork?


* 1 - http://pico.vub.ac.be/~wdmeuter/RDL04/papers/Meijer.pdf

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



Re: [PHP] phpMailer Problem!

2009-01-18 Thread Richard Heyes
 $mail-Port   = 80;

 Invalid mail port

Further to that, the normal port for SMTP is 25.

-- 
Richard Heyes

HTML5 Graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 17th)

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Per Jessen
Nathan Rixham wrote:

 You can't have your cake and eat it.  You can't/shouldn't have strong
 and loose typing in the same language.  In my opinion.
 
 Instead of providing programmers with a black or white choice between
 static or dynamic typing, we should instead strive for softer type
 systems. That is, static typing where possible, dynamic typing when
 needed. Unfortunately there is a discontinuity between contemporary
 statically typed and dynamically typed languages as well as a huge
 technical and cultural gap between the respective language
 communities.

I'm not sure whether to take you seriously now - you're quoting from a
Microsoft research paper? :-)

 By all means create a PHP++, but leave PHP as it is.  It has
 enough feature-bloat already.
 
 you do have a good point, I've thought that myself often and indeed it
 was brought up in the namespace discussions - however if it's optional
 then why fork?

Because it would be such a major change (as Tony has also pointed out) -
ones PHP code would work with php -normal, but would fail miserably
with php -strongtyping.  In essence, with your optional strong typing
enabled, you'd have a different language.  


/Per Jessen, Zürich


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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Per Jessen wrote:

Nathan Rixham wrote:


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



I'm curious - can you list what the 25% are?


it lacks dynamic typing, the ability to procedural code and its 
precompiled not interpreted; all in a hello world in php is 10 seconds, 
in java it's nigh on 10 minutes. Hence why php is such a good language



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)


But why?  Why not use Java and J2EE and all that good stuff?  I'm not
much of a java fan myself, but you've got to give credit where credit
is due. 


well I can give two examples:
Three other PHP Developers and myself spent the best part of a year 
creating a large multi-site event management system in PHP; the whole 
process was deeply frustrating primarily due to the lack of optional 
static typing and there in the lack of a solid ORM; with this small 
addition the whole process would have been a 6 month process if that, 
and a far more pleasurable experience.


Currently 7 other Java developers and myself are building a large 
multisite transportation management and ticketing system in Java, this 
is a 9 month project with a decent sized and very skilled team; because 
of the lack of static typing (and thus the lack of development tools and 
frameworks/orms for PHP) we've had to go with Java; TBH the static 
typing is only needed on the domain model and the api layer, the bulk of 
the business logic in between where the majority of the work comes in, 
would be a great deal easier using a mix of procedural code and dynamic 
typing. I'd argue that again the development time of this project could 
be halfed if it was done in PHP AND if in PHP had support for optional 
static typing coupled with a good ORM. Further the difference between 
precompilation and interpretation is v noticable when it comes to 
rolling applications out, often in development you want to run a hlaf 
built or broken application to see what happens and check if parts x y 
and z are good + to test your infrastructure; when you can't compile and 
do this testing becuase the app isn't bug free or completed it's rather 
limiting. Sometimes unit tests just don't cover what you need.



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?


No, you're not so bad :-) 

The point is - why not just use Java, when you really need the features?  


the cases above should show why, fact is (imho) PHP would be a far 
better language than java for web based applications in 99% of cases if 
it had this optional static typing and the tools that allows. *IF* it 
did, then 10 other people and myself wouldn't have wasted a year of 
there lives on writing what could be unneeded code; I'm sure I'm not the 
only one in this position.


I've already quoted this, but in this context I feel it's appropriate to 
reiterate:


Instead of providing programmers with a black or white choice between 
static or dynamic typing, we should instead strive for softer type 
systems. That is, static typing where possible, dynamic typing when 
needed. Unfortunately there is a discontinuity between contemporary 
statically typed and dynamically typed languages as well as a huge 
technical and cultural gap between the respective language communities.


The problems surrounding hybrid statically and dynamically typed 
languages are largely not understood, and both camps often use arguments 
that cut no ice. We argue that there is no need to polarize the 
differences, and instead we should focus on leveraging the strengths of 
each side.


Regards!

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Per Jessen wrote:

Nathan Rixham wrote:


You can't have your cake and eat it.  You can't/shouldn't have strong
and loose typing in the same language.  In my opinion.

Instead of providing programmers with a black or white choice between
static or dynamic typing, we should instead strive for softer type
systems. That is, static typing where possible, dynamic typing when
needed. Unfortunately there is a discontinuity between contemporary
statically typed and dynamically typed languages as well as a huge
technical and cultural gap between the respective language
communities.


I'm not sure whether to take you seriously now - you're quoting from a
Microsoft research paper? :-)


lol well picked up - for all I'm a linux fan M$ aren't all bad and hell 
they must have some very good programmers in the various teams, seems a 
shame to invalidate thier hard work and research just because they work 
for satan.



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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Per Jessen
Nathan Rixham wrote:

 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)
 
 But why?  Why not use Java and J2EE and all that good stuff?  I'm not
 much of a java fan myself, but you've got to give credit where credit
 is due.
 
 well I can give two examples:
 Three other PHP Developers and myself spent the best part of a year
 creating a large multi-site event management system in PHP; the whole
 process was deeply frustrating primarily due to the lack of optional
 static typing and there in the lack of a solid ORM; with this small
 addition the whole process would have been a 6 month process if that,
 and a far more pleasurable experience.

I think that's at best an example of someone having chosen the wrong
tool. I can easily appreciate the frustration.  My own rule-of-thumb - 
scripts are for small things and rapid prototyping. Once when a script
(regardless of language) grows towards 1000 lines, start thinking about
writing it in C (or whatever else is appropriate).  I know of too many
situations where thousands of lines of script code have turned into
maintenance nightmares. 

 Currently 7 other Java developers and myself are building a large
 multisite transportation management and ticketing system in Java, this
 is a 9 month project with a decent sized and very skilled team;
 because of the lack of static typing (and thus the lack of development
 tools and frameworks/orms for PHP) we've had to go with Java; TBH the
 static typing is only needed on the domain model and the api layer,
 the bulk of the business logic in between where the majority of the
 work comes in, would be a great deal easier using a mix of procedural
 code and dynamic typing. I'd argue that again the development time of
 this project could be halfed if it was done in PHP AND if in PHP had
 support for optional static typing coupled with a good ORM.

First of all - development time is largely irrelevant, Nathan - I think
the standard rule is that program lifetime = 25% development time + 75%
maintenance time. 
Second - instead of discussing optional strong typing for PHP, I think
you need to look at why your productivity in Java is only half of that
of PHP.  Your tools for Java development are far more sophisticated,
you've got the strong typing you want - what's reducing your
productivity?

 Further the difference between precompilation and interpretation is v
 noticable when it comes to rolling applications out, often in
 development you want to run a hlaf built or broken application to see
 what happens and check if parts x y and z are good + to test your
 infrastructure; when you can't compile and do this testing becuase the
 app isn't bug free or completed it's rather limiting. Sometimes unit
 tests just don't cover what you need.

I agree.  You need a full blown test system.  That is pretty much the
norm in a corporate environment - I've certainly never worked anywhere
that didn't have separate test systems. 


/Per Jessen, Zürich


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



Re: [PHP] To check for existing user in database

2009-01-18 Thread tedd

At 10:36 AM -0600 1/16/09, Shawn McKenzie wrote:

mysql_num_rows() may make more sense, however mysql_affected_rows() will
work the same with a select.  The PHP mysql_affected_rows() calls the
MySQL mysql_affected_rows(), which states:

For SELECT statements, mysql_affected_rows() works like mysql_num_rows().

--
Thanks!
-Shawn


I guess that explains why my code is still working.

I had been using mysql_num_rows() to see if anything had been 
returned from a successful search, but had a problem of some sort. 
So, I started using mysql_affected_rows()  and the problem vanished 
-- as such, that became my preferred method. However, I had been 
remiss in reading the manuals.


So after all of this, I plan of setting up tests and testing all 
combinations to see how this actually works. While the manual says 
one thing, it appears that the application can be a bit different. Of 
course, I could be wrong.


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] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Skip Evans s...@bigskypenguin.com wrote in message 
news:49723137.2010...@bigskypenguin.com...
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.


Saying that someone's ideas are absolute rubbish is not an insult. Calling 
him a moron would be, but I did not.


agreed, tone and meaning are so hard to convey using written words 
alone. (you did say I was feeble brained though..)


Frankly, it's this kind of treatment that make these lists less productive 
than they could be.


And you think that his ideas for changing PHP to suit his particular 
programming style would be productive? I think not.


you think not; I know they'd raise my productivity in php somewhat and 
increase the scope where I can use php.



It intimidates less experienced programmers from asking good questions,


What makes you think that he is an inexperienced programmer? What makes you 
think that these are good questions? He is saying that he doesn't like the 
way that PHP works and wants it changed to suit his personal needs.


inexperienced I am not, perfect I am not. all questions are good 
questions, how can things progress when nobody questions? I love the way 
currently php works and I'd like (and can see a need in certain 
circumstances for) a bit of optional functionality which would increase, 
yes my, productivity. I'm sure though if this can increase my 
productivity it can increase others as well - I'd like to hear from some 
of the spl_ and pdo_ devs on this, not to mention those who currently 
make orm's for php such as the one in symphony.


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.


If it stops feeble minded people from filling this forum with useless 
requests then surely that's a good thing? Personally I'm sick and tired from 
reading posts such as this which say I'm used to language X, and my feeble 
brain cannot cope with the differences, so why can't PHP be changed to 
behave like language X?


there you go with the feeble minded again tony..
a: this wasn't a useless request, it was a request for opinions and votes.

b: I'm used to PHP, it is my one of my current primary languages and has 
been for a long time; I help others with both simple and complex 
problems on this list and devote a hell of a lot of my personal time to 
helping people use php to do what they want. I am definately an advocate 
of php, contribute to open source projects and release packages which 
many thousands of people around the world use. I've also used many other 
languages and can see advantages and disadvantages to all of them; I'm 
not so niave or feeble minded to think that php is perfect the way it 
is, it's not - but it's a damn good language.


c: nothing I'm suggesting would have any effect on you're php the cobol 
way approach, I can easily cope with the difference, can you comprehend 
that it wouldn't be changing any existing functionality only adding new 
*optional* functionality.


PHP has support for objects and classes, right down to type hinting on 
arguments, exceptions, inheritance, reflection the whole lot - to add in 
the bits that are missing seems rather logical to me; thats why we've 
got the OO features that already exist.


give me one good reason why optional type hinting / static typing of 
class properties and normal variables would be a bad thing? and another 
of how it would have any impact at all on you.


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.


Then the OP should respect PHP for what it is, and not request changes that 
would make it unusable for 99.999% of  the millions of programmers who have 
already written millions of programs with it. PHP is successful because of 
the way it works, and changing the way it works, as suggested by the OP, 
would not make it more successful. On the contrary, I think that it would 
PHuck it up completely.


But that's just my opinion.



make it unusable for 99.999% of the millions of programmers who have 
already written millions of programs with it -  eh.. read tony; 
OPTIONAL, this wouldn't have any impact or break any bc if done 
correctly - just like typehinting on methods didn't..


php would work the same, just add in some *optional* functionality for 
those who do need it, or 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Nathan Rixham nrix...@gmail.com wrote in message 
news:497354c3.9090...@gmail.com...
 Per Jessen wrote:
 Nathan Rixham wrote:

 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


 I'm curious - can you list what the 25% are?

 it lacks dynamic typing, the ability to procedural code and its 
 precompiled not interpreted; all in a hello world in php is 10 seconds, in 
 java it's nigh on 10 minutes. Hence why php is such a good language

 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)

 But why?  Why not use Java and J2EE and all that good stuff?  I'm not
 much of a java fan myself, but you've got to give credit where credit
 is due.

 well I can give two examples:
 Three other PHP Developers and myself spent the best part of a year 
 creating a large multi-site event management system in PHP; the whole 
 process was deeply frustrating primarily due to the lack of optional 
 static typing and there in the lack of a solid ORM; with this small 
 addition the whole process would have been a 6 month process if that, and 
 a far more pleasurable experience.

Really? In 2007 I single-handedly designed and built an ERP system with 130 
database tables, 230 relationships and 1000 screens, all with PHP and 
without an ORM and static typing. This took me 6 months. If you can't equal 
that then either you are not much of a programmer, or your development style 
is not as good as you think it is. If other people can write perfectly good 
applications in PHP without the extra features that you say are 
indispensible then why can't you?

 Currently 7 other Java developers and myself are building a large 
 multisite transportation management and ticketing system in Java, this is 
 a 9 month project with a decent sized and very skilled team; because of 
 the lack of static typing (and thus the lack of development tools and 
 frameworks/orms for PHP) we've had to go with Java; TBH the static typing 
 is only needed on the domain model and the api layer, the bulk of the 
 business logic in between where the majority of the work comes in, would 
 be a great deal easier using a mix of procedural code and dynamic typing. 
 I'd argue that again the development time of this project could be halfed 
 if it was done in PHP AND if in PHP had support for optional static typing 
 coupled with a good ORM.

If you want a good ORM then write one yourself, or is that beyond your 
capabilities?

Personally I wouldn't touch an ORM with a barge pole. I develop applications 
using the 3 Tier Architecture (no, it's not the same as MVC) with a Data 
Access layer that I can easily switch between MySQL, PostgreSQL and Oracle. 
If I can do it then why can't you?

 Further the difference between precompilation and interpretation is v 
 noticable when it comes to rolling applications out, often in development 
 you want to run a hlaf built or broken application to see what happens and 
 check if parts x y and z are good + to test your infrastructure; when you 
 can't compile and do this testing becuase the app isn't bug free or 
 completed it's rather limiting. Sometimes unit tests just don't cover what 
 you need.

 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?

 No, you're not so bad :-) The point is - why not just use Java, when you 
 really need the features?

 the cases above should show why, fact is (imho) PHP would be a far better 
 language than java for web based applications in 99% of cases if it had 
 this optional static typing and the tools that allows. *IF* it did, then 
 10 other people and myself wouldn't have wasted a year of there lives on 
 writing what could be unneeded code; I'm sure I'm not the only one in this 
 position.

If you spend a year writing useless code, then it's your fault, not PHPs. 
It's a bad workman who blames his tools.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 I've already quoted this, but in this context I feel it's appropriate to 
 reiterate:

 Instead of providing programmers with a black or white choice between 
 static or dynamic typing, we should instead strive for softer type 
 systems. That is, static typing where possible, dynamic typing when 
 needed. Unfortunately there is a discontinuity between contemporary 
 statically typed and dynamically typed languages as well as a huge 
 technical 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Per Jessen
Nathan Rixham wrote:

 Per Jessen wrote:
 Nathan Rixham wrote:
 
 You can't have your cake and eat it.  You can't/shouldn't have
 strong
 and loose typing in the same language.  In my opinion.
 Instead of providing programmers with a black or white choice
 between static or dynamic typing, we should instead strive for
 softer type systems. That is, static typing where possible, dynamic
 typing when needed. Unfortunately there is a discontinuity between
 contemporary statically typed and dynamically typed languages as
 well as a huge technical and cultural gap between the respective
 language communities.
 
 I'm not sure whether to take you seriously now - you're quoting from
 a Microsoft research paper? :-)
 
 lol well picked up - for all I'm a linux fan M$ aren't all bad and
 hell they must have some very good programmers in the various teams,
 seems a shame to invalidate thier hard work and research just because
 they work for satan.

Completely agree, I just thought I'd score an easy point ...


/Per Jessen, Zürich


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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Nathan Rixham nrix...@gmail.com wrote in message 
news:497366f5.2030...@gmail.com...
 Tony Marston wrote:
 Skip Evans s...@bigskypenguin.com wrote in message 
 news:49723137.2010...@bigskypenguin.com...
 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.

 Saying that someone's ideas are absolute rubbish is not an insult. 
 Calling him a moron would be, but I did not.

 agreed, tone and meaning are so hard to convey using written words alone. 
 (you did say I was feeble brained though..)

 Frankly, it's this kind of treatment that make these lists less 
 productive than they could be.

 And you think that his ideas for changing PHP to suit his particular 
 programming style would be productive? I think not.

 you think not; I know they'd raise my productivity in php somewhat and 
 increase the scope where I can use php.

 It intimidates less experienced programmers from asking good questions,

 What makes you think that he is an inexperienced programmer? What makes 
 you think that these are good questions? He is saying that he doesn't 
 like the way that PHP works and wants it changed to suit his personal 
 needs.

 inexperienced I am not, perfect I am not. all questions are good 
 questions, how can things progress when nobody questions? I love the way 
 currently php works and I'd like (and can see a need in certain 
 circumstances for) a bit of optional functionality which would increase, 
 yes my, productivity. I'm sure though if this can increase my productivity 
 it can increase others as well - I'd like to hear from some of the spl_ 
 and pdo_ devs on this, not to mention those who currently make orm's for 
 php such as the one in symphony.

 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.

 If it stops feeble minded people from filling this forum with useless 
 requests then surely that's a good thing? Personally I'm sick and tired 
 from reading posts such as this which say I'm used to language X, and my 
 feeble brain cannot cope with the differences, so why can't PHP be 
 changed to behave like language X?

 there you go with the feeble minded again tony..
 a: this wasn't a useless request, it was a request for opinions and votes.

Yes, I think that any programmer who wants to change PHP so that it looks 
and feels more like his current language of choice simply because he cannot 
cope with the differences is feeble minded.

 b: I'm used to PHP, it is my one of my current primary languages and has 
 been for a long time; I help others with both simple and complex problems 
 on this list and devote a hell of a lot of my personal time to helping 
 people use php to do what they want. I am definately an advocate of php, 
 contribute to open source projects and release packages which many 
 thousands of people around the world use. I've also used many other 
 languages and can see advantages and disadvantages to all of them; I'm not 
 so niave or feeble minded to think that php is perfect the way it is, it's 
 not - but it's a damn good language.

 c: nothing I'm suggesting would have any effect on you're php the cobol 
 way approach, I can easily cope with the difference, can you comprehend 
 that it wouldn't be changing any existing functionality only adding new 
 *optional* functionality.

As others have already pointed out it would simply not be feasible to change 
PHP so that it can be switched between dynamic typing to static typing at 
the flick of a switch. PHP is dynamicly typed, so either get used to it or 
switch to a different language.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 PHP has support for objects and classes, right down to type hinting on 
 arguments, exceptions, inheritance, reflection the whole lot - to add in 
 the bits that are missing seems rather logical to me; thats why we've got 
 the OO features that already exist.

 give me one good reason why optional type hinting / static typing of class 
 properties and normal variables would be a bad thing? and another of how 
 it would have any impact at all on you.

 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.

 Then the OP should respect PHP for what it is, and not request changes 
 that would make it unusable for 99.999% of  the 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Jochem Maas
Per Jessen schreef:
 Nathan Rixham wrote:
 
 Per Jessen wrote:
 Nathan Rixham wrote:

 You can't have your cake and eat it.  You can't/shouldn't have
 strong
 and loose typing in the same language.  In my opinion.
 Instead of providing programmers with a black or white choice
 between static or dynamic typing, we should instead strive for
 softer type systems. That is, static typing where possible, dynamic
 typing when needed. Unfortunately there is a discontinuity between
 contemporary statically typed and dynamically typed languages as
 well as a huge technical and cultural gap between the respective
 language communities.
 I'm not sure whether to take you seriously now - you're quoting from
 a Microsoft research paper? :-)
 lol well picked up - for all I'm a linux fan M$ aren't all bad and
 hell they must have some very good programmers in the various teams,
 seems a shame to invalidate thier hard work and research just because
 they work for satan.
 
 Completely agree, I just thought I'd score an easy point ...

+1 to you both :-)

 
 
 /Per Jessen, Zürich
 
 


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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Nathan Rixham nrix...@gmail.com wrote in message 
news:497354c3.9090...@gmail.com...

Per Jessen wrote:

Nathan Rixham wrote:


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


I'm curious - can you list what the 25% are?
it lacks dynamic typing, the ability to procedural code and its 
precompiled not interpreted; all in a hello world in php is 10 seconds, in 
java it's nigh on 10 minutes. Hence why php is such a good language



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)

But why?  Why not use Java and J2EE and all that good stuff?  I'm not
much of a java fan myself, but you've got to give credit where credit
is due.

well I can give two examples:
Three other PHP Developers and myself spent the best part of a year 
creating a large multi-site event management system in PHP; the whole 
process was deeply frustrating primarily due to the lack of optional 
static typing and there in the lack of a solid ORM; with this small 
addition the whole process would have been a 6 month process if that, and 
a far more pleasurable experience.


Really? In 2007 I single-handedly designed and built an ERP system with 130 
database tables, 230 relationships and 1000 screens, all with PHP and 
without an ORM and static typing. This took me 6 months. If you can't equal 
that then either you are not much of a programmer, or your development style 
is not as good as you think it is. If other people can write perfectly good 
applications in PHP without the extra features that you say are 
indispensible then why can't you?


clap clap, would you like to compare dick size? You have no idea of the 
size or scope of the applications I've developed by myself or as part of 
team tony, so why even attempt to comment? Why assume that I haven't 
written perfectly good applications in PHP and that incapable of it when 
the opposite is true. Again tony, nobody is knocking php simply saying 
that in some scenarios development time could be speeded up by adding in 
static typing; perhaps you've not came accross this but I and others have.


Currently 7 other Java developers and myself are building a large 
multisite transportation management and ticketing system in Java, this is 
a 9 month project with a decent sized and very skilled team; because of 
the lack of static typing (and thus the lack of development tools and 
frameworks/orms for PHP) we've had to go with Java; TBH the static typing 
is only needed on the domain model and the api layer, the bulk of the 
business logic in between where the majority of the work comes in, would 
be a great deal easier using a mix of procedural code and dynamic typing. 
I'd argue that again the development time of this project could be halfed 
if it was done in PHP AND if in PHP had support for optional static typing 
coupled with a good ORM.


If you want a good ORM then write one yourself, or is that beyond your 
capabilities?


already am tony, and have spotted areas where by adding optional static 
typing:

a: it could be improved
b: code could be optimized
c: development time could be considerably reduced

Personally I wouldn't touch an ORM with a barge pole. I develop applications 
using the 3 Tier Architecture (no, it's not the same as MVC) with a Data 
Access layer that I can easily switch between MySQL, PostgreSQL and Oracle. 
If I can do it then why can't you?


likewise, although I would touch an ORM in certain cases (but not with 
your barge pole), frequently use modified n-tier or the good ol 3 tier 
architecture with preference going to using a class based oo paradigm 
rather than a prototype style, and have written many data access and 
persistance layers which can switch between different RDBMS both pre pdo 
and post pdo. If I can see the need for this.. why can't you? weg


Further the difference between precompilation and interpretation is v 
noticable when it comes to rolling applications out, often in development 
you want to run a hlaf built or broken application to see what happens and 
check if parts x y and z are good + to test your infrastructure; when you 
can't compile and do this testing becuase the app isn't bug free or 
completed it's rather limiting. Sometimes unit tests just don't cover what 
you need.



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?
No, you're not so 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Nathan Rixham nrix...@gmail.com wrote in message 
news:497366f5.2030...@gmail.com...

Tony Marston wrote:
Skip Evans s...@bigskypenguin.com wrote in message 
news:49723137.2010...@bigskypenguin.com...
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.
Saying that someone's ideas are absolute rubbish is not an insult. 
Calling him a moron would be, but I did not.
agreed, tone and meaning are so hard to convey using written words alone. 
(you did say I was feeble brained though..)


Frankly, it's this kind of treatment that make these lists less 
productive than they could be.
And you think that his ideas for changing PHP to suit his particular 
programming style would be productive? I think not.
you think not; I know they'd raise my productivity in php somewhat and 
increase the scope where I can use php.



It intimidates less experienced programmers from asking good questions,
What makes you think that he is an inexperienced programmer? What makes 
you think that these are good questions? He is saying that he doesn't 
like the way that PHP works and wants it changed to suit his personal 
needs.
inexperienced I am not, perfect I am not. all questions are good 
questions, how can things progress when nobody questions? I love the way 
currently php works and I'd like (and can see a need in certain 
circumstances for) a bit of optional functionality which would increase, 
yes my, productivity. I'm sure though if this can increase my productivity 
it can increase others as well - I'd like to hear from some of the spl_ 
and pdo_ devs on this, not to mention those who currently make orm's for 
php such as the one in symphony.


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.
If it stops feeble minded people from filling this forum with useless 
requests then surely that's a good thing? Personally I'm sick and tired 
from reading posts such as this which say I'm used to language X, and my 
feeble brain cannot cope with the differences, so why can't PHP be 
changed to behave like language X?

there you go with the feeble minded again tony..
a: this wasn't a useless request, it was a request for opinions and votes.


Yes, I think that any programmer who wants to change PHP so that it looks 
and feels more like his current language of choice simply because he cannot 
cope with the differences is feeble minded.


but tony.. PHP is my current language of choice..

b: I'm used to PHP, it is my one of my current primary languages and has 
been for a long time; I help others with both simple and complex problems 
on this list and devote a hell of a lot of my personal time to helping 
people use php to do what they want. I am definately an advocate of php, 
contribute to open source projects and release packages which many 
thousands of people around the world use. I've also used many other 
languages and can see advantages and disadvantages to all of them; I'm not 
so niave or feeble minded to think that php is perfect the way it is, it's 
not - but it's a damn good language.


c: nothing I'm suggesting would have any effect on you're php the cobol 
way approach, I can easily cope with the difference, can you comprehend 
that it wouldn't be changing any existing functionality only adding new 
*optional* functionality.


As others have already pointed out it would simply not be feasible to change 
PHP so that it can be switched between dynamic typing to static typing at 
the flick of a switch. PHP is dynamicly typed, so either get used to it or 
switch to a different language.




flick of a switch? I'd be suggesting fully implemented optional code.
php is dynamically typed WITH type hinting on methods, this would just 
be type hinting on variables as well. why switch when

a: php could have this implemented
b: I'm capable of using multiple languages and picking the correct one 
for each scenario.
c: there is a gap between dynamic and statically typed languages that 
php already addresses in part with typehinting on methods, it could 
fully address this gap easily and be the best of both world for strict 
and dynamic typers, just like it pretty much does for procedural and oo 
coders.


ps: already am used to it, will continue to be, but would like to see it 
implemented.


pps: rar rar rar tony, are you tony the tiger from that breakfast cerial?

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Jochem Maas wrote:

Per Jessen schreef:

Nathan Rixham wrote:


Per Jessen wrote:

Nathan Rixham wrote:


You can't have your cake and eat it.  You can't/shouldn't have
strong
and loose typing in the same language.  In my opinion.

Instead of providing programmers with a black or white choice
between static or dynamic typing, we should instead strive for
softer type systems. That is, static typing where possible, dynamic
typing when needed. Unfortunately there is a discontinuity between
contemporary statically typed and dynamically typed languages as
well as a huge technical and cultural gap between the respective
language communities.

I'm not sure whether to take you seriously now - you're quoting from
a Microsoft research paper? :-)

lol well picked up - for all I'm a linux fan M$ aren't all bad and
hell they must have some very good programmers in the various teams,
seems a shame to invalidate thier hard work and research just because
they work for satan.

Completely agree, I just thought I'd score an easy point ...


+1 to you both :-)



omfg positivety returns to the list :-D cheers guys!


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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Stuart
2009/1/18 Tony Marston t...@marston-home.demon.co.uk:

 Nathan Rixham nrix...@gmail.com wrote in message
 news:497366f5.2030...@gmail.com...
 Tony Marston wrote:
 Skip Evans s...@bigskypenguin.com wrote in message
 news:49723137.2010...@bigskypenguin.com...
 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.

 Saying that someone's ideas are absolute rubbish is not an insult.
 Calling him a moron would be, but I did not.

 agreed, tone and meaning are so hard to convey using written words alone.
 (you did say I was feeble brained though..)

 Frankly, it's this kind of treatment that make these lists less
 productive than they could be.

 And you think that his ideas for changing PHP to suit his particular
 programming style would be productive? I think not.

 you think not; I know they'd raise my productivity in php somewhat and
 increase the scope where I can use php.

 It intimidates less experienced programmers from asking good questions,

 What makes you think that he is an inexperienced programmer? What makes
 you think that these are good questions? He is saying that he doesn't
 like the way that PHP works and wants it changed to suit his personal
 needs.

 inexperienced I am not, perfect I am not. all questions are good
 questions, how can things progress when nobody questions? I love the way
 currently php works and I'd like (and can see a need in certain
 circumstances for) a bit of optional functionality which would increase,
 yes my, productivity. I'm sure though if this can increase my productivity
 it can increase others as well - I'd like to hear from some of the spl_
 and pdo_ devs on this, not to mention those who currently make orm's for
 php such as the one in symphony.

 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.

 If it stops feeble minded people from filling this forum with useless
 requests then surely that's a good thing? Personally I'm sick and tired
 from reading posts such as this which say I'm used to language X, and my
 feeble brain cannot cope with the differences, so why can't PHP be
 changed to behave like language X?

 there you go with the feeble minded again tony..
 a: this wasn't a useless request, it was a request for opinions and votes.

 Yes, I think that any programmer who wants to change PHP so that it looks
 and feels more like his current language of choice simply because he cannot
 cope with the differences is feeble minded.

And I think any participant on this list who cannot reasonably respond
to perfectly reasonable suggestions without resorting to child-like
name-calling should reconsider their personal brand. Every time I see
you contribute to this list you manage to lessen the respect I have
for you as a person nevermind as a developer.

PHP would not have the OO capabilities it has if developers hadn't
compared it to other languages and said yes, that would be a
useful addition. Improvements don't happen without inspiration, and
definitely won't happen if people feel threatened when they make
suggestions.

 b: I'm used to PHP, it is my one of my current primary languages and has
 been for a long time; I help others with both simple and complex problems
 on this list and devote a hell of a lot of my personal time to helping
 people use php to do what they want. I am definately an advocate of php,
 contribute to open source projects and release packages which many
 thousands of people around the world use. I've also used many other
 languages and can see advantages and disadvantages to all of them; I'm not
 so niave or feeble minded to think that php is perfect the way it is, it's
 not - but it's a damn good language.

 c: nothing I'm suggesting would have any effect on you're php the cobol
 way approach, I can easily cope with the difference, can you comprehend
 that it wouldn't be changing any existing functionality only adding new
 *optional* functionality.

 As others have already pointed out it would simply not be feasible to change
 PHP so that it can be switched between dynamic typing to static typing at
 the flick of a switch. PHP is dynamicly typed, so either get used to it or
 switch to a different language.

I don't recall seeing anyone say it's not feasible, just that it comes
with costs other PHP developers might not be happy with. Performance
makes it tricky, BC could make it tricky and there's probably a whole
bunch of other issues that might make it difficult, but it's certainly
possible.

As far as your if I can do it why can't you comment goes, 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Nathan Rixham nrix...@gmail.com wrote in message 
news:49737051.9080...@gmail.com...
 Tony Marston wrote:
 Nathan Rixham nrix...@gmail.com wrote in message 
 news:497366f5.2030...@gmail.com...
 Tony Marston wrote:
 Skip Evans s...@bigskypenguin.com wrote in message 
 news:49723137.2010...@bigskypenguin.com...
 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.
 Saying that someone's ideas are absolute rubbish is not an insult. 
 Calling him a moron would be, but I did not.
 agreed, tone and meaning are so hard to convey using written words 
 alone. (you did say I was feeble brained though..)

 Frankly, it's this kind of treatment that make these lists less 
 productive than they could be.
 And you think that his ideas for changing PHP to suit his particular 
 programming style would be productive? I think not.
 you think not; I know they'd raise my productivity in php somewhat and 
 increase the scope where I can use php.

 It intimidates less experienced programmers from asking good 
 questions,
 What makes you think that he is an inexperienced programmer? What makes 
 you think that these are good questions? He is saying that he doesn't 
 like the way that PHP works and wants it changed to suit his personal 
 needs.
 inexperienced I am not, perfect I am not. all questions are good 
 questions, how can things progress when nobody questions? I love the way 
 currently php works and I'd like (and can see a need in certain 
 circumstances for) a bit of optional functionality which would increase, 
 yes my, productivity. I'm sure though if this can increase my 
 productivity it can increase others as well - I'd like to hear from some 
 of the spl_ and pdo_ devs on this, not to mention those who currently 
 make orm's for php such as the one in symphony.

 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.
 If it stops feeble minded people from filling this forum with useless 
 requests then surely that's a good thing? Personally I'm sick and tired 
 from reading posts such as this which say I'm used to language X, and 
 my feeble brain cannot cope with the differences, so why can't PHP be 
 changed to behave like language X?
 there you go with the feeble minded again tony..
 a: this wasn't a useless request, it was a request for opinions and 
 votes.

 Yes, I think that any programmer who wants to change PHP so that it looks 
 and feels more like his current language of choice simply because he 
 cannot cope with the differences is feeble minded.

 but tony.. PHP is my current language of choice..

If it is your language of choice the it must be better than the alernatives. 
So if it is better then why are you saying that it is virually unusable 
without the improvements that you have suggested?

 b: I'm used to PHP, it is my one of my current primary languages and has 
 been for a long time; I help others with both simple and complex 
 problems on this list and devote a hell of a lot of my personal time to 
 helping people use php to do what they want. I am definately an advocate 
 of php, contribute to open source projects and release packages which 
 many thousands of people around the world use. I've also used many other 
 languages and can see advantages and disadvantages to all of them; I'm 
 not so niave or feeble minded to think that php is perfect the way it 
 is, it's not - but it's a damn good language.

 c: nothing I'm suggesting would have any effect on you're php the cobol 
 way approach, I can easily cope with the difference, can you comprehend 
 that it wouldn't be changing any existing functionality only adding new 
 *optional* functionality.

 As others have already pointed out it would simply not be feasible to 
 change PHP so that it can be switched between dynamic typing to static 
 typing at the flick of a switch. PHP is dynamicly typed, so either get 
 used to it or switch to a different language.


 flick of a switch? I'd be suggesting fully implemented optional code.
 php is dynamically typed WITH type hinting on methods,
 this would just be type hinting on variables as well.

You did not ask for type HINTING on variables, you asked for static TYPING 
which is a different kettle of fish.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 why switch when
 a: php could have this implemented
 b: I'm capable of using multiple languages and picking the correct one for 
 each scenario.
 c: there is a gap between dynamic and statically typed languages that php 
 already addresses 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Stuart stut...@gmail.com wrote in message 
news:a5f019de0901181015g5e2db21fn2782839ab9648...@mail.gmail.com...
 2009/1/18 Tony Marston t...@marston-home.demon.co.uk:

 Nathan Rixham nrix...@gmail.com wrote in message
 news:497366f5.2030...@gmail.com...
 Tony Marston wrote:
 Skip Evans s...@bigskypenguin.com wrote in message
 news:49723137.2010...@bigskypenguin.com...
 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.

 Saying that someone's ideas are absolute rubbish is not an insult.
 Calling him a moron would be, but I did not.

 agreed, tone and meaning are so hard to convey using written words 
 alone.
 (you did say I was feeble brained though..)

 Frankly, it's this kind of treatment that make these lists less
 productive than they could be.

 And you think that his ideas for changing PHP to suit his particular
 programming style would be productive? I think not.

 you think not; I know they'd raise my productivity in php somewhat and
 increase the scope where I can use php.

 It intimidates less experienced programmers from asking good 
 questions,

 What makes you think that he is an inexperienced programmer? What makes
 you think that these are good questions? He is saying that he doesn't
 like the way that PHP works and wants it changed to suit his personal
 needs.

 inexperienced I am not, perfect I am not. all questions are good
 questions, how can things progress when nobody questions? I love the way
 currently php works and I'd like (and can see a need in certain
 circumstances for) a bit of optional functionality which would increase,
 yes my, productivity. I'm sure though if this can increase my 
 productivity
 it can increase others as well - I'd like to hear from some of the spl_
 and pdo_ devs on this, not to mention those who currently make orm's for
 php such as the one in symphony.

 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.

 If it stops feeble minded people from filling this forum with useless
 requests then surely that's a good thing? Personally I'm sick and tired
 from reading posts such as this which say I'm used to language X, and 
 my
 feeble brain cannot cope with the differences, so why can't PHP be
 changed to behave like language X?

 there you go with the feeble minded again tony..
 a: this wasn't a useless request, it was a request for opinions and 
 votes.

 Yes, I think that any programmer who wants to change PHP so that it looks
 and feels more like his current language of choice simply because he 
 cannot
 cope with the differences is feeble minded.

 And I think any participant on this list who cannot reasonably respond
 to perfectly reasonable suggestions

In case you have forgotten what this thread is about, the OP gave a list of 
suggested improvements to PHP and asked for opinions. I merely gave my 
opinion that these improvements would be a waste of time as they would add 
nothing to the language (IMHO, of course). How many in this frum have 
expressed any support for any of these improvements?

 without resorting to child-like
 name-calling should reconsider their personal brand. Every time I see
 you contribute to this list you manage to lessen the respect I have
 for you as a person nevermind as a developer.

 PHP would not have the OO capabilities it has if developers hadn't
 compared it to other languages and said yes, that would be a
 useful addition. Improvements don't happen without inspiration, and
 definitely won't happen if people feel threatened when they make
 suggestions.

 b: I'm used to PHP, it is my one of my current primary languages and has
 been for a long time; I help others with both simple and complex 
 problems
 on this list and devote a hell of a lot of my personal time to helping
 people use php to do what they want. I am definately an advocate of php,
 contribute to open source projects and release packages which many
 thousands of people around the world use. I've also used many other
 languages and can see advantages and disadvantages to all of them; I'm 
 not
 so niave or feeble minded to think that php is perfect the way it is, 
 it's
 not - but it's a damn good language.

 c: nothing I'm suggesting would have any effect on you're php the cobol
 way approach, I can easily cope with the difference, can you comprehend
 that it wouldn't be changing any existing functionality only adding new
 *optional* functionality.

 As others have already pointed out it would simply not be feasible to 
 change
 PHP so that it can be switched 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Nathan Rixham nrix...@gmail.com wrote in message 
news:49737051.9080...@gmail.com...

Tony Marston wrote:
Nathan Rixham nrix...@gmail.com wrote in message 
news:497366f5.2030...@gmail.com...

Tony Marston wrote:
Skip Evans s...@bigskypenguin.com wrote in message 
news:49723137.2010...@bigskypenguin.com...
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.
Saying that someone's ideas are absolute rubbish is not an insult. 
Calling him a moron would be, but I did not.
agreed, tone and meaning are so hard to convey using written words 
alone. (you did say I was feeble brained though..)


Frankly, it's this kind of treatment that make these lists less 
productive than they could be.
And you think that his ideas for changing PHP to suit his particular 
programming style would be productive? I think not.
you think not; I know they'd raise my productivity in php somewhat and 
increase the scope where I can use php.


It intimidates less experienced programmers from asking good 
questions,
What makes you think that he is an inexperienced programmer? What makes 
you think that these are good questions? He is saying that he doesn't 
like the way that PHP works and wants it changed to suit his personal 
needs.
inexperienced I am not, perfect I am not. all questions are good 
questions, how can things progress when nobody questions? I love the way 
currently php works and I'd like (and can see a need in certain 
circumstances for) a bit of optional functionality which would increase, 
yes my, productivity. I'm sure though if this can increase my 
productivity it can increase others as well - I'd like to hear from some 
of the spl_ and pdo_ devs on this, not to mention those who currently 
make orm's for php such as the one in symphony.


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.
If it stops feeble minded people from filling this forum with useless 
requests then surely that's a good thing? Personally I'm sick and tired 
from reading posts such as this which say I'm used to language X, and 
my feeble brain cannot cope with the differences, so why can't PHP be 
changed to behave like language X?

there you go with the feeble minded again tony..
a: this wasn't a useless request, it was a request for opinions and 
votes.
Yes, I think that any programmer who wants to change PHP so that it looks 
and feels more like his current language of choice simply because he 
cannot cope with the differences is feeble minded.

but tony.. PHP is my current language of choice..


If it is your language of choice the it must be better than the alernatives. 
So if it is better then why are you saying that it is virually unusable 
without the improvements that you have suggested?


it's very usable tony and is beter than the alternatives (for developing 
server side web applications fitting most common specs [imho]); but the 
improvements I've suggested would make it more usable (ie allow me to 
use php more efficiently in even more scenarios). Been able to use php 
to make almost everything needed so far; but sometimes it does feel a 
bit hacky and sometimes I can see how a specific part of the entire app 
could be made better in another language).


Perhaps this addresses something per jesson said as well actually. There 
is often a case where php suits 75% of the application while the 
remaning 25% would be better suited in another language; in this 
scenario often the two can't be seperated and thus rather than coding 
around the functionality lacking it would be preferable to have the 
limitation addressed in the language (if possible).


how non confrontational was that :p!

b: I'm used to PHP, it is my one of my current primary languages and has 
been for a long time; I help others with both simple and complex 
problems on this list and devote a hell of a lot of my personal time to 
helping people use php to do what they want. I am definately an advocate 
of php, contribute to open source projects and release packages which 
many thousands of people around the world use. I've also used many other 
languages and can see advantages and disadvantages to all of them; I'm 
not so niave or feeble minded to think that php is perfect the way it 
is, it's not - but it's a damn good language.


c: nothing I'm suggesting would have any effect on you're php the cobol 
way approach, I can easily cope with the difference, can you comprehend 
that it wouldn't be changing any existing functionality only adding new 
*optional* 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Stuart stut...@gmail.com wrote in message 
news:a5f019de0901181015g5e2db21fn2782839ab9648...@mail.gmail.com...

2009/1/18 Tony Marston t...@marston-home.demon.co.uk:

Nathan Rixham nrix...@gmail.com wrote in message
news:497366f5.2030...@gmail.com...

Tony Marston wrote:

Skip Evans s...@bigskypenguin.com wrote in message
news:49723137.2010...@bigskypenguin.com...
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.

Saying that someone's ideas are absolute rubbish is not an insult.
Calling him a moron would be, but I did not.
agreed, tone and meaning are so hard to convey using written words 
alone.

(you did say I was feeble brained though..)


Frankly, it's this kind of treatment that make these lists less
productive than they could be.

And you think that his ideas for changing PHP to suit his particular
programming style would be productive? I think not.

you think not; I know they'd raise my productivity in php somewhat and
increase the scope where I can use php.

It intimidates less experienced programmers from asking good 
questions,

What makes you think that he is an inexperienced programmer? What makes
you think that these are good questions? He is saying that he doesn't
like the way that PHP works and wants it changed to suit his personal
needs.

inexperienced I am not, perfect I am not. all questions are good
questions, how can things progress when nobody questions? I love the way
currently php works and I'd like (and can see a need in certain
circumstances for) a bit of optional functionality which would increase,
yes my, productivity. I'm sure though if this can increase my 
productivity

it can increase others as well - I'd like to hear from some of the spl_
and pdo_ devs on this, not to mention those who currently make orm's for
php such as the one in symphony.


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.

If it stops feeble minded people from filling this forum with useless
requests then surely that's a good thing? Personally I'm sick and tired
from reading posts such as this which say I'm used to language X, and 
my

feeble brain cannot cope with the differences, so why can't PHP be
changed to behave like language X?

there you go with the feeble minded again tony..
a: this wasn't a useless request, it was a request for opinions and 
votes.

Yes, I think that any programmer who wants to change PHP so that it looks
and feels more like his current language of choice simply because he 
cannot

cope with the differences is feeble minded.

And I think any participant on this list who cannot reasonably respond
to perfectly reasonable suggestions


In case you have forgotten what this thread is about, the OP gave a list of 
suggested improvements to PHP and asked for opinions. I merely gave my 
opinion that these improvements would be a waste of time as they would add 
nothing to the language (IMHO, of course). How many in this frum have 
expressed any support for any of these improvements?


you know; other than type hinting of primatives and the ability to type 
hint that a method argument - no they haven't; which has actually really 
suprised me tbh - I was just thinking if I compeltely renamed and 
simplified the post what the outcome would be.. I think it may be 
suprising, people can be very fickle over terminology (and change).



without resorting to child-like
name-calling should reconsider their personal brand. Every time I see
you contribute to this list you manage to lessen the respect I have
for you as a person nevermind as a developer.

PHP would not have the OO capabilities it has if developers hadn't
compared it to other languages and said yes, that would be a
useful addition. Improvements don't happen without inspiration, and
definitely won't happen if people feel threatened when they make
suggestions.


b: I'm used to PHP, it is my one of my current primary languages and has
been for a long time; I help others with both simple and complex 
problems

on this list and devote a hell of a lot of my personal time to helping
people use php to do what they want. I am definately an advocate of php,
contribute to open source projects and release packages which many
thousands of people around the world use. I've also used many other
languages and can see advantages and disadvantages to all of them; I'm 
not
so niave or feeble minded to think that php is perfect the way it is, 
it's

not - but it's a damn good language.

c: nothing I'm suggesting would have any effect on 

Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Stuart
2009/1/18 Tony Marston t...@marston-home.demon.co.uk:
 In case you have forgotten what this thread is about, the OP gave a list of
 suggested improvements to PHP and asked for opinions. I merely gave my
 opinion that these improvements would be a waste of time as they would add
 nothing to the language (IMHO, of course). How many in this frum have
 expressed any support for any of these improvements?

That's not the point. You attacked the suggester not the suggestions.
That's all I'm trying to point out. There's a way to disagree in a
reasonable manner.

 not be feasible covers loss of performance, loss of BC and a whole
 bunch of other issues. If the cost of implementing your improvements is
 not worth the dubious benefit then why should they considered?

Without adequate investigation or comment from people who actually
know about this stuff it's impossible to say whether the costs are too
great to make them acceptable against the benefits.

OO had a massive negative effect on performance, but it still happened
because the benefits greatly outweighed the costs. IMHO all ideas
should be properly considered, regardless of my gut reaction to them.

 As far as your if I can do it why can't you comment goes, I don't
 think anything has been said that would imply Nathan is not just as
 capable of developing complex systems as you think you are. He has
 expressed a wish for some additional features in PHP because he's used
 other languages with those features and he likes them. Does this mean
 he's inexperienced or incapable? No, and it's a shame you can't see
 past the end of your superiority complex and acknowledge that.

 I never said that I am superior, just that the lack of these requested
 features has not stopped me, or many other PHP programmers I would imagine,
 from writing large, complex applications with PHP. I have used many
 languages in my 35+ year career, and I am far more productive with PHP than
 I have been with all the others.

People rarely say they're superior, but that opinion often comes
across in the way they interact with others. I don't care how long
your career has been, there's a way to productively deal with other
people.

Coming back to the OO example, a lot of us got a lot done before that
came along, but that didn't make it any less welcome when it arrived,
and someone had to take the first step and suggest it. Attack people
for making suggestions and you'll quickly lose a valuable source of
ideas.

I'm done with this now as you're clearly set in your ways and it's not
adding value to the discussion.

Nathan: I see you've taken this over to the internals list. I wish you
luck with your suggestions. Keep 'em coming.

-Stuart

-- 
http://stut.net/

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



[PHP] optional type hinting enhancements

2009-01-18 Thread Nathan Rixham

Hi All,

preface: Having discussed at great length previously and probably 
completely misnaming and thus misleading the conversation here goes again.


question: Would anybody else like to see, or feel the need for, 
*optional* type hinting of variables and class properties in PHP?


examples (all optional, and syntax may differ):

class Example {
  private TypeHint $var;
}

Example $var = new Example();

in addition the ability to type hint primatives/scalars/[type object] in 
the existing implementation:


function(bool $flag) {
}

function(object $flag) {
}


This would all be under the assumption and proviso that an 
implementation would not break bc, have any markable perfomance hit, or 
in any other way effect existing applications or new applications that 
did not use the functionality (in the same way the existing type hinting 
implementation doesn't)


Any +1's?

Regards.

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



Re: [PHP] 100% CPU Usage somewhere in script - how to find it?

2009-01-18 Thread Alex Davies
Hi Eric, Richard,

Thank-you for your suggestions. I had already tried xdebug - the problem
that I had is that because of the CPU overload it was showing pretty much
everything as screwed! However by using absolute CPU time measures I managed
to work out what method was involved, and on removing it the situation is
completely resolved.

I still wonder if there is a neater way to do this!

Cheers,

Alex

On Sun, Jan 18, 2009 at 2:43 PM, Eric Butera eric.but...@gmail.com wrote:

 On Sun, Jan 18, 2009 at 3:16 AM, Alex Davies a...@davz.net wrote:
  Hi,
 
  I use a (externally developed) library within my application which
  used to work fine. However, after a recent update (which unfortunately
  we can't roll back due to dependencies) I have crazy CPU loads - there
  are ~20 cores in total on the webservers and they have gone from an
  average utilization of ~5% to 99%. I am using lighttpd, and so I can
  see the php-cgi processes using 99% all my CPU!
 
  I have an extremely basic understanding of how to track this down, and
  using XDebug and KCacheGrind I think that I have a pretty good idea
  which area the problem lies in, but the problem is that because
  whatever it is that has broken is using up the whole CPU everything
  else slows down. Furthermore, it would appear that a large part of
  what gets scheduled is luck because sometimes things are instant and
  the same activity a short while later can take forever. However, based
  on absolute CPU time's from this XDebug/KCacheGrind analysis and a gut
  hunch based upon what has changed recently I think I know roughly what
  it is. I do have a diff of the recent code change, and I have looked
  at it to no avail.
 
  My questions are:
  - Is there a better way to see what is using up the CPU? There must be
  a single loop or something talking to an external service, that is
  using so much CPU user time. Is there a super-quick way to do to this?
  I really need to know what function (or even line) is using all that
  CPU time, because I can't spot it in the code. Perhaps this
  information can be obtained from XDebug but I can't find it!
  - If there is no such magic answer to this question, what is the
  correct way to find such a phantom problem? Are there any other
  applications that might be better?
 
  If anyone has any personal recommendations for Consultants able to
  look at and fix this sort of problem that would be much appreciated
  too; I am now well out of my depth and sinking fast!
 
  Many thanks for any help,
 
  Alex
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 XDebug can produce a result showing time spent in each function across
 an entire run.  So if you were somehow able to turn on xdebug and
 reproduce this issue, it would indeed say what function/method this
 was happening in.

 http://xdebug.org/docs/profiler

 Sounds like that'd be pretty tricky, so good luck.

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




-- 
Alex Davies

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender immediately by e-mail and delete this e-mail permanently.


Re: [PHP] PMA_List_Database

2009-01-18 Thread Chris

Merlin Morgenstern wrote:

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


(Just because it has 'php' in the name does not mean we support it). 
Ask the guys that look after phpmyadmin.


http://www.phpmyadmin.net/home_page/support.php

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


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



[PHP] Re: Project management systems

2009-01-18 Thread Nathan Rixham

Skip Evans wrote:

Hey all (except Tony),


treat others how you want them to treat you *passes all his biscuits* - 
yet lol.


I've been using dotProject for a few years now and have been quite happy 
with it, and have written my own invoicing module, and a few other mods 
for the way I track hours for subcontractors, etc.


condolences

But it has trouble with MySQL 5 and from the Googling I've done it 
doesn't seem likely it will be fixed soon. Besides, I've hacked my 
install up quite a bit and if I were to upgrade there'd trouble 'a foot, 
ya'll.


maybe you'd be best fixing it yourself OR not upgrading to mysql 5?

I'm considering switching to something else, and the start of a new year 
would be a good time since my subs have all been given their 10-99s so I 
can start fresh.


really.. good luck and please let me know what you choose

Suggestions for a PHP based PM system? I'd like to be able to make mods 
so PHP is the logical choice since it's the language I know best, and as 
Tony will tell you, it's perfect and doesn't need no feeble minded Java 
guys trying to improve it.


.

Basic requirements are time tracking for multiple coders, generating 
invoices per project based on start and end date (I bill the 15th and 
last day of each month).


Gee, I guess that's the basics.

Thoughts, opinions, corrections to grammar?


not every ones cup of tea but rally agile development 
[http://www.rallydev.com/]


if you don't do anything else with this link please watch this:
http://www.rallydev.com/5601_Rally_15.html

than consider what you want from a project management system.

in all honesty though, no I can't - none seem to fit the bill completly 
and in every place I've ever worked, and personally, picking a good 
project management system has always been a major stumbling block / problem


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



Re: [PHP] optional type hinting enhancements

2009-01-18 Thread Jochem Maas
Nathan Rixham schreef:
 Hi All,
 
 preface: Having discussed at great length previously and probably
 completely misnaming and thus misleading the conversation here goes again.
 
 question: Would anybody else like to see, or feel the need for,
 *optional* type hinting of variables and class properties in PHP?
 
 examples (all optional, and syntax may differ):
 
 class Example {
   private TypeHint $var;
 }
 
 Example $var = new Example();
 
 in addition the ability to type hint primatives/scalars/[type object] in
 the existing implementation:
 
 function(bool $flag) {
 }
 
 function(object $flag) {
 }
 
 
 This would all be under the assumption and proviso that an
 implementation would not break bc, have any markable perfomance hit, or
 in any other way effect existing applications or new applications that
 did not use the functionality (in the same way the existing type hinting
 implementation doesn't)
 
 Any +1's?

can I give a +1 for you making a request to start a RFC on the matter ...
I'm sure LKS will give you perms to set up one on wiki.php.net/rfc.

some of your ideas have merit, some maybe not, others are likely to be 
impossible
to implement from a performance technical POV.

either way, having a work-in-progress RFC for these ideas would give a solid 
point
of reference for discussion. all/any of your ideas have much more chance of
making inroads if implementation/BC/performance/syntax details/proposals are
properly documented.

I think adhoc discussion via the mailing list leads generally nowhere with this
type of thing, there is too much noise and it's nigh on impossible to grok where
the status quo is at or what current the proposal might be.

some of your points lean purely to making php more consistent, they may even
be self-evident (e.g. completion of things your able to typehint) but 
nonetheless
even that needs solid argumentation in order to win the minds of the guys that
will/may end up implementing it.

RFC is the way to go. I for one would gladly take time to read/review/comment, 
if
nothing else it's interesting.

actually thinking about it you might consider thinking in terms of a collection
of RFC's (your ideas cover quite a lot of ground/scope) in order to maintain 
tight
focus.

 Regards.
 


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



Re: [PHP] optional type hinting enhancements

2009-01-18 Thread Török Alpár
I see a problem with this. Scalars are automatically casted by PHP based on
a set of rules. In  case of  a scalar type hint, would jo issue an error, or
make the automatic type cast?   both approaches have there advantages, but
the automatic cast, would go better with the actual features of the
language, but in this case, object could also cast an array to stdClass, and
i am not sure that's how you imagined it. Besides this i am not against it
along as it doens't create implementaion nor performance problems, and this
problem is solved.

2009/1/18 Nathan Rixham nrix...@gmail.com

 Hi All,

 preface: Having discussed at great length previously and probably
 completely misnaming and thus misleading the conversation here goes again.

 question: Would anybody else like to see, or feel the need for, *optional*
 type hinting of variables and class properties in PHP?

 examples (all optional, and syntax may differ):

 class Example {
  private TypeHint $var;
 }



 Example $var = new Example();


 in addition the ability to type hint primatives/scalars/[type object] in
 the existing implementation:

 function(bool $flag) {
 }



 function(object $flag) {
 }




 This would all be under the assumption and proviso that an implementation
 would not break bc, have any markable perfomance hit, or in any other way
 effect existing applications or new applications that did not use the
 functionality (in the same way the existing type hinting implementation
 doesn't)

 Any +1's?

 Regards.

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




-- 
Torok, Alpar Istvan


Re: [PHP] optional type hinting enhancements

2009-01-18 Thread Nathan Rixham

Jochem Maas wrote:

Nathan Rixham schreef:

Hi All,

preface: Having discussed at great length previously and probably
completely misnaming and thus misleading the conversation here goes again.

question: Would anybody else like to see, or feel the need for,
*optional* type hinting of variables and class properties in PHP?

examples (all optional, and syntax may differ):

class Example {
  private TypeHint $var;
}

Example $var = new Example();

in addition the ability to type hint primatives/scalars/[type object] in
the existing implementation:

function(bool $flag) {
}

function(object $flag) {
}


This would all be under the assumption and proviso that an
implementation would not break bc, have any markable perfomance hit, or
in any other way effect existing applications or new applications that
did not use the functionality (in the same way the existing type hinting
implementation doesn't)

Any +1's?


can I give a +1 for you making a request to start a RFC on the matter ...
I'm sure LKS will give you perms to set up one on wiki.php.net/rfc.


lukas, thoughts? [ini proposals coming in a minute, just diff'ing]


some of your ideas have merit, some maybe not, others are likely to be 
impossible
to implement from a performance technical POV.

either way, having a work-in-progress RFC for these ideas would give a solid 
point
of reference for discussion. all/any of your ideas have much more chance of
making inroads if implementation/BC/performance/syntax details/proposals are
properly documented.


agreed and thanks for the idea.


I think adhoc discussion via the mailing list leads generally nowhere with this
type of thing, there is too much noise and it's nigh on impossible to grok where
the status quo is at or what current the proposal might be.


noticed that one; which is a shame tbh; alas..


some of your points lean purely to making php more consistent, they may even
be self-evident (e.g. completion of things your able to typehint) but 
nonetheless
even that needs solid argumentation in order to win the minds of the guys that
will/may end up implementing it.

RFC is the way to go. I for one would gladly take time to read/review/comment, 
if
nothing else it's interesting.


interesting it is; it's a shame the evangalism list died a death [not 
sure why i see that as related, but i do]



actually thinking about it you might consider thinking in terms of a collection
of RFC's (your ideas cover quite a lot of ground/scope) in order to maintain 
tight
focus.



agreed, probably
- enhancing / completing existing type hinting
- single superclass which all objects extend
- optional type hinting for variables and class parameters
- optional type hinting for return types (mind you thats already rfc'd)
- additional magic method __cast (needs more thought)
- constructor overloading
- generics and templates [i jest]

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Stuart stut...@gmail.com wrote in message 
news:a5f019de0901181322i2a4cbfaam4d36eff843f42...@mail.gmail.com...
 2009/1/18 Tony Marston t...@marston-home.demon.co.uk:
 In case you have forgotten what this thread is about, the OP gave a list 
 of
 suggested improvements to PHP and asked for opinions. I merely gave my
 opinion that these improvements would be a waste of time as they would 
 add
 nothing to the language (IMHO, of course). How many in this frum have
 expressed any support for any of these improvements?

 That's not the point. You attacked the suggester not the suggestions.
 That's all I'm trying to point out. There's a way to disagree in a
 reasonable manner.

Anybody who suggests that PHP be changed from dynamic typing to static 
typing is feeble minded, one brick short of a full load, one sandwich short 
of a picnic, off his trolley, talking out of the wrong end of his alimentary 
canal, etc, etc. In my humble opinion, of course.

 not be feasible covers loss of performance, loss of BC and a whole
 bunch of other issues. If the cost of implementing your improvements 
 is
 not worth the dubious benefit then why should they considered?

 Without adequate investigation or comment from people who actually
 know about this stuff it's impossible to say whether the costs are too
 great to make them acceptable against the benefits.

 OO had a massive negative effect on performance, but it still happened
 because the benefits greatly outweighed the costs. IMHO all ideas
 should be properly considered, regardless of my gut reaction to them.

Statuic typing is unworthy of consideration in a language whch has made its 
bones from being dynamically typed. In my humble opinion, of course.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 As far as your if I can do it why can't you comment goes, I don't
 think anything has been said that would imply Nathan is not just as
 capable of developing complex systems as you think you are. He has
 expressed a wish for some additional features in PHP because he's used
 other languages with those features and he likes them. Does this mean
 he's inexperienced or incapable? No, and it's a shame you can't see
 past the end of your superiority complex and acknowledge that.

 I never said that I am superior, just that the lack of these requested
 features has not stopped me, or many other PHP programmers I would 
 imagine,
 from writing large, complex applications with PHP. I have used many
 languages in my 35+ year career, and I am far more productive with PHP 
 than
 I have been with all the others.

 People rarely say they're superior, but that opinion often comes
 across in the way they interact with others. I don't care how long
 your career has been, there's a way to productively deal with other
 people.

 Coming back to the OO example, a lot of us got a lot done before that
 came along, but that didn't make it any less welcome when it arrived,
 and someone had to take the first step and suggest it. Attack people
 for making suggestions and you'll quickly lose a valuable source of
 ideas.

 I'm done with this now as you're clearly set in your ways and it's not
 adding value to the discussion.

 Nathan: I see you've taken this over to the internals list. I wish you
 luck with your suggestions. Keep 'em coming.

 -Stuart

 -- 
 http://stut.net/ 



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



Re: [PHP] optional type hinting enhancements

2009-01-18 Thread Nathan Rixham

Török Alpár wrote:

I see a problem with this. Scalars are automatically casted by PHP based on
a set of rules. In  case of  a scalar type hint, would jo issue an error, or
make the automatic type cast?   both approaches have there advantages, but
the automatic cast, would go better with the actual features of the
language, but in this case, object could also cast an array to stdClass, and
i am not sure that's how you imagined it. Besides this i am not against it
along as it doens't create implementaion nor performance problems, and this
problem is solved.


I see what you mean with the casts; and a very good point on why scalars 
aren't already implemented..


On the one hand i see scope for a set of primative wrappers (class 
String, Integer, Boolean etc) which those who wished could use (with an 
auto cast).


Whilst on the other hand it could be argued that the current is_xxx 
functionality could be copied so an integer in a string is still a 
string, likewise 1 is an integer not a boolean true etc etc.


defintaly needs some thought and practical examples though.. rfc time 
one thinks.


with the specific array example, this is already implemented so no 
problems there, what is not implemented though is the ability to 
function(object $obj) which seems strange.


as for the error, same as it is currently E_RECOVERABLE_ERROR and def 
not automatic type casting; last thing you want when trying to be strict 
is anything like that :p


thanks for the input!

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Nathan Rixham

Tony Marston wrote:
Stuart stut...@gmail.com wrote in message 
news:a5f019de0901181322i2a4cbfaam4d36eff843f42...@mail.gmail.com...

2009/1/18 Tony Marston t...@marston-home.demon.co.uk:
In case you have forgotten what this thread is about, the OP gave a list 
of

suggested improvements to PHP and asked for opinions. I merely gave my
opinion that these improvements would be a waste of time as they would 
add

nothing to the language (IMHO, of course). How many in this frum have
expressed any support for any of these improvements?

That's not the point. You attacked the suggester not the suggestions.
That's all I'm trying to point out. There's a way to disagree in a
reasonable manner.


Anybody who suggests that PHP be changed from dynamic typing to static 
typing is feeble minded, one brick short of a full load, one sandwich short 
of a picnic, off his trolley, talking out of the wrong end of his alimentary 
canal, etc, etc. In my humble opinion, of course.


luckily.. nobody suggested that and the only person who came close was 
tony himself :D perhaps the phrase optional type hinting of variables 
and class properties is more appropriate ;)



not be feasible covers loss of performance, loss of BC and a whole
bunch of other issues. If the cost of implementing your improvements 
is

not worth the dubious benefit then why should they considered?

Without adequate investigation or comment from people who actually
know about this stuff it's impossible to say whether the costs are too
great to make them acceptable against the benefits.

OO had a massive negative effect on performance, but it still happened
because the benefits greatly outweighed the costs. IMHO all ideas
should be properly considered, regardless of my gut reaction to them.


Statuic typing is unworthy of consideration in a language whch has made its 
bones from being dynamically typed. In my humble opinion, of course.




luckily.. nobody suggested that and the only person who came close was 
tony himself :D perhaps the phrase optional type hinting of variables 
and class properties is more appropriate ;)


ground hog day!

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



Re: [PHP] optional type hinting enhancements

2009-01-18 Thread Török Alpár
2009/1/19 Nathan Rixham nrix...@gmail.com

 Török Alpár wrote:

 I see a problem with this. Scalars are automatically casted by PHP based
 on
 a set of rules. In  case of  a scalar type hint, would jo issue an error,
 or
 make the automatic type cast?   both approaches have there advantages, but
 the automatic cast, would go better with the actual features of the
 language, but in this case, object could also cast an array to stdClass,
 and
 i am not sure that's how you imagined it. Besides this i am not against it
 along as it doens't create implementaion nor performance problems, and
 this
 problem is solved.


 I see what you mean with the casts; and a very good point on why scalars
 aren't already implemented..

 On the one hand i see scope for a set of primative wrappers (class String,
 Integer, Boolean etc) which those who wished could use (with an auto cast).

 Whilst on the other hand it could be argued that the current is_xxx
 functionality could be copied so an integer in a string is still a string,
 likewise 1 is an integer not a boolean true etc etc.

 defintaly needs some thought and practical examples though.. rfc time one
 thinks.

 with the specific array example, this is already implemented so no problems
 there, what is not implemented though is the ability to function(object
 $obj) which seems strange.

if a cast is made, and $obj is in fact an array, the outcome may not be what
you wanted. This one is even trickier, since you may expect an error here,
given that you have type hinting for specific object types.



 as for the error, same as it is currently E_RECOVERABLE_ERROR and def not
 automatic type casting; last thing you want when trying to be strict is
 anything like that :p

agree, but that would make static types behave differently than they
currently are. With some wrapper classes, you might end up with the same
trouble, you can type hint Integer, and send a scalar string that contains
an integer, then you are back to the good old casting rules.



 thanks for the input!


i think that this functionality is worth talking about, but the point is to
integrate this with the way PHP does things right now, you can't take the
Java model as is, and apply it to PHP, there is  a devil in the details.

-- 
Torok, Alpar Istvan


[PHP] Re: Project management systems

2009-01-18 Thread Skip Evans

Hey Nathan and all, (even Tony, kisses big T!)

I decided, rather quickly, on this one.

http://itprojectguide.org/

It's dotProject based with apparent upgrades to work with 
MySQL 5 and jQuery so that it has some nice AJAX functionality 
where dP would keep you waiting on whole page refreshes.


The developer is very responsive to the minor issues I've had, 
so I'm going to probably keep it and import my custom modules 
from dP into it.


Skip

Nathan Rixham wrote:

Skip Evans wrote:

Hey all (except Tony),


treat others how you want them to treat you *passes all his biscuits* - 
yet lol.


I've been using dotProject for a few years now and have been quite 
happy with it, and have written my own invoicing module, and a few 
other mods for the way I track hours for subcontractors, etc.


condolences

But it has trouble with MySQL 5 and from the Googling I've done it 
doesn't seem likely it will be fixed soon. Besides, I've hacked my 
install up quite a bit and if I were to upgrade there'd trouble 'a 
foot, ya'll.


maybe you'd be best fixing it yourself OR not upgrading to mysql 5?

I'm considering switching to something else, and the start of a new 
year would be a good time since my subs have all been given their 
10-99s so I can start fresh.


really.. good luck and please let me know what you choose

Suggestions for a PHP based PM system? I'd like to be able to make 
mods so PHP is the logical choice since it's the language I know best, 
and as Tony will tell you, it's perfect and doesn't need no feeble 
minded Java guys trying to improve it.


.

Basic requirements are time tracking for multiple coders, generating 
invoices per project based on start and end date (I bill the 15th and 
last day of each month).


Gee, I guess that's the basics.

Thoughts, opinions, corrections to grammar?


not every ones cup of tea but rally agile development 
[http://www.rallydev.com/]


if you don't do anything else with this link please watch this:
http://www.rallydev.com/5601_Rally_15.html

than consider what you want from a project management system.

in all honesty though, no I can't - none seem to fit the bill completly 
and in every place I've ever worked, and personally, picking a good 
project management system has always been a major stumbling block / problem




--

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

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



Re: [PHP] Re: Opinions / Votes Needed

2009-01-18 Thread Tony Marston

Nathan Rixham nrix...@gmail.com wrote in message 
news:4973b738.3010...@gmail.com...
 Tony Marston wrote:
 Stuart stut...@gmail.com wrote in message 
 news:a5f019de0901181322i2a4cbfaam4d36eff843f42...@mail.gmail.com...
 2009/1/18 Tony Marston t...@marston-home.demon.co.uk:
 In case you have forgotten what this thread is about, the OP gave a 
 list of
 suggested improvements to PHP and asked for opinions. I merely gave 
 my
 opinion that these improvements would be a waste of time as they 
 would add
 nothing to the language (IMHO, of course). How many in this frum have
 expressed any support for any of these improvements?
 That's not the point. You attacked the suggester not the suggestions.
 That's all I'm trying to point out. There's a way to disagree in a
 reasonable manner.

 Anybody who suggests that PHP be changed from dynamic typing to static 
 typing is feeble minded, one brick short of a full load, one sandwich 
 short of a picnic, off his trolley, talking out of the wrong end of his 
 alimentary canal, etc, etc. In my humble opinion, of course.

 luckily.. nobody suggested that

You suggested that. You original post specifically said static typing and 
not type hinting. There is a BIG difference.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 and the only person who came close was tony himself :D perhaps the phrase 
 optional type hinting of variables and class properties is more 
 appropriate ;)

 not be feasible covers loss of performance, loss of BC and a 
 whole
 bunch of other issues. If the cost of implementing your improvements 
 is
 not worth the dubious benefit then why should they considered?
 Without adequate investigation or comment from people who actually
 know about this stuff it's impossible to say whether the costs are too
 great to make them acceptable against the benefits.

 OO had a massive negative effect on performance, but it still happened
 because the benefits greatly outweighed the costs. IMHO all ideas
 should be properly considered, regardless of my gut reaction to them.

 Statuic typing is unworthy of consideration in a language whch has made 
 its bones from being dynamically typed. In my humble opinion, of course.


 luckily.. nobody suggested that and the only person who came close was 
 tony himself :D perhaps the phrase optional type hinting of variables and 
 class properties is more appropriate ;)

 ground hog day! 



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



Re: [PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-18 Thread Jochem Maas
Graham Anderson schreef:
 Hi
 
 I am having problems getting GD to convert a transparent PNG-8 to a
 transparent GIF
 The below WILL produce a GIF...but leaves a white background
 
 # Convert the PreExisting PNG Image to a GIF
 $img = imagecreatefrompng($pngPath);
 
 # Set the GIF to be transparent: Does not seem to work
 $trans_color = imagecolortransparent($img );
  $trans_index = imagecolorallocate($img, $trans_color['red'],
 $trans_color['green'], $trans_color['blue'] );
  imagecolortransparent($img, $trans_index );

I can't see the above code doing much useful. the problem is somewhat
more involved, png uses an alpha channel to determine how much transparency
a given pixel has, with gif a pixel is either transparent or not, essentially
a given colour in the gif's palette is marked as transparent and all
pixels with that color are therefore shown as transparent.

try the code here (no idea how well it works):

http://demo.pixelsandpages.com/php-tests/images/test.html

and/or dig into the user comments here:

http://php.net/imagecolortransparent


 # Save the Image as a GIF in the directory
 imagegif($img, $gifAbsolutePath);
 
 
 Is there another way that works?
 
 Many thanks in advance
 
 G
 


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



Re: [PHP] 100% CPU Usage somewhere in script - how to find it?

2009-01-18 Thread Kyle Terry
On Sun, Jan 18, 2009 at 2:00 PM, Alex Davies a...@davz.net wrote:

 Hi Eric, Richard,

 Thank-you for your suggestions. I had already tried xdebug - the problem
 that I had is that because of the CPU overload it was showing pretty much
 everything as screwed! However by using absolute CPU time measures I
 managed
 to work out what method was involved, and on removing it the situation is
 completely resolved.

 I still wonder if there is a neater way to do this!

 Cheers,

 Alex

 On Sun, Jan 18, 2009 at 2:43 PM, Eric Butera eric.but...@gmail.com
 wrote:

  On Sun, Jan 18, 2009 at 3:16 AM, Alex Davies a...@davz.net wrote:
   Hi,
  
   I use a (externally developed) library within my application which
   used to work fine. However, after a recent update (which unfortunately
   we can't roll back due to dependencies) I have crazy CPU loads - there
   are ~20 cores in total on the webservers and they have gone from an
   average utilization of ~5% to 99%. I am using lighttpd, and so I can
   see the php-cgi processes using 99% all my CPU!
  
   I have an extremely basic understanding of how to track this down, and
   using XDebug and KCacheGrind I think that I have a pretty good idea
   which area the problem lies in, but the problem is that because
   whatever it is that has broken is using up the whole CPU everything
   else slows down. Furthermore, it would appear that a large part of
   what gets scheduled is luck because sometimes things are instant and
   the same activity a short while later can take forever. However, based
   on absolute CPU time's from this XDebug/KCacheGrind analysis and a gut
   hunch based upon what has changed recently I think I know roughly what
   it is. I do have a diff of the recent code change, and I have looked
   at it to no avail.
  
   My questions are:
   - Is there a better way to see what is using up the CPU? There must be
   a single loop or something talking to an external service, that is
   using so much CPU user time. Is there a super-quick way to do to this?
   I really need to know what function (or even line) is using all that
   CPU time, because I can't spot it in the code. Perhaps this
   information can be obtained from XDebug but I can't find it!
   - If there is no such magic answer to this question, what is the
   correct way to find such a phantom problem? Are there any other
   applications that might be better?
  
   If anyone has any personal recommendations for Consultants able to
   look at and fix this sort of problem that would be much appreciated
   too; I am now well out of my depth and sinking fast!
  
   Many thanks for any help,
  
   Alex
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
  XDebug can produce a result showing time spent in each function across
  an entire run.  So if you were somehow able to turn on xdebug and
  reproduce this issue, it would indeed say what function/method this
  was happening in.
 
  http://xdebug.org/docs/profiler
 
  Sounds like that'd be pretty tricky, so good luck.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 Alex Davies

 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the sender immediately by e-mail and delete this e-mail permanently.

You should probably use Xdebug to find out what needs that method...


-- 
Kyle Terry | www.kyleterry.com


[PHP] xLog: Extended PHP Logging

2009-01-18 Thread shire


I've just released the first public version of xLog, a PHP extension that 
allows extended logging of PHP errors, including Fatal errors.  Output 
typically includes referral, GET values, URL, and a full backtrace.  Additional 
information can be included via custom variables by the developer at runtime.  
xLog is derived from similar code used for the last couple years at Facebook 
for faster debugging by developers.  It’s finally reached the point where I 
believe it’s ready to take the next step into the Open Source community so it 
can grow and benefit a larger group of people.

I'd like to get get more feedback on use cases, and any problems that might be 
encountered on different or unusual code.  You can get more information and 
download the source from:  http://tekrat.com/php/xlog/.  Please contact me with 
any problems or feedback, and I hope that you all find it useful!  Example 
error log output is below:

[15415:001:0001] [xlog1.0.0] Fatal PHP Fatal error: Call to undefined 
function foo() in /www/foo.php on line 3
(ip: 127.0.0.1)
(at: localhost/foo.php)
(referer: empty)
(agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.5) 
Gecko/2008120121 Firefox/3.0.5)
(post: empty)
(cookies: empty)
trace starts at [/www/foo.php:3]

#0 in bar at [/www/foo.php:3]
#1 bar(’somestring’, 10039877, object, TRUE), called at [/www/foo.php:5]


Thanks,

-shire

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



Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Benjamin Hawkes-Lewis

On 16/1/09 23:41, Shawn McKenzie wrote:

Again, I say that it won't work on URLs with spaces, like my web
page.html.  When I get a minute I'll fix it.  I thought spaces in URLs
weren't valid markup, but it seems to validate.


Some small points of information:

An HTML4 validator will only check that a HREF value is CDATA, as 
required by the DTD:


http://www.w3.org/TR/REC-html40/struct/links.html#adef-href

http://www.w3.org/TR/REC-html40/sgml/dtd.html#URI

http://www.w3.org/TR/REC-html40/types.html#type-cdata

Plenty of things can be CDATA without being a valid URI:

http://gbiv.com/protocols/uri/rfc/rfc3986.html

Space characters (U+0020) that are not percent encoded are not valid in 
a URI:


http://gbiv.com/protocols/uri/rfc/rfc3986.html#collected-abnf

That's not to say that browsers haven't developed error handling for 
space characters (and other illegal characters) in HREF values.


The HTML5 draft proposes an algorithm for parsing and resolving HREF 
values that includes such error handling:


http://www.whatwg.org/specs/web-apps/current-work/#parsing-urls

http://www.whatwg.org/specs/web-apps/current-work/#resolving-urls

--
Benjamin Hawkes-Lewis

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



[PHP] Curriculum Vitae opinions

2009-01-18 Thread Jason Pruim

Hi everyone,

I am working on putting together my Curriculum Vitae (Cv/Resume for  
those not the US and not in the academic world) and wanted to get some  
opinions on how you would list a long term project? You know,  
something like where you may only work a little each month but are  
involved in it?


Once I have a permanent home for my cv on line along with my site I'll  
spam the list :)


Thanks for your opinions.



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



Re: [PHP] Parsing HTML href-Attribute

2009-01-18 Thread Micah Gersten
Depending on the goal, using the base tag in the head section might help:
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Edmund Hertle wrote:
 Hey,
 I want to parse a href-attribute in a given String to check if there is a
 relative link and then adding an absolute path.
 Example:
 $string  = 'a class=sample [...additional attributes...]
 href=/foo/bar.php ';

 I tried using regular expressions but my knowledge of RegEx is very limited.
 Things to consider:
 - $string could be quite long but my concern are only those href attributes
 (so working with explode() would be not very handy)
 - Should also work if href= is not using quotes or using single quotes
 - link could already be an absolute path, so just searching for href= and
 then inserting absolute path could mess up the link

 Any ideas? Or can someone create a RegEx to use?

 Thanks

   

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



Re: [PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-18 Thread Graham Anderson

Thanks for the reply

I tried the example (below) from the link and still get a gif with  
white background.  Maybe, you can only do this with PNG-24s...not  
PNG-8s?

Anyone else know if this can work?


# Convert the PreExisting PNG Image to a GIF
$img = imagecreatefrompng($pngPath);

$gifAbsolutePath = PROJECT_ROOT_DIR.'/'.$gifDir.'/'.$gif;   


$transparentColor = imagecolorallocate($img, 0xfe, 0x3, 0xf4 );
//$ditherHistory = array(); //stores number of times it was transparent
$height = imagesy($img);
$width = imagesx($img);

for($x = 0; $x  $width; $x++):
for($y = 0; $y  $height; $y++):
$alpha = (imagecolorat($img,$x,$y)  0x7F00)  24;//127 is  
completely TRANSPARENT, 0 opaque

//DITHER!
if($alpha3(
$alpha =127-3 ||
(rand(0,127))=(127-$alpha)
)){
imagesetpixel($img,$x,$y,$transparentColor);
}

endfor;
endfor;

imagecolortransparent($img, $transparentColor);

# Save the Image as a GIF in the directory $gifDir
imagegif($img, $gifAbsolutePath);

imagedestroy($img);


On Jan 18, 2009, at 4:46 PM, Jochem Maas wrote:


Graham Anderson schreef:

Hi

I am having problems getting GD to convert a transparent PNG-8 to a
transparent GIF
The below WILL produce a GIF...but leaves a white background

# Convert the PreExisting PNG Image to a GIF
$img = imagecreatefrompng($pngPath);

# Set the GIF to be transparent: Does not seem to work
$trans_color = imagecolortransparent($img );
$trans_index = imagecolorallocate($img, $trans_color['red'],
$trans_color['green'], $trans_color['blue'] );
imagecolortransparent($img, $trans_index );


I can't see the above code doing much useful. the problem is somewhat
more involved, png uses an alpha channel to determine how much  
transparency
a given pixel has, with gif a pixel is either transparent or not,  
essentially

a given colour in the gif's palette is marked as transparent and all
pixels with that color are therefore shown as transparent.

try the code here (no idea how well it works):

http://demo.pixelsandpages.com/php-tests/images/test.html

and/or dig into the user comments here:

http://php.net/imagecolortransparent



# Save the Image as a GIF in the directory
imagegif($img, $gifAbsolutePath);


Is there another way that works?

Many thanks in advance

G






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



[PHP] ob_start(ob_gzhandler) producing garbage before document header

2009-01-18 Thread Graham Anderson
Hi, using ob_gzhandler  produces a 5-8 characters,  
�“×2���, before the document header.

Using ob_start() does not produce the text garbage.

Is there a way to get ob_start(ob_gzhandler) to behave?

Many thanks in advance



Abridged Code:
ob_start(ob_gzhandler); //produces initial text garbage
# ob_start() //Produces No initial text garbage

# Cache the output
$data = ob_get_contents();

//ob_end_clean(); Can't seem to make this work with ob_gzhandler


# Remove any whitespace that screws up the headers (cannot modify  
headers error)

print trim($data);

# Flush in all ways known to man
flush(); ob_flush(); ob_end_flush();
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] GD and Converting a Transparent PNG-8 to a Transparent GIF

2009-01-18 Thread Graham Anderson

I got it to work :)
Like you had recommended, I found a script in http://php.net/imagecolortransparent 
 from: fmkaiba at optonline dot net

07-Feb-2008 08:05.  The function is called, createthumb

Cheers
Graham

On Jan 18, 2009, at 4:46 PM, Jochem Maas wrote:


Graham Anderson schreef:

Hi

I am having problems getting GD to convert a transparent PNG-8 to a
transparent GIF
The below WILL produce a GIF...but leaves a white background

# Convert the PreExisting PNG Image to a GIF
$img = imagecreatefrompng($pngPath);

# Set the GIF to be transparent: Does not seem to work
$trans_color = imagecolortransparent($img );
$trans_index = imagecolorallocate($img, $trans_color['red'],
$trans_color['green'], $trans_color['blue'] );
imagecolortransparent($img, $trans_index );


I can't see the above code doing much useful. the problem is somewhat
more involved, png uses an alpha channel to determine how much  
transparency
a given pixel has, with gif a pixel is either transparent or not,  
essentially

a given colour in the gif's palette is marked as transparent and all
pixels with that color are therefore shown as transparent.

try the code here (no idea how well it works):

http://demo.pixelsandpages.com/php-tests/images/test.html

and/or dig into the user comments here:

http://php.net/imagecolortransparent



# Save the Image as a GIF in the directory
imagegif($img, $gifAbsolutePath);


Is there another way that works?

Many thanks in advance

G






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



[PHP] PHP Imagefill

2009-01-18 Thread Ron Piggott
Is there a way to specify an already existing file to use as the
background, instead of a specific color, such as what
http://ca.php.net/manual/en/function.imagefill.php illustrates?  Ron


[PHP] old HTTP variables

2009-01-18 Thread Ashley M. Kirchner


   Maybe I'm asking for trouble here, but, is there any way to make PHP 
5.2.8 understand the old $HTTP variables?  Like:


$HTTP_SESSION_VARS
$HTTP_GET_VARS
$HTTP_POST_VARS
$HTTP_SESSION_VARS
$HTTP_COOKIE_VARS

   etc., etc.

   I have an old application for which development has stopped back in 
2004 ...  Should I give up now and install an earlier version of PHP 
(and somehow have it behave nice next to PHP5?


   -- A

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



Re: [PHP] old HTTP variables

2009-01-18 Thread mike
$HTTP_GET_VARS = $_GET;

etc. :)

On Sun, Jan 18, 2009 at 9:12 PM, Ashley M. Kirchner ash...@pcraft.com wrote:

   Maybe I'm asking for trouble here, but, is there any way to make PHP 5.2.8
 understand the old $HTTP variables?  Like:

 $HTTP_SESSION_VARS
 $HTTP_GET_VARS
 $HTTP_POST_VARS
 $HTTP_SESSION_VARS
 $HTTP_COOKIE_VARS

   etc., etc.

   I have an old application for which development has stopped back in 2004
 ...  Should I give up now and install an earlier version of PHP (and somehow
 have it behave nice next to PHP5?

   -- A

 --
 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] old HTTP variables

2009-01-18 Thread Ashley M. Kirchner

mike wrote:

$HTTP_GET_VARS = $_GET;

etc. :)
   I know what they are.  I'm not about to change a couple of thousand 
lines of someone else's code unless there's no other way.  :)


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



Re: [PHP] old HTTP variables

2009-01-18 Thread mike
On Sun, Jan 18, 2009 at 9:18 PM, Ashley M. Kirchner ash...@pcraft.com wrote:
 mike wrote:

 $HTTP_GET_VARS = $_GET;

 etc. :)

   I know what they are.  I'm not about to change a couple of thousand lines
 of someone else's code unless there's no other way.  :)

no i mean define that at the top before the code runs.

maybe use the ini setting for prepending script...

(i do the following to standardize our codebase)

unset($_REQUEST);
unset($HTTP_GET_VARS);
unset($HTTP_POST_VARS);
unset($HTTP_COOKIE_VARS);
unset($HTTP_SERVER_VARS);
unset($HTTP_ENV_VARS);
unset($HTTP_POST_FILES);
unset($HTTP_SESSION_VARS);

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



[PHP] phpMailer Problem!

2009-01-18 Thread shahrzad khorrami
I tested with port 25, but it didn't work.
I confuse, I don't know what problem is
 it works well with gmail...

thanks for reply :)


Re: [PHP] phpMailer Problem!

2009-01-18 Thread Chris

shahrzad khorrami wrote:

I tested with port 25, but it didn't work.
I confuse, I don't know what problem is
 it works well with gmail...


http://phpmailer.codeworxtech.com/index.php?pg=sfp=ml

The phpmailer users/developers will be able to help you debug this better.

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


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



Re: [PHP] phpMailer Problem!

2009-01-18 Thread shahrzad khorrami
thanks chris :)


Re: [PHP] old HTTP variables

2009-01-18 Thread Larry Garfield
On Sunday 18 January 2009 11:12:28 pm Ashley M. Kirchner wrote:
 Maybe I'm asking for trouble here, but, is there any way to make PHP
 5.2.8 understand the old $HTTP variables?  Like:

 $HTTP_SESSION_VARS
 $HTTP_GET_VARS
 $HTTP_POST_VARS
 $HTTP_SESSION_VARS
 $HTTP_COOKIE_VARS

 etc., etc.

 I have an old application for which development has stopped back in
 2004 ...  Should I give up now and install an earlier version of PHP
 (and somehow have it behave nice next to PHP5?

 -- A

http://us3.php.net/manual/en/ini.core.php#ini.register-long-arrays

Although you should probably take the time to upgrade the app anyway, as those 
variables are deprecated and won't be around forever.

-- 
Larry Garfield
la...@garfieldtech.com

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



Re: [PHP] old HTTP variables

2009-01-18 Thread Ashley M. Kirchner

Larry Garfield wrote:

http://us3.php.net/manual/en/ini.core.php#ini.register-long-arrays
  

   Bingo.  That's what I needed.

Although you should probably take the time to upgrade the app anyway, as those 
variables are deprecated and won't be around forever.
   Yeah, that would be nice, except it's not something I wrote, nor am 
I inclined to go rewrite the app at this point in time.  Maybe sometime 
later, but right now I just needed to get the thing up and running.


   Thanks for the pointer!

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