Understanding code generated by PHPMaker 7 and PHP Generator for MySQL (SQLMaestro)

572 views
Skip to first unread message

BobA

unread,
Jun 1, 2010, 2:20:29 PM6/1/10
to Professional PHP Developers
I am trying out both of the above PHP code generators. I would like
to better understand the generated PHP code. the seem to be
structured with classes and functions. What I need to know is what is
the code that is actually executed? Overall how does it work?

Yes it is commented and I can see lots of functions and classes. But
decyphering how it works is beyond me.

Yes I am a novice with PHP but have programmed with a number of other
programming languages.

thanks

bob

Jack Timmons

unread,
Jun 2, 2010, 9:27:20 AM6/2/10
to professi...@googlegroups.com

The best thing you can do is head over to php.net and reference the
functions and what they do.

Or, stop using code generators, and write something yourself along the
lines of what you see.

You can also start here, although it's really, really old:

http://devzone.zend.com/article/627

It's still useful.

--
-Jack Timmons
Blog: http://www.codeacula.com
Sandbox: http://www.trotlc.com
Twitter: @codeacula
Google Chat: Figure it out. C'mon, seriously.

Robert Gonzalez

unread,
Jun 2, 2010, 12:47:47 PM6/2/10
to professi...@googlegroups.com
I agree with Jack. If you are n00b then trying to learn from generated code is probably bad juju for you. I'd say start simple. Maybe download the free chapters of Kevin Yank's Sitepoint book "Build Your Own Database Driven Web Site Using PHP & MySQL". I used that a lot when I first started in PHP and it helped me tremendously.

But doing what you're doing is like a contract learning how to build buildings by looking at blueprints that were made by a computer application. It might work, but it will be a long road to travel.


--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professi...@googlegroups.com
To unsubscribe from this group, send email to Professional-P...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP

Subir Jolly

unread,
Jun 2, 2010, 1:21:10 PM6/2/10
to professi...@googlegroups.com
I completely agree with Jack and Robert. One more good thing about writing code yourself is that you will know what "exactly" is happening in the application. So, there won't be any "hidden backdoor entry" to your application as well. You can't fully trust code generators unless you review the entire code.

BobA

unread,
Jun 2, 2010, 11:07:00 PM6/2/10
to Professional PHP Developers

I really don't want to learn to code PHP - except as a last resort.
Ideally I want to specify what the forms should look like and how they
should function and let a rad app create the code. The PHP generated
from these two software products was not very customizable after the
code was generated. I am now using PHPrunner which generates the app
but allows editing of the forms it generates. that seems to work for
me. also the generated code seems much more understandable for a PHP
novice like me.

Jack Timmons

unread,
Jun 2, 2010, 11:25:30 PM6/2/10
to professi...@googlegroups.com

Good luck, then. I know PHPrunner has had security issues before, back
in 4, but now that they're at whatever (I hope it's not 4, and it's
not worth looking up), namely SQL Injection, easy user access, etc,
etc.

There's bound to be something that comes up, too. One of the employees
on my team set up an ad server on our website. The very day they
announced a vulnerability was found, our websites were hacked. So,
you'll have to keep up with that stuff.

kyle stanley

unread,
Jun 3, 2010, 11:40:30 AM6/3/10
to Professional PHP Developers
Why wouldn't you want to learn PHP?
If you want to specify what the forms look like use CSS.
How do you want the forms to function? Anything outside of post and
get would require javascript/AJAX (mootools, jQuery). I don't think
at that point using a generator would be a good time.

Jeff

unread,
Jun 3, 2010, 6:52:33 PM6/3/10
to Professional PHP Developers
On Jun 2, 10:07 pm, BobA <bobalst...@yahoo.com> wrote:
> I really don't want to learn to code PHP - except as a last resort.

Sorry Bob, I'm with the other guys - you're not in a good place if you
don't understand what you are seeing and the only way that will happen
is by cracking a book, opening a text editor, and makin' some
mistakes. The time invested in learning the language, however, will
be well worth it. YOU will be much more valuable for what you can do.

> Ideally I want to specify what the forms should look like and how they
> should function and let a rad app create the code.  The PHP generated
> from these two software products was not very customizable after the
> code was generated.  


PHPMaker DOES allow you to customize the forms - but it's not very
practical to do in the generated code. It's in the interface prior to
generating the code where you should do this. You need to edit /
modify the "templates" in order to get the kind of form you like.

I am now using PHPrunner which generates the app
> but allows editing of the forms it generates.  that seems to work for
> me.  also the generated code seems much more understandable for a PHP
> novice like me.

That sounds interesting - thanks for the lead, I'll be looking at it.
While there's nothing like DIY code, there are times when a RAD
package is the practical solution ... bulky code & learning curve
included as negatives in the equation.

Good luck in your search for a solution - I hope you take some time to
learn PHP!

Jeff
Reply all
Reply to author
Forward
0 new messages