 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Danne Lundqvist's Blog: Getting to grips with an existing XML structure
by Chris Cornutt April 25, 2012 @ 10:44:43
Danne Lundqvist has a new post where he shares a bit of code he's written to "come to grips" with an existing XML structure.
Very often I find myself writing input filters for large XML files using PHP. Common enough task; and PHP offer a great variety of tools to do this effectively depending on the situation. Unfortunately, almost as common is the lack of documentation for the aforementioned XML files. [...] I have looked around for a simple tool but I didn't really find a tool that gave me the quick and dirty overview I wanted. A year or so ago I finally wrote a small PHP class to analyze large XML files.
He includes an example XML file, the HTML output of the parsing and a sample of how to use the class to parse and output the XML structure, complete with some CSS.
voice your opinion now!
xml structure schema parse output html csss
Sameer Borate' Blog: Creating SQL schemas with Doctrine DBAL
by Chris Cornutt December 22, 2010 @ 14:25:53
On his blog today Sameer Borate has a new post looking at using Doctrine DBAL to make schemas rather than having to make them by hand each time (can be very useful for reloads with fixtures).
A tedious task during web development is that of database schema creation. A schema containing a few tables comprising of a small set of rows is quick, while that containing dozens of tables and large numbers of columns is a tedious process. I usually resort to a small php script with some regular expression tossed in to automatically create a schema from a text file definition. But that is a little buggy as I've to manually add the indexes and other small things. Now that Doctrine has released a DBAL library, this will provide a nice ability to automatically create sql schemas.
He introduces the DBAL abstraction layer and includes a basic script to create a schema for a MySQL database, manually adding the columns and setting up things like primary keys and foreign key constraints. He also includes the SQL statements that it will generate and execute on your Doctrine-based connection.
voice your opinion now!
sql schema doctrine generate dbal mysql
Gonzalo Ayuso's Blog: Keep our PostgreSQL databases synchronized with PHP. Database version control
by Chris Cornutt December 13, 2010 @ 09:26:49
In this new post to his blog today Gonzalo Ayuso looks at how he's set up a system that uses PHP to synchronize their PostgreSQL databases' schemas when things changed.
We create source code at development server and push the changes to production. It's really easy to keep synchronized all our code. But with databases it's different. [...] It's a recurrent problem working with databases. We create database objects (tables, views, ..) in the development server and when our application is ready to go live we push the changes to production server. If we are smart developers we save all database scripts in a file and when we deploy them to production we execute the script.
He mentions tools like dbdeploy and phing to help make these migrations a bit more automatic. He needed something a little different though - a command-line script that would, based on an ini file, sync two or more databases. He's created the basic script that includes the actions to show the differences between the databases, a summary of the differences and an execution method to bring them into sync. He gives a basic example of how it would handle the sync between his example production and development databases.
voice your opinion now!
synchronize database schema version control
Rob Allen's Blog: Akrabat_Db_Schema_Manager Zend Framework database migrations
by Chris Cornutt March 29, 2010 @ 10:16:41
Rob Allen has a new post to his blog today that looks at database migrations in Zend Framework applications. He introduces a component of his own - Akrabat_Db_Schema_Manager - to handle the migrations.
It is intended that any time you want to make a change to your database schema (add columns, tables, indexes, etc), then you create a new migration file. [...] The migration file contains a class that extends Akrabat_Db_Schema_AbstractChange and must contain two methods: up() and down(). It follows that up() is called when implementing the changes in this migration and down() is called to put the database back where it was if the change is backed out.
He includes an example of a migration file, one that defines the "up" method to create a table and the "down" to remove it. The Akrabat_Db_Schema_Manager is what your script would interface with by calling the "updateTo" method and change your database's structure. It can even hook into Zend_Tool to make it command-line friendly.
voice your opinion now!
zendframework database migration akrabat schema
Chris Hartjes' Blog: Converting Legacy Apps to CakePHP, Part 2
by Chris Cornutt December 09, 2008 @ 10:26:09
Chris Hartjes has posted the second part of his look at converting legacy applications over to a more structured CakePHP environment. In this new post he looks at working with the database schema.
Now you've decided to convert your legacy app over to CakePHP, you will run into the first serious obstacle: your database schema. To put it bluntly, if your schema does not already account for relationships between multiple tables you are screwed. Given that CakePHP is good at generating the queries you need to pull related records in for you, you NEED that schema to contain relationships.
He talks about the importance of relationships, creating his working models and some things to get well acquainted with - ow relationships work in CakePHP, how to use Containable behavior and some good SQL to back you up should you need it.
voice your opinion now!
cakephp legacy application convert model database schema
IBM developerWorks: Use an XML database in PHP and Java applications
by Chris Cornutt April 03, 2008 @ 09:33:36
The IBM developerWorks site has posted a tutorial (you'll need to log in) showing how to use native XML databases to speed up development time for your applications.
Native XML databases have grown in popularity along with XML, because data is stored as native XML, rather than through tables in a traditional database. Using a native XML database means that a change to the schema requires minimal changes to your code and no change to the database. PHP and Java developers can benefit greatly from using native XML databases
IT talks about how to connect to the database (in this case DB2), grab the XML data via a query and how to insert information back in via a web-based form. There's also an example showing how to make a "search" on the data and how to change the schema of the database on the fly as well.
voice your opinion now!
xml database application tutorial db2 modify schema
|
Community Events
Don't see your event here? Let us know!
|