Browse Source

Merge pull request #239 from thefinn93/phplibrary

Updated the PHP library to work with the UDP admin interface.
Caleb James DeLisle 11 years ago
parent
commit
17f89d35f8

+ 191 - 0
contrib/php/Bencode.php

@@ -0,0 +1,191 @@
+<?php
+
+/**
+ * Contains a pair of recursive functions that implement the bencode data
+ * encoding format.
+ *
+ * @author  Michael J. I. Jackson <mjijackson@gmail.com>
+ */
+class Bencode
+{
+
+    /**
+     * The version of the library.
+     *
+     * @var string
+     */
+    const VERSION = "1.0";
+
+    /**
+     * Bencodes the given data structure.
+     *
+     * @param   mixed
+     * @return  string
+     * @throws  Exception
+     */
+    public static function encode($value)
+    {
+        if (is_null($value)) {
+            return "0:";
+        }
+        if (is_int($value)) {
+            return "i" . $value . "e";
+        }
+        if (is_string($value)) {
+            return strlen($value) . ":" . $value;
+        }
+        if (is_array($value)) {
+            if (self::isAssoc($value)) {
+                ksort($value, SORT_STRING);
+                $buffer = "d";
+                foreach ($value as $key => $v) {
+                    $buffer .= self::encode(strval($key));
+                    $buffer .= self::encode($v);
+                }
+                $buffer .= "e";
+            } else {
+                ksort($value, SORT_NUMERIC);
+                $buffer = "l";
+                foreach ($value as $v) {
+                    $buffer .= self::encode($v);
+                }
+                $buffer .= "e";
+            }
+            return $buffer;
+        }
+
+        throw new Exception("Unable to encode data type: " . gettype($value));
+    }
+
+    /**
+     * Decodes the given string. The second parameter is only used in recursion.
+     *
+     * @param   string
+     * @param   int
+     * @return  mixed
+     * @throws  Exception
+     */
+    public static function decode($tokens, &$i=0)
+    {
+        if (is_string($tokens)) {
+            $tokens = str_split($tokens);
+        }
+
+        switch ($tokens[$i]) {
+        case "d":
+            $dict = array();
+            while (isset($tokens[++$i])) {
+                if ($tokens[$i] == "e") {
+                    return $dict;
+                } else {
+                    $key = self::decode($tokens, $i);
+                    if (isset($tokens[++$i])) {
+                        $dict[$key] = self::decode($tokens, $i);
+                    } else {
+                        throw new Exception("Dictionary key ($key) without a value at index $i");
+                    }
+                }
+            }
+            throw new Exception("Unterminated dictionary at index $i");
+
+        case "l":
+            $list = array();
+            while (isset($tokens[++$i])) {
+                if ($tokens[$i] == "e") {
+                    return $list;
+                } else {
+                    $list[] = self::decode($tokens, $i);
+                }
+            }
+            throw new Exception("Unterminated list at index $i");
+
+        case "i":
+            $buffer = '';
+            while (isset($tokens[++$i])) {
+                if ($tokens[$i] == "e") {
+                    return intval($buffer);
+                } elseif (ctype_digit($tokens[$i])) {
+                    $buffer .= $tokens[$i];
+                } else {
+                    throw new Exception("Unexpected token while parsing integer at index $i: {$tokens[$i]}");
+                }
+            }
+            throw new Exception("Unterminated integer at index $i");
+
+        case ctype_digit($tokens[$i]):
+            $length = $tokens[$i];
+            while (isset($tokens[++$i])) {
+                if ($tokens[$i] == ":") {
+                    break;
+                } elseif (ctype_digit($tokens[$i])) {
+                    $length .= $tokens[$i];
+                } else {
+                    throw new Exception("Unexpected token while parsing string length at index $i: {$tokens[$i]}");
+                }
+            }
+            $end = $i + intval($length);
+            $buffer = '';
+            while (isset($tokens[++$i])) {
+                if ($i <= $end) {
+                    $buffer .= $tokens[$i];
+                    if ($i == $end) {
+                        return $buffer;
+                    }
+                }
+            }
+            throw new Exception("Unterminated string at index $i");
+        }
+
+        throw new Exception("Unexpected token at index $i: {$tokens[$i]}");
+    }
+
+    /**
+     * Tells whether an array is associative or not. In order to be non-associative,
+     * each of the array's key numbers must correspond exactly to it's position
+     * in the array.
+     *
+     * @param   array
+     * @return  bool
+     */
+    public static function isAssoc($array)
+    {
+        return count($array) !== array_reduce(array_keys($array), array("Bencode", "isAssocCallback"), 0);
+    }
+
+    /**
+     * A callback function used by {@link isAssoc()}.
+     *
+     * @return  int
+     */
+    protected static function isAssocCallback($a, $b)
+    {
+        return $a === $b ? $a + 1 : 0;
+    }
+
+}
+
+/**
+ * Shorthand for {@link Bencode::encode()}.
+ *
+ * @param   mixed
+ * @return  string
+ * @throws  Exception
+ * @see     Bencode::encode()
+ */
+function bencode($value)
+{
+    return Bencode::encode($value);
+}
+
+/**
+ * Shorthand for {@link Bencode::decode()}.
+ *
+ * @param   string
+ * @return  mixed
+ * @throws  Exception
+ * @see     Bencode::decode()
+ */
+function bdecode($value)
+{
+    return Bencode::decode($value);
+}

