[PHP] Solution: [PHP] OOP slow -- am I an idiot?

2006-10-15 Thread Chris de Vidal
As I cannot think of a class-based way to build my report, I think I'll use a customer class everywhere BUT in the report. Inside the report I'll just use one SQL statement instead of dozens of instances and hundreds of queries. I'll make a note inside the class that this and that method is

Re: [PHP] OOP slow -- am I an idiot?

2006-10-12 Thread Chris de Vidal
By the way, about myself. I'm primarily a system administrator. Most of the time I USE code, NOT write it. But I also dabble, and right now we need to improve our old custom PHP revenue application which has sat stagnant for a few years. We can't afford a full-time programmer and I know

Re: [PHP] OOP slow -- am I an idiot?

2006-10-11 Thread Chris de Vidal
--- Johan Martin [EMAIL PROTECTED] wrote: You should look into getting Professional PHP5 by Lecky-Thompson, Eide-Goodman, Nowicki and Cove from WROX. ... The collection class in chapter 5 discusses a programming problem just like yours. I will look into that, thank you. CD Think

Re: [PHP] OOP slow -- am I an idiot?

2006-10-11 Thread Chris de Vidal
--- Larry Garfield [EMAIL PROTECTED] wrote: For your rudimentary example of object-relational mapping below, yes, performance is going to be atrocious. That's because you're not taking any advantage of the features that using OOP gives you. Well, I /thought/ I was taking advantage of black

[PHP] OOP slow -- am I an idiot?

2006-10-10 Thread Chris de Vidal
I think perhaps I'm using classes and OOP incorrectly. The last time I used them, they were slow. I want to create a customer class which fetches its attributes from a MySQL database. Something like this pseudocode: class customer { ... getName ($id) { $result =

Re: AW: [PHP] smarty

2004-04-16 Thread Chris de Vidal
Ben said: But i don't see an alternative in your Example 3. Here was example 3 from my post: http://marc.theaimsgroup.com/?l=php-generalm=108145205519710w=2 $result = mysql_query (SELECT * FROM users WHERE id = '.$_GET[id].'); $row_array = mysql_fetch_array ($result); $name=

Re: AW: [PHP] smarty

2004-04-16 Thread Chris de Vidal
pete M said: Smarty is a cool tool and lots of people use it. You have decided NOT to use it. I don't believe you've read a word I've written. I've been trying to tell people like myself that one can easily template with PHP. I thought I *needed* Smarty or any nice templating engine to

[PHP] From my side, this thread is closed (Was: smarty)

2004-04-16 Thread Chris de Vidal
Richard Harb said: Could we please close the thread already? Sorry; sometimes I learn something new but still see ignorance going on around me, so I get on a mission to help. Seems some people are determined to stay ignorant and even get upset when someone offers a fresh point of view that

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
pete M said: Moving our sites to smarty is the best thing we've done at our company... Just a few weeks ago, I'd have agreed wit' yah, but now I see Smarty as mostly (not always) redundant. See my post where I learned that PHP makes a great templating engine:

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
pete M said: what about the modifiers long list of modifiers snipped How would you code that lot and remember its ALL to do with presentation ? I mentioned this. Take another look at my post: http://marc.theaimsgroup.com/?l=php-generalm=108145205519710w=2 [By using only PHP], At worst [I lose]

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
Vicente Werner said: http://marc.theaimsgroup.com/?l=php-generalm=108145205519710w=2 Ugh that's not just fuckingly ugly, but a total doom to maintain over the time -two months without touching the code and you're absolutely lost- . It maybe faster, it maybe a bit simpler since you only have

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
Kelly Hallman said: I don't recall anyone ever advancing the notion that Smarty turned PHP into something more than it was before. By definition it is merely a layer that makes your life as a developer easier. A tool! Yeah but in my ignorance that's what I thought, and I realized I probably

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
pete M said: Think everyone is missing the point.. the whole point of smarty is to take the presentation code away from the logic No, I understood that point. It's why I started using Smarty. Take another look at what I said: http://marc.theaimsgroup.com/?l=php-generalm=108145205519710w=2

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
Justin French said: You must remember, Smarty is just a layer over PHP. All the functions that you've listed exist in pure PHP code somewhere. It would relatively easy to code equivalent templates in PHP. Taking some random examples from your list: examples snipped I believe Smarty users

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
Richard Davey said: CdV I don't understand... how is this: [snip] CdV Better than this? CdV = CdV $result = mysql_query (SELECT * FROM users WHERE id = '.$_GET[id].'); CdV $row_array = mysql_fetch_array ($result); CdV $name= $row_array[name]; CdV $address =

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
pete M said: We sit in front of a PC and mock up the forms/ pages/ nav bar etc.. That stuff then gets coded. I agree, and I'm saying you can also do that with native PHP. I plan on doing that with the next site I build. Then if I see that it makes sense to use Smarty I will, but you can mock

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
Enrico Weigelt said: I really don't like smarty. The idea is simply not right. It's a good idea; in fact, PHP was originally supposed to be a templating engine. You can easily separate business and presentation logic in either PHP or Smarty. + does not separate (imperative) code from layout.

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
Peter Morgan said: We sit in front of a PC and mock up the forms/ pages/ nav bar etc.. That stuff then gets coded. I agree, and I'm saying you can also do that with native PHP. I plan on doing that with the next site I build. Then if I see that it makes sense to use Smarty I will, but you can

