Does pog have a script for reverse engineering an existing table e.g. I
have a table in my existing mysql db with a gazillion attributes
(fields) which I would like to pogify.
So I run a form where I pick my table and a script then runs which
creates an @link tag which takes me to the pog site and generates a pog
object for my table.
Sorry if it has been asked before: I had a quick search but couldn't
find anything on this.
Cheers
TP.
unfortunately, no such thing exists right now. but if you ever
write/find something that does it, feel free to send it to us. this
could indeed be very useful to other users as well.
Thanks
Joel
http://groups.google.com/group/Php-Object-Generator/browse_frm/thread/0c71c3a79a70c14d
Im new to POG, and I must say that it's an incredible idea....
Congratulations!!!
Now I'm developing a script that use the "object" object than will do
that...
When It's done I will send you
Thanks a lot for the great job
And sorry for my English! ;)
I've got a whole database here waiting for pog :)
Cheers,
TP
Anyhow, I was reading the API guide last night and was playing around
with this exact issue. I think that I can tweek my XML function to work
with POG so that you can use your existing database tables and pass
them directly to POG. I need to play with the API a bit, but I'm
working on this
Once I have it ready for testing, where should I post it? Also, if
anyone cares to help out a bit let me know.
sean [at] savetheorcas.org
that's a great idea... and i think there'll be many ppl who'll find
this useful.
I'd be very happy to help if you have any issues regarding the SOAP
api, having worked with it myself... please post any issues/question to
this thread if you have any.
Once you have it ready for testing, you can zip it and send it to us
directly at pog...@phpobjectgenerator.com
Thanks again.
Joel
I'm designing the hack so that it will work for everyone without
knowledge of PHP. So, there are multiple options for generating the
objects. One option will use the SOAP feature described in the API.
The other option, where I'm having the problem, simply creates an @link
link to the POG website. I almost have this working properly, but I
can't figure out what the following code is from the API sample (and
from looking at my own @link link in my POG objects).
WHERE attributeList=array+%28%0A++0+%3D%3E+%27
What is the true value of this code? I've tried to decode it, but
nothing. This code apepars throughout the @link string. If I can figure
out what this it, I can get this working.
Thanks
Sean
your 'hack' seems pretty cool indeed,
the POG @link is urlencoded. To decode it and see what it looks like
use this to decode any @link:
http://www.albionresearch.com/misc/urlencode.php
the important parts of the @link is the attributelist as you mentioned
and the typelist variables, which are string representation of arrays
obtained by var_export. (http://ca.php.net/var_export)
hope this helps.
Joel
With any luck I'll have the @link generator available by tomorrow. It
won't look pretty, but it will functional so that people can start
using while I add the other features and attempt to add a GUI that
matches the current POG template.
I've run into another problem with the SOAP function of the hack -
actually it's more of a problem working with arrays within the class
that loops through the database and extracts all the tables. I'm
working on it though.
I can't tell you how much I LOVE POG!! I'll have to post a short
description of what I've been through trying to get other objects like
this to work. I was using another open-source class which worked for a
while, then it just stopped working and corrupted my database.
I'll email you later tonight with the package.
sean
don't worry about the interface too much, if we have time, we can try
adding it to the setup interface later on.
however, i thought a little bit about the functionality you're
implementing: i can foresee 2 needs coming up pretty soon because of
POG's own shortcomings currently:
- the POG API needs to let you disable encoding/decoding, and it's
currently not available yet.
- the POG API needs to let you generate objects with non-lower case
tables.
these 2 requirements will occur because users with existing tables will
have data that's not encoded and might have tables with non-lower case
names. So, we'll work on those asap and squeeze those in for 2.0
release
thanks again.
Joel
The only disadvantage to this would be that this could take a while if
there are lots of records to loop through. I would imagine that one
could also write in an "elseif" function that could be added to the POG
database class where POG would convert the data as it's called. In
other words, when a record is called from the POG CRUD class, it would
check to see if the data is encoded, if it's not the elseif clause
would kick and encode the content.
I'll have to look into this further to see if this would work.
Nonetheless, I'm making some great progress on the hack. You'll
probably have it tomorrow afternoon.
Sean
Parse error: parse error, unexpected '\'' in
/home/phpob/public_html/index.php(36) : eval()'d code on line 1
The actual values for the attribute types are replaced with "a", "r"
... in each of th form fields, spelling out array.
I'm working on this. I did get it to where it worked but it populated
all the attribute types as VARCHAR(255) and not the actual values from
the database.
Sean
Just wanted to give you a status update. I got things working pretty
well as far as the auto-generation is concerned. I'm still working on
some other features. I didn't occur to me at first, but after reading
your post, I realized that in order for this script to be useful to
most people, it needs to convert their existing data to the encoded
format. Otherwise, this extension is only going to be useful for
creating new database objects, which can already be done easily through
your site.
I'm currently working on a conversion function that will do the
conversion automatically. Since we're talking about working with live
databases, and since there's always the chance that something can go
wrong, the script will make a copy of all the tables in the database
and work on the new tables only, thus leaving the original data in
tact. The script will then encode all the non-numeric data and
interface with POG API to create the object files.
Of course, the simplest solution would simply be to comment out the
encoding functions within POG, but I personally thing that the
advantages of encoding far outweighs the need for simplicity.
I'm going to start uploading my nightly builds of what I have so far to
my website for people here to take a look at things make suggestions.
I'm working on this full-time, so hopefully the script will be
available to everyone shortly.
Sean