+ 104 - 0
contrib/php/Cjdns.php

@@ -0,0 +1,104 @@
+<?
+
+class Cjdns {
+    public $buffersize = 69632;
+    public $keepalive = 2;
+    public $functions;
+    private $socket;
+    private $password;
+    private $responses = array();
+
+    public static function randStr() {
+        $output = "";
+        $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
+        for($i = 0; $i < 10; $i++) {
+            $output .= $chars[rand(0, strlen($chars)-1)];
+        }
+        return $output;
+    }
+    
+    function receive($txid) {
+        while(!isset($this->responses[$txid])) {
+            $data = fread($this->socket, $this->buffersize);
+            if($data != "") {
+                try {
+                    $decoded = bdecode($data);
+                }
+                catch(Exception $e) {
+                    die("Failed to decode: ".$data);
+                }
+            }
+            $this->responses[$decoded['txid']] = $decoded;
+        }
+        $response = $this->responses[$txid];
+        unset($this->response[$txid]);
+        return $response;
+    }
+
+    public function send_raw($message) {
+        $txid = $this->randStr();
+        if(!isset($message['txid'])) {
+            $message['txid'] = $txid;
+        } else {
+            $txid = $message['txid'];
+        }
+        fwrite($this->socket, bencode($message));
+        return $txid;
+    }
+    
+    private function getCookie() {
+        $data = $this->receive($this->send_raw(array("q" => "cookie")));
+        return $data['cookie'];
+    }
+
+    public function call($function, $args) {
+        echo "$function(";
+        print_r($args);
+        echo ")\n\n<hr />";
+        $cookie = $this->getCookie();
+        $txid = $this->randStr();
+        $request = array("q" => "auth",
+            "aq" => $function,
+            "hash" => hash("sha256", $this->password.$cookie),
+            "cookie" => $cookie,
+            "args" => $args,
+            "txid" => $txid
+            );
+        $requestBencoded = bencode($request);
+        $request['hash'] = hash("sha256", $requestBencoded);
+        $this->send_raw($request);
+        return $this->receive($txid);
+    }
+
+    function __construct($password, $host="127.0.0.1", $port=11234) {
+        $this->socket = stream_socket_client("udp://".$host.":".$port, $errorno, $errorstr);
+        if(!$this->socket) {
+            die("Failed to connect, Error #$errorno: $errorstr");
+        }
+        fwrite($this->socket, bencode(array("q"=>"ping")));   // Try to ping it
+        $returndata = fread($this->socket, $this->buffersize);
+        if($returndata != "d1:q4:ponge") {
+            die("Looks like $host:$port isn't a cjdns admin port");
+        }
+        $this->password = $password;
+        $page = 0;
+        while(True) {
+            $request = array("q" => "Admin_availableFunctions",
+                "args" => array("page" => $page));
+            fwrite($this->socket, bencode($request));
+            $result = bdecode(fread($this->socket, $this->buffersize));
+            foreach($result['availableFunctions'] as $function => $description) {
+                $this->functions[$function] = $description;
+            }
+            if(isset($result['more'])) {
+                $page++;
+            } else {
+                break;
+            }
+        }
+    }
+    
+    function __destructor() {
+        socket_close($this->socket);
+    }
+}