Re: [PHP] smarty

2004-04-14 Thread Chris de Vidal
Vicente Werner said: mmm some points: 1st. Clarity. It's much more clear to me to take a look at a template and identify a subsituing variable when it's marked as something different like: {$var} than the uglyness of ?=$var ? -and if you follo the recommended way: ?php=$var ? Tomay-toe,

Re: [PHP] Re: smarty

2004-04-14 Thread Chris de Vidal
Enrico Weigelt said: Well, I'm a little bit unpolite against smarty, since it seems that people tend to see it as the best (tm) and ignore other, probably better solutions. (its the same thing w/ mysql or mailman) I'm unpolite against Smarty because I used to think PHP couldn't *easily* do

[PHP] PHP makes a great templating engine (Was: smarty)

2004-04-08 Thread Chris de Vidal
Justin French said: PHP itself is a great templating language :) I've been studying on this myself. For some reason I didn't see this (is it not explained well enough in books/websites/articles? Dunno.) I used to code like so (shorthand), mixing business logic with presentation: html body

Re: [PHP] Smarty Summary was Re: [PHP] smarty

2004-04-08 Thread Chris de Vidal
Jochem Maas said: 1. 'Template Engine' - you can justifyably call PHP a template engine Correct. Seems that Smarty is, for the most part, redundant (see my last post called PHP makes a great templating engine (Was: smarty)). but I think calling Smarty a template engine confuses the issue - it

Re: [PHP] smarty

2004-04-07 Thread Chris de Vidal
Kelly Hallman said: Going even one step further (the beauty of Smarty: always another level), just extend the Smarty object itself. Then, instead of making all your templates includes other templates (such as a header or a footer), you can make your overall page be a template, and the extended

Re: [PHP] smarty

2004-04-07 Thread Chris de Vidal
John W. Holmes said: From: Chris de Vidal [EMAIL PROTECTED] Kelly Hallman said: Going even one step further (the beauty of Smarty: always another level), just extend the Smarty object itself. Then, instead of making all your templates includes other templates (such as a header or a footer

RE: [PHP] very large and long if statement

2004-04-07 Thread Chris de Vidal
I have this very large and long if statement: if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date'] !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county']) !empty($_SESSION['add']['discription'])

Re: [PHP] smarty

2004-04-06 Thread Chris de Vidal
Kelly Hallman said: Apr 6 at 5:33pm, Angelo Zanetti wrote: hi all has anyone used smarty before? what do you think of it? I think it's pretty nice to seperate your script (code) from your design. i would like to hear your comments and if you have any alternatives There are a lot of

Re: [PHP] smarty

2004-04-06 Thread Chris de Vidal
Kelly Hallman said: Apr 6 at 2:43pm, Chris de Vidal wrote: Given that scripts are compiled the first time they're ran, you'll never* notice the bloat and never lack performance; it's the same as real PHP code and can be optimized with a caching engine like Zend. Certainly. However

RE: [PHP] smarty

