Re: [PHP] OOP to run sequential SQL queries?

2013-02-17 Thread tamouse mailing lists
On Sun, Feb 17, 2013 at 10:00 AM, AmirBehzad Eslami wrote: > We have a bunch of SQL-queries, they should be executed in > a sequential order, with a defensive programming style in mind. > > We were thinking to implement the solution as "Stored Procedures" > instead of a PHP solution that runs SQL

Re: [PHP] OOP to run sequential SQL queries?

2013-02-17 Thread Serge Fonville
Hi, We were thinking to implement the solution as "Stored Procedures" > instead of a PHP solution that runs SQL queries, but an article in > Coding Horro recommendeds to avoid SP for good reasons: The article shows only one thing. that common practice should be to 'do everything where it belongs

Re: [PHP] OOP to run sequential SQL queries?

2013-02-17 Thread Marco Behnke
Am 17.02.13 17:00, schrieb AmirBehzad Eslami: > Dear list, > > We have a bunch of SQL-queries, they should be executed in > a sequential order, with a defensive programming style in mind. I don't understand what you want? Queries are executed sequentially or do you plan to create a multi-process PH

Re: [PHP] OOP problems

2011-12-15 Thread Fatih P.
On 12/15/2011 01:05 PM, Alex Pojarsky wrote: I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) {

Re: [PHP] OOP problems

2011-12-15 Thread Alex Pojarsky
I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) { $this->_path = $base_path; } public func

Re: [PHP] OOP problems

2011-12-11 Thread Dominik Halvoník
Hi guys, I try to applied your solutions but I have problems whit it. I need to achieve this schema( -> is something like ../ it means that it is one level up folder): connec.php(class Connect MySql)-> select.php(class Select MySql) -> -> mysql.ph

Re: [PHP] OOP problems

2011-12-08 Thread Mokaddim Akm
Sent from a handheld device On 08-Dec-2011, at 11:14 PM, "Dominik Halvoník" wrote: > Hello, > > I would like to ask you for help. This days I am trying to build one of my > applications. But I have problem which stopped me. I have folder whit php > files like connect.php, delete.php etc. These f

Re: [PHP] OOP problems

2011-12-08 Thread Stuart Dallas
On 8 Dec 2011, at 17:14, Dominik Halvoník wrote: > I would like to ask you for help. This days I am trying to build one of my > applications. But I have problem which stopped me. I have folder whit php > files like connect.php, delete.php etc. These files contains classes named > the same as files

Re: [PHP] OOP: __construct() and "extend"

2009-12-22 Thread Allen McCabe
Extended classes may have their own constructors which are implicitly called, and as Jonathan mentioned, the constructor of any ancestors (ie. the parent) must explicitly be called. If the child (extended) class does NOT have it's own constructor method defined, the parent's constructor is called.

Re: [PHP] OOP: __construct() and "extend"

2009-12-22 Thread Jonathan Tapicer
Hey, Constructors behave the same way as regular methods with inheritance, you have to manually call the parent constructor, ie: parent::__construct(). Regards, Jonathan On Tue, Dec 22, 2009 at 7:45 PM, APseudoUtopia wrote: > Hey list, > > I'm writing my own class which extends upon the Memcac

Re: [PHP] OOP Design Question