+ 5 - 18
contrib/php/README.md

@@ -2,38 +2,25 @@ cjdns.inc.php
 =============
 A simple PHP API for the CJDNS admin interface.
 
-Installing
--------------
-Make a `secrets.inc.php` file (see `secrets.example.inc.php`) and include it in
-your page, in addition to `cjdns.inc.php`. It is recommended that you keep
-`secrets.inc.php` out of your http directory to prevent accidental password
-leakage.
-
 Usage
 -------------
 ```php
 <?
 // Include the two files
-require("/etc/cjdns/secrets.inc.php");
-require("cjdns.inc.php");
+require "Bencode.php";
+require "Cjdns.php";
 
-// Make a new cjdns object
-$cjdns = new cjdns;
-
-// Connect to the admin interface
-$cjdns->connect();
+// Make a new Cjdns object. The only required argument is the password, but it also accepts the IP and the port
+$cjdns = new Cjdns("password", "127.0.0.1", 11234);
 
 // Print a list of available functions and their arguments
-print_r($cjdns->functionlist());
+print_r($cjdns->functions);
 
 // Call one of them:
 $ping = $cjdns->call("RouterModule_pingNode",array("path"=>"fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588")));
 
 // Display the result:
 print_r($ping);
-
-// Close the connection:
-$cjdns->disconnect();
 ?>
 ```
 

+ 0 - 360
contrib/php/bencode.inc.php

