Overview
Comment: | Mostly ported to Chicken 4.7.x |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | move-to-ck4.7.x |
Files: | files | file ages | folders |
SHA1: |
2274e4ac364cdf83d1ccc2c48130eb6a |
User & Date: | matt on 2011-10-02 19:47:56 |
Other Links: | branch diff | manifest | tags |
Context
2011-10-02
| ||
22:22 | 90% ported to chicken-scheme v4.7.0 check-in: 45412597aa user: matt tags: move-to-ck4.7.x | |
19:47 | Mostly ported to Chicken 4.7.x check-in: 2274e4ac36 user: matt tags: move-to-ck4.7.x | |
07:18 | Bit more ported check-in: d3ad3e868e user: matt tags: move-to-ck4.7.x | |
Changes
Modified Makefile from [1d36e0d212] to [90551885a6].
︙ | |||
13 14 15 16 17 18 19 20 21 22 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + - + - + - - - - - - + + + + + + - | SOFILES = $(MODULEFILES:%.scm=%.so) CFILES = $(MODULEFILES:%.scm=%.c) OFILES = $(MODULEFILES:%.scm=%.o) TARGFILES = $(notdir $(SOFILES)) MODULES = $(addprefix $(TARGDIR)/modules/,$(TARGFILES)) install : $(TARGDIR)/stmlrun $(LOGDIR) $(MODULES) all : $(SOFILES) stmlrun : stmlrun.scm formdat.scm misc-stml.scm session.scm stml.scm \ setup.scm html-filter.scm requirements.scm keystore.scm \ |
Modified formdat.scm from [3adbf991ae] to [36ecd60344].
︙ | |||
145 146 147 148 149 150 151 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | - + | (define formdat:bin-data-name-rex (regexp "\\Wname=\"([^\"]+)\"")) (define formdat:bin-file-name-rex (regexp "\\Wfilename=\"([^\"]+)\"")) (define formdat:bin-file-type-rex (regexp "Content-Type:\\s+([^\\s]+)")) (define formdat:delim-patt-rex (regexp "^\\-+[0-9]+\\-*$")) ;; returns a hash with entries for all forms - could well use a proplist? (define (formdat:load-all) |
︙ |
Modified misc-stml.scm from [97e4132f22] to [f5de1fb05e].
︙ | |||
147 148 149 150 151 152 153 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - - + + - + | (s:html (s:head (s:title err) (s:body (s:h1 "ERROR") (s:p err))))))) (define (s:validate-uri) |
︙ |
Modified session.scm from [0f87b604f7] to [4f92f7adcd].
︙ | |||
158 159 160 161 162 163 164 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - - + + | (let* ((rawconfigdat (session:read-config self)) (configdat (if rawconfigdat (eval rawconfigdat) '())) (sroot (s:find-param 'sroot configdat)) (logfile (s:find-param 'logfile configdat)) (dbtype (s:find-param 'dbtype configdat)) (dbinit (s:find-param 'dbinit configdat)) (domain (s:find-param 'domain configdat))) |
︙ | |||
189 190 191 192 193 194 195 | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | - + | (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) ;; capture stdin if this is a POST |
︙ | |||
246 247 248 249 250 251 252 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - - + + | conn query) (if result (dbi:exec conn (conc "UPDATE sessions SET last_used=" (dbi:now conn) " WHERE session_key=?;") session-key)) result) #f)) ;; (define (session:process-url-path self) |
︙ | |||
272 273 274 275 276 277 278 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - + | (dbi:for-each-row (lambda (tuple) (set! status #t)) conn (string-append "INSERT INTO sessions (session_key) VALUES ('" tmpkey "')")) tmpkey)) ;; returns session key IFF it is in the HTTP_COOKIE (define (session:extract-session-key self) |
︙ | |||
468 469 470 471 472 473 474 | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | - - - - + + + + + + + + - - - - + + + + | (del-query "DELETE FROM session_vars WHERE session_id=? AND page=? AND key=?;") (ins-query "INSERT INTO session_vars (session_id,page,key,value) VALUES(?,?,?,?);") (upd-query "UPDATE session_vars set value=? WHERE key=? AND session_id=? AND page=?;") (changed-count 0)) ;; save the delta only (for-each (lambda (page) ;; page is: "*globalvars*" "*sessionvars*" or otherstring |
︙ | |||
508 509 510 511 512 513 514 | 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (set! changed-count (+ changed-count 1))) conn (s:sqlparam ins-query session-id page key master-value))) (else (err:log "Shouldn't get here"))))) all-keys))) ;; process all keys (list "*sessionvars*" "*globalvars*" page-name)))))) |
︙ | |||
673 674 675 676 677 678 679 | 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | - - - - + + + + - + | (let ((newresult (cons (string-append (s:any->string key) "=" (s:any->string val)) result))) (if (< (length tail) 1) ;; true if done (string-intersperse newresult "&") (loop (car tail)(cadr tail)(cddr tail) newresult)))))) (define (session:link-to self page params) |
︙ |
Modified setup.scm from [a5066a3ddf] to [c6717dd49d].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + | wrapperfunc s:strong) errmsg) '()))) (define (s:current-page) (sdat-get-page s:session)) (define (s:delete-session) |
︙ |
Modified stmlrun.scm from [88627319f4] to [cf9034b401].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - - - + + - + | ;; PURPOSE. ;; (require-extension syntax-case) ;; (declare (run-time-macros)) (require-library dbi) |
︙ |
Modified tests/test.scm from [525e5f0347] to [6a4cc3871f].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | (require-extension sqlite3) (import (prefix sqlite3 sqlite3:)) (require-library dbi) (load "./requirements.scm") (load "./cookie.so") (load "./misc-stml.scm") (load "./formdat.scm") (load "./stml.scm") (load "./session.scm") ;(load "./sqltbl.scm") (load "./html-filter.scm") (load "./keystore.scm") |
︙ | |||
78 79 80 81 82 83 84 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | ;; (test "Session var del" #f (s:session-var-get "nick")) ;; test person (load "./tests/models/test.scm") |
︙ |