Overview

Namespaces

  • Mapbender
    • Component
      • HTTP
    • CoreBundle
      • Command
      • Component
        • Exception
      • Controller
      • DataFixtures
        • ORM
      • DependencyInjection
      • Element
        • Type
      • Entity
      • EventListener
      • Extension
      • Form
        • DataTransformer
        • EventListener
        • Type
      • Security
      • Template
    • KmlBundle
      • Element
    • ManagerBundle
      • Controller
      • Form
        • DataTransformer
        • Type
    • MonitoringBundle
      • Command
      • Component
      • Controller
      • DependencyInjection
      • Entity
      • EventListener
      • Form
    • PrintBundle
      • Component
      • Controller
    • WmcBundle
      • Component
        • Exception
      • Element
        • Type
      • Entity
      • Form
        • Type
    • WmsBundle
      • Component
        • Exception
      • Controller
      • DependencyInjection
      • Element
        • Type
      • Entity
      • Event
      • Form
        • EventListener
        • Type
    • WmtsBundle
      • Component
        • Exception
      • Controller
      • Entity
      • Form
        • Type
  • None
  • PHP

Classes

  • LoadApplicationData
  • LoadEpsgData
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: 
 3: namespace Mapbender\CoreBundle\DataFixtures\ORM;
 4: 
 5: use Doctrine\Common\Persistence\ObjectManager;
 6: use Doctrine\Common\DataFixtures\FixtureInterface;
 7: use Mapbender\CoreBundle\Entity\SRS;
 8: 
 9: /**
10:  * The LoadEpsgData loads the epsg parameter from a text file into a database table.
11:  * 
12:  * @author Paul Schmidt
13:  */
14: class LoadEpsgData implements FixtureInterface
15: {
16: 
17:     /**
18:      * @inheritdoc
19:      */
20:     public function load(ObjectManager $manager)
21:     {
22:         $filepath = __DIR__ . '/../../../Resources/proj4/proj4js_epsg.txt';
23:         $file = @fopen($filepath, "r");
24:         while(!feof($file))
25:         {
26:             $help = trim(str_ireplace("\n", "", fgets($file)));
27:             if(strlen($help) === 0)
28:             {
29:                 continue;
30:             }
31:             $temp = explode("|", $help);
32:             if($temp[0] === null || strlen($temp[0]) === 0)
33:             {
34:                 continue;
35:             }
36:             $srs = new SRS();
37:             $srs->setName($temp[0]);
38:             $srs->setTitle($temp[1]);
39:             $srs->setDefinition($temp[2]);
40: 
41:             $manager->persist($srs);
42:         }
43:         $manager->flush();
44:         fclose($file);
45:     }
46: 
47: }
48: 
Mapbender3 API documenation API documentation generated by ApiGen 2.8.0