@@ -1,360 +0,0 @@
-<?php
-/*
-  Bencoding OOP wrapper for PHP | by Proger_XP | In public domain
-    http://proger.i-forge.net/BEncoded/7Tn
-
-  Based on lightenc.php functions from
-    http://wiki.theory.org/Decoding_encoding_bencoded_data_with_PHP
-*/
-
-/* BEncoded classes by Proger_XP */
-class BEncoded {
-  public $nodes;
-  public $tempChar;
-
-  static function Decode($str) {
-    $res = bdecode($str);
-    if ($res === null) {
-      throw new EBEncode(null, 'Cannot decode bencoded data.', 'string: '.$str);
-    } else {
-      return $res;
-    }
-  }
-
-  static function Encode($data, $tempChar = null) {
-    $res = bencode($data, $tempChar);
-    if ($res === null) {
-      throw new EBEncode(null, 'Cannot encode bencoded data of type '.gettype($data).'.');
-    }
-    return $res;
-  }
-
-  static function TypeOf($value) {
-    if (is_scalar($value) or $value === null) {
-      return ((is_int($value) or is_float($value)) ? 'int' : 'str');
-    } else {
-      return empty($value['isDct']) ? 'list' : 'dict';
-    }
-  }
-
-  static function HashOf($nodes, $raw = false) {
-    return strtoupper(sha1(self::Encode($nodes), $raw));
-  }
-
-  /* Instance methods */
-
-  function __construct($str = null) {
-    if ($str !== null) {
-      $this->FromString($str);
-    }
-  }
-
-  function FromString($str) {
-    $nodes = self::Decode($str);
-
-    if (!is_array($nodes)) {
-      throw new EBEncode($this, 'Cannot load bencoded string - it decodes to'.
-                                ' a non-array ('.gettype($nodes).').');
-    }
-
-    $this->nodes = &$nodes;
-  }
-
-    function FromFile($file) {
-      $str = file_get_contents($file);
-      if (!is_string($str)) {
-        throw new EBEncode($this, 'File to load bencoded file from doesn\'t exist.', 'file: '.$file);
-      }
-      $this->FromString($str);
-    }
-
-  function ToString() {
-    return self::Encode($this->nodes, $this->tempChar);
-  }
-
-    function ToFile($file) {
-      $bytes = file_put_contents($file, $this->ToString, LOCK_EX);
-      if (!is_int($bytes)) {
-        throw new EBEncode($this, 'Cannot save bencoded file.', 'dest file: '.$file);
-      }
-      return $bytes;
-    }
-
-  // returns a shallow copy of root; to operate directly $this->nodes can be used.
-  function Root() { return $this->nodes; }
-
-  // returns null if node doesn't exist. $name = "/" or "" returns (sets/deletes) root.
-  function ValueOf($name) { return $this->Alter($name); }
-  // alias to ValueOf():
-  function Get($name) { return $this->ValueOf($name); }
-
-  function Set($name, $value) { return $this->Alter($name, 'set', $value); }
-  function Copy($src, $dest) { return $this->Set($dest, $this->ValueOf($src)); }
-
-  function Exchange($node_1, $node_2) {
-    $temp = $this->ValueOf($node_2);
-    $this->Set($node_2, $this->ValueOf($node_1));
-    $this->Set($node_1, $temp);
-  }
-
-  function Delete($name) { return $this->Alter($name, 'delete'); }
-
-    // $op: (g)et / (s)et, returns new value / (d)elete.
-    protected function Alter($name, $op = 'get', $arg = null) {
-      $lastSlash = strpbrk(mb_substr($name, -1), '\\/');
-
-      $name = trim( strtr($name, '\\', '/'), '/' );
-      $path = $name === '' ? array() : explode('/', $name);
-
-      $parent = &$this->nodes;
-      while ($path and is_array($parent)) {
-        $value = &$parent[array_shift($path)];
-
-        if ($op[0] === 'd') {
-          if (!$path and $lastSlash == is_array($value)) {
-            $value = null;
-          }
-        } elseif ($op[0] === 's') {
-          if ($value === null and $path) {
-            $value = array();
-            if (( (string) $path[0] ) !== '0') {
-              $value['isDct'] = true;
-            }
-          }
-        }
-
-        $parent = &$value;
-      }
-
-      if ($op[0] === 's') {
-        $parent = $arg;
-      } elseif ($op[0] === 'd' and !$name) {
-        $parent = array();
-      }
-
-      return $parent;
-    }
-
-  function Export($name = '') { return $this->Dump( $this->ValueOf($name) ); }
-
-    function Dump($value, $prefix = '') {
-      $type = self::TypeOf($value);
-
-      if ($type === 'int') {
-        return is_float($value) ? sprintf('%1.1f', $value) : $value;
-      } elseif ($type === 'str') {
-        return var_export($value, true);
-      } else {
-        $res = '';
-
-          $isDict = $type === 'dict';
-          foreach ($value as $key => &$item) {
-            if (!bskip($key, $item, $this->tempChar)) {
-              $res .= $prefix;
-              $res .= $isDict ? "$key:" : "#$key";
-              $res .= is_array($item) ? "\n" : '  ';
-              $res .= $this->Dump($item, "$prefix  ")."\n";
-            }
-          }
-
-        return substr($res, 0, -1);
-      }
-    }
-
-  // type: int|str|list|dict; other type throws exception.
-  function NewNode($type, $name) {
-    switch ($type = strtolower($type)) {
-    case 'int':   return $this->Set($name, 0);
-    case 'str':   return $this->Set($name, '');
-    case 'list':  return $this->Set($name, array());
-    case 'dict':  return $this->Set($name, array('isDct' => true));
-    default:      throw new EBEncode($this, 'Cannot create bencoded node because type '.$type.' is unknown.');
-    }
-  }
-
-  function SetEmpty($name) {
-    $value = $this->ValueOf($name);
-
-    if (is_int($value) or is_float($value)) {
-      $value = 0;
-    } elseif (is_string($value) or $value === null) {
-      $value = '';
-    } elseif (empty($value['isDct'])) {
-      $value = array();
-    } else {
-      $value = array('isDct' => true);
-    }
-
-    return $this->Set($name, $value);
-  }
-
-  function Cast($name, $asType, $onlyIfNum = false) {
-    $value = $this->ValueOf($name);
-    if ($value === null) {
-      throw new EBEncode($this, 'Cannot cast node '.$name.' into '.$asType.' because node doesn\'t exist.');
-    }
-
-    $asType = strtolower($asType);
-    if (!in_array($asType, array('int', 'str', 'list', 'dict'))) {
-      throw new EBEncode($this, 'Cannot cast node "'.$name.'" because new type ('.$asType.') is invalid.');
-    }
-
-    $type = self::TypeOf($value);
-    if ($type !== $asType) {
-      if ($type === 'int' or $type === 'str') {
-        switch ($asType) {
-        // str -> int:
-        case 'int':
-          if (!is_numeric($value)) {
-            if (!$onlyIfNum) {
-              throw new EBEncode($this, 'Cannot cast string "'.$value.' to integer because it\'s not a number.');
-            }
-          } else {
-            $value = (float) $value;
-          }
-
-          break;
-
-        // int -> str:
-        case 'str':   $value = (string) $value; break;
-        case 'list':  $value = array(0 => $value); break;
-        case 'dict':  $value = array('isDct' => true, 0 => $value); break;
-        }
-      } elseif ($asType === 'int' or $asType === 'str') {
-        throw new EBException($this, 'Casting list/dict node "'.$name.'" into int/str isn\'t allowed.');
-      } elseif ($asType === 'dict') {   // list -> dict
-        $value['isDct'] = true;
-      } else {                          // dict -> list
-        unset($value['isDct']);
-      }
-
-      $this->Set($name, $value);
-    }
-
-    return $value;
-  }
-
-  function TempChar($new = null) {
-    $new === null or $this->tempChar = $new === '' ? null : $new;
-    return $this->tempChar;
-  }
-
-  function InfoHash($raw = false) {
-    $info = &$this->nodes['info'];
-    if (empty($info)) {
-      throw new EBEncode($this, 'Cannot calculate info hash because there is no \'info\' dictionary.');
-    } else {
-      return self::HashOf($info, $raw);
-    }
-  }
-}
-
-  class EBEncode extends Exception {
-    public $obj;
-
-    function __construct($bencObj, $msg, $details = '', $previous = null) {
-      $this->obj = $bencObj;
-      parent::__construct(rtrim($msg, '.').": $details", $previous);
-    }
-  }
-
-/* lightenc.php */
-function bdecode($s, &$pos=0) {
-  if($pos>=strlen($s)) {
-    return null;
-  }
-  switch($s[$pos]){
-  case 'd':
-    $pos++;
-    $retval=array();
-    while ($s[$pos]!='e'){
-      $key=bdecode($s, $pos);
-      $val=bdecode($s, $pos);
-      if ($key===null || $val===null)
-        break;
-      $retval[$key]=$val;
-    }
-    $retval["isDct"]=true;
-    $pos++;
-    return $retval;
-
-  case 'l':
-    $pos++;
-    $retval=array();
-    while ($s[$pos]!='e'){
-      $val=bdecode($s, $pos);
-      if ($val===null)
-        break;
-      $retval[]=$val;
-    }
-    $pos++;
-    return $retval;
-
-  case 'i':
-    $pos++;
-    $digits=strpos($s, 'e', $pos)-$pos;
-    // Proger_XP: changed (int) -> (float) to avoid trimming of values exceeding
-    //            signed int's max value (2147483647).
-    $val=(float)substr($s, $pos, $digits);
-    $pos+=$digits+1;
-    return $val;
-
-//  case "0": case "1": case "2": case "3": case "4":
-//  case "5": case "6": case "7": case "8": case "9":
-  default:
-    $digits=strpos($s, ':', $pos)-$pos;
-    if ($digits<0 || $digits >20)
-      return null;
-    $len=(float)substr($s, $pos, $digits);
-    $pos+=$digits+1;
-    $str=substr($s, $pos, $len);
-    $pos+=$len;
-    //echo "pos: $pos str: [$str] len: $len digits: $digits\n";
-    return (string)$str;
-  }
-  return null;
-}
-
-// Proger_XP: added added skipping for null values and $tempChar prefix for list/dicts.
-function bencode(&$d, $tempChar = null){
-  if(is_array($d)){
-    $ret="l";
-    $isDict=!empty($d["isDct"]);
-    if($isDict){
-      $ret="d";
-      // this is required by the specs, and BitTornado actualy chokes on unsorted dictionaries
-      ksort($d, SORT_STRING);
-    }
-    foreach($d as $key=>$value) {
-      if($isDict){
-        // skip the isDct element, only if it's set by us
-        if (!bskip($key, $value, $tempChar)) {
-          $ret .= strlen($key).":$key";
-        }
-      } elseif (!is_int($key) and !is_float($key) and trim($key, '0..9') !== '') {
-                // Proger_XP: added exception raising for non-numeric list keys.
-                throw new EBEncode(null, 'Cannot bencode() a list - it contains a non-numeric key "'.$key.'".');
-            }
-
-      if (is_string($value)) {
-        $ret.=strlen($value).":".$value;
-      } elseif (is_int($value) or is_float($value)){
-        $ret.="i${value}e";
-      } else {
-        $ret.=bencode ($value);
-      }
-    }
-    return $ret."e";
-  } elseif (is_string($d)) { // fallback if we're given a single bencoded string or int
-    return strlen($d).":".$d;
-  } elseif (is_int($d) or is_float($d)) {
-    return "i${d}e";
-  } else {
-    return null;
-  }
-}
-
-// bskip by Proger_XP.
-function bskip($key, &$value, $tempChar = null) {
-  return ($key === 'isDct' and $value) or $value === null or strpos($key, $tempChar) === 0;
-}

