Archive for the ‘Web development’ category

PHP Spell Checker v1.1

February 16th, 2010

A new version of PHP Spell Checker is available.
The new feature is checking the spelling with Google’s “Did you mean” feature, so not a big update, but useful non the less.

The syntax is the same:

<?php

// include the class
require_once(dirname(__FILE__)."/../GDYMSpellChecker.class.php");

// instantiate the class
$spellCheck = new GDYMSpellChecker();

$textWithErrors = "PHP: the quik browm fox jumps over the lazi dog lazi today"; // this text has 3 errors
$result = $spellCheck->checkSpelling($textWithErrors, "en-US"); // will return an array with the wrong words with associated suggestions
//$result = $spellCheck->checkSpelling($textWithErrors, "en-US", false); // will return an array with the wrong words without associated suggestions
//print_r($spellCheck->getWarnings());// get all warnings
//print_r($spellCheck->getErrors());// get all errors
if (count($result) == 0) {
	print "Text is OK !<br/>";
} else {
	print "Text has errors !<br/>";
	print "<pre>";
	print_r($result);
}

?>

For further reading about the PHP class [p2p type=”id” value=”20″ text=”read this post”].

Download the class from here

VN:F [1.9.22_1171]
Rating: 7.7/10 (15 votes cast)

PHP FIFA Manager online editor project

December 2nd, 2009

I am a fan of the FIFA Manager game, i play it every year and every year i would like to install all the “database extensions” (community database improvements) available out there, but the problem is that i have to keep track of all fan sites and choose carefully as some databases, club badges, player pictures, etc collide with each other.

In this regard I started the FIFA Manger online editor. The aim is to create a web application for editing the database of the game and allow contributors to upload all the images (club badges, player’s pictures, etc) into one place, aggregate everything in one place.

This is a big project in the way that there is a lot of data to parse and even harder to understand the internal database structure.

Until now i have a small draft of how the application will look like and also I have already written the parser for some details.
You can take a look and test it here: http://fmed.protung.ro/
For now only England is available for testing (not with the full database).
For now you can see a list of all countries, clubs in that country, all players of the clubs and some details of the players.
The referees are also parsed but there is no interface to see them for now.

Everybody that is interested in this project and has a few hours per week free is more than welcome to join. I need as much help as possible in order to complete this project before the 2011 release 😉

One of the biggest problems now is the user interface, there are just so many buttons, input fields and windows. So if you are an ExtJS developer and want to create a nice, clean and fast interface for this project do not hesitate to contact me.

Have a nice game, and more about this project soon.

VN:F [1.9.22_1171]
Rating: 6.0/10 (7 votes cast)

Simple XML Parser Namespace support

October 27th, 2009

I have added support for namespaces to the parser.
What this means, you are now able to register a namspace in order to be able to parse the XML.

Also the usage of this class changed.

<?php

$xml = "http://www.protung.ro/feed/atom/"; // parse an Atom feed

// create a new object
$parser = new SimpleLargeXMLParser();
// load the XML
$parser->loadXML($xml);

// register the namespace
$parser->registerNamespace("atom", "http://www.w3.org/2005/Atom");
// this will get an array of entries
$array = $parser->parseXML("//atom:feed/atom:entry");

?>

As always, you can download the new version from here.

VN:F [1.9.22_1171]
Rating: 8.5/10 (14 votes cast)

New PHP Simple Large XML Parser version

October 2nd, 2009

I have added support for node attributes to the PHP Simple Large XML Parser class.

Now it’s possible to retrieve the structure of the XML document with the attributes of the nodes. If you choose to get the nodes also the structure of the result array will be different from the non-attribute array.

The new structure will be like this:

<?php

array('value'=> 'another node / value' ,
     'attributes'=>array('attribute name'=>'attribute value',
                    'another attribute'=>'some value',
                    'yet another attribute'=>'other value'
                    )
);

?>

In order to get the array with attributes you need to pass the 3rd parameter as true:

<?php

   SimpleLargeXMLParser::parseXML($xml, "//myFirstNode", true);

?>

You can download the new version from here.

Please [p2p type=”id” value=”180″ text=”read this post”] for more information about the functionality of the class:

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

PHP Yahoo Messenger Archive Decoder v1.5

September 10th, 2009

A new version of PHP Yahoo Messenger Archive Decoder is available for download.

I know 2 years have passed since the release (or actually any other modifications), but a friend asked me to modify it so he can use it to parse conference history files. So this is what’s new in this version.

I really don’t think a new version will be added, unless it will not work anymore with the latest yahoo messenger version (it still works with version 10 beta)

VN:F [1.9.22_1171]
Rating: 8.4/10 (8 votes cast)

PHP simple large XML parser

September 6th, 2009

I needed a simple PHP script to parse large XML files fast and without huge memory consumption, so I’ve written a small class for this.

This class can be used to parse large XML files (it works with small one also) fast and with minimum of memory consumption.
It can parse any valid XML and convert it to an array. What it does not do is to get the attributes of the nodes.
If you need it, contact me and i can implement it for you if you want.

You can parse any part of the XML as it supports XPath with the same performance as parsing the entire XML (well, a little bit faster as it’s less data to parse)

» Read more: PHP simple large XML parser

VN:F [1.9.22_1171]
Rating: 10.0/10 (3 votes cast)

PHP WSDL Generator new version work in progress

September 1st, 2009

i started working on a new (improved) version of PHP WSDL Generator.
Many people have asked for new features and better output this is what the new version will have.
I will also rewrite almost all the code.

The new PHP parser is almost done. Now you can also add classes without specifying files. Just include them in your code and tell the generator to also use those classes. Of course the old way to add classes (by specifying files with PHP code) will still be available, but unlike before when the content of the files was parsed, now the files first will be included (using require_once() ). I know this is not ideal if you have other code that must not arbitrary execute, but then again it’s good practice to have the classes separated from any other code. The new parser will be much faster and more accurate.

That’s all for now, I will post more news about this after more work is done.

Please don’t ask when the release will happen as I don’t know. I do this in my free time witch is somehow limited right now.

VN:F [1.9.22_1171]
Rating: 8.3/10 (35 votes cast)

PHP Web Commander

August 19th, 2009

PHP Web Commander is an application designed for web server usage.
The basic idea of the program concerns the possibility to manage files, ftp accounts, database, etc.
Similarly to the populars files managers, the utility is endowed with an user-friendly interface, ensuring the same level of functional procedures.
Supporting a wide range of plugins, the application allows the user to configure his own Web Commander system, through miscellaneous commands.

Download it from here. Changelog here.

VN:F [1.9.22_1171]
Rating: 8.5/10 (6 votes cast)

PHP Spell Checker

August 18th, 2009

This package can be used to check the spelling of text and get fix suggestions.

There is a base class that defines functions for spell checking.

There are also two classes for checking the spelling of text using either PHP scripts that contain arrays of valid words and grammar definitions, or using the hunspell program.

If the classes determine that there are misspelled words, they may return suggestions for eventual fixes.

» Read more: PHP Spell Checker

VN:F [1.9.22_1171]
Rating: 9.7/10 (12 votes cast)

PHP WSDL Generator

August 18th, 2009

This package can be used to generate a Web Services Definition Language (WSDL) document from the code of a class that implements Web services calls.

It parses the code of a given PHP class script files and generates a WSDL definition from the list of the class functions.

Certain functions may be skipped to not be included in the WSDL definition based on the function access type.

The generated WSDL may be saved to a given file, returned as a string or served for download.

Download class

VN:F [1.9.22_1171]
Rating: 9.4/10 (9 votes cast)