2 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3 and is published under the AGPL license. */
6 class Syj_Controller_Action_Helper_SyjAltiService extends Zend_Controller_Action_Helper_Abstract
8 protected static $_service = null;
10 public function service() {
11 if (is_null (self::$_service)) {
12 $params = Zend_Controller_Front::getInstance()->getParam('altiphp');
13 if ($params['source'] == 'srtmtiles' and isset($params['cache'])) {
14 $cachedir = $params['cache'];
15 if (!is_dir($cachedir)) {
16 if (@mkdir($cachedir, 0755, true) === false) {
17 throw new Zend_Exception();
21 self::$_service = new alti\Alti($params);
23 return self::$_service;