[clhp-cvs] CVS update: clhp/package.lisp clhp/clhp.lisp clhp/ChangeLog

Anthony Ventimiglia aventimiglia at common-lisp.net
Wed Nov 12 22:41:58 UTC 2003


Update of /project/clhp/cvsroot/clhp
In directory common-lisp.net:/tmp/cvs-serv30903

Modified Files:
	package.lisp clhp.lisp ChangeLog 
Log Message:
REQUIRE function, loads lisp files in the
current clhp document-root

Date: Wed Nov 12 17:41:56 2003
Author: aventimiglia

Index: clhp/package.lisp
diff -u clhp/package.lisp:1.2 clhp/package.lisp:1.3
--- clhp/package.lisp:1.2	Tue Oct 21 00:16:58 2003
+++ clhp/package.lisp	Wed Nov 12 17:41:55 2003
@@ -1,4 +1,4 @@
-#+cmu (ext:file-comment "$Id: package.lisp,v 1.2 2003/10/21 04:16:58 aventimiglia Exp $")
+#+cmu (ext:file-comment "$Id: package.lisp,v 1.3 2003/11/12 22:41:55 aventimiglia Exp $")
 ;;
 ;; CLHP the Common Lisp Hypertext Preprocessor
 ;; (C) 2003 Anthony J Ventimiglia
@@ -29,4 +29,5 @@
 	   #:parse #:*clhp-version* #:echo #:include #:xml-element
 	   #:make-xml-element #:copy-xml-element #:xml-element-attributes
 	   #:xml-element-name #:xml-element-contents #:xml-element-p #:tag
+	   #:require
 	   ))


Index: clhp/clhp.lisp
diff -u clhp/clhp.lisp:1.17 clhp/clhp.lisp:1.18
--- clhp/clhp.lisp:1.17	Fri Oct 17 09:11:44 2003
+++ clhp/clhp.lisp	Wed Nov 12 17:41:55 2003
@@ -1,5 +1,5 @@
 (ext:file-comment
- "$Id: clhp.lisp,v 1.17 2003/10/17 13:11:44 aventimiglia Exp $")
+ "$Id: clhp.lisp,v 1.18 2003/11/12 22:41:55 aventimiglia Exp $")
 ;;
 ;; CLHP the Common Lisp Hypertext Preprocessor
 ;; (C) 2003 Anthony J Ventimiglia
@@ -29,7 +29,7 @@
 ;; will override the CVS keyword
 (defconstant *CLHP-VERSION*
   #.(or nil				; Set this for releases
-	(let* ((trimmed (string-trim "$ Date:" "$Date: 2003/10/17 13:11:44 $"))
+	(let* ((trimmed (string-trim "$ Date:" "$Date: 2003/11/12 22:41:55 $"))
 	       (date (subseq trimmed 0 (search " " trimmed))))
 	  (concatenate 'string
 		       (subseq date 0 4)
@@ -192,6 +192,15 @@
     (make-xml-element :name (car args)
 	      :attributes att-list
 	      :contents contents)))
+
+;; Similar to PHP's require, loads a lisp file in the local directory.
+(defun require (filename)
+  "Load the lisp source or fasl file FILENAME, relative to the document root"
+  (let ((doc-root
+	 (make-pathname :name nil :type nil :version nil
+			:defaults (parse-namestring
+				   (gethash :script_filename *server-env*)))))
+    (load (merge-pathnames doc-root filename))))
 
 ;; Error handling is probably the biggest room to work here.  I should
 ;; eventually make a handler that binds the evaluation of clhp PI


Index: clhp/ChangeLog
diff -u clhp/ChangeLog:1.22 clhp/ChangeLog:1.23
--- clhp/ChangeLog:1.22	Wed Nov 12 16:57:12 2003
+++ clhp/ChangeLog	Wed Nov 12 17:41:56 2003
@@ -1,3 +1,8 @@
+2003-11-12  Anthony Ventimiglia  <ant at afghan.dogpound>
+
+	* clhp.lisp (require): REQUIRE function, loads lisp files in the
+	current clhp document-root
+
 2003-11-12  Anthony Ventimiglia  <aventimiglia at common-lisp.net>
 
 	* mod_clhp.c: Changed handler name to clhp-handler
@@ -280,9 +285,9 @@
 2003-09-17 16:21  <aventimiglia at common-lisp.net>
 
 	* clhp.lisp: Wrote a nice little reader macro to make cvs
-	  versioning automatic, the $Date: 2003/11/12 21:57:12 $ keyword is parsed to make a 8
+	  versioning automatic, the $Date: 2003/11/12 22:41:56 $ keyword is parsed to make a 8
 	  digit number YYYYMMDD with the suffix "cvs" addedd, so a CVS
-	  release with a $Date: 2003/11/12 21:57:12 $ of 2003/09/15 ends up with a
+	  release with a $Date: 2003/11/12 22:41:56 $ of 2003/09/15 ends up with a
 	  *CLHP-VERSION* of "20030915cvs"
 
 2003-09-17 14:47  <aventimiglia at common-lisp.net>
@@ -291,4 +296,4 @@
 	  that will aide in compiling lisp in a mkae freindly way by
 	  passing a non-zero exit code when compilation fails
 
-$Id: ChangeLog,v 1.22 2003/11/12 21:57:12 aventimiglia Exp $
\ No newline at end of file
+$Id: ChangeLog,v 1.23 2003/11/12 22:41:56 aventimiglia Exp $
\ No newline at end of file





More information about the Clhp-cvs mailing list