The simplest approach is just a includeclass, for example
class PolygonController …
public function someAction()
{
include 'path/to/class/file.php';
$pointLocation = new pointLocation;
// do something $pointLocation;
}
You may also be able to download this file using Zend_Loader or Autoloader, but since the class name does not comply with 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 available.
Since this is a third-party class, you can extend it to conform to the ZF / Pear naming convention. Then put it in the library folder so you can use Autoloader:
<?php
include 'path/to/class/file.php';
class My_PointLoader extends pointLoader {}
APPLICATION_ROOT/lib/My/PointLoader.php
"My_"
$autoloader->registerNamespace('My_');
$pointLoader = new My_PointLoader; , .
, API , ,
<?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);
}
}
, , Autoloader .