Skip to content

Instantly share code, notes, and snippets.

<?php
$site_root = $_SERVER["SERVER_NAME"];
$serverRoot = $_SERVER["DOCUMENT_ROOT"] . '/';
spl_autoload_register(function ($class) {
global $serverRoot;
require_once $serverRoot . 'classes/' . $class . '.class.php';
});
if ( ! isset($_SESSION)) {
session_start();
@farfromunique
farfromunique / classes_Character.class.php
Created August 27, 2013 01:56
This Gist is related to the issue described in http://www.reddit.com/r/PHPhelp/comments/1l3ete/my_object_isnt_an_object_help/ Files with _ in the name should be in directories, but Gists don't support directories.
<?php
class Character {
/** @var int the UID of this character. Corresponds to User->Character */
public $UID;
/** @var string The Character's name */
protected $aName;
/** @var int Character's Age in years */
protected $Age;
/** @var string Character's Gender: M, F, or Other */