2009-12-20 Thread Larry Garfield
On Sunday 20 December 2009 1:08:46 pm you wrote: > >> Maybe this would be the perfect opportunity for the php autoload > >> functions...? > >> > >> Thanks for your help/thoughts/comments, > >> dK > >> ` > > > > Yep, this is a textbook case for a proper autoload setup. And no, > > cramming all of

Re: [PHP] OOP Design Question

2009-12-20 Thread Larry Garfield
On Sunday 20 December 2009 10:35:56 am Daniel Kolbo wrote: > Hello PHPers, > > I have a collection of about 60 objects (class definitions). They are > all very similar. They all share a substantial % of the same core. But > they all have slight variations as well. The approach I took was to > m

Re: [PHP] OOP Design Question

2009-12-20 Thread Robert Cummings
Set up autoloading: http://php.net/manual/en/language.oop5.autoload.php Cheers, Rob. Daniel Kolbo wrote: Hello PHPers, I have a collection of about 60 objects (class definitions). They are all very similar. They all share a substantial % of the same core. But they all have slight vari

Re: [PHP] OOP Design Software

2009-07-26 Thread Daniel Kolbo
Caner BULUT wrote: > Hi Daniel, > > You can use Eclipse with plugin PDT or Zend Studio. They can track your > classes and methods. They can remember your methods and classes also they > have code completion abilities. > > Thanks > Caner. > > -Original Message- > From: Daniel Kolbo [mai

Re: [PHP] OOP Design Software

2009-07-26 Thread Eddie Drapkin
On Sun, Jul 26, 2009 at 12:54 PM, Caner BULUT wrote: > > Hi Daniel, > > You can use Eclipse with plugin PDT or Zend Studio. They can track your > classes and methods. They can remember your methods and classes also they > have code completion abilities. > > Thanks > Caner. > > -Original Message

RE: [PHP] OOP Design Software

2009-07-26 Thread Caner BULUT
Hi Daniel, You can use Eclipse with plugin PDT or Zend Studio. They can track your classes and methods. They can remember your methods and classes also they have code completion abilities. Thanks Caner. -Original Message- From: Daniel Kolbo [mailto:kolb0...@umn.edu] Sent: 26 July 2009

[PHP] Re: PHP, OOP and AJAX

2009-06-08 Thread Julian Muscat Doublesin
One final update. The way one sets the path to required files is very important. I found it is best to use instead of relative paths. Regards Julian On Fri, Jun 5, 2009 at 2:19 PM, Julian Muscat Doublesin < opensourc...@gmail.com> wrote: > Update. > > Hello Everyone, > > First of all, thank yo

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Nathan Nobbe
On Thu, May 28, 2009 at 2:42 PM, Eddie Drapkin wrote: > autoloading doesn't do anything but follow a set of logic rules to decide > what file to require, so it doesn't mess with opcode caches at all. umm.., right, but what do you think happens at the center of that logic ? require / include ca

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Eddie Drapkin
autoloading doesn't do anything but follow a set of logic rules to decide what file to require, so it doesn't mess with opcode caches at all. On Thu, May 28, 2009 at 4:02 PM, Nathan Nobbe wrote: > On Thu, May 28, 2009 at 9:25 AM, Tony Marston < > t...@marston-home.demon.co.uk > > wrote: > > > > >

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Nathan Nobbe
On Thu, May 28, 2009 at 9:25 AM, Tony Marston wrote: > > "Eddie Drapkin" wrote in message > news:68de37340905280801m6964d355l2d6d8ef773f3b...@mail.gmail.com... > > There's a huge difference between laziness and opting in to use an > > incredibly useful (and easy to properly deploy) feature to sa

Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Ashley Sheridan
On Thu, 2009-05-28 at 16:17 +0300, Olexandr Heneralov wrote: > Hi! > Do not use low-level AJAX. > There are many frameworks for ajax (JQUERY). > Try to use PHP frameworks like symfony, zend framework. They simplify your > work. > > > 2009/5/28 Lenin > > > 2009/5/28 kranthi > > > > > > > > > >

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Tony Marston
"Eddie Drapkin" wrote in message news:68de37340905280801m6964d355l2d6d8ef773f3b...@mail.gmail.com... > There's a huge difference between laziness and opting in to use an > incredibly useful (and easy to properly deploy) feature to save myself > time > so that I can spend more time writing that

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Eddie Drapkin
There's a huge difference between laziness and opting in to use an incredibly useful (and easy to properly deploy) feature to save myself time so that I can spend more time writing that structured and efficient code of which you speak. And the problem with what you're saying is that you still have

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Tony Marston
"Eddie Drapkin" wrote in message news:68de37340905280737t3e1ad844y188ab8fa08f17...@mail.gmail.com... > Your code might not, but you sure do! Spending all that time writing > require statements = :( If you are too lazy to write "require" statements then you are probably too lazy to write readab

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Eddie Drapkin
Your code might not, but you sure do! Spending all that time writing require statements = :( On Thu, May 28, 2009 at 9:49 AM, Tony Marston wrote: > > wrote in message > news:000e0cd6ad1a9f7d3d046af89...@google.com... > > Two things: > > > > 1. Try using the fully qualified path (ie /var/www/fo

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Tony Marston
wrote in message news:000e0cd6ad1a9f7d3d046af89...@google.com... > Two things: > > 1. Try using the fully qualified path (ie /var/www/foo/bar.php instead of > foo/bar.php) > 2. Look at setting up autoloading so you don't need to manually include > anyway. If you're going OOP, autoloading is a mu

Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Luke
2009/5/28 Olexandr Heneralov > Hi! > Do not use low-level AJAX. > There are many frameworks for ajax (JQUERY). > Try to use PHP frameworks like symfony, zend framework. They simplify your > work. > > > 2009/5/28 Lenin > > > 2009/5/28 kranthi > > > > > > > > > > > i recommend you firebug firefox

Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Olexandr Heneralov
Hi! Do not use low-level AJAX. There are many frameworks for ajax (JQUERY). Try to use PHP frameworks like symfony, zend framework. They simplify your work. 2009/5/28 Lenin > 2009/5/28 kranthi > > > > > > > i recommend you firebug firefox adddon (just go to the net tab and you > > can see all

Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Lenin
2009/5/28 kranthi > > > i recommend you firebug firefox adddon (just go to the net tab and you > can see all the details of the communication between client and > server) > and i find it helpful to use a standard javascript(jQuery in my case) > library instead of highly limited plain javascript

Re: Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread oorza2k5
Two things: 1. Try using the fully qualified path (ie /var/www/foo/bar.php instead of foo/bar.php) 2. Look at setting up autoloading so you don't need to manually include anyway. If you're going OOP, autoloading is a must! On May 28, 2009 8:49am, kranthi wrote: i never faced such a proble

Re: [PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread kranthi
i never faced such a problem and i can assure you that it will never happen. try... main.php second.php test call main.php via AJAX and see the responseText. many things can go wrong in your coding. dont come to the conclusion that this particular thing is not working. i recommend you firebug

[PHP] Re: PHP, OOP and AJAX

2009-05-28 Thread Jo�o C�ndido de Souza Neto
Julian, could you please show us an example of this problem? -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br "Julian Muscat Doublesin" escreveu na mensagem news:5e0039ed0905280431o2e9d8036u217b0449eccd...@mail.gmail.com..

[PHP] Re: PHP OOP

2009-02-10 Thread Ondrej Kulaty
I don't think that PHP is good language for teaching OOP as many folks above said. I have never programmed in OOP style but i plan to learn it. I started in PHP but i was little confused and i am used to program in procedural way in PHP, so i've decided to learn some pure OOP language. I am read

Re: [PHP] OOP in PHP

2007-08-15 Thread Patrik Hasibuan
Dear my friend, Jim Lucas. Thank you very much for your help. You've solved my problem one more time. I really appreciate your help. === On Wed, 15 Aug 2007 14:17:02 -0700 Jim Lucas <[EMAIL PROTECTED]> wrote: > Jim Lucas wrote: > > Patrik Hasibuan wrote: > >> Dear Jim, > >> > >> thanks for your

Re: [PHP] OOP in PHP

2007-08-15 Thread Jim Lucas
Jim Lucas wrote: Patrik Hasibuan wrote: Dear Jim, thanks for your help. I've modified my codes as you adviced. But than the output is: " superclass koneksi dipanggil koneksi berhasil No results found " The column 'country' of table 'countries' already really contents complete all contry name

Re: [PHP] OOP in PHP

2007-08-15 Thread Jim Lucas
Patrik Hasibuan wrote: Dear Jim, thanks for your help. I've modified my codes as you adviced. But than the output is: " superclass koneksi dipanggil koneksi berhasil No results found " The column 'country' of table 'countries' already really contents complete all contry name from all over the

Re: [PHP] OOP in PHP

2007-08-15 Thread Patrik Hasibuan
Dear Jim, thanks for your help. I've modified my codes as you adviced. But than the output is: " superclass koneksi dipanggil koneksi berhasil No results found " The column 'country' of table 'countries' already really contents complete all contry name from all over the earth. How come the query

Re: [PHP] OOP in PHP

2007-08-15 Thread Jim Lucas
Patrik Hasibuan wrote: Dear Jim, You've solved my problem, Jim. Thank you very much. Now, my code give the output as my expectation: " superclass koneksi dipanggil koneksi berhasil negara-> ". But come another problem, namely: the $negara is empty. I tried to read the documentation on " http

Re: [PHP] OOP in PHP

2007-08-15 Thread Patrik Hasibuan
Dear Jim, You've solved my problem, Jim. Thank you very much. Now, my code give the output as my expectation: " superclass koneksi dipanggil koneksi berhasil negara-> ". But come another problem, namely: the $negara is empty. I tried to read the documentation on " http://www.php.net/manual/en/

Re: [PHP] OOP in PHP

2007-08-15 Thread Jim Lucas
A few missing pieces in your code. Take a look below within your class. I corrected it. try also using include_once instead of require and make sure that your error level and reporting are turned on so you can see what is happening. Patrik Hasibuan wrote: Dear my friends, This is the fi

Re: [PHP] OOP in PHP

2007-08-15 Thread Robert . Degen
> Theoritically if Class "koneksi" is being initialized than it > prints "koneksi berhasil (connection succeeded)" but it doesn't. What "does" it? Just nothing? No warnings at all? Possibly disabled? so far rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP] OOP in PHP

2007-08-15 Thread Nathan Nobbe
what sort of error are you encountering ? -nathan On 8/15/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote: > > Dear my friends, > > This is the first time for me to use OOP concept of PHP. I wrote still a > very simple codes but it doesn't work as my manual book taught. the book > titled "MySQL/PHP

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

2006-11-08 Thread Stut
Stut wrote: This is a question of design, not a question of whether to use OOP. For example, in several of the sites I maintain I have classes that inherit from a base class called Table. The base class provides a lot of the basic methods for working on a table (think ActiveRecord). It also ha

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

2006-10-14 Thread Tony Marston
"Ed Lazor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Oct 13, 2006, at 1:54 AM, Stut wrote: >> Youch!! Your implementation seems to be focused on development >> efficiency rather than runtime efficience. In all but rare research >> projects this is backwards for a web-ba

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

2006-10-14 Thread Tony Marston
"Ed Lazor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Oct 13, 2006, at 1:35 AM, Tony Marston wrote: >> What a coincidence! That's exactly my approach, but I've taken it one >> step >> further. I always start with a properly normalised database which I can >> then >> im

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

2006-10-14 Thread Tony Marston
"Stut" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ed Lazor wrote: >> On Oct 12, 2006, at 4:36 PM, Stut wrote: >>> If I then go on to create an admin interface for the users, I would >>> create another completely separate class called UserCollection to handle >>> more than one

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

2006-10-14 Thread Tony Marston
"Stut" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tony Marston wrote: >> "Stut" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>> My general approach to designing a system is data-centric. I tend to >>> start by defining the database schema since getting t

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

2006-10-13 Thread Ed Lazor
On Oct 13, 2006, at 1:54 AM, Stut wrote: Youch!! Your implementation seems to be focused on development efficiency rather than runtime efficience. In all but rare research projects this is backwards for a web-based system. This is exactly the practice I am trying to discourage. It's a well-

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

2006-10-13 Thread Ed Lazor
On Oct 13, 2006, at 1:35 AM, Tony Marston wrote: What a coincidence! That's exactly my approach, but I've taken it one step further. I always start with a properly normalised database which I can then import into my daa dictionary application. From there I can press a button and create a c

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

2006-10-13 Thread John Wells
On 10/13/06, Stut <[EMAIL PROTECTED]> wrote: Ed Lazor wrote: > ...Or is it something else entirely; I dunno, maybe > UserCollection has a property defined as an array of User class? I > think that's what people were saying earlier in the thread as being a > "very bad thing" in terms of memory ut

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

2006-10-13 Thread Stut
Ed Lazor wrote: On Oct 12, 2006, at 4:36 PM, Stut wrote: If I then go on to create an admin interface for the users, I would create another completely separate class called UserCollection to handle more than one user. I may at that point choose to expose any data-massaging methods in User to

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

2006-10-13 Thread Stut
Tony Marston wrote: "Stut" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] My general approach to designing a system is data-centric. I tend to start by defining the database schema since getting that clear in my head tends to lead me to a decent design. What a coincidence

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

2006-10-13 Thread Tony Marston
"Stut" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ed Lazor wrote: >> On Oct 12, 2006, at 12:15 PM, Stut wrote: >>> As such you cannot start designing a solution unless you know how the >>> data/entities are going to be used. >> >> Doesn't this mean that your design breaks when

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

2006-10-13 Thread Stut
Please include the list when replying to that others may benefit (or suffer) from the discussion. Bruce Cowin wrote: I like your static user class. Does the user instance then get saved to a session variable that is serialized/unserialized on every page? There is no user instance as such

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

2006-10-12 Thread Ed Lazor
On Oct 12, 2006, at 4:36 PM, Stut wrote: You may end up refactoring code if your application changes that much, but a good OO design should also mean that when changes of that magnitude occur the changes required are limited to relatively small sections of code. Ok, I think we're using t

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

2006-10-12 Thread Stut
Ed Lazor wrote: On Oct 12, 2006, at 12:15 PM, Stut wrote: As such you cannot start designing a solution unless you know how the data/entities are going to be used. Doesn't this mean that your design breaks when the behavior or use of the data/entities changes? You may end up refactoring cod

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

2006-10-12 Thread Tony Marston
""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, October 12, 2006 3:11 am, Tony Marston wrote: >> I have to disagree as well. There is absolutely nothing wrong which >> the >> approach of creating one class for each table in the database. It >> cannot be >>

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

2006-10-12 Thread Ed Lazor
Comments / Questions below. On Oct 12, 2006, at 12:15 PM, Stut wrote: Except that is the attitude that leads to painful OOP in PHP. PHP is not the same environment as C++. The environment (classes, objects, etc) needs to be created and destroyed with each request. I definitely agree that P

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

2006-10-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-12 16:29:09 -0500: > On Thu, October 12, 2006 1:03 pm, Ed Lazor wrote: > > On Oct 12, 2006, at 10:18 AM, Richard Lynch wrote: > >> I can't architect a good OOP solution to a problem that hasn't been > >> fully defined, any more than one can architect a house without >

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

2006-10-12 Thread Richard Lynch
On Thu, October 12, 2006 1:03 pm, Ed Lazor wrote: > On Oct 12, 2006, at 10:18 AM, Richard Lynch wrote: >> I can't architect a good OOP solution to a problem that hasn't been >> fully defined, any more than one can architect a house without >> knowing >> all the rooms that are needed... > > Sorry to

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

2006-10-12 Thread Stut
Ed Lazor wrote: On Oct 12, 2006, at 10:18 AM, Richard Lynch wrote: I can't architect a good OOP solution to a problem that hasn't been fully defined, any more than one can architect a house without knowing all the rooms that are needed... Sorry to jump into the middle of the conversation, but

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

2006-10-12 Thread Stut
Richard Lynch wrote: I *still* don't see OOP as a Right Answer for spitting out HTML web pages in optimized minimalist time frames... Maybe my brain just got warped by all that AI/Lisp work I did for a couple decades, but it feels to me like a bad selection of weapons for the task at hand, most

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

2006-10-12 Thread Ed Lazor
On Oct 12, 2006, at 10:18 AM, Richard Lynch wrote: I can't architect a good OOP solution to a problem that hasn't been fully defined, any more than one can architect a house without knowing all the rooms that are needed... Sorry to jump into the middle of the conversation, but I thought this

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

2006-10-12 Thread Richard Lynch
On Thu, October 12, 2006 8:24 am, Chris de Vidal wrote: > [use the archives] I can't architect a good OOP solution to a problem that hasn't been fully defined, any more than one can architect a house without knowing all the rooms that are needed... I agree that all the code samples you provided be

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

2006-10-12 Thread Richard Lynch
On Thu, October 12, 2006 3:11 am, Tony Marston wrote: > I have to disagree as well. There is absolutely nothing wrong which > the > approach of creating one class for each table in the database. It > cannot be > wrong for the simple reason THAT IT WORKS! Only problem is that then you often end up

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

2006-10-12 Thread Richard Lynch
On Thu, October 12, 2006 12:49 am, Stut wrote: > Roman Neuhauser wrote: >> # [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: >>> Richard Lynch wrote: On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: > I want to create a "customer" class which fetches its attributes > from > a

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

2006-10-12 Thread Richard Lynch
On Wed, October 11, 2006 3:28 pm, Stut wrote: > Richard Lynch wrote: >> On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: >>> I want to create a "customer" class which fetches its attributes >>> from >>> a MySQL database. >> >> No, you don't. :-) >> >> This is a classic example of the "obviou

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 enou

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

2006-10-12 Thread Tony Marston
"Roman Neuhauser" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ># [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: >> Richard Lynch wrote: >> >On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: >> >>I want to create a "customer" class which fetches its attributes from >> >>a MyS

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

2006-10-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-12 06:49:22 +0100: > Roman Neuhauser wrote: > ># [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: > >>Richard Lynch wrote: > >>>This is a classic example of the "obvious" OOP solution being wildly > >>>inappropriate. > >>Ok, so I now find myself in the unusual position o

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

2006-10-11 Thread Stut
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: Richard Lynch wrote: On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: I want to create a "customer" class which fetches its attributes from a MySQL database. No, you don't. :-) This is a classic example of the "ob

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

2006-10-11 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-11 21:28:36 +0100: > Richard Lynch wrote: > >On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: > >>I want to create a "customer" class which fetches its attributes from > >>a MySQL database. > > > >No, you don't. :-) > > > >This is a classic example of the "obvio

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

2006-10-11 Thread Stut
Richard Lynch wrote: On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: I want to create a "customer" class which fetches its attributes from a MySQL database. No, you don't. :-) This is a classic example of the "obvious" OOP solution being wildly inappropriate. Ok, so I now find mysel

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

2006-10-11 Thread Richard Lynch
On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote: > I want to create a "customer" class which fetches its attributes from > a MySQL database. No, you don't. :-) This is a classic example of the "obvious" OOP solution being wildly inappropriate. The sad thing is, there are a zillion applica

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

2006-10-11 Thread Satyam
- Original Message - From: "Chris de Vidal" <[EMAIL PROTECTED]> To: Sent: Wednesday, October 11, 2006 12:42 PM Subject: Re: [PHP] OOP slow -- am I an idiot? --- Johan Martin <[EMAIL PROTECTED]> wrote: You should look into getting Professional PHP5 by Lecky-

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 bl

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 yo

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

2006-10-10 Thread Johan Martin
On 10 Oct 2006, at 4:14 PM, Chris de Vidal wrote: 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

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

2006-10-10 Thread Larry Garfield
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. One could write a dissertation on this problem, but I will just give you some general guidelines

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

2006-10-10 Thread Chris
Chris de Vidal wrote: I think perhaps I'm using classes and OOP incorrectly. The last time I used them, they were slow. The examples you provided shows that it's not OOP that's the problem, it's how your getting the data as you suspected. Doing tons of queries is going to be slow whether y

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On May 1, 2006, at 8:56 PM, chris smith wrote: Depending on your content you could cache some of it to static files.. http://pear.php.net/packages.php?catpid=3&catname=Caching (I'm sure there are tons more packages to do this as well).. Yeah, that's what I'm looking at right now, although

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread chris smith
On 5/2/06, Edward Vermillion <[EMAIL PROTECTED]> wrote: On May 1, 2006, at 3:53 PM, Richard Lynch wrote: > On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: >> What I was mainly thinking of though, what kind of hoops does PHP >> jump through to take a class, that I assume it's holding in me

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On May 1, 2006, at 3:53 PM, Richard Lynch wrote: On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the constructor?

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Jochem Maas
Richard Lynch wrote: On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the constructor? Is it doubling the memory co

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Richard Lynch
On Mon, May 1, 2006 8:25 am, Edward Vermillion wrote: > What I was mainly thinking of though, what kind of hoops does PHP > jump through to take a class, that I assume it's holding in memory, > and make an object out of it, aside from the constructor? Is it > doubling the memory consumption, or mor

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
Thanks guys! I guess it comes down to "Don't do anything stupid and you should be fine" :D I'm just still in the design stage, and since my past practice was write/figure out what you did wrong why it doesn't work like it should/rewrite, I'm trying to cover as many bases as I can from the

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent constru

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread chris smith
On 5/1/06, Edward Vermillion <[EMAIL PROTECTED]> wrote: On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: > Instantiating an object does have some extra overhead that the static > call bypasses. > > How much overhead depends on the complexity of the object, I would > predict that it's mainly in

Re: [PHP] OOP Static Functions vs. Objects

2006-05-01 Thread Edward Vermillion
On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote: Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent constructors. Well there's a b

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Richard Lynch
Instantiating an object does have some extra overhead that the static call bypasses. How much overhead depends on the complexity of the object, I would predict that it's mainly in its constructor and any parent constructors. I can't speak to differences in PHP4/PHP5 in this specific regard, but w

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Stut
Jochem Maas wrote: me I'm just slow - I still on 'how the f*** do I use branches in CVS' after using it for 18 months+; and I haven't even begun to look at subversion yet :-P I strongly suggest you skip branches in CVS and go straight to subversion. I've been using CVS for years and have att

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 10:45 AM, Jochem Maas wrote: CVS or subversion (and 3 weeks intensive study of what branches are) might be of help to you - not for the faint-hearted though! Been reading the subversion manual for the past three days... ;) (I'm a slow reader

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Edward Vermillion
On Apr 30, 2006, at 10:45 AM, Jochem Maas wrote: CVS or subversion (and 3 weeks intensive study of what branches are) might be of help to you - not for the faint-hearted though! Been reading the subversion manual for the past three days... ;) (I'm a slow reader) Ed -- PHP General Mail

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: On Apr 30, 2006, at 10:10 AM, Jochem Maas wrote: Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situation

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Edward Vermillion
On Apr 30, 2006, at 10:10 AM, Jochem Maas wrote: Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situations where both methods wil

Re: [PHP] OOP Static Functions vs. Objects

2006-04-30 Thread Jochem Maas
Edward Vermillion wrote: I'm still trying to get my head around all the OOP stuff and was wondering if there is any basic difference between calling a static function as opposed to creating an object, in situations where both methods will do the same thing for you. Is there any overhead to

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Stephen Leaf
would have to be. http://smileaf.org/bob.php as you can see it's working great. did make few more changes: class Test { public $saying = ""; function __construct() {

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jochem Maas
Bob, 'wrapping' you class definition within HTML like you have done is not only weird but down right ugly. I recommend sticking each class you write in a seperate file and using include_once() or require_once() before you output anything to the browser. basically try to seperate you code into 'st

Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jesper Gran
On 2005-10-21 06:17, Stephen Leaf wrote: most likely var is depreciated in php5. (can someone confirm this?) Well, if I try to use Var in a class i get this message: Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in C:\code\test\var.php on line 3* /*

Re: [PHP] OOP Newbie - why does this not work?

2005-10-20 Thread Stephen Leaf
Here is the working code You had __constructor() it's __construct() notice I also moved your saying declaration outside of the constructor. this is to make it a class level variable. the way that you had it set it was only in scope until you finished the construct code. I guess I was wrong about

  1   2   3   >