This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Predis\Client; | |
class RedisSession implements SessionHandlerInterface { | |
private $redis; | |
private $keyPrefix; | |
private $maxLifetime; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> PHP Smarty | |
--- | |
``` | |
<?php | |
require '../global/libs/Smarty/Smarty.class.php'; | |
class ViewManager extends Smarty{ | |
public function __construct(){ | |
parent::__construct(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header['Content-Type'] = undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream project { | |
server 22.22.22.2:3000; | |
server 22.22.22.3:3000; | |
server 22.22.22.5:3000; | |
} | |
server { | |
listen 80; | |
location / { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE "user" ( | |
id SERIAL PRIMARY KEY NOT NULL, | |
login VARCHAR(64) NOT NULL UNIQUE | |
); | |
CREATE TABLE account ( | |
id SERIAL PRIMARY KEY NOT NULL, | |
name VARCHAR(128) NOT NULL, | |
parent_account_id BIGINT REFERENCES account NULL, | |
owner_id BIGINT REFERENCES "user" NOT NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE accounts( | |
account text not null | |
, account_kind text not null | |
, account_id serial not null unique | |
, primary key(account) | |
); | |
CREATE TABLE transactions( | |
transaction_id uuid not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delimiter $$ | |
CREATE TABLE `accounts` ( | |
`account_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Account ID', | |
`account_username` char(32) NOT NULL DEFAULT '' COMMENT 'Account username', | |
`account_password` char(64) NOT NULL COMMENT 'Account password', | |
`account_station_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Account STATION_ID', | |
`account_level` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Account - CSR Flag', | |
`account_banned` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Account - Banned Status', | |
`account_email` char(64) NOT NULL DEFAULT '' COMMENT 'Account - User email', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* begin table creation */ | |
create table department | |
(department_id serial primary key, | |
name varchar(20) not null | |
); | |
create table branch | |
(branch_id serial primary key, | |
name varchar(20) not null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE xixi; | |
/** | |
* accounts | |
*/ | |
CREATE TABLE accounts ( | |
id bigserial UNIQUE NOT NULL, | |
-- UNIQUE is needed | |
-- http://www.postgresql.org/docs/9.5/static/datatype-numeric.html#DATATYPE-SERIAL | |
-- |
OlderNewer