Developer howto:

EVEShipInfo can be used as a portable EVE ships database. Install and activate the plugin, and you can access the ships collection from your own plugin or custom scripts in your wordpress site.

Quick start

There are two aspects to the ships database: the collection management class EVEShipInfo_Collection, which is used to query the database and retrieve individual ships or ship collections matching any number of criteria, and the ship class EVEShipInfo_Collection_Ship which is used to access individual ship information.

Note: I strongly recommend using a PHP editor with function insight to make it easier to see what API methods are available. Personally I use Zend Studio, but a great free alternative is PHP Development Tools (PDT), which is also based on Eclipse.

Access the database

The first step is to get the collection instance:

$collection = EVEShipInfo::getInstance()->createCollection();

From here, it's simply a question what you want to do. Let's explore a few common use cases.

Find a single ship

Find a ship by name (case insensitive)

$ship = $collection->getShipByName('abaddon');

// always check the return value.
if($ship) {
    echo $ship->getID();
}

Find a ship by its ID (same as the official dump)

$ship = $collection->getShipByID(1234);

// always check the return value
if($ship) {
   echo $ship->getName();
}

Find a specific subset of ships

To find ships matching specific criteria, you can use the ship filter:

// create a new filter
$filter = $collection->createFilter();

// let's add some criteria
$filter->selectFrigates();
$filter->selectRaceByName('Minmatar');

// get all matching ships
$ships = $filter->getShips();

// do something with the result
echo '<b>Matches:</b><br/>';
foreach($ships as $ship) {
    echo $ship->getName().'<br/>';
}

Find ships by fulltext search

$filter = $collection->createFilter();
$filter->selectSearch('tash-murkon'); // find all tash-murkon edition ships

$ships = $filter->getShips();

Working with ship data

The ship class has an easy to use API that can be used to access ship attributes.

Note: Not all ship data is currently available, but more methods will be added incrementally in upcoming updates.

Some methods can optionally add the units matching the ship attribute value:

// Retrieve the drone bandwidth value
$ship->getDroneBandwidth();     // 75
$ship->getDroneBandwidth(true); // 75 MB/S