|
||||
| ||||
|
|||||||
| OOTP Mods - Database Tools Do you need to take a dump? SQL gurus welcome |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
All Star Starter
Join Date: Aug 2003
Posts: 1,146
|
OPI (OOTP 2006 PHP Importer)
The first version is available for public release. I submitted a dumbed down version of this for the contest, but I've put the finishing touches on this for now and am making it available to the masses.
OPI requires PHP 4.1 or greater with PEAR DB. PEAR is a DB independent API which allows OPI to be used with DBs beyond just MySQL. Although, I have currently only tested it with MySQL. The readme file in the download contains installation and use directions. Download Here Feel free to post comments, suggestions, questions here. |
|
|
|
|
|
#2 |
|
Minors (Double A)
Join Date: Sep 2003
Posts: 161
|
Have not actually ran the code but looking through it and it is much more sphoisticated then the 20 liner I threw together just to do it.
I really like the abstraction of the DB layer with PEAR, but I wonder if some will not have that enabled or available. Also you may should be able to use PEAR or the DB_ado specifically to possibally have a import to MSAccess.
__________________
Scott Stewart World Baseball Hierarchy - Calgary Outlaws Beyond the Ivy - Chicago Cubs Stars and Strips Baseball League - Chicago White Soxs Action Pack Baseball League - Toronto Blue Jays |
|
|
|
|
|
#3 |
|
All Star Starter
Join Date: Aug 2003
Posts: 1,146
|
I agree, PEAR does support many DBs, I use it with PostGreSQL (far superior to MySQL
) everyday. Although, I only tested this with MySQL because I know that is what 99.99% of the OOTP community will have and my time is limited. I'd be very interested to hear of success stories with other DBs. Problems will likely arise with some non-standard SQL DBs because CREATE TABLE constructs in non-SQL standard DBs are usually somewhat proprietary.In my experience, any shared hosting company I've dealt with had PEAR installed by default. But I'm sure there are exceptions out there. It has been GPL'd, so anyone could of course convert the code to use the dependent mySQL php statements instead of PEAR. But the fact that I used PEAR will even make that easier, because they could simply make their own DB.php class, implement a handful of methods, put it at the same directory level, and my code would pickup their DB.php and not PEARS and make the DB dependent API calls instead of using the real PEAR DB.php.
|
|
|
|
|
|
#4 |
|
All Star Reserve
Join Date: Feb 2003
Location: Orange, CA
Posts: 569
|
I get the following error when attempting to run this with my host.
Fatal error: Cannot redeclare scandir() in /home/xxx/xxx/xxx/ootp/ootp2006import.php on line 263 I'm using PHP5, which might be the problem considering I see some issues with this error dealing with php5. I will see what happens in PHP4 in a moment.
__________________
DanGarion GM - Los Angeles Dodgers The Peanuts and Cracker Jack Baseball League PCJBL! Last edited by dangarion; 06-03-2006 at 06:17 PM. |
|
|
|
|
|
#5 |
|
All Star Reserve
Join Date: Feb 2003
Location: Orange, CA
Posts: 569
|
I went to PHP 4 and it works fine. Now I just have to open up my PHP book and refresh myself on what I can do with this.
__________________
DanGarion GM - Los Angeles Dodgers The Peanuts and Cracker Jack Baseball League PCJBL! |
|
|
|
|
|
#6 |
|
All Star Starter
Join Date: Aug 2003
Posts: 1,146
|
I have a function called scandir which is a exact replication of the same function in PHP5. PHP5 folks could comment out my redeclared function and it should work fine, but I'll just rename the function for future PHP5 users.
|
|
|
|
|
|
#7 |
|
Hall Of Famer
Join Date: Dec 2001
Location: Union City, TN
Posts: 6,383
|
Dave, tell me exactly what this does. I'm a newb, I guess.
|
|
|
|
|
|
#8 |
|
All Star Starter
Join Date: Aug 2003
Posts: 1,146
|
It uses the SQL dump output from OOTP2006 and automatically loads your entire OOTP universe into your database. This is essential for anyone building addons for OOTP2006 (i.e. future CATOs or BOSIs). Its also extremely useful (if you know SQL) if you want to create customized reports or get to your data in specific ways. For example, I recently wrote a script to compare my OOTP6 data (using commish joe's exporters/BOSI2) to my OOTP2006 data of the same imported league. I was able to quickly spit out a report of every single player not imported and those who lost positions and get a look into my conversion not possible simply with a eyes on approach.
|
|
|
|
|
|
#9 | |
|
Hall Of Famer
Join Date: Jul 2002
Location: Detroit, MI
Posts: 3,498
|
Quote:
Thanks |
|
|
|
|
![]() |
| Bookmarks |
|
|