Re: [PHP] Do you use a public framework or roll your own?

2010-01-27 Thread Rene Veerman
I usually roll my own, unless there's a free lib / cms that does the trick near-perfectly, and is well-written (so extensible) About 80-90% of my tasks require me to use one of my own frameworks (i have 2, one "simple" and one with many graphical gimmicks), and i re-use / improve the mid-level fun

Re: [PHP] Do you use a public framework or roll your own?

2010-01-27 Thread Teus Benschop
Shortly ago, moving from programming in Gtk+ / C++ to PHP for the first time in my life, I made a good study of the available rapid application development options out there, studied a few PHP frameworks, read the opinions on the internet about it, then initially decided to use a framework to speed

Re: [PHP] Do you use a public framework or roll your own?

2010-01-27 Thread Stuart Dallas
On 27 Jan 2010, at 00:17, Daevid Vincent wrote: > And for those interested, here are the results of the last poll: > > "To add the final ?> in PHP or not..." > http://www.rapidpoll.net/show.aspx?id=arc1opy > > I'm relieved to know I'm in the majority (almost 2:1) who close their > opening PHP tag

[PHP] Re: Recursion issue with Zend_Soap_AutoDiscovery.

2010-01-27 Thread Richard Quadling
2010/1/25 Richard Quadling : > Hi. > > I'm in the process of building a web service which incorporates the > ability for the server to inform the client that a particular call has > been superseded by another. > > So, cut down (I've removed all the other details), ... > > class ServiceDetails >    

[PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Ryan Park
Hypothetically say that I have MySQL with petabytes of data. I want to use XSL as my template language. But in order to use XSL, I need to make XML filled with petabytes of data. This does not sound elaborate way to use XSL/XML; I would rather use PHP/MySQL/Smarty. Is there a way around this so

Re: [PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 03:31 -0800, Ryan Park wrote: > Hypothetically say that I have MySQL with petabytes of data. I want to > use XSL as my template language. But in order to use XSL, I need to make > XML filled with petabytes of data. This does not sound elaborate way to > use XSL/XML; I woul

Re: [PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Ryan Park
My only reason doing this because I could use XSL as my templating engine; achieve the separation of content, design, and code. But in order to use XSL I need to use XML. XML needs to big if I want to use the data from the huge MySQL database. On 1/27/2010 3:32 AM, Ashley Sheridan wrote: On W

Re: [PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 03:39 -0800, Ryan Park wrote: > My only reason doing this because I could use XSL as my templating > engine; achieve the separation of content, design, and code. But in > order to use XSL I need to use XML. XML needs to big if I want to use > the data from the huge MySQL d

Re: [PHP] Reports generator

2010-01-27 Thread Ashley Sheridan
On Tue, 2010-01-26 at 18:54 +0100, PEPITOVADECURT wrote: > Exists any reports generator that exports directly to html/php? > > What do you want to generate reports on? I would assume this would be some sort of data from a database, and that you're looking for a PHP-based reporting tool that ca

[PHP] Multiple Class Inheritance

2010-01-27 Thread Ashley Sheridan
Hi All, I know that a class can only inherit from one other single class in PHP, but how would I go about simulating a multiple class inheritance? For example, if I had several small classes that dealt with things like form generation, navbar generation, etc, how could I create a class in which th

RE: [PHP] If the first four characters are "0000", then do {}

2010-01-27 Thread Ford, Mike
> -Original Message- > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: 26 January 2010 03:52 > > if (substr($mydata->restored,0,4) == "") { } > > Or in your very specific case you could do the harder way and note > that > strings work like simple arrays too in a way, so $mydat

Re: [PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Jay Ess
Ryan Park wrote: Hypothetically say that I have MySQL with petabytes of data. I want to use XSL as my template language. But in order to use XSL, I need to make XML filled with petabytes of data. This does not sound elaborate way to use XSL/XML; I would rather use PHP/MySQL/Smarty. Is there a

Re: [PHP] Multiple Class Inheritance

2010-01-27 Thread Rene Veerman
If you want m-inheritance, you can "include" (encapsulate is the word i think) your smaller classes in "midware" and "big top-level" classes that expose (part of) their interfaces. It's easy. But guard against creating too many dependencies between different smaller classes to and "bigger" classes

Re: [PHP] Multiple Class Inheritance

2010-01-27 Thread Rene Veerman
Oh, and i'd allow 1 (or _maybe_ 2) "very big" super-class(es) at the top level of a framework / cms, that do include 50-100 smaller classes. "midware" classes can evolve (be extracted) from the superclass, as your app evolves. Try to keep groups of functions relating to as few smaller/lower classe

Re: [PHP] If the first four characters are "0000", then do {} - timing tests

2010-01-27 Thread Daniel Brown
On Tue, Jan 26, 2010 at 19:48, Daevid Vincent wrote: > > Another thing I just noticed, is that we (that is Dan and I) should NOT > have used count() > This is bad form and wasted cycles. This is certainly correct, but it should also be noted that my original code used it once (thus, it was in

Re: [PHP] Multiple Class Inheritance

2010-01-27 Thread Ryan Sun
1, you can implement multiple interfaces 2, you may want to return object instead of extending classes, eg. class Small_Class_Abstract { public function getFormGeneration() { return new Form_Generation(); } } class Small_Class_A extends Small_Class_Abstract { } $A = new Small_Class_A();

Re: [PHP] Multiple Class Inheritance

2010-01-27 Thread Richard Quadling
2010/1/27 Ryan Sun : > 1, you can implement multiple interfaces > > 2, you may want to return object instead of extending classes, > eg. > class Small_Class_Abstract > { >  public function getFormGeneration() >  { >    return new Form_Generation(); >  } > } > class Small_Class_A extends Small_Class

Re: [PHP] Multiple Class Inheritance

2010-01-27 Thread Nathan Nobbe
On Wed, Jan 27, 2010 at 5:52 AM, Ashley Sheridan wrote: > Hi All, > > I know that a class can only inherit from one other single class in PHP, > but how would I go about simulating a multiple class inheritance? For > example, if I had several small classes that dealt with things like form > genera

[PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Paul M Foster
"... should be obvious - but are often overlooked - points within coding practice that can cause the programmer to develop bad habits and bad code." - Dan Brown Tip #1: Don't use count() in loops unless there are very few items to count and performance doesn't matter, or the number will vary over

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote: > "... should be obvious - but are often overlooked - points within coding > practice that can cause the programmer to develop bad habits and bad > code." - Dan Brown > > Tip #1: > > Don't use count() in loops unless there are very few item

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Michael A. Peters
Paul M Foster wrote: "... should be obvious - but are often overlooked - points within coding practice that can cause the programmer to develop bad habits and bad code." - Dan Brown Tip #1: Don't use count() in loops unless there are very few items to count and performance doesn't matter, or th

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 08:01 -0800, Michael A. Peters wrote: > Paul M Foster wrote: > > "... should be obvious - but are often overlooked - points within coding > > practice that can cause the programmer to develop bad habits and bad > > code." - Dan Brown > > > > Tip #1: > > > > Don't use count(

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Eric Lee
On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan wrote: > On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote: > > > "... should be obvious - but are often overlooked - points within coding > > practice that can cause the programmer to develop bad habits and bad > > code." - Dan Brown > > > >

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Ashley Sheridan
On Thu, 2010-01-28 at 00:08 +0800, Eric Lee wrote: > On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan > wrote: > > > On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote: > > > > > "... should be obvious - but are often overlooked - points within coding > > > practice that can cause the progra

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Richard Quadling
2010/1/27 Michael A. Peters : > Paul M Foster wrote: >> >> "... should be obvious - but are often overlooked - points within coding >> practice that can cause the programmer to develop bad habits and bad >> code." - Dan Brown >> >> Tip #1: >> >> Don't use count() in loops unless there are very few

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Michael A. Peters
Richard Quadling wrote: for ($i = 0, $j = count($a) ; $i < $j ; ++$i) { } is a very common way to handle that. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Richard Quadling
2010/1/27 Richard Quadling : > 2010/1/27 Michael A. Peters : >> Paul M Foster wrote: >>> >>> "... should be obvious - but are often overlooked - points within coding >>> practice that can cause the programmer to develop bad habits and bad >>> code." - Dan Brown >>> >>> Tip #1: >>> >>> Don't use cou

Re: [PHP] Question on XML/XSL/PHP/MySQL

2010-01-27 Thread tedd
At 3:39 AM -0800 1/27/10, Ryan Park wrote: My only reason doing this because I could use XSL as my templating engine; achieve the separation of content, design, and code. But in order to use XSL I need to use XML. XML needs to big if I want to use the data from the huge MySQL database. On 1/2

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Daniel Egeberg
On Wed, Jan 27, 2010 at 16:44, Ashley Sheridan wrote: > What about using the right type of quotation marks for output: > > I use double quotes(") if I expect to output variables within the > string, and single quotes when it's just a simple string. > > It's only a general rule of thumb and should

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Daniel Brown
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: > > There is virtually no difference nowadays. It's a long time since > anything like that has mattered. Actually, that's not true enough to be dismissive. It depends on several factors. -- daniel.br...@parasane.net || danbr...@php.net

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Daniel Egeberg
On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote: > On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: >> >> There is virtually no difference nowadays. It's a long time since >> anything like that has mattered. > >    Actually, that's not true enough to be dismissive.  It depends on > several

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote: > On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote: > > On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: > >> > >> There is virtually no difference nowadays. It's a long time since > >> anything like that has mattered. > > > >Actu

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Daniel Brown
On Wed, Jan 27, 2010 at 12:26, Daniel Egeberg wrote: > > Well, I would still say it's far too insignificant to bother with. And for the most part, you'd be right but it still isn't good practice to *not* teach something strictly because it's not entirely significant. For example, pol

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Robert Cummings
Ashley Sheridan wrote: On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote: On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote: On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: There is virtually no difference nowadays. It's a long time since anything like that has mattered. Actu

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Daniel Brown
On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan wrote: > > Depends I guess on how far you need to optimise the code. I'd imagine that to > something like Facebook, every split-second of optimisation is worth it, as > even a 100th of a second becomes minutes of wasted time over the course of a >

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Robert Cummings
Daniel Brown wrote: On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan wrote: Depends I guess on how far you need to optimise the code. I'd imagine that to something like Facebook, every split-second of optimisation is worth it, as even a 100th of a second becomes minutes of wasted time over t

Re: [PHP] Creating an Entire .html page with PHP

2010-01-27 Thread dealtek
On 1/26/2010 6:08 PM, clanc...@cybec.com.au wrote: In principle this is extremely simple. Take your existing procedure to generate the page then: 1. $page = ''; 2. Replace every echo 'whatever'; statement with $page .= 'whatever';, and every with $page .= ''; 3. file_put_contents($page,$fil

[PHP] Curious PHP cli output in context of bash completion ?

2010-01-27 Thread Alexandre Simon
Hello, I'm pretty "sure" (in realty I do not understand a lot about the problem... :( ) this is a distribution or a version problem but maybe some PHP/bash expert here could have some idea and tell me what I could try to solve the problem described here : http://ubuntuforums.org/showthread.ph

Re: [PHP] SQL question

2010-01-27 Thread Skip Evans
Kim Madsen wrote: But Skip, as the others say, use a date class, since you're passing a php var on to the SQL anyway, then you could determine the exact days from start to end of donation. Combine this with to_days and you have your solution Yes, this sounds like the best way to go. Than

Re: [PHP] Curious PHP cli output in context of bash completion ?

2010-01-27 Thread Rene Veerman
Have you tried letting the php script output "\r\n" instead of just "\n" as newline ? On Wed, Jan 27, 2010 at 10:46 PM, Alexandre Simon wrote: > Hello, > > I'm pretty "sure" (in realty I do not understand a lot about the problem... > :(  ) this is a distribution or a version problem but maybe so

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Rene Veerman
I'd like to add that when dealing with large memory structures, usually arrays, combining them is fastest when done like this: $array1 += $array2; This will not always produce correct results when dealing with arrays that contain identical keys, but for non-overlapping arrays it is far faster tha

[PHP] Replacing accented characters?

2010-01-27 Thread Skip Evans
Hey all, I'm looking for recommendations on how to replace accented characters, like e and u with those two little dots above them, with the regular e and u characters. I'm finding some solutions via Google, but would like to hear from some of you to hear how you handle those situations. T

[PHP] Storing time in mysql prior to 1970

2010-01-27 Thread Haig Davis
Hi Everyone, I'm sure I'm missing something simple. I'm trying to store dates of birth prior to 1970 in mysql. I've tried mysql's date_format but am hitting a wall. I'm chasing my tail and was hoping for the best practice. Many Thanks Haig

Re: [PHP] Replacing accented characters?

2010-01-27 Thread Skip Evans
Looks like strtr() is the way to go? Skip Skip Evans wrote: Hey all, I'm looking for recommendations on how to replace accented characters, like e and u with those two little dots above them, with the regular e and u characters. I'm finding some solutions via Google, but would like to hear

Re: [PHP] Storing time in mysql prior to 1970

2010-01-27 Thread Floyd Resler
Haig, What kind of problems are you having? I do this by using the date function to convert to the -MM-DD format for MySQL. I've had no problems with birth dates prior to 1970. Take care, Floyd On Jan 27, 2010, at 5:58 PM, Haig Davis wrote: > Hi Everyone, > > I'm sure I'm missin

[PHP] Re: Replacing accented characters?

2010-01-27 Thread Ross McKay
On Wed, 27 Jan 2010 16:55:46 -0600, Skip Evans wrote: >I'm looking for recommendations on how to replace accented >characters, like e and u with those two little dots above >them, with the regular e and u characters. $newText = iconv('UTF-8', 'ASCII//TRANSLIT', $text); But ensure you have set

Re: [PHP] Creating an Entire .html page with PHP

2010-01-27 Thread clancy_1
On Wed, 27 Jan 2010 10:21:00 -0800, deal...@gmail.com (dealtek) wrote: >On 1/26/2010 6:08 PM, clanc...@cybec.com.au wrote: > >> In principle this is extremely simple. Take your existing procedure to >> generate the page >> then: >> >> 1. $page = ''; >> >> 2. Replace every echo 'whatever'; stateme

Re: [PHP] Storing time in mysql prior to 1970

2010-01-27 Thread Jonathan Tapicer
On Wed, Jan 27, 2010 at 7:58 PM, Haig Davis wrote: > Hi Everyone, > > I'm sure I'm missing something simple. I'm trying to store dates of birth > prior to 1970 in mysql. I've tried mysql's date_format but am hitting a > wall. I'm chasing my tail and was hoping for the best practice. > > Many Thank

Re: [PHP] Re: Replacing accented characters?

2010-01-27 Thread Ashley Sheridan
On Thu, 2010-01-28 at 10:25 +1100, Ross McKay wrote: > On Wed, 27 Jan 2010 16:55:46 -0600, Skip Evans wrote: > > >I'm looking for recommendations on how to replace accented > >characters, like e and u with those two little dots above > >them, with the regular e and u characters. > > $newText =

Re: [PHP] Storing time in mysql prior to 1970

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 20:38 -0300, Jonathan Tapicer wrote: > On Wed, Jan 27, 2010 at 7:58 PM, Haig Davis wrote: > > Hi Everyone, > > > > I'm sure I'm missing something simple. I'm trying to store dates of birth > > prior to 1970 in mysql. I've tried mysql's date_format but am hitting a > > wall.

Re: [PHP] Curious PHP cli output in context of bash completion ?

2010-01-27 Thread Ashley Sheridan
On Wed, 2010-01-27 at 23:27 +0100, Rene Veerman wrote: > Have you tried letting the php script output "\r\n" instead of just > "\n" as newline ? > > On Wed, Jan 27, 2010 at 10:46 PM, Alexandre Simon wrote: > > Hello, > > > > I'm pretty "sure" (in realty I do not understand a lot about the proble

Re: [PHP] Re: Replacing accented characters?

2010-01-27 Thread Ross McKay
On Wed, 27 Jan 2010 23:38:42 +, Ashley Sheridan wrote: >Don't forget that changing some characters can actually change the words >and meanings of words. While an ë might look like and e, it's actually a >completely different character, with a different pronunciation to go >with it. [...] True

[PHP] Re: Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Nathan Rixham
Ryan Park wrote: > Hypothetically say that I have MySQL with petabytes of data. I want to > use XSL as my template language. But in order to use XSL, I need to make > XML filled with petabytes of data. This does not sound elaborate way to > use XSL/XML; I would rather use PHP/MySQL/Smarty. Is there

[PHP] Re: Multiple Class Inheritance

2010-01-27 Thread Nathan Rixham
Ashley Sheridan wrote: > Hi All, > > I know that a class can only inherit from one other single class in PHP, > but how would I go about simulating a multiple class inheritance? For > example, if I had several small classes that dealt with things like form > generation, navbar generation, etc, how

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Nathan Rixham
Daniel Egeberg wrote: > On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote: >> On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: >>> There is virtually no difference nowadays. It's a long time since >>> anything like that has mattered. >>Actually, that's not true enough to be dismissive. I

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Nathan Rixham
Richard Quadling wrote: > 2010/1/27 Richard Quadling : >> 2010/1/27 Michael A. Peters : >>> Paul M Foster wrote: "... should be obvious - but are often overlooked - points within coding practice that can cause the programmer to develop bad habits and bad code." - Dan Brown

Re: [PHP] Pointers For Newbies, Reminders For Oldies

2010-01-27 Thread Nathan Rixham
Nathan Rixham wrote: > Daniel Egeberg wrote: >> On Wed, Jan 27, 2010 at 18:13, Daniel Brown wrote: >>> On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg wrote: There is virtually no difference nowadays. It's a long time since anything like that has mattered. >>>Actually, that's not true

Re: [PHP] Replacing accented characters?

2010-01-27 Thread Paul M Foster
On Wed, Jan 27, 2010 at 04:55:46PM -0600, Skip Evans wrote: > Hey all, > > I'm looking for recommendations on how to replace accented > characters, like e and u with those two little dots above > them, with the regular e and u characters. FWIW, those two dots are called an "umlaut". Paul -- Pa

RE: [PHP] POLL: To add the final ?> or not...

2010-01-27 Thread Daevid Vincent
I think someone has been having fun with the Poll... ;-) It used to be like 10::20 and now it's 71::31... Hmmm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reports generator

2010-01-27 Thread Allen McCabe
I actually started on a report class yesterday, and I have a few questions, but first some details: - Reports will be on user orders (ticket reservations). - Need to be able to build a large variety of reports based on existing data + Orders by a specific user + Orders for a specific product (ev

Re: [PHP] Reports generator

2010-01-27 Thread Paul M Foster
On Wed, Jan 27, 2010 at 08:20:21PM -0800, Allen McCabe wrote: > I actually started on a report class yesterday, and I have a few questions, > but first some details: > > - Reports will be on user orders (ticket reservations). > - Need to be able to build a large variety of reports based on existi

Re: [PHP] Reports generator

2010-01-27 Thread Rene Veerman
Allen, i think your primary design consideration is this; > - Need to be able to build a large variety of reports based on existing data This would lead me to jump at a 'plugin' solution. I'd make: - 1 superclass as interface to the rest of your webapp(s) - 1 "top-class" that has the

Re: [PHP] POLL: To add the final ?> or not...

2010-01-27 Thread Rene Veerman
I'd give short-but-descriptive variable- and function-naming a much higher priority than something that not really affects code-reliability. And i'd insist on doing all names and comments in english, even if it's broken english. It makes code much easier to be taken over by someone of another nati

Re: [PHP] Curious PHP cli output in context of bash completion ?

2010-01-27 Thread Alexandre Simon
The problem has nothing to do with "myscript.php" output. The problem is in bash completion process wich involves only "echoscrip.[php|sh]". These scripts only have (to my comprehension) to output a single string, without newline and it is what they do. The fact is, and I do not understand why be

Re: [PHP] Curious PHP cli output in context of bash completion ?

2010-01-27 Thread Alexandre Simon
Le 28 janv. 2010 à 00:42, Ashley Sheridan a écrit : On Wed, 2010-01-27 at 23:27 +0100, Rene Veerman wrote: > My initial goal is to complete a PHP script, using the PHP script itselfs as function for bash completion. Mechanism that works perfectly on some other platforms (with different PHP AND b