]> git.mxchange.org Git - friendica.git/commitdiff
never enough comments
authorFriendika <info@friendika.com>
Sat, 11 Dec 2010 04:21:34 +0000 (20:21 -0800)
committerFriendika <info@friendika.com>
Sat, 11 Dec 2010 04:21:34 +0000 (20:21 -0800)
boot.php
testargs.php

index 6530973339e27a22a92744047339fb09a446ad75..a526dd0d1495017c0c79bbf9801a11ed9a01e663 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -200,10 +200,31 @@ class App {
                if(x($_GET,'q'))
                        $this->cmd = trim($_GET['q'],'/');
 
+               /** 
+                * Figure out if we are running at the top of a domain
+                * or in a sub-directory and adjust accordingly
+                */
+
                $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/');
                if(isset($path) && strlen($path) && ($path != $this->path))
                        $this->path = $path;
 
+
+               /**
+                *
+                * Break the URL path into C style argc/argv style arguments for our
+                * modules. Given "http://example.com/module/arg1/arg2", $this->argc
+                * will be 3 (integer) and $this->argv will contain:
+                *   [0] => 'module'
+                *   [1] => 'arg1'
+                *   [2] => 'arg2'
+                *
+                *
+                * There will always be one argument. If provided a naked domain
+                * URL, $this->argv[0] is set to "home".
+                *
+                */
+
                $this->argv = explode('/',$this->cmd);
                $this->argc = count($this->argv);
                if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) {
@@ -213,10 +234,20 @@ class App {
                        $this->module = 'home';
                }
 
+               /**
+                * Special handling for the webfinger/lrdd host XRD file
+                * Just spit out the contents and exit.
+                */
+
                if($this->cmd === '.well-known/host-meta')
                        require_once('include/hostxrd.php');
 
 
+               /**
+                * See if there is any page number information, and initialise 
+                * pagination
+                */
+
                $this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
                $this->pager['itemspage'] = 50;
                $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
index 65e56ec3ebf272a0abf5ceb81fb8fd25bd9c5ebe..4c9bce4e93cf551919056f15ad60fb6c62d12590 100644 (file)
@@ -1,5 +1,20 @@
 <?php
 
+/**
+ *
+ * File: testargs.php
+ *
+ * Purpose:
+ * During installation we need to check if register_argc_argv is
+ * enabled for the command line PHP processor, because otherwise
+ * deliveries will fail. So we will do a shell exec of php and
+ * execute this file with a command line argument, and see if it 
+ * echoes the argument back to us. Otherwise notify the person 
+ * that their installation doesn't meet the system requirements.
+ *
+ */ 
+
 if(($argc > 1) && isset($argv[1]))
        echo $argv[1];
 else