Skip to content

Instantly share code, notes, and snippets.

View themasch's full-sized avatar

Mark Schmale themasch

  • SMF GmbH & Co. KG
  • Germany
View GitHub Profile
<?php
class db {
// Eigenschaft um die Datenbankverbindung zu speichern.
protected static $con = null;
// Zugangsdaten als Parameter weil global böse ist
public static function createConnection($host, $name, $user, $pass) {
// neue Verbindung erzeugen und in Klasse speichern.
self::$con = new mysqli($host, $user, $pass, $name);
<?php
/**
* Sound-Generation.FM v3.0
*
* @copyright Copyright (c) 2010 by sound-generation.fm
* @author Rico "Mahribarius" Schäfer <[email protected]>
* @author Mark "MaSch" Schmale <[email protected]>
* @package SG.FMv3
* @version $Id: DB.php 119 2010-06-03 00:40:56Z masch $
*/
var sys = require('sys'),
http = require('http'),
fs = require('fs'),
couchdb = require('./lib/couchdb'),
client = couchdb.createClient(5984, 'localhost'),
db = client.db('chat');
function chat(port) {
this.createServer(port);
}