Skip to content

Commit 00fd704

Browse files
committed
the server package is now merged with the compiler
1 parent db58a4e commit 00fd704

File tree

9 files changed

+12
-602
lines changed

9 files changed

+12
-602
lines changed

src/compiler/api/GF/Server.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ import System.Exit(ExitCode(..))
3939
import GF.Infra.UseIO(readBinaryFile,writeBinaryFile,ePutStrLn)
4040
import GF.Infra.SIO(captureSIO)
4141
import GF.Data.Utilities(apSnd,mapSnd)
42-
import qualified PGFService as PS
4342
import Data.Version(showVersion)
4443
import Paths_gf(getDataDir,version)
4544
import GF.Infra.BuildInfo (buildInfo)
45+
import GF.Server.PGFService
4646
import GF.Server.SimpleEditor.Convert(parseModule)
4747
import Control.Monad.IO.Class
4848

@@ -53,9 +53,9 @@ server jobs port optroot init execute1 = do
5353
state <- newMVar M.empty
5454
datadir <- getDataDir
5555
let root = maybe (datadir</>"www") id optroot
56-
cache <- PS.newPGFCache root jobs
56+
cache <- newPGFCache root jobs
5757
setDir root
58-
let readNGF = PS.readCachedNGF cache
58+
let readNGF = readCachedNGF cache
5959
state0 <- init readNGF
6060
http_server (execute1 readNGF) state0 state cache root
6161
where
@@ -110,15 +110,15 @@ handle logLn documentroot state0 cache execute stateVar conn = do
110110
"/gfshell" -> addDate (stateful $ inDir command)
111111
"/cloud" -> addDate (stateful $ inDir cloud)
112112
"/parse" -> addDate (parse query)
113-
"/version" -> addDate (versionInfo `fmap` PS.listPGFCache cache)
114-
"/flush" -> addDate (PS.flushPGFCache cache >> return (ok200 "flushed"))
113+
"/version" -> addDate (versionInfo `fmap` listPGFCache cache)
114+
"/flush" -> addDate (flushPGFCache cache >> return (ok200 "flushed"))
115115
'/':rpath ->
116116
-- This code runs without mutual exclusion, so it must *not*
117117
-- use/change the cwd. Access files by absolute paths only.
118118
let path = translatePath rpath
119119
in case (takeDirectory path,takeFileName path,takeExtension path) of
120-
(_ ,_ ,".pgf") -> PS.pgfMain logLn conn cache path rq
121-
(_ ,_ ,".ngf") -> PS.pgfMain logLn conn cache path rq
120+
(_ ,_ ,".pgf") -> pgfMain logLn conn cache path rq
121+
(_ ,_ ,".ngf") -> pgfMain logLn conn cache path rq
122122
(dir,"grammars.cgi",_ ) -> addDate (grammarList dir query)
123123
_ -> serveStaticFile conn rpath path
124124
_ -> addDate (return $ resp400 upath)

src/server/Cache.hs renamed to src/compiler/api/GF/Server/Cache.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- | A file cache to avoid reading and parsing the same file many times
2-
module Cache (Cache,newCache,flushCache,expireCache,listCache,readCache,readCache') where
2+
module GF.Server.Cache (Cache,newCache,flushCache,expireCache,listCache,readCache,readCache') where
33

44
import Control.Concurrent.MVar
55
import Data.Map (Map)

src/server/PGFService.hs renamed to src/compiler/api/GF/Server/PGFService.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{-# LANGUAGE CPP, ScopedTypeVariables #-}
2-
module PGFService(pgfMain,
3-
Caches,newPGFCache,readCachedPGF,readCachedNGF,
4-
flushPGFCache,listPGFCache) where
2+
module GF.Server.PGFService(pgfMain,
3+
Caches,newPGFCache,readCachedPGF,readCachedNGF,
4+
flushPGFCache,listPGFCache) where
55

66
import PGF2
77
import PGF2.Transactions
8-
import Cache
8+
import GF.Server.Cache
99

1010
import Data.Time.Format(formatTime)
1111
import Data.Time.Format(defaultTimeLocale,rfc822DateFormat)

src/server/LICENSE

Lines changed: 0 additions & 340 deletions
This file was deleted.

src/server/Setup.hs

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/server/URLEncoding.hs

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/server/lighttpd.conf

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/server/pgf-fcgi.hs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/server/pgf-service.cabal

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)