The simplest approach would be to just include the class, e.g.
class PolygonController …
public function someAction()
{
include 'path/to/class/file.php';
$pointLocation = new pointLocation;
// do something $pointLocation;
}
You can probably load this file with Zend_Loader or the Autoloader as well, but since the class name does't follow the Pear/ZF naming convention, the easiest is this. It doesn't matter where you put the actual class file as long as it is accessible somehow.
Since this is a third party class, you could extend it to make it match the ZF/Pear naming convention. Then place it into your library folder, so you can use the Autoloader:
<?php
include 'path/to/class/file.php';
class My_PointLoader extends pointLoader {}
This file would be placed in APPLICATION_ROOT/lib/My/PointLoader.php
And in your bootstrap, register your "My_" namespace with
$autoloader->registerNamespace('My_');
Then you can do $pointLoader = new My_PointLoader; in your controller and the autoloader will take care of including the file.
Or, when you want to add functionality or change the API of the class, aggregate it with an Adapter, e.g.
<?php
include 'path/to/class/file.php';
class My_PointLoader_Adapter
{
protected $_pointLoader;
public function __construct(pointLoader $pointLoader = NULL)
{
if($pointLoader === NULL) {
$pointLoader = new pointLoader;
}
$this->_pointLoader = new pointLoader;
}
public function someAdapterMethod($foo)
{
$this->_pointLoader->someMethodInPointLoader($foo);
}
// … more methods
}
Then add the namespace prefix as shown above, so the Autoloader handles inclusion.