2004-04-06 Thread Chris de Vidal
Chris W. Parker said: I could have put a tag in the template like {bio} but that'd mean maintaining HTML in the PHP code which I wanted to avoid (left the prettyness to the Front Page developer). Instead, I put something like this in the template: {if $level 2} {bio} I should have put

Re: [PHP] smarty

2004-04-06 Thread Chris de Vidal
John W. Holmes said: I could have put a tag in the template like {bio} but that'd mean maintaining HTML in the PHP code which I wanted to avoid (left the prettyness to the Front Page developer). Instead, I put something like this in the template: {if $level 2} {bio} {/if} Rather than

Re: [PHP] [Newbie Guide] For the benefit of new members

2004-04-01 Thread Chris de Vidal
Ma Siva Kumar said: 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html Though I've been using newsgroups since '95 and though I'd read this page before, it's helpful to review it. I can see a few mistakes I'd made as recently as a few months ago on another list :-) This

Re: [PHP] What's the use in OOP?

2004-03-29 Thread Chris de Vidal
Stephen Craton said: I've been reading up on object oriented programming in PHP for a while now and I just don't get what's the use in using it. It supposedly makes it faster, but I don't really see how in any of my scripts. What's the advantage of OOP anyway, and why are so many people using

[PHP] RE:[PHP]What'stheuseinOOP?

2004-03-29 Thread Chris de Vidal
Stephen Craton said: I used OO in my chat script (can be found at http://php.melchior.us) but it really seemed like a waste since it was such a small basic script. I never really find myself re-needing code except for database connectivity and calling the database and stuff like that. My

Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-19 Thread Chris de Vidal
Marek Kilimajer said: I searched this group and someone suggested disabling Apache's keepalives but I don't have root on this box so that option is out. Try to send Connection: close header, then the connection will be terminated by the client. I don't understand... would I place that code

[PHP] Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Chris de Vidal
Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be able to log into our MySQL-authenticated website: http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2displaylang=en Microsoft won't put out this patch into the regular XP updates (I

Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Adam Voigt said: What exactly is breaking? If it's the header to redirect, you could just issue a meta refresh, or a javascript one. The only time redirects are sent is when there is a failure. Otherwise it's a simple post operation to a PHP file with an include. Have another look at the

Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Adam Voigt said: If I ran XP I might be able to do that. From reading the security release my MS, it sounds like some times the POST request gets b0rked, Yep. if this is the case, I'm not sure there's much that can be done about it. ...except find an alternate login method, which is my

Re: [PHP] Re: Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Chris de Vidal
Andre Cerqueira said: try absolute urls on 'Location' headers if thats the problem, ie is not exactly broken, just making some (questionable) standards mandatory There are no Location headers on correct logins. It's failing on correct logins. It's a known bug and they're not pushing out the

RE: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Chris W. Parker said: maybe this is too simple an answer but how about using GET instead? I'm about 90% sure that URL strings are passed in the clear to SSL servers, so this would defeat the purpose of SSL. I've found that some people have solved this problem by upgrading the server to a newer

RE: [PHP] Thank you, Microsoft! Now I need an alternateloginmethod

2004-03-18 Thread Chris de Vidal
Matt Matijevich said: snip I'm about 90% sure that URL strings are passed in the clear to SSL servers, so this would defeat the purpose of SSL. /snip I don't think this is true. You can see the query string in the address bar, but (with what little http knowledge I have) the http

[PHP] Working with a Front Page developer

2004-02-10 Thread Chris de Vidal
I've got a design developer who only knows Front Page. Despite my general hatred for Microsoft I can work around it :-) She's installed a Front Page PHP plugin (I think it's called Rocket PHP). However, the plugin is buggy; it's got problems that would be best fixed if I could completely

Re: [PHP] Working with a Front Page developer

2004-02-10 Thread Chris de Vidal
Richard Davey said: One of the most common (and well used) template engines is Smarty: http://smarty.php.net/ It might be overkill for your needs though, writing a simple template system is pretty easy. Looks like it's overkill, but I'll look through it in case I could use it on other

Re: Re[2]: [PHP] Working with a Front Page developer

2004-02-10 Thread Chris de Vidal
Richard Davey said: You don't have to use preg_replace, in its most simplest form the following code will work just fine for a basic template system: snip Blow me down, that's exactly what I need! You just saved me hours of research. You rock!! Thanks Rich! /dev/idal -- PHP General