JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform: separate wfpl_main.php from config.php
authorJason Woofenden <jason@jasonwoof.com>
Tue, 3 Mar 2015 14:31:49 +0000 (09:31 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 3 Mar 2015 14:31:49 +0000 (09:31 -0500)
metaform.php
metaform/htaccess
metaform/wfpl_main.php [new file with mode: 0644]

index c604d9a..bf90466 100644 (file)
@@ -599,7 +599,8 @@ function download_tar() {
        $files = array(
                "README" => "These files are meant to work with wfpl.\n\nSee: http://sametwice.com/wfpl\n",
                ".htaccess" => make_htaccess(),
        $files = array(
                "README" => "These files are meant to work with wfpl.\n\nSee: http://sametwice.com/wfpl\n",
                ".htaccess" => make_htaccess(),
-               "config.php" => "<?php\n\nrequire_once(__DIR__.'/'.'inc/wfpl/main.php');\nmetaform_main();\n",
+               "config.php" => "<?php\n\n# put your site-wide configuration here\n",
+               "wfpl_main.php" => read_whole_file(__DIR__.'/'.'metaform/wfpl_main.php'),
                "styl.styl" => read_whole_file(__DIR__.'/'.'metaform/styl.styl'),
                "template.html" => read_whole_file(__DIR__.'/'.'metaform/site-template.html'),
                "$admin_name.html" => make_html(),
                "styl.styl" => read_whole_file(__DIR__.'/'.'metaform/styl.styl'),
                "template.html" => read_whole_file(__DIR__.'/'.'metaform/site-template.html'),
                "$admin_name.html" => make_html(),
index 4cb28ed..ebf4f8b 100644 (file)
@@ -34,7 +34,7 @@ RewriteEngine  on
 # Unfortunately, the rewrite rules only work with absolute paths, so if your
 # files are not at the top level of the domain, you'll have to customize this
 # part. Here's the config for running at the top level:
 # Unfortunately, the rewrite rules only work with absolute paths, so if your
 # files are not at the top level of the domain, you'll have to customize this
 # part. Here's the config for running at the top level:
-RewriteRule    ^[^/.]*$  /config.php [L]
+RewriteRule    ^[^/.]*$  /wfpl_main.php [L]
 
 # use this line instead if you have this (.htaccess) file and your php and html
 # files in the ~form~ directory:
 
 # use this line instead if you have this (.htaccess) file and your php and html
 # files in the ~form~ directory:
diff --git a/metaform/wfpl_main.php b/metaform/wfpl_main.php
new file mode 100644 (file)
index 0000000..86b0693
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+define('DOCROOT', __DIR__ .'/');
+define('INC_WFPL', DOCROOT . 'inc/wfpl/');
+
+require_once(DOCROOT . 'config.php');
+
+require_once(INC_WFPL . 'main.php');
+wfpl_main();