 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Christian Weiske's Blog: Importing huge XML files using PHP5 - efficiently and conveniently
by Chris Cornutt August 25, 2008 @ 09:34:38
Christian Weiske has a quick tip on how to get larger XML files to pull into PHP5 and be usable:
At work I had the task to implement the synchronization between an online shop and a commodity management system. Data exchange format was XML - one big XML file for all of the products (some thousands with dozens of attributes). Big question: How do I import the file in a way that is most convenient for me as a programmer - and without exceeding the machine's RAM when loading a 1 GiB file?
The newer alternatives both use the same technology (DOM and SimpleXML - with DOM behind it) so he goes more "low tech" than that and opts for the XMLReader extension to pull in the large amounts of data. Available in PHP5, the XMLReader extension, which he combines with an Iterator from the SPL to makes for a simple, quick little parser.
voice your opinion now!
import xml file php5 efficient convenient xmlreader spl iterator
ThinkPHP Blog: Using LDIF to simulate LDAP transactions with PHP
by Chris Cornutt July 01, 2008 @ 08:45:18
On the ThinkPHP blog today, there's a new post from Stephanie Ehrling about simulating an LDAP connection and data request to PHP with LDIF.
An LDIF file is a simple text file that can contain those LDAP information, which can be separated into two groups. On the one hand, it can hold exported LDAP data in a text format. The other purpose of LDIF is to use it for importing data into an LDAP based system. So it can contain data to be imported or just commands that shall be processed. This is an important fact, because that opens the door to an interesting workaround.
This workaround allows you to import large amounts of data quickly and easy by dumping it into the server via a simple PHP script. The code is included in the post, but you'll need to have the binaries to get the LDIF and LDAP functionality working together.
voice your opinion now!
ldif simulate ldap connection data import binaries ldapmodify
Greg Szorc's Blog: Using DTD's and Catalogs for XHTML Validation
by Chris Cornutt April 10, 2008 @ 11:29:48
Greg Szorc shows how, in this entry on his blog, to use DTDs and catalogs to validate your XHTML pages with a little help from PHP.
This [validation from an external site like the W3C validator] approach is a good start, but it is far from ideal because it is based on an honor system of sorts. You often forget to validate each change you make and there is always some corner case that you forget. So, what can be done about it? Well, if you find yourself developing in PHP, you can employ the following solution.
The code he includes pulls in the XHTML content from your page (or the output of the framework's view layer) and pushes it into a DOMDocument that's build with the LIBXML_DTDLOAD and LIBXML_DTDATTR options.
voice your opinion now!
html validation dom extension document import
Developer Tutorials Blog: Working With Wordpress Offline Like a Pro
by Chris Cornutt April 10, 2008 @ 09:48:51
On the Developer Tutorials blog, there's a new post showing you what all you'll need to install to work with WordPress offline "like a pro" on your local machine.
I used to work off of my web server but the problem I've had lately is that when I'm not connected to the internet I haven't been able to code for Wordpress in a way that allows me to view my changes. Since I started using the techniques used in this tutorial my productivity has increased significantly.
His method has you install MAMP on your local machine (for the Windows users, WAMP is just about as easy to set up) and how to import content over from your remote server to the local machine. Of course, you could just set up a subversion repository, but that's another tutorial...
voice your opinion now!
wordpress ofline mamp wamp configure import content webserver
|
Community Events
Don't see your event here? Let us know!
|