+ 0 - 81
contrib/php/cjdns.inc.php

@@ -1,81 +0,0 @@
-<?php
-/*
- * You may redistribute this program and/or modify it under the terms of
- * the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
-
- CJDNS admin interface for PHP. See index.php for sample usage
- https://github.com/thefinn93/cjdns
-
-*/
-
-require_once("bencode.inc.php");
-
-class cjdns {
-    public $conn;
-    public function connect() {
-        global $ip, $port;
-        $conn = fsockopen($ip, $port, $errno, $errstr, 10);
-        if (!$conn)
-           {die("Failed to connect to admin interface: $errstr ($errno) ");}
-
-        // Connection established. Just gotta make sure it's a CJDNS admin interface we're connected to:
-        fwrite($conn, "d1:q4:pinge\r\n");
-        if(fread($conn, 11) != "d1:q4:ponge") {
-            die("Connected to non CJDNS port");
-        }
-        $this->conn = $conn;
-    }
-
-    public function functionlist() {
-        $be = new BEncoded;
-        $this->write("d1:q7:invalide");
-        $list = $be->Decode($this->read());
-        return $list["availableFunctions"];
-    }
-
-    public function call($function, $args=array()) {
-        global $password;
-        $be = new BEncoded;
-        $args['isDct'] = TRUE;
-
-        // Get a cookie
-        $this->write("d1:q6:cookiee");
-        $cookie = $be->Decode($this->read());
-        $cookie = $cookie['cookie'];
-
-        // Build the request
-        $req = array("q"=>"auth","aq"=>$function,"hash"=>hash("sha256",$password.$cookie), "cookie"=>$cookie,"args"=>$args,"isDct" => TRUE);
-
-        // Do CJD's weird ass hashing thingy
-        $hash = hash("sha256",$be->Encode($req));
-        $req['hash'] = $hash;
-        $this->write($be->Encode($req));
-        return $be->Decode($this->read());
-    }
-
-    public function read() {
-        $reply = fread($this->conn, 69632);
-        return $reply;
-    }
-
-    public function write($data) {
-        if(!fwrite($this->conn, "$data\r\n")) {
-            die("Please connect before making function calls: $errstr ($errno) ");
-        }
-
-    }
-    public function disconnect() {
-          fclose($this->conn);
-    }
-}
-?>

+ 4 - 8
contrib/php/index.php

@@ -1,17 +1,13 @@
 <pre>
 <?php
-require_once("secrets.inc.php");
-require_once("cjdns.inc.php");
+require "Bencode.php";
+require "Cjdns.php";
 
-$admin = new cjdns;
-
-$admin->connect();
+$admin = new Cjdns("supersecure password");
 
 print_r($admin->call("RouterModule_pingNode",array("path"=>"fc72:6c3b:8c74:68a7:d8c3:b4e0:6cbd:9588")));
 
-print_r($admin->functionlist());
-
-$admin->disconnect();
+print_r($admin->functionlist);
 
 ?>
 </pre>

+ 0 - 6
contrib/php/secrets.example.inc.php

@@ -1,6 +0,0 @@
-<?php
-global $password,$ip,$port;
-$password = "supersecure_password";
-$ip="127.0.0.1";
-$port=11234;
-?>