• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Gesior AAC 2011 - Needed? Ideas?

Very nice. I'll be sure to test this once a full release is avaiable.
 
Because it's not even alpha version. When I want change variable name or function return value I can find all classes that use it and edit.

EDIT:
You can view guilds page here:
http://skalski.at/xanteria/?page=guild&amp0=list

guild/view page (when you are logged on account and you are guild owner):
guilds_view.PNG


EDIT 2:
default acc. maker parameter amp changed to aac
 
Last edited:
I'll start to making it looks good from a visual side, because now it blows.
 
I'll start to making it looks good from a visual side, because now it blows.
Colors are now set to test table generator. Bufo will set normal colors when I will finish Table class.
 
Do you use in your GesiorAAC PDO? I think this is the best option in PHP: statements, transactions, and others.

Diath, thanks I don't see this repository with GesiorAAC 2011. Okay, i will check myself.​
 
Last edited:
Do you use in your GesiorAAC PDO? I think this is the best option in PHP: statements, transactions, and others.

Diath, thanks I don't see this repository with GesiorAAC 2011. Okay, i will check myself.​
Yes. Now it's in index.php, hard to find :p
PHP:
class Database extends PDO
{
	private $connected = false;
	const DB_MYSQL = 1;
	const DB_SQLITE = 2;

	private $db_driver;
	private $db_host = 'localhost';
	private $db_port = '3306';
	private $db_name;
	private $db_username;
	private $db_password;
	private $db_file;

	public function connect()
	{
		return false;
	}

	public function isConnected()
	{
		return $this->connected;
	}

	public function setConnected($value)
	{
		$this->connected = $value;
	}

	public function getDatabaseDriver()
	{
		return $this->db_driver;
	}

	public function getDatabaseHost()
	{
		return $this->db_host;
	}

	public function getDatabasePort()
	{
		return $this->db_port;
	}

	public function getDatabaseName()
	{
		return $this->db_name;
	}

	public function getDatabaseUsername()
	{
		return $this->db_username;
	}

	public function getDatabasePassword()
	{
		return $this->db_password;
	}

	public function getDatabaseFile()
	{
		return $this->db_file;
	}

	public function setDatabaseDriver($value)
	{
		$this->db_driver = $value;
	}

	public function setDatabaseHost($value)
	{
		$this->db_host = $value;
	}

	public function setDatabasePort($value)
	{
		$this->db_port = $value;
	}

	public function setDatabaseName($value)
	{
		$this->db_name = $value;
	}

	public function setDatabaseUsername($value)
	{
		$this->db_username = $value;
	}

	public function setDatabasePassword($value)
	{
		$this->db_password = $value;
	}

	public function setDatabaseFile($value)
	{
		$this->db_file = $value;
	}

	public function beginTransaction()
	{
		if($this->isConnected() || $this->connect())
			return parent::beginTransaction();
		else
			throw new Exception('Website is not connected to database. Cannot execute "beginTransaction()"');
	}

	public function commit()
	{
		if($this->isConnected() || $this->connect())
			return parent::commit();
		else
			throw new Exception('Website is not connected to database. Cannot execute "commit()"');
	}

	public function errorCode()
	{
		if($this->isConnected() || $this->connect())
			return parent::errorCode();
		else
			throw new Exception('Website is not connected to database. Cannot execute "errorCode()"');
	}

	public function errorInfo()
	{
		if($this->isConnected() || $this->connect())
			return parent::errorInfo();
		else
			throw new Exception('Website is not connected to database. Cannot execute errorInfo()');
	}

	public function exec($statement)
	{
		if($this->isConnected() || $this->connect())
			return parent::exec($statement);
		else
			throw new Exception('Website is not connected to database. Cannot execute exec(\$statement)');
	}

	public function getAttribute($attribute)
	{
		if($this->isConnected() || $this->connect())
			return parent::getAttribute($attribute);
		else
			throw new Exception('Website is not connected to database. Cannot execute getAttribute(\$attribute)');
	}

	public static function getAvailableDrivers()
	{
		if($this->isConnected() || $this->connect())
			return parent::getAvailableDrivers();
		else
			throw new Exception('Website is not connected to database. Cannot execute getAvailableDrivers()');
	}

	public function inTransaction()
	{
		if($this->isConnected() || $this->connect())
			return parent::inTransaction();
		else
			throw new Exception('Website is not connected to database. Cannot execute inTransaction()');
	}

	public function lastInsertId($name = NULL)
	{
		if($this->isConnected() || $this->connect())
			return parent::lastInsertId($name);
		else
			throw new Exception('Website is not connected to database. Cannot execute ');
	}

	public function prepare($statement, $driver_options = array())
	{
		if($this->isConnected() || $this->connect())
			return parent::prepare($statement, $driver_options);
		else
			throw new Exception('Website is not connected to database. Cannot execute lastInsertId(\$name)');
	}

	public function query($statement)
	{
		$GLOBALS['queries']++;
		if($this->isConnected() || $this->connect())
			return parent::query($statement);
		else
			throw new Exception('Website is not connected to database. Cannot execute query(\$statement)');
	}

	public function quote($string, $parameter_type = PDO::PARAM_STR)
	{
		if($this->isConnected() || $this->connect())
			return parent::quote($string, $parameter_type);
		else
			throw new Exception('Website is not connected to database. Cannot execute quote(\$string, \$parameter_type)');
	}

	public function rollBack()
	{
		if($this->isConnected() || $this->connect())
			return parent::rollBack();
		else
			throw new Exception('Website is not connected to database. Cannot execute rollBack()');
	}

	public function setAttribute($attribute, $value)
	{
		if($this->isConnected() || $this->connect())
			return parent::setAttribute($attribute, $value);
		else
			throw new Exception('Website is not connected to database. Cannot execute setAttribute(\$attribute, \$value)');
	}
}

class Database_MySQL extends Database
{
	public function __construct()
	{
		$this->setDatabaseDriver(self::DB_MYSQL);
	}

	public function connect()
	{
		try
		{// add error reporting
			parent::__construct('mysql:host=' . $this->getDatabaseHost() . ';port=' . $this->getDatabasePort() . ';dbname=' . $this->getDatabaseName(), $this->getDatabaseUsername(), $this->getDatabasePassword());
			$this->setConnected(true);
			return true;
		}
		catch(PDOException $error)
		{
			return false;
		}
	}

	public function fieldName($name)
	{
		return '`' . $name . '`';
	}

	public function tableName($name)
	{
		return '`' . $name . '`';
	}
}

class Database_SQLite extends Database
{
	public function __construct()
	{
		$this->setDatabaseDriver(self::DB_SQLITE);
	}

	public function connect()
	{
		try
		{// add error reporting
			parent::__construct('sqlite:' . $this->getDatabaseFile());
			$this->setConnected(true);
			return true;
		}
		catch(PDOException $error)
		{
			return false;
		}
	}

	public function fieldName($name)
	{
		return '"' . $name . '"';
	}

	public function tableName($name)
	{
		return '"' . $name . '"';
	}
}
 
Looking better Gesior, I appreciate you keeping your code organized and tabbed this time around. Your last AAC scared me... :eek:
 
noob
if pot does not exist u dont write any acc naps.

lol? You call Gesior a noob. Take a look at yourself.. You made 1 good Layout, and your a PhP God?
Gesior made many revisions of Gesior Acc and countless pages of PhP, and he's a noob.
I think he knows what he is doing.
 
Back
Top