Exemple #1
0
<?php

// this is the way you should work with POT if you moved main OTS.php file outside POT's directory
include 'path/to/OTS.php';
// dont use 'new POT()'!!!
// dont use POT::getInstance() anymore
POT::setPOTPath('classes');
/*
    here comes your stuff...
*/
Exemple #2
0
    /**
     * Returns OTServ database information.
     * 
     * <p>
     * Especialy currently only schema version is available (via <i>'version'</i> key).
     * </p>
     * 
     * <p>
     * Note: Since 0.2.0+SVN this method is static.
     * </p>
     * 
     * @version 0.2.0+SVN
     * @since 0.1.6
     * @return array List of schema settings.
     * @throws PDOException On PDO operation error.
     * @example examples/schema.php schema.php
     */
    public static function getSchemaInfo()
    {
        $info = array();
        // generates associative array
        foreach (self::$db->query('SELECT ' . self::$db->fieldName('name') . ', ' . self::$db->fieldName('value') . ' FROM ' . self::$db->tableName('schema_info')) as $row) {
            $info[$row['name']] = $row['version'];
        }
        return $info;
    }
}
// default POT directory
POT::setPOTPath(dirname(__FILE__) . '/');
// registers POT autoload mechanism
spl_autoload_register(array('POT', 'loadClass'));