Module: nagvis Branch: master Commit: 8655f745ce77bd7789c525833f361fd1195b42b4 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=8655f745ce77bd7789c525833f361fd1195b42b4
Author: Roman Kyrylych <[email protected]> Date: Tue Aug 25 19:25:09 2009 +0300 gmap: Redefine variable as CONFIG_PATH constant Signed-off-by: Roman Kyrylych <[email protected]> --- share/netmap/LinkService.php | 18 +++++++++--------- share/netmap/LocationService.php | 18 +++++++++--------- share/netmap/SettingsService.php | 8 ++++---- share/netmap/ViewpointService.php | 10 +++++----- share/netmap/amf-server.php | 2 +- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/share/netmap/LinkService.php b/share/netmap/LinkService.php index ca9e843..81e412f 100644 --- a/share/netmap/LinkService.php +++ b/share/netmap/LinkService.php @@ -62,7 +62,7 @@ class LinkService private function createFile() { $xml = '<?xml version="1.0" standalone="yes" ?><links/>'; - if (file_put_contents($config_path . 'links.xml', $xml) === FALSE) + if (file_put_contents(CONFIG_PATH . 'links.xml', $xml) === FALSE) throw new Exception('Could not create links.xml'); } @@ -72,10 +72,10 @@ class LinkService */ public function getAll($problemonly = false) { - if (!file_exists($config_path . 'links.xml')) + if (!file_exists(CONFIG_PATH . 'links.xml')) self::createFile(); - if (($xml = @simplexml_load_file($config_path . 'links.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'links.xml')) === FALSE) throw new Exception('Could not read links.xml'); $links = array(); @@ -103,13 +103,13 @@ class LinkService $link->id = uniqid('', true); self::validate($link); - if (($xml = @simplexml_load_file($config_path . 'links.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'links.xml')) === FALSE) throw new Exception('Could not read links.xml'); self::updateState($link); $node = $link->toXML($xml); - if (file_put_contents($config_path . 'links.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'links.xml', $xml->asXML()) !== FALSE) return $link; else throw new Exception('Could not write links.xml'); @@ -141,7 +141,7 @@ class LinkService { self::validate($link); - if (($xml = @simplexml_load_file($config_path . 'links.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'links.xml')) === FALSE) throw new Exception('Could not read links.xml'); self::updateState($link); @@ -150,7 +150,7 @@ class LinkService $link->toXML($xml); - if (file_put_contents($config_path . 'links.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'links.xml', $xml->asXML()) !== FALSE) return $link; else throw new Exception('Could not write links.xml'); @@ -162,12 +162,12 @@ class LinkService */ public function remove($id) { - if (($xml = @simplexml_load_file($config_path . 'links.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'links.xml')) === FALSE) throw new Exception('Could not read links.xml'); self::removeNode($xml, $id); - if (file_put_contents($config_path . 'links.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'links.xml', $xml->asXML()) !== FALSE) return $id; else throw new Exception('Could not write links.xml'); diff --git a/share/netmap/LocationService.php b/share/netmap/LocationService.php index 49009de..b236b9a 100644 --- a/share/netmap/LocationService.php +++ b/share/netmap/LocationService.php @@ -62,7 +62,7 @@ class LocationService private function createFile() { $xml = '<?xml version="1.0" standalone="yes" ?><locations/>'; - if (file_put_contents($config_path . 'locations.xml', $xml) === FALSE) + if (file_put_contents(CONFIG_PATH . 'locations.xml', $xml) === FALSE) throw new Exception('Could not create locations.xml'); } @@ -72,10 +72,10 @@ class LocationService */ public function getAll($problemonly = false) { - if (!file_exists($config_path . 'locations.xml')) + if (!file_exists(CONFIG_PATH . 'locations.xml')) self::createFile(); - if (($xml = @simplexml_load_file($config_path . 'locations.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'locations.xml')) === FALSE) throw new Exception('Could not read locations.xml'); $locations = array(); @@ -103,13 +103,13 @@ class LocationService $location->id = uniqid('', true); self::validate($location); - if (($xml = @simplexml_load_file($config_path . 'locations.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'locations.xml')) === FALSE) throw new Exception('Could not read locations.xml'); self::updateState($location); $node = $location->toXML($xml); - if (file_put_contents($config_path . 'locations.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'locations.xml', $xml->asXML()) !== FALSE) return $location; else throw new Exception('Could not write locations.xml'); @@ -141,7 +141,7 @@ class LocationService { self::validate($location); - if (($xml = @simplexml_load_file($config_path . 'locations.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'locations.xml')) === FALSE) throw new Exception('Could not read locations.xml'); self::updateState($location); @@ -150,7 +150,7 @@ class LocationService $location->toXML($xml); - if (file_put_contents($config_path . 'locations.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'locations.xml', $xml->asXML()) !== FALSE) return $location; else throw new Exception('Could not write locations.xml'); @@ -162,12 +162,12 @@ class LocationService */ public function remove($id) { - if (($xml = @simplexml_load_file($config_path . 'locations.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'locations.xml')) === FALSE) throw new Exception('Could not read locations.xml'); self::removeNode($xml, $id); - if (file_put_contents($config_path . 'locations.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'locations.xml', $xml->asXML()) !== FALSE) return $id; else throw new Exception('Could not write locations.xml'); diff --git a/share/netmap/SettingsService.php b/share/netmap/SettingsService.php index e5f8e42..27f6d4b 100644 --- a/share/netmap/SettingsService.php +++ b/share/netmap/SettingsService.php @@ -26,7 +26,7 @@ class SettingsService private function createFile() { $xml = '<?xml version="1.0" standalone="yes" ?><settings/>'; - if (file_put_contents($config_path . 'settings.xml', $xml) === FALSE) + if (file_put_contents(CONFIG_PATH . 'settings.xml', $xml) === FALSE) throw new Exception('Could not create settings.xml'); } @@ -63,10 +63,10 @@ class SettingsService if (($mapurl = $CORE->MAINCFG->getValue('defaults', 'mapurl')) === false) throw new Exception('Error in NagVis configuration'); - if (!file_exists($config_path . 'settings.xml')) + if (!file_exists(CONFIG_PATH . 'settings.xml')) self::createFile(); - if (($xml = @simplexml_load_file($config_path . 'settings.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'settings.xml')) === FALSE) throw new Exception('Could not read settings.xml'); return new Settings((string)$xml['googleMapsKey'], @@ -88,7 +88,7 @@ class SettingsService @$xml->addAttribute('defaultLocationAction', $settings->defaultLocationAction); @$xml->addAttribute('openLinksInNewWindow', $settings->openLinksInNewWindow); - if (file_put_contents($config_path . 'settings.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'settings.xml', $xml->asXML()) !== FALSE) return $settings; else throw new Exception('Could not write settings.xml'); diff --git a/share/netmap/ViewpointService.php b/share/netmap/ViewpointService.php index b71a7e2..4eb8a06 100644 --- a/share/netmap/ViewpointService.php +++ b/share/netmap/ViewpointService.php @@ -26,7 +26,7 @@ class ViewpointService private function createFile() { $xml = '<?xml version="1.0" standalone="yes" ?><viewpoints/>'; - if (file_put_contents($config_path . 'viewpoints.xml', $xml) === FALSE) + if (file_put_contents(CONFIG_PATH . 'viewpoints.xml', $xml) === FALSE) throw new Exception('Could not create viewpoints.xml'); } @@ -36,10 +36,10 @@ class ViewpointService public function getAll() { - if (!file_exists($config_path . 'viewpoints.xml')) + if (!file_exists(CONFIG_PATH . 'viewpoints.xml')) self::createFile(); - if (($xml = @simplexml_load_file($config_path . 'viewpoints.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'viewpoints.xml')) === FALSE) throw new Exception('Could not read viewpoints.xml'); $viewpoints = array(); @@ -58,7 +58,7 @@ class ViewpointService */ public function add($label, $center, $zoom) { - if (($xml = @simplexml_load_file($config_path . 'viewpoints.xml')) === FALSE) + if (($xml = @simplexml_load_file(CONFIG_PATH . 'viewpoints.xml')) === FALSE) throw new Exception('Could not read viewpoints.xml'); $node = $xml->addChild('viewpoint'); @@ -68,7 +68,7 @@ class ViewpointService $viewpoint = new Viewpoint($label, $center, $zoom); - if (file_put_contents($config_path . 'viewpoints.xml', $xml->asXML()) !== FALSE) + if (file_put_contents(CONFIG_PATH . 'viewpoints.xml', $xml->asXML()) !== FALSE) return $viewpoint; else throw new Exception('Could not write viewpoints.xml'); diff --git a/share/netmap/amf-server.php b/share/netmap/amf-server.php index 3f7e7cb..e269606 100644 --- a/share/netmap/amf-server.php +++ b/share/netmap/amf-server.php @@ -39,7 +39,7 @@ class Custom_Zend_Amf_Server extends Zend_Amf_Server protected $_production = false; } -$config_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/../..') . '/etc/geomap/'; +define('CONFIG_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/../..') . '/etc/geomap/'); $server = new Custom_Zend_Amf_Server(); $server->setClassMap("Settings", "Settings"); ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
