]> git.openstreetmap.org Git - nominatim.git/commitdiff
apply marker filtering to functions.sql also after table creation
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 20 Apr 2016 22:00:15 +0000 (00:00 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 20 Apr 2016 22:00:15 +0000 (00:00 +0200)
fixes #430

utils/setup.php

index cfe7f560191e353153aff9b5500f96f96141ed7b..4a2bc64ff3a8e7d3919f9fbb62452ee4b3894b05 100755 (executable)
                echo "Functions\n";
                $bDidSomething = true;
                if (!file_exists(CONST_InstallPath.'/module/nominatim.so')) fail("nominatim module not built");
                echo "Functions\n";
                $bDidSomething = true;
                if (!file_exists(CONST_InstallPath.'/module/nominatim.so')) fail("nominatim module not built");
-               $sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
-               $sTemplate = str_replace('{modulepath}', CONST_InstallPath.'/module', $sTemplate);
-               if ($aCMDResult['enable-diff-updates'])
-               {
-                       $sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
-               }
-               if ($aCMDResult['enable-debug-statements'])
-               {
-                       $sTemplate = str_replace('--DEBUG:', '', $sTemplate);
-               }
-               if (CONST_Limit_Reindexing)
-               {
-                       $sTemplate = str_replace('--LIMIT INDEXING:', '', $sTemplate);
-               }
-               if (!CONST_Use_US_Tiger_Data)
-               {
-                       $sTemplate = str_replace('-- %NOTIGERDATA% ', '', $sTemplate);
-               }
-               if (!CONST_Use_Aux_Location_data)
-               {
-                       $sTemplate = str_replace('-- %NOAUXDATA% ', '', $sTemplate);
-               }
-               pgsqlRunScript($sTemplate);
+               create_sql_functions();
        }
 
        if ($aCMDResult['create-tables'] || $aCMDResult['all'])
        }
 
        if ($aCMDResult['create-tables'] || $aCMDResult['all'])
 
                // re-run the functions
                echo "Functions\n";
 
                // re-run the functions
                echo "Functions\n";
-               $sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
-               $sTemplate = str_replace('{modulepath}',
-                                            CONST_InstallPath.'/module', $sTemplate);
-               pgsqlRunScript($sTemplate);
+               create_sql_functions();
        }
 
        if ($aCMDResult['create-partition-tables'] || $aCMDResult['all'])
        }
 
        if ($aCMDResult['create-partition-tables'] || $aCMDResult['all'])
                return $sSql;
        }
 
                return $sSql;
        }
 
+       function create_sql_functions()
+       {
+               $sTemplate = file_get_contents(CONST_BasePath.'/sql/functions.sql');
+               $sTemplate = str_replace('{modulepath}', CONST_InstallPath.'/module', $sTemplate);
+               if ($aCMDResult['enable-diff-updates'])
+               {
+                       $sTemplate = str_replace('RETURN NEW; -- %DIFFUPDATES%', '--', $sTemplate);
+               }
+               if ($aCMDResult['enable-debug-statements'])
+               {
+                       $sTemplate = str_replace('--DEBUG:', '', $sTemplate);
+               }
+               if (CONST_Limit_Reindexing)
+               {
+                       $sTemplate = str_replace('--LIMIT INDEXING:', '', $sTemplate);
+               }
+               if (!CONST_Use_US_Tiger_Data)
+               {
+                       $sTemplate = str_replace('-- %NOTIGERDATA% ', '', $sTemplate);
+               }
+               if (!CONST_Use_Aux_Location_data)
+               {
+                       $sTemplate = str_replace('-- %NOAUXDATA% ', '', $sTemplate);
+               }
+               pgsqlRunScript($sTemplate);
+
+       }
+