Overview
Comment:Added additional verbage for debug and setup easing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 18e7e965e20def479df080c6bcb8389a5270b7ed
User & Date: matt on 2013-02-03 05:25:45
Other Links: manifest | tags
Context
2015-04-14
04:45
Merged selfcontained back to trunk check-in: d3fdfad50d user: matt tags: trunk
2013-05-17
07:08
refactor for selfcontained executables (incomplete) check-in: 55a8152be6 user: matt tags: selfcontained
2013-02-03
05:25
Added additional verbage for debug and setup easing check-in: 18e7e965e2 user: matt tags: trunk
2013-01-09
06:20
Fixed output of error in error page check-in: 60f784c4db user: matt tags: trunk
Changes

Modified session.scm from [8cf5e377cc] to [c4e9fdabd2].

174
175
176
177
178
179
180

181
182


183
184
185
186
187
188
189
190
191
192




193

194





195
196
197
198
199






200
201
202
203
204
205
206
207
174
175
176
177
178
179
180
181


182
183
184
185
186
187
188
189
190



191
192
193
194
195
196
197
198
199
200
201
202





203
204
205
206
207
208

209
210
211
212
213
214
215







+
-
-
+
+







-
-
-
+
+
+
+

+

+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-







    (if dbtype   (sdat-set-dbtype!   self dbtype))
    (if dbinit   (sdat-set-dbinit!   self dbinit))
    (if domain   (sdat-set-domain!   self domain))
    (if twikidir (sdat-set-twikidir! self twikidir))
    (if debugmode (sdat-set-debugmode! self debugmode))
    (sdat-set-page-dir-style! self page-dir)
    ;; (print "configdat: ")(pp configdat)
    (if debugmode
    ;;(session:log self "sroot: " sroot " logfile: " logfile " dbtype: " dbtype 
    ;;		 " dbinit: " dbinit " domain: " domain " page-dir-style: " page-dir)
	(session:log self "sroot: " sroot " logfile: " logfile " dbtype: " dbtype 
		     " dbinit: " dbinit " domain: " domain " page-dir-style: " page-dir))
    )
  )
;;   (let ((dbtype (sdat-get-dbtype self)))
;;     (print "dbtype: " dbtype)
;;     (sdat-set-dbtype! self (eval dbtype))))

(define (session:setup self)
  (let ((dbtype (sdat-get-dbtype self))
	(dbinit (eval (sdat-get-dbinit self)))
	(dbexists #f))
  (let ((dbtype    (sdat-get-dbtype self))
	(debugmode (sdat-get-debugmode self))
	(dbinit    (eval (sdat-get-dbinit self)))
	(dbexists  #f))
    (let ((dbfname (alist-ref 'dbname dbinit)))
      (if debugmode (session:log self "session:setup dbfname=" dbfname ", dbtype=" dbtype ", dbinit=" dbinit))
      (if (eq? dbtype 'sqlite3)
	  (let ((dbpath (pathname-directory dbfname)))  ;; do a couple sanity checks here to make setting up easier
	    (if debugmode (session:log self "INFO: setting up for sqlite3 db access to " dbfname))
	    (if (not (file-write-access? dbpath))
		(session:log self "WARNING: Cannot write to " dbpath)
		(if debugmode (session:log self "INFO: " dbpath " is writeable")))
	  (if (file-exists? dbfname)
	      (begin
		;; (session:log self "setting dbexists to #t")
		(set! dbexists #t))))
      ;; (session:log self "dbtype: " dbtype " dbfname: " dbfname " dbexists: " dbexists))
	    (if (file-exists? dbfname)
		(begin
		  ;; (session:log self "setting dbexists to #t")
		  (set! dbexists #t))))
	  (if debugmode (session:log self "INFO: setting up for pg db access to account info " dbinit)))
      (if debugmode (session:log self "dbtype: " dbtype " dbfname: " dbfname " dbexists: " dbexists)))
      )
    (sdat-set-conn! self (dbi:open dbtype dbinit))
    (if (and (not dbexists)(eq? dbtype 'sqlite3))
 	(begin
	  (print "WARNING: Setting up session db with sqlite3")
	  (session:setup-db self)))
    (session:process-url-path self)
    (session:setup-session-key self)