diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..cedc3fa8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "src"]
+ path = src
+ url = https://github.com/thilinah/isotope-core.git
diff --git a/src b/src
new file mode 160000
index 00000000..7a2e9d0b
--- /dev/null
+++ b/src
@@ -0,0 +1 @@
+Subproject commit 7a2e9d0b1a9ebf74abe8a9cc789ebc4af40db60f
diff --git a/src/adodb512/adodb-active-record.inc.php b/src/adodb512/adodb-active-record.inc.php
deleted file mode 100644
index f2b93f5c..00000000
--- a/src/adodb512/adodb-active-record.inc.php
+++ /dev/null
@@ -1,1061 +0,0 @@
-_dbat
-$_ADODB_ACTIVE_DBS = array();
-$ACTIVE_RECORD_SAFETY = true;
-$ADODB_ACTIVE_DEFVALS = false;
-$ADODB_ACTIVE_CACHESECS = 0;
-
-class ADODB_Active_DB {
- var $db; // ADOConnection
- var $tables; // assoc array of ADODB_Active_Table objects, indexed by tablename
-}
-
-class ADODB_Active_Table {
- var $name; // table name
- var $flds; // assoc array of adofieldobjs, indexed by fieldname
- var $keys; // assoc array of primary keys, indexed by fieldname
- var $_created; // only used when stored as a cached file
- var $_belongsTo = array();
- var $_hasMany = array();
-}
-
-// $db = database connection
-// $index = name of index - can be associative, for an example see
-// http://phplens.com/lens/lensforum/msgs.php?id=17790
-// returns index into $_ADODB_ACTIVE_DBS
-function ADODB_SetDatabaseAdapter(&$db, $index=false)
-{
- global $_ADODB_ACTIVE_DBS;
- $obj = null;
- //error_log("Coming into ".self::_pluralize(get_called_class())."'s SetDatabaseAdapter where ".get_class());
- foreach($_ADODB_ACTIVE_DBS as $k => $d) {
- if (PHP_VERSION >= 5) {
- if ($d->db === $db) {
- $obj = $d;
- break;
- }
- } else {
- if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database) {
- $obj = $d;
- break;
- }
- }
- }
-
- if ($index == false) $index = sizeof($_ADODB_ACTIVE_DBS);
-
- if(!isset($obj)) {
- $obj = new ADODB_Active_DB();
- $obj->db = $db;
- $obj->tables = array();
- }
-
- $_ADODB_ACTIVE_DBS[$index] = $obj;
-
- return $index;
-}
-
-
-class ADODB_Active_Record {
- static $_changeNames = true; // dynamically pluralize table names
- static $_quoteNames = false;
-
- static $_foreignSuffix = '_id'; //
- var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat]
- var $_table; // tablename, if set in class definition then use it as table name
- var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat]
- var $_where; // where clause set in Load()
- var $_saved = false; // indicates whether data is already inserted.
- var $_lasterr = false; // last error message
- var $_original = false; // the original values loaded or inserted, refreshed on update
-
- var $foreignName; // CFR: class name when in a relationship
- static $_supportedAggregateFunctions = array ("avg", "count", "max", "min", "std", "sum");
-
- static function UseDefaultValues($bool=null)
- {
- global $ADODB_ACTIVE_DEFVALS;
- if (isset($bool)) $ADODB_ACTIVE_DEFVALS = $bool;
- return $ADODB_ACTIVE_DEFVALS;
- }
-
- // should be static
- static function SetDatabaseAdapter(&$db, $index=false)
- {
- //error_log("Coming into ".self::_pluralize(get_called_class())."'s SetDatabaseAdapter where ".get_class());
- if(!$index || !isset($index)) {
- $index = self::_pluralize(get_called_class());
- }
- return ADODB_SetDatabaseAdapter($db, $index);
- }
-
-
- public function __set($name, $value)
- {
- $name = str_replace(' ', '_', $name);
- $this->$name = $value;
- }
-
- // php5 constructor
- function __construct($table = false, $pkeyarr=false, $db=false)
- {
- global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS;
-
- if ($db == false && is_object($pkeyarr)) {
- $db = $pkeyarr;
- $pkeyarr = false;
- }
-
- if (!$table) {
- if (!empty($this->_table)) $table = $this->_table;
- else $table = $this->_pluralize(get_class($this));
- }
- $this->foreignName = strtolower(get_class($this)); // CFR: default foreign name
- if ($db) {
- $this->_dbat = self::SetDatabaseAdapter($db);
- } else if (!isset($this->_dbat)) {
- if (sizeof($_ADODB_ACTIVE_DBS) == 0) $this->Error("No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)",'ADODB_Active_Record::__constructor');
- end($_ADODB_ACTIVE_DBS);
- if(isset($_ADODB_ACTIVE_DBS[self::_pluralize(get_called_class())])) {
- $this->_dbat = self::_pluralize(get_called_class());
- } else {
- $this->_dbat = key($_ADODB_ACTIVE_DBS);
- }
-
- }
-
- $this->_table = $table;
- $this->_tableat = $table; # reserved for setting the assoc value to a non-table name, eg. the sql string in future
-
- $this->UpdateActiveTable($pkeyarr);
- }
-
- function __wakeup()
- {
- $class = get_class($this);
- new $class;
- }
-
- static function _pluralize($table)
- {
- if (!ADODB_Active_Record::$_changeNames) return $table;
-
- $ut = strtoupper($table);
- $len = strlen($table);
- $lastc = $ut[$len-1];
- $lastc2 = substr($ut,$len-2);
- switch ($lastc) {
- case 'S':
- return $table.'es';
- case 'Y':
- return substr($table,0,$len-1).'ies';
- case 'X':
- return $table.'es';
- case 'H':
- if ($lastc2 == 'CH' || $lastc2 == 'SH')
- return $table.'es';
- default:
- return $table.'s';
- }
- }
-
- // CFR Lamest singular inflector ever - @todo Make it real!
- // Note: There is an assumption here...and it is that the argument's length >= 4
- function _singularize($tables)
- {
-
- if (!ADODB_Active_Record::$_changeNames) return $table;
-
- $ut = strtoupper($tables);
- $len = strlen($tables);
- if($ut[$len-1] != 'S')
- return $tables; // I know...forget oxen
- if($ut[$len-2] != 'E')
- return substr($tables, 0, $len-1);
- switch($ut[$len-3])
- {
- case 'S':
- case 'X':
- return substr($tables, 0, $len-2);
- case 'I':
- return substr($tables, 0, $len-3) . 'y';
- case 'H';
- if($ut[$len-4] == 'C' || $ut[$len-4] == 'S')
- return substr($tables, 0, $len-2);
- default:
- return substr($tables, 0, $len-1); // ?
- }
- }
-
- function hasMany($foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new $foreignClass($foreignRef);
- $ar->foreignName = $foreignRef;
- $ar->UpdateActiveTable();
- $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
- $table =& $this->TableInfo();
- $table->_hasMany[$foreignRef] = $ar;
- # $this->$foreignRef = $this->_hasMany[$foreignRef]; // WATCHME Removed assignment by ref. to please __get()
- }
-
- // use when you don't want ADOdb to auto-pluralize tablename
- static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new ADODB_Active_Record($table);
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
- // use when you don't want ADOdb to auto-pluralize tablename
- static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
- $ar = new ADODB_Active_Record($table,$tablePKey);
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
-
- // use when you want ADOdb to auto-pluralize tablename for you. Note that the class must already be defined.
- // e.g. class Person will generate relationship for table Persons
- static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
- {
- $ar = new $parentclass();
- $ar->hasMany($foreignRef, $foreignKey, $foreignClass);
- }
-
-
- function belongsTo($foreignRef,$foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- global $inflector;
-
- $ar = new $parentClass($this->_pluralize($foreignRef));
- $ar->foreignName = $foreignRef;
- $ar->parentKey = $parentKey;
- $ar->UpdateActiveTable();
- $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix;
-
- $table =& $this->TableInfo();
- $table->_belongsTo[$foreignRef] = $ar;
- # $this->$foreignRef = $this->_belongsTo[$foreignRef];
- }
-
- static function ClassBelongsTo($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- $ar = new $class();
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
- static function TableBelongsTo($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- $ar = new ADOdb_Active_Record($table);
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
- static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record')
- {
- if (!is_array($tablePKey)) $tablePKey = array($tablePKey);
- $ar = new ADOdb_Active_Record($table, $tablePKey);
- $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass);
- }
-
-
- /**
- * __get Access properties - used for lazy loading
- *
- * @param mixed $name
- * @access protected
- * @return mixed
- */
- function __get($name)
- {
- return $this->LoadRelations($name, '', -1, -1);
- }
-
- /**
- * @param string $name
- * @param string $whereOrderBy : eg. ' AND field1 = value ORDER BY field2'
- * @param offset
- * @param limit
- * @return mixed
- */
- function LoadRelations($name, $whereOrderBy='', $offset=-1,$limit=-1)
- {
- $extras = array();
- $table = $this->TableInfo();
- if ($limit >= 0) $extras['limit'] = $limit;
- if ($offset >= 0) $extras['offset'] = $offset;
-
- if (strlen($whereOrderBy))
- if (!preg_match('/^[ \n\r]*AND/i',$whereOrderBy))
- if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i',$whereOrderBy))
- $whereOrderBy = 'AND '.$whereOrderBy;
-
- if(!empty($table->_belongsTo[$name]))
- {
- $obj = $table->_belongsTo[$name];
- $columnName = $obj->foreignKey;
- if(empty($this->$columnName))
- $this->$name = null;
- else
- {
- if ($obj->parentKey) $key = $obj->parentKey;
- else $key = reset($table->keys);
-
- $arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras);
- if ($arrayOfOne) {
- $this->$name = $arrayOfOne[0];
- return $arrayOfOne[0];
- }
- }
- }
- if(!empty($table->_hasMany[$name]))
- {
- $obj = $table->_hasMany[$name];
- $key = reset($table->keys);
- $id = @$this->$key;
- if (!is_numeric($id)) {
- $db = $this->DB();
- $id = $db->qstr($id);
- }
- $objs = $obj->Find($obj->foreignKey.'='.$id. ' '.$whereOrderBy,false,false,$extras);
- if (!$objs) $objs = array();
- $this->$name = $objs;
- return $objs;
- }
-
- return array();
- }
- //////////////////////////////////
-
- // update metadata
- function UpdateActiveTable($pkeys=false,$forceUpdate=false)
- {
- global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS;
- global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE;
-
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
-
- $table = $this->_table;
- $tables = $activedb->tables;
- $tableat = $this->_tableat;
- if (!$forceUpdate && !empty($tables[$tableat])) {
-
- $acttab = $tables[$tableat];
- foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
- $this->$name = $fld->default_value;
- else
- $this->$name = null;
- }
- return;
- }
- $db = $activedb->db;
- $fname = $ADODB_CACHE_DIR . '/adodb_' . $db->databaseType . '_active_'. $table . '.cache';
- if (!$forceUpdate && $ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR && file_exists($fname)) {
- $fp = fopen($fname,'r');
- @flock($fp, LOCK_SH);
- $acttab = unserialize(fread($fp,100000));
- fclose($fp);
- if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) {
- // abs(rand()) randomizes deletion, reducing contention to delete/refresh file
- // ideally, you should cache at least 32 secs
-
- foreach($acttab->flds as $name => $fld) {
- if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value))
- $this->$name = $fld->default_value;
- else
- $this->$name = null;
- }
-
- $activedb->tables[$table] = $acttab;
-
- //if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname");
- return;
- } else if ($db->debug) {
- ADOConnection::outp("Refreshing cached active record file: $fname");
- }
- }
- $activetab = new ADODB_Active_Table();
- $activetab->name = $table;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($db->fetchMode !== false) $savem = $db->SetFetchMode(false);
-
- $cols = $db->MetaColumns($table);
-
- if (isset($savem)) $db->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$cols) {
- $this->Error("Invalid table name: $table",'UpdateActiveTable');
- return false;
- }
- $fld = reset($cols);
- if (!$pkeys) {
- if (isset($fld->primary_key)) {
- $pkeys = array();
- foreach($cols as $name => $fld) {
- if (!empty($fld->primary_key)) $pkeys[] = $name;
- }
- } else
- $pkeys = $this->GetPrimaryKeys($db, $table);
- }
- if (empty($pkeys)) {
- $this->Error("No primary key found for table $table",'UpdateActiveTable');
- return false;
- }
-
- $attr = array();
- $keys = array();
-
- switch($ADODB_ASSOC_CASE) {
- case 0:
- foreach($cols as $name => $fldobj) {
- $name = strtolower($name);
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
- $this->$name = $fldobj->default_value;
- else
- $this->$name = null;
- $attr[$name] = $fldobj;
- }
- foreach($pkeys as $k => $name) {
- $keys[strtolower($name)] = strtolower($name);
- }
- break;
-
- case 1:
- foreach($cols as $name => $fldobj) {
- $name = strtoupper($name);
-
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
- $this->$name = $fldobj->default_value;
- else
- $this->$name = null;
- $attr[$name] = $fldobj;
- }
-
- foreach($pkeys as $k => $name) {
- $keys[strtoupper($name)] = strtoupper($name);
- }
- break;
- default:
- foreach($cols as $name => $fldobj) {
- $name = ($fldobj->name);
-
- if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value))
- $this->$name = $fldobj->default_value;
- else
- $this->$name = null;
- $attr[$name] = $fldobj;
- }
- foreach($pkeys as $k => $name) {
- $keys[$name] = $cols[$name]->name;
- }
- break;
- }
-
- $activetab->keys = $keys;
- $activetab->flds = $attr;
-
- if ($ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR) {
- $activetab->_created = time();
- $s = serialize($activetab);
- if (!function_exists('adodb_write_file')) include(ADODB_DIR.'/adodb-csvlib.inc.php');
- adodb_write_file($fname,$s);
- }
- if (isset($activedb->tables[$table])) {
- $oldtab = $activedb->tables[$table];
-
- if ($oldtab) $activetab->_belongsTo = $oldtab->_belongsTo;
- if ($oldtab) $activetab->_hasMany = $oldtab->_hasMany;
- }
- $activedb->tables[$table] = $activetab;
- }
-
- function GetPrimaryKeys(&$db, $table)
- {
- return $db->MetaPrimaryKeys($table);
- }
-
- // error handler for both PHP4+5.
- function Error($err,$fn)
- {
- global $_ADODB_ACTIVE_DBS;
-
- $fn = get_class($this).'::'.$fn;
- $this->_lasterr = $fn.': '.$err;
-
- if ($this->_dbat < 0) $db = false;
- else {
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $db = $activedb->db;
- }
-
- if (function_exists('adodb_throw')) {
- if (!$db) adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
- else adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
- } else
- if (!$db || $db->debug) ADOConnection::outp($this->_lasterr);
-
- }
-
- // return last error message
- function ErrorMsg()
- {
- if (!function_exists('adodb_throw')) {
- if ($this->_dbat < 0) $db = false;
- else $db = $this->DB();
-
- // last error could be database error too
- if ($db && $db->ErrorMsg()) return $db->ErrorMsg();
- }
- return $this->_lasterr;
- }
-
- function ErrorNo()
- {
- if ($this->_dbat < 0) return -9999; // no database connection...
- $db = $this->DB();
-
- return (int) $db->ErrorNo();
- }
-
-
- // retrieve ADOConnection from _ADODB_Active_DBs
- function DB()
- {
- global $_ADODB_ACTIVE_DBS;
-
- if ($this->_dbat < 0) {
- $false = false;
- $this->Error("No database connection set: use ADOdb_Active_Record::SetDatabaseAdaptor(\$db)", "DB");
- return $false;
- }
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $db = $activedb->db;
- return $db;
- }
-
- // retrieve ADODB_Active_Table
- function &TableInfo()
- {
- global $_ADODB_ACTIVE_DBS;
- $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
- $table = $activedb->tables[$this->_tableat];
- return $table;
- }
-
-
- // I have an ON INSERT trigger on a table that sets other columns in the table.
- // So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook
- function Reload()
- {
- $db =& $this->DB(); if (!$db) return false;
- $table =& $this->TableInfo();
- $where = $this->GenWhere($db, $table);
- return($this->Load($where));
- }
-
-
- // set a numeric array (using natural table field ordering) as object properties
- function Set(&$row)
- {
- global $ACTIVE_RECORD_SAFETY;
-
- $db = $this->DB();
-
- if (!$row) {
- $this->_saved = false;
- return false;
- }
-
- $this->_saved = true;
-
- $table = $this->TableInfo();
- if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) {
- #
';
- }
- return $rs;
- }
-
- $meta = false;
- $meta = fgetcsv($fp, 32000, ",");
- if (!$meta) {
- fclose($fp);
- $err = "Unexpected EOF 1";
- return $false;
- }
- }
-
- // Get Column definitions
- $flds = array();
- foreach($meta as $o) {
- $o2 = explode(':',$o);
- if (sizeof($o2)!=3) {
- $arr[] = $meta;
- $flds = false;
- break;
- }
- $fld = new ADOFieldObject();
- $fld->name = urldecode($o2[0]);
- $fld->type = $o2[1];
- $fld->max_length = $o2[2];
- $flds[] = $fld;
- }
- } else {
- fclose($fp);
- $err = "Recordset had unexpected EOF 2";
- return $false;
- }
-
- // slurp in the data
- $MAXSIZE = 128000;
-
- $text = '';
- while ($txt = fread($fp,$MAXSIZE)) {
- $text .= $txt;
- }
-
- fclose($fp);
- @$arr = unserialize($text);
- //var_dump($arr);
- if (!is_array($arr)) {
- $err = "Recordset had unexpected EOF (in serialized recordset)";
- if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!";
- return $false;
- }
- $rs = new $rsclass();
- $rs->timeCreated = $ttl;
- $rs->InitArrayFields($arr,$flds);
- return $rs;
- }
-
-
- /**
- * Save a file $filename and its $contents (normally for caching) with file locking
- * Returns true if ok, false if fopen/fwrite error, 0 if rename error (eg. file is locked)
- */
- function adodb_write_file($filename, $contents,$debug=false)
- {
- # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows
- # So to simulate locking, we assume that rename is an atomic operation.
- # First we delete $filename, then we create a $tempfile write to it and
- # rename to the desired $filename. If the rename works, then we successfully
- # modified the file exclusively.
- # What a stupid need - having to simulate locking.
- # Risks:
- # 1. $tempfile name is not unique -- very very low
- # 2. unlink($filename) fails -- ok, rename will fail
- # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs
- # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and cache updated
- if (strncmp(PHP_OS,'WIN',3) === 0) {
- // skip the decimal place
- $mtime = substr(str_replace(' ','_',microtime()),2);
- // getmypid() actually returns 0 on Win98 - never mind!
- $tmpname = $filename.uniqid($mtime).getmypid();
- if (!($fd = @fopen($tmpname,'w'))) return false;
- if (fwrite($fd,$contents)) $ok = true;
- else $ok = false;
- fclose($fd);
-
- if ($ok) {
- @chmod($tmpname,0644);
- // the tricky moment
- @unlink($filename);
- if (!@rename($tmpname,$filename)) {
- unlink($tmpname);
- $ok = 0;
- }
- if (!$ok) {
- if ($debug) ADOConnection::outp( " Rename $tmpname ".($ok? 'ok' : 'failed'));
- }
- }
- return $ok;
- }
- if (!($fd = @fopen($filename, 'a'))) return false;
- if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) {
- if (fwrite( $fd, $contents )) $ok = true;
- else $ok = false;
- fclose($fd);
- @chmod($filename,0644);
- }else {
- fclose($fd);
- if ($debug)ADOConnection::outp( " Failed acquiring lock for $filename
\n");
- $ok = false;
- }
-
- return $ok;
- }
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-datadict.inc.php b/src/adodb512/adodb-datadict.inc.php
deleted file mode 100644
index 69060c5c..00000000
--- a/src/adodb512/adodb-datadict.inc.php
+++ /dev/null
@@ -1,1032 +0,0 @@
-$str
"; -print_r($a); -print ""; -} - - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { - return preg_match('/^[a-z0-9]*$/i', $text); - } -} - -//Lens_ParseTest(); - -/** - Parse arguments, treat "text" (text) and 'text' as quotation marks. - To escape, use "" or '' or )) - - Will read in "abc def" sans quotes, as: abc def - Same with 'abc def'. - However if `abc def`, then will read in as `abc def` - - @param endstmtchar Character that indicates end of statement - @param tokenchars Include the following characters in tokens apart from A-Z and 0-9 - @returns 2 dimensional array containing parsed tokens. -*/ -function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-') -{ - $pos = 0; - $intoken = false; - $stmtno = 0; - $endquote = false; - $tokens = array(); - $tokens[$stmtno] = array(); - $max = strlen($args); - $quoted = false; - $tokarr = array(); - - while ($pos < $max) { - $ch = substr($args,$pos,1); - switch($ch) { - case ' ': - case "\t": - case "\n": - case "\r": - if (!$quoted) { - if ($intoken) { - $intoken = false; - $tokens[$stmtno][] = implode('',$tokarr); - } - break; - } - - $tokarr[] = $ch; - break; - - case '`': - if ($intoken) $tokarr[] = $ch; - case '(': - case ')': - case '"': - case "'": - - if ($intoken) { - if (empty($endquote)) { - $tokens[$stmtno][] = implode('',$tokarr); - if ($ch == '(') $endquote = ')'; - else $endquote = $ch; - $quoted = true; - $intoken = true; - $tokarr = array(); - } else if ($endquote == $ch) { - $ch2 = substr($args,$pos+1,1); - if ($ch2 == $endquote) { - $pos += 1; - $tokarr[] = $ch2; - } else { - $quoted = false; - $intoken = false; - $tokens[$stmtno][] = implode('',$tokarr); - $endquote = ''; - } - } else - $tokarr[] = $ch; - - }else { - - if ($ch == '(') $endquote = ')'; - else $endquote = $ch; - $quoted = true; - $intoken = true; - $tokarr = array(); - if ($ch == '`') $tokarr[] = '`'; - } - break; - - default: - - if (!$intoken) { - if ($ch == $endstmtchar) { - $stmtno += 1; - $tokens[$stmtno] = array(); - break; - } - - $intoken = true; - $quoted = false; - $endquote = false; - $tokarr = array(); - - } - - if ($quoted) $tokarr[] = $ch; - else if (ctype_alnum($ch) || strpos($tokenchars,$ch) !== false) $tokarr[] = $ch; - else { - if ($ch == $endstmtchar) { - $tokens[$stmtno][] = implode('',$tokarr); - $stmtno += 1; - $tokens[$stmtno] = array(); - $intoken = false; - $tokarr = array(); - break; - } - $tokens[$stmtno][] = implode('',$tokarr); - $tokens[$stmtno][] = $ch; - $intoken = false; - } - } - $pos += 1; - } - if ($intoken) $tokens[$stmtno][] = implode('',$tokarr); - - return $tokens; -} - - -class ADODB_DataDict { - var $connection; - var $debug = false; - var $dropTable = 'DROP TABLE %s'; - var $renameTable = 'RENAME TABLE %s TO %s'; - var $dropIndex = 'DROP INDEX %s'; - var $addCol = ' ADD'; - var $alterCol = ' ALTER COLUMN'; - var $dropCol = ' DROP COLUMN'; - var $renameColumn = 'ALTER TABLE %s RENAME COLUMN %s TO %s'; // table, old-column, new-column, column-definitions (not used by default) - var $nameRegex = '\w'; - var $nameRegexBrackets = 'a-zA-Z0-9_\(\)'; - var $schema = false; - var $serverInfo = array(); - var $autoIncrement = false; - var $dataProvider; - var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql - var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob - /// in other words, we use a text area for editting. - - function GetCommentSQL($table,$col) - { - return false; - } - - function SetCommentSQL($table,$col,$cmt) - { - return false; - } - - function MetaTables() - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaTables(); - } - - function MetaColumns($tab, $upper=true, $schema=false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaColumns($this->TableName($tab), $upper, $schema); - } - - function MetaPrimaryKeys($tab,$owner=false,$intkey=false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaPrimaryKeys($this->TableName($tab), $owner, $intkey); - } - - function MetaIndexes($table, $primary = false, $owner = false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaIndexes($this->TableName($table), $primary, $owner); - } - - function MetaType($t,$len=-1,$fieldobj=false) - { - static $typeMap = array( - 'VARCHAR' => 'C', - 'VARCHAR2' => 'C', - 'CHAR' => 'C', - 'C' => 'C', - 'STRING' => 'C', - 'NCHAR' => 'C', - 'NVARCHAR' => 'C', - 'VARYING' => 'C', - 'BPCHAR' => 'C', - 'CHARACTER' => 'C', - 'INTERVAL' => 'C', # Postgres - 'MACADDR' => 'C', # postgres - 'VAR_STRING' => 'C', # mysql - ## - 'LONGCHAR' => 'X', - 'TEXT' => 'X', - 'NTEXT' => 'X', - 'M' => 'X', - 'X' => 'X', - 'CLOB' => 'X', - 'NCLOB' => 'X', - 'LVARCHAR' => 'X', - ## - 'BLOB' => 'B', - 'IMAGE' => 'B', - 'BINARY' => 'B', - 'VARBINARY' => 'B', - 'LONGBINARY' => 'B', - 'B' => 'B', - ## - 'YEAR' => 'D', // mysql - 'DATE' => 'D', - 'D' => 'D', - ## - 'UNIQUEIDENTIFIER' => 'C', # MS SQL Server - ## - 'TIME' => 'T', - 'TIMESTAMP' => 'T', - 'DATETIME' => 'T', - 'TIMESTAMPTZ' => 'T', - 'SMALLDATETIME' => 'T', - 'T' => 'T', - 'TIMESTAMP WITHOUT TIME ZONE' => 'T', // postgresql - ## - 'BOOL' => 'L', - 'BOOLEAN' => 'L', - 'BIT' => 'L', - 'L' => 'L', - ## - 'COUNTER' => 'R', - 'R' => 'R', - 'SERIAL' => 'R', // ifx - 'INT IDENTITY' => 'R', - ## - 'INT' => 'I', - 'INT2' => 'I', - 'INT4' => 'I', - 'INT8' => 'I', - 'INTEGER' => 'I', - 'INTEGER UNSIGNED' => 'I', - 'SHORT' => 'I', - 'TINYINT' => 'I', - 'SMALLINT' => 'I', - 'I' => 'I', - ## - 'LONG' => 'N', // interbase is numeric, oci8 is blob - 'BIGINT' => 'N', // this is bigger than PHP 32-bit integers - 'DECIMAL' => 'N', - 'DEC' => 'N', - 'REAL' => 'N', - 'DOUBLE' => 'N', - 'DOUBLE PRECISION' => 'N', - 'SMALLFLOAT' => 'N', - 'FLOAT' => 'N', - 'NUMBER' => 'N', - 'NUM' => 'N', - 'NUMERIC' => 'N', - 'MONEY' => 'N', - - ## informix 9.2 - 'SQLINT' => 'I', - 'SQLSERIAL' => 'I', - 'SQLSMINT' => 'I', - 'SQLSMFLOAT' => 'N', - 'SQLFLOAT' => 'N', - 'SQLMONEY' => 'N', - 'SQLDECIMAL' => 'N', - 'SQLDATE' => 'D', - 'SQLVCHAR' => 'C', - 'SQLCHAR' => 'C', - 'SQLDTIME' => 'T', - 'SQLINTERVAL' => 'N', - 'SQLBYTES' => 'B', - 'SQLTEXT' => 'X', - ## informix 10 - "SQLINT8" => 'I8', - "SQLSERIAL8" => 'I8', - "SQLNCHAR" => 'C', - "SQLNVCHAR" => 'C', - "SQLLVARCHAR" => 'X', - "SQLBOOL" => 'L' - ); - - if (!$this->connection->IsConnected()) { - $t = strtoupper($t); - if (isset($typeMap[$t])) return $typeMap[$t]; - return 'N'; - } - return $this->connection->MetaType($t,$len,$fieldobj); - } - - function NameQuote($name = NULL,$allowBrackets=false) - { - if (!is_string($name)) { - return FALSE; - } - - $name = trim($name); - - if ( !is_object($this->connection) ) { - return $name; - } - - $quote = $this->connection->nameQuote; - - // if name is of the form `name`, quote it - if ( preg_match('/^`(.+)`$/', $name, $matches) ) { - return $quote . $matches[1] . $quote; - } - - // if name contains special characters, quote it - $regex = ($allowBrackets) ? $this->nameRegexBrackets : $this->nameRegex; - - if ( !preg_match('/^[' . $regex . ']+$/', $name) ) { - return $quote . $name . $quote; - } - - return $name; - } - - function TableName($name) - { - if ( $this->schema ) { - return $this->NameQuote($this->schema) .'.'. $this->NameQuote($name); - } - return $this->NameQuote($name); - } - - // Executes the sql array returned by GetTableSQL and GetIndexSQL - function ExecuteSQLArray($sql, $continueOnError = true) - { - $rez = 2; - $conn = $this->connection; - $saved = $conn->debug; - foreach($sql as $line) { - - if ($this->debug) $conn->debug = true; - $ok = $conn->Execute($line); - $conn->debug = $saved; - if (!$ok) { - if ($this->debug) ADOConnection::outp($conn->ErrorMsg()); - if (!$continueOnError) return 0; - $rez = 1; - } - } - return $rez; - } - - /** - Returns the actual type given a character code. - - C: varchar - X: CLOB (character large object) or largest varchar size if CLOB is not supported - C2: Multibyte varchar - X2: Multibyte CLOB - - B: BLOB (binary large object) - - D: Date - T: Date-time - L: Integer field suitable for storing booleans (0 or 1) - I: Integer - F: Floating point number - N: Numeric or decimal number - */ - - function ActualType($meta) - { - return $meta; - } - - function CreateDatabase($dbname,$options=false) - { - $options = $this->_Options($options); - $sql = array(); - - $s = 'CREATE DATABASE ' . $this->NameQuote($dbname); - if (isset($options[$this->upperName])) - $s .= ' '.$options[$this->upperName]; - - $sql[] = $s; - return $sql; - } - - /* - Generates the SQL to create index. Returns an array of sql strings. - */ - function CreateIndexSQL($idxname, $tabname, $flds, $idxoptions = false) - { - if (!is_array($flds)) { - $flds = explode(',',$flds); - } - - foreach($flds as $key => $fld) { - # some indexes can use partial fields, eg. index first 32 chars of "name" with NAME(32) - $flds[$key] = $this->NameQuote($fld,$allowBrackets=true); - } - - return $this->_IndexSQL($this->NameQuote($idxname), $this->TableName($tabname), $flds, $this->_Options($idxoptions)); - } - - function DropIndexSQL ($idxname, $tabname = NULL) - { - return array(sprintf($this->dropIndex, $this->NameQuote($idxname), $this->TableName($tabname))); - } - - function SetSchema($schema) - { - $this->schema = $schema; - } - - function AddColumnSQL($tabname, $flds) - { - $tabname = $this->TableName ($tabname); - $sql = array(); - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' '; - foreach($lines as $v) { - $sql[] = $alter . $v; - } - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - } - return $sql; - } - - /** - * Change the definition of one column - * - * As some DBM's can't do that on there own, you need to supply the complete defintion of the new table, - * to allow, recreating the table and copying the content over to the new table - * @param string $tabname table-name - * @param string $flds column-name and type for the changed column - * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default '' - * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default '' - * @return array with SQL strings - */ - function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') - { - $tabname = $this->TableName ($tabname); - $sql = array(); - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' '; - foreach($lines as $v) { - $sql[] = $alter . $v; - } - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - - } - return $sql; - } - - /** - * Rename one column - * - * Some DBM's can only do this together with changeing the type of the column (even if that stays the same, eg. mysql) - * @param string $tabname table-name - * @param string $oldcolumn column-name to be renamed - * @param string $newcolumn new column-name - * @param string $flds='' complete column-defintion-string like for AddColumnSQL, only used by mysql atm., default='' - * @return array with SQL strings - */ - function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='') - { - $tabname = $this->TableName ($tabname); - if ($flds) { - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - list(,$first) = each($lines); - list(,$column_def) = preg_split("/[\t ]+/",$first,2); - } - return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def)); - } - - /** - * Drop one column - * - * Some DBM's can't do that on there own, you need to supply the complete defintion of the new table, - * to allow, recreating the table and copying the content over to the new table - * @param string $tabname table-name - * @param string $flds column-name and type for the changed column - * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default '' - * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default '' - * @return array with SQL strings - */ - function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') - { - $tabname = $this->TableName ($tabname); - if (!is_array($flds)) $flds = explode(',',$flds); - $sql = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->dropCol . ' '; - foreach($flds as $v) { - $sql[] = $alter . $this->NameQuote($v); - } - return $sql; - } - - function DropTableSQL($tabname) - { - return array (sprintf($this->dropTable, $this->TableName($tabname))); - } - - function RenameTableSQL($tabname,$newname) - { - return array (sprintf($this->renameTable, $this->TableName($tabname),$this->TableName($newname))); - } - - /** - Generate the SQL to create table. Returns an array of sql strings. - */ - function CreateTableSQL($tabname, $flds, $tableoptions=array()) - { - list($lines,$pkey,$idxs) = $this->_GenFields($flds, true); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - - $taboptions = $this->_Options($tableoptions); - $tabname = $this->TableName ($tabname); - $sql = $this->_TableSQL($tabname,$lines,$pkey,$taboptions); - - // ggiunta - 2006/10/12 - KLUDGE: - // if we are on autoincrement, and table options includes REPLACE, the - // autoincrement sequence has already been dropped on table creation sql, so - // we avoid passing REPLACE to trigger creation code. This prevents - // creating sql that double-drops the sequence - if ($this->autoIncrement && isset($taboptions['REPLACE'])) - unset($taboptions['REPLACE']); - $tsql = $this->_Triggers($tabname,$taboptions); - foreach($tsql as $s) $sql[] = $s; - - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - } - - return $sql; - } - - - - function _GenFields($flds,$widespacing=false) - { - if (is_string($flds)) { - $padding = ' '; - $txt = $flds.$padding; - $flds = array(); - $flds0 = Lens_ParseArgs($txt,','); - $hasparam = false; - foreach($flds0 as $f0) { - $f1 = array(); - foreach($f0 as $token) { - switch (strtoupper($token)) { - case 'INDEX': - $f1['INDEX'] = ''; - // fall through intentionally - case 'CONSTRAINT': - case 'DEFAULT': - $hasparam = $token; - break; - default: - if ($hasparam) $f1[$hasparam] = $token; - else $f1[] = $token; - $hasparam = false; - break; - } - } - // 'index' token without a name means single column index: name it after column - if (array_key_exists('INDEX', $f1) && $f1['INDEX'] == '') { - $f1['INDEX'] = isset($f0['NAME']) ? $f0['NAME'] : $f0[0]; - // check if column name used to create an index name was quoted - if (($f1['INDEX'][0] == '"' || $f1['INDEX'][0] == "'" || $f1['INDEX'][0] == "`") && - ($f1['INDEX'][0] == substr($f1['INDEX'], -1))) { - $f1['INDEX'] = $f1['INDEX'][0].'idx_'.substr($f1['INDEX'], 1, -1).$f1['INDEX'][0]; - } - else - $f1['INDEX'] = 'idx_'.$f1['INDEX']; - } - // reset it, so we don't get next field 1st token as INDEX... - $hasparam = false; - - $flds[] = $f1; - - } - } - $this->autoIncrement = false; - $lines = array(); - $pkey = array(); - $idxs = array(); - foreach($flds as $fld) { - $fld = _array_change_key_case($fld); - - $fname = false; - $fdefault = false; - $fautoinc = false; - $ftype = false; - $fsize = false; - $fprec = false; - $fprimary = false; - $fnoquote = false; - $fdefts = false; - $fdefdate = false; - $fconstraint = false; - $fnotnull = false; - $funsigned = false; - $findex = ''; - $funiqueindex = false; - - //----------------- - // Parse attributes - foreach($fld as $attr => $v) { - if ($attr == 2 && is_numeric($v)) $attr = 'SIZE'; - else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v); - - switch($attr) { - case '0': - case 'NAME': $fname = $v; break; - case '1': - case 'TYPE': $ty = $v; $ftype = $this->ActualType(strtoupper($v)); break; - - case 'SIZE': - $dotat = strpos($v,'.'); if ($dotat === false) $dotat = strpos($v,','); - if ($dotat === false) $fsize = $v; - else { - $fsize = substr($v,0,$dotat); - $fprec = substr($v,$dotat+1); - } - break; - case 'UNSIGNED': $funsigned = true; break; - case 'AUTOINCREMENT': - case 'AUTO': $fautoinc = true; $fnotnull = true; break; - case 'KEY': - // a primary key col can be non unique in itself (if key spans many cols...) - case 'PRIMARY': $fprimary = $v; $fnotnull = true; /*$funiqueindex = true;*/ break; - case 'DEF': - case 'DEFAULT': $fdefault = $v; break; - case 'NOTNULL': $fnotnull = $v; break; - case 'NOQUOTE': $fnoquote = $v; break; - case 'DEFDATE': $fdefdate = $v; break; - case 'DEFTIMESTAMP': $fdefts = $v; break; - case 'CONSTRAINT': $fconstraint = $v; break; - // let INDEX keyword create a 'very standard' index on column - case 'INDEX': $findex = $v; break; - case 'UNIQUE': $funiqueindex = true; break; - } //switch - } // foreach $fld - - //-------------------- - // VALIDATE FIELD INFO - if (!strlen($fname)) { - if ($this->debug) ADOConnection::outp("Undefined NAME"); - return false; - } - - $fid = strtoupper(preg_replace('/^`(.+)`$/', '$1', $fname)); - $fname = $this->NameQuote($fname); - - if (!strlen($ftype)) { - if ($this->debug) ADOConnection::outp("Undefined TYPE for field '$fname'"); - return false; - } else { - $ftype = strtoupper($ftype); - } - - $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec); - - if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls - - if ($fprimary) $pkey[] = $fname; - - // some databases do not allow blobs to have defaults - if ($ty == 'X') $fdefault = false; - - // build list of indexes - if ($findex != '') { - if (array_key_exists($findex, $idxs)) { - $idxs[$findex]['cols'][] = ($fname); - if (in_array('UNIQUE', $idxs[$findex]['opts']) != $funiqueindex) { - if ($this->debug) ADOConnection::outp("Index $findex defined once UNIQUE and once not"); - } - if ($funiqueindex && !in_array('UNIQUE', $idxs[$findex]['opts'])) - $idxs[$findex]['opts'][] = 'UNIQUE'; - } - else - { - $idxs[$findex] = array(); - $idxs[$findex]['cols'] = array($fname); - if ($funiqueindex) - $idxs[$findex]['opts'] = array('UNIQUE'); - else - $idxs[$findex]['opts'] = array(); - } - } - - //-------------------- - // CONSTRUCT FIELD SQL - if ($fdefts) { - if (substr($this->connection->databaseType,0,5) == 'mysql') { - $ftype = 'TIMESTAMP'; - } else { - $fdefault = $this->connection->sysTimeStamp; - } - } else if ($fdefdate) { - if (substr($this->connection->databaseType,0,5) == 'mysql') { - $ftype = 'TIMESTAMP'; - } else { - $fdefault = $this->connection->sysDate; - } - } else if ($fdefault !== false && !$fnoquote) { - if ($ty == 'C' or $ty == 'X' or - ( substr($fdefault,0,1) != "'" && !is_numeric($fdefault))) { - - if (($ty == 'D' || $ty == 'T') && strtolower($fdefault) != 'null') { - // convert default date into database-aware code - if ($ty == 'T') - { - $fdefault = $this->connection->DBTimeStamp($fdefault); - } - else - { - $fdefault = $this->connection->DBDate($fdefault); - } - } - else - if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ') - $fdefault = trim($fdefault); - else if (strtolower($fdefault) != 'null') - $fdefault = $this->connection->qstr($fdefault); - } - } - $suffix = $this->_CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned); - - // add index creation - if ($widespacing) $fname = str_pad($fname,24); - - // check for field names appearing twice - if (array_key_exists($fid, $lines)) { - ADOConnection::outp("Field '$fname' defined twice"); - } - - $lines[$fid] = $fname.' '.$ftype.$suffix; - - if ($fautoinc) $this->autoIncrement = true; - } // foreach $flds - - return array($lines,$pkey,$idxs); - } - - /** - GENERATE THE SIZE PART OF THE DATATYPE - $ftype is the actual type - $ty is the type defined originally in the DDL - */ - function _GetSize($ftype, $ty, $fsize, $fprec) - { - if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) { - $ftype .= "(".$fsize; - if (strlen($fprec)) $ftype .= ",".$fprec; - $ftype .= ')'; - } - return $ftype; - } - - - // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) - { - $suffix = ''; - if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; - if ($fnotnull) $suffix .= ' NOT NULL'; - if ($fconstraint) $suffix .= ' '.$fconstraint; - return $suffix; - } - - function _IndexSQL($idxname, $tabname, $flds, $idxoptions) - { - $sql = array(); - - if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) { - $sql[] = sprintf ($this->dropIndex, $idxname); - if ( isset($idxoptions['DROP']) ) - return $sql; - } - - if ( empty ($flds) ) { - return $sql; - } - - $unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : ''; - - $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' '; - - if ( isset($idxoptions[$this->upperName]) ) - $s .= $idxoptions[$this->upperName]; - - if ( is_array($flds) ) - $flds = implode(', ',$flds); - $s .= '(' . $flds . ')'; - $sql[] = $s; - - return $sql; - } - - function _DropAutoIncrement($tabname) - { - return false; - } - - function _TableSQL($tabname,$lines,$pkey,$tableoptions) - { - $sql = array(); - - if (isset($tableoptions['REPLACE']) || isset ($tableoptions['DROP'])) { - $sql[] = sprintf($this->dropTable,$tabname); - if ($this->autoIncrement) { - $sInc = $this->_DropAutoIncrement($tabname); - if ($sInc) $sql[] = $sInc; - } - if ( isset ($tableoptions['DROP']) ) { - return $sql; - } - } - $s = "CREATE TABLE $tabname (\n"; - $s .= implode(",\n", $lines); - if (sizeof($pkey)>0) { - $s .= ",\n PRIMARY KEY ("; - $s .= implode(", ",$pkey).")"; - } - if (isset($tableoptions['CONSTRAINTS'])) - $s .= "\n".$tableoptions['CONSTRAINTS']; - - if (isset($tableoptions[$this->upperName.'_CONSTRAINTS'])) - $s .= "\n".$tableoptions[$this->upperName.'_CONSTRAINTS']; - - $s .= "\n)"; - if (isset($tableoptions[$this->upperName])) $s .= $tableoptions[$this->upperName]; - $sql[] = $s; - - return $sql; - } - - /** - GENERATE TRIGGERS IF NEEDED - used when table has auto-incrementing field that is emulated using triggers - */ - function _Triggers($tabname,$taboptions) - { - return array(); - } - - /** - Sanitize options, so that array elements with no keys are promoted to keys - */ - function _Options($opts) - { - if (!is_array($opts)) return array(); - $newopts = array(); - foreach($opts as $k => $v) { - if (is_numeric($k)) $newopts[strtoupper($v)] = $v; - else $newopts[strtoupper($k)] = $v; - } - return $newopts; - } - - - function _getSizePrec($size) - { - $fsize = false; - $fprec = false; - $dotat = strpos($size,'.'); - if ($dotat === false) $dotat = strpos($size,','); - if ($dotat === false) $fsize = $size; - else { - $fsize = substr($size,0,$dotat); - $fprec = substr($size,$dotat+1); - } - return array($fsize, $fprec); - } - - /** - "Florian Buzin [ easywe ]"
Error=".$this->ErrorNo().'
';
- $first = true;
- foreach($fieldArray as $k => $v) {
- if ($has_autoinc && in_array($k,$keyCol)) continue; // skip autoinc col
-
- if ($first) {
- $first = false;
- $iCols = "$k";
- $iVals = "$v";
- } else {
- $iCols .= ",$k";
- $iVals .= ",$v";
- }
- }
- $insert = "INSERT INTO $table ($iCols) VALUES ($iVals)";
- $rs = $zthis->Execute($insert);
- return ($rs) ? 2 : 0;
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-
-/*
- Count the number of records this sql statement will return by using
- query rewriting heuristics...
-
- Does not work with UNIONs, except with postgresql and oracle.
-
- Usage:
-
- $conn->Connect(...);
- $cnt = _adodb_getcount($conn, $sql);
-
-*/
-function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
-{
- $qryRecs = 0;
-
- if (!empty($zthis->_nestedSQL) || preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) ||
- preg_match('/\s+GROUP\s+BY\s+/is',$sql) ||
- preg_match('/\s+UNION\s+/is',$sql)) {
-
- $rewritesql = adodb_strip_order_by($sql);
-
- // ok, has SELECT DISTINCT or GROUP BY so see if we can use a table alias
- // but this is only supported by oracle and postgresql...
- if ($zthis->dataProvider == 'oci8') {
- // Allow Oracle hints to be used for query optimization, Chris Wrye
- if (preg_match('#/\\*+.*?\\*\\/#', $sql, $hint)) {
- $rewritesql = "SELECT ".$hint[0]." COUNT(*) FROM (".$rewritesql.")";
- } else
- $rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
-
- } else if (strncmp($zthis->databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
- } else {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
- }
- } else {
- // now replace SELECT ... FROM with SELECT COUNT(*) FROM
- $rewritesql = preg_replace(
- '/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
- // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
- // with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
- // also see http://phplens.com/lens/lensforum/msgs.php?id=12752
- $rewritesql = adodb_strip_order_by($rewritesql);
- }
-
- if (isset($rewritesql) && $rewritesql != $sql) {
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- // we only use half the time of secs2cache because the count can quickly
- // become inaccurate if new records are added
- $qryRecs = $zthis->CacheGetOne($secs2cache/2,$rewritesql,$inputarr);
-
- } else {
- $qryRecs = $zthis->GetOne($rewritesql,$inputarr);
- }
- if ($qryRecs !== false) return $qryRecs;
- }
- //--------------------------------------------
- // query rewrite failed - so try slower way...
-
-
- // strip off unneeded ORDER BY if no UNION
- if (preg_match('/\s*UNION\s*/is', $sql)) $rewritesql = $sql;
- else $rewritesql = $rewritesql = adodb_strip_order_by($sql);
-
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- $rstest = $zthis->CacheExecute($secs2cache,$rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->CacheExecute($secs2cache,$sql,$inputarr);
- } else {
- $rstest = $zthis->Execute($rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr);
- }
- if ($rstest) {
- $qryRecs = $rstest->RecordCount();
- if ($qryRecs == -1) {
- global $ADODB_EXTENSION;
- // some databases will return -1 on MoveLast() - change to MoveNext()
- if ($ADODB_EXTENSION) {
- while(!$rstest->EOF) {
- adodb_movenext($rstest);
- }
- } else {
- while(!$rstest->EOF) {
- $rstest->MoveNext();
- }
- }
- $qryRecs = $rstest->_currentRow;
- }
- $rstest->Close();
- if ($qryRecs == -1) return 0;
- }
- return $qryRecs;
-}
-
-/*
- Code originally from "Cornel G" LOGSQL Insert Failed: $isql $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." Clear SQL Log ".htmlspecialchars($sqls)." No Recordset returned %s: '%s' not implemented for driver '%s' Testing gregorian <=> julian conversion ";
- $t = adodb_mktime(0,0,0,10,11,1492);
- //http://www.holidayorigins.com/html/columbus_day.html - Friday check
- if (!(adodb_date('D Y-m-d',$t) == 'Fri 1492-10-11')) print 'Error in Columbus landing Testing overflow ";
-
- $t = adodb_mktime(0,0,0,3,33,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-04-02')) print 'Error in day overflow 1 ";
- if (adodb_year_digit_check(00) != 2000) print "Err 2-digit 2000 Testing date formating ";
- $pos = strcmp($s1,$s2);
-
- if (($s1) != ($s2)) {
- for ($j=0,$k=strlen($s1); $j < $k; $j++) {
- if ($s1[$j] != $s2[$j]) {
- print substr($s1,$j).' ';
- break;
- }
- }
- print "Error date(): $ts ";
- $fail = true;
- }
- }
-
- // Test generation of dates outside 1901-2038
- print " Testing random dates between 100 and 4000 ';
- $start = 1960+rand(0,10);
- $yrs = 12;
- $i = 365.25*86400*($start-1970);
- $offset = 36000+rand(10000,60000);
- $max = 365*$yrs*86400;
- $lastyear = 0;
-
- // we generate a timestamp, convert it to a date, and convert it back to a timestamp
- // and check if the roundtrip broke the original timestamp value.
- print "Testing $start to ".($start+$yrs).", or $max seconds, offset=$offset: ";
- $cnt = 0;
- for ($max += $i; $i < $max; $i += $offset) {
- $ret = adodb_date('m,d,Y,H,i,s',$i);
- $arr = explode(',',$ret);
- if ($lastyear != $arr[2]) {
- $lastyear = $arr[2];
- print " $lastyear ";
- flush();
- }
- $newi = adodb_mktime($arr[3],$arr[4],$arr[5],$arr[0],$arr[1],$arr[2]);
- if ($i != $newi) {
- print "Error at $i, adodb_mktime returned $newi ($ret)";
- $fail = true;
- break;
- }
- $cnt += 1;
- }
- echo "Tested $cnt dates Passed ! Failed :-( Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true; Insert_ID error Affected_Rows error ADONewConnection: Unable to load database driver '$db' (c) 2000-2010 John Lim (jlim#natsoft.com) This software is dual licensed using BSD-Style and LGPL. This
- means you can use it in compiled proprietary and commercial products.
-ADOdb_Active_Record is an Object Relation Mapping (ORM) implementation using PHP. In an ORM system, the tables and rows of the database are abstracted into native PHP objects. This allows the programmer to focus more on manipulating the data and less on writing SQL queries.
-
-This implementation differs from Zend Framework's implementation in the following ways:
-
-
-
-
-
-
-
-
-
-
-ADOdb_Active_Record is designed upon the principles of the "ActiveRecord" design pattern, which was first described by Martin Fowler. The ActiveRecord pattern has been implemented in many forms across the spectrum of programming languages. ADOdb_Active_Record attempts to represent the database as closely to native PHP objects as possible.
-
-ADOdb_Active_Record maps a database table to a PHP class, and each instance of that class represents a table row. Relations between tables can also be defined, allowing the ADOdb_Active_Record objects to be nested.
-
-
-
-The first step to using ADOdb_Active_Record is to set the default connection that an ADOdb_Active_Record objects will use to connect to a database.
-
-
-First, let's create a temporary table in our MySQL database that we can use for demonstrative purposes throughout the rest of this tutorial. We can do this by sending a CREATE query:
-
-
-ADOdb_Active_Records are object representations of table rows. Each table in the database is represented by a class in PHP. To begin working with a table as a ADOdb_Active_Record, a class that extends ADOdb_Active_Record needs to be created for it.
-
-
-In the above example, a new ADOdb_Active_Record object $person was created to access the "persons" table. Zend_Db_DataObject takes the name of the class, pluralizes it (according to American English rules), and assumes that this is the name of the table in the database. Also note that with MySQL, table names are case-sensitive, so your class name must match the table name's case. With other databases with case-insensitive tables, your class can be capitalized differently.
-
-This kind of behavior is typical of ADOdb_Active_Record. It will assume as much as possible by convention rather than explicit configuration. In situations where it isn't possible to use the conventions that ADOdb_Active_Record expects, options can be overridden as we'll see later.
-
-
-When the $person object was instantiated, ADOdb_Active_Record read the table metadata from the database itself, and then exposed the table's columns (fields) as object properties.
-
-Our "persons" table has three fields: "name_first", "name_last", and "favorite_color". Each of these fields is now a property of the $person object. To see all these properties, use the ADOdb_Active_Record::getAttributeNames() method:
-
-One big difference between ADOdb and Zend's implementation is we do not automatically convert to camelCaps style.
-
-
-
-An ADOdb_Active_Record object is a representation of a single table row. However, when our $person object is instantiated, it does not reference any particular row. It is a blank record that does not yet exist in the database. An ADOdb_Active_Record object is considered blank when its primary key is NULL. The primary key in our persons table is "id".
-
-To insert a new record into the database, change the object's properties and then call the ADOdb_Active_Record::save() method:
-
-Oh, no! The above code snippet does not insert a new record into the database. Instead, outputs an error:
-
-This error occurred because MySQL rejected the INSERT query that was generated by ADOdb_Active_Record. If exceptions are enabled in ADOdb and you are using PHP5, an error will be thrown. In the definition of our table, we specified all of the fields as NOT NULL; i.e., they must contain a value.
-
-ADOdb_Active_Records are bound by the same contraints as the database tables they represent. If the field in the database cannot be NULL, the corresponding property in the ADOdb_Active_Record also cannot be NULL. In the example above, we failed to set the property $person->favoriteColor, which caused the INSERT to be rejected by MySQL.
-
-To insert a new ADOdb_Active_Record in the database, populate all of ADOdb_Active_Record's properties so that they satisfy the constraints of the database table, and then call the save() method:
-
-Once this $person has been INSERTed into the database by calling save(), the primary key can now be read as a property. Since this is the first row inserted into our temporary table, its "id" will be 1:
-
-From this point on, updating it is simply a matter of changing the object's properties and calling the save() method again:
-
-
-The code snippet above will change the favorite color to red, and then UPDATE the record in the database.
-
-
- The default behaviour on creating an ADOdb_Active_Record is to "pluralize" the class name and
- use that as the table name. Often, this is not the case. For example, the person class could be reading
- from the "People" table.
- We provide two ways to define your own table:
- 1. Use a constructor parameter to override the default table naming behaviour.
- 2. Define it in a class declaration:
- This allows you to control the case of field names and properties. For example, all field names in Oracle are upper-case by default. So you
-can force field names to be lowercase using $ADODB_ASSOC_CASE. Legal values are as follows:
- So to force all Oracle field names to lower-case, use
- Also see $ADODB_ASSOC_CASE.
-
-
-Saves a record by executing an INSERT or UPDATE SQL statement as appropriate.
- Returns false on unsuccessful INSERT, true if successsful INSERT.
- Returns 0 on failed UPDATE, and 1 on UPDATE if data has changed, and -1 if no data was changed, so no UPDATE statement was executed.
-
-
-ADOdb supports replace functionality, whereby the record is inserted if it does not exists, or updated otherwise.
- Sometimes, we want to load a single record into an Active Record. We can do so using:
- Returns false if an error occurs.
-
- We want to retrieve an array of active records based on some search criteria. For example:
- You can force column names to be quoted in INSERT and UPDATE statements, typically because you are using reserved words as column names by setting
- Default is false.
-
-
-In PHP5, if adodb-exceptions.inc.php is included, then errors are thrown. Otherwise errors are handled by returning a value. False by default means an error has occurred. You can get the last error message using the ErrorMsg() function.
-
-To check for errors in ADOdb_Active_Record, do not poll ErrorMsg() as the last error message will always be returned, even if it occurred several operations ago. Do this instead:
- The ADOConnection::Debug property is obeyed. So
-if $db->debug is enabled, then ADOdb_Active_Record errors are also outputted to standard output and written to the browser.
-
- You can convert an array to an ADOdb_Active_Record using Set(). The array must be numerically indexed, and have all fields of the table defined in the array. The elements of the array must be in the table's natural order too.
-
-
-ADOdb_Active_Record does not require the table to have a primary key. You can insert records for such a table, but you will not be able to update nor delete.
- Sometimes you are retrieving data from a view or table that has no primary key, but has a unique index. You can dynamically set the primary key of a table through the constructor:
-
-Sometimes we want to load data from one database and insert it into another using ActiveRecords. This can be done using the optional parameter of the ADOdb_Active_Record constructor. In the following example, we read data from db.table1 and store it in db2.table2:
-
-If you have to pass in a primary key called "id" and the 2nd db connection in the constructor, you can do so too:
- You can now give a named label in SetDatabaseAdapter, allowing to determine in your class definition which database to load, using var $_dbat.
- You can cache the table metadata (field names, types, and other info such primary keys) in $ADODB_CACHE_DIR (which defaults to /tmp) by setting
-the global variable $ADODB_ACTIVE_CACHESECS to a value greater than 0. This will be the number of seconds to cache.
- You should set this to a value of 30 seconds or greater for optimal performance.
-
- Although the Active Record concept is useful, you have to be aware of some pitfalls when using Active Record. The level of granularity of Active Record is individual records. It encourages code like the following, used to increase the price of all furniture products by 10%:
- For performance sensitive code, using direct SQL will always be faster than using Active Records due to overhead and the fact that all fields in a row are retrieved (rather than only the subset you need) whenever an Active Record is loaded.
-
-
-The default transaction mode in ADOdb is autocommit. So that is the default with active record too.
-The general rules for managing transactions still apply. Active Record to the database is a set of insert/update/delete statements, and the db has no knowledge of active records.
-
-Smart transactions, that does an auto-rollback if an error occurs, is still the best method to multiple activities (inserts/updates/deletes) that need to be treated as a single transaction:
- Since ADOdb 5.06, we support parent child relationships. This is done using the ClassBelongsTo() and ClassHasMany() functions.
-
- To globally define a one-to-many relationship we use the static function ADODB_Active_Record::ClassHasMany($class, $relation, $foreignKey = '', $foreignClass = 'ADODB_Active_Record'). For example, we have 2 tables, persons (parent table) and children (child table)
-linked by persons.id = children.person_id. The variable $person->children is an array that holds the children. To define this relationship:
- If no data is loaded, then children is set to an empty array:
- By default, data returned by HasMany() is unsorted. To define an order by clause (or define a SELECT LIMIT window), see LoadRelations() below. Another point is that all children are loaded only when the child member is accessed (in __get), and not when the Load() function of the parent object is called. This helps to conserve memory.
-
- To create and save new parent and child records:
- You can have multiple relationships (warning: relations are case-sensitive, 'Children' !== 'children'):
- By default, the child class is ADOdb_Active_Record. Sometimes you might want the child class to be based on your own class which has additional functions. You can do so using the last parameter:
- Lastly some troubleshooting issues. We use the __get() method to set
-$p->children below. So once $p->children is defined by accessing it, we don't change the child reference, as shown below:
- The solution to the above is to unset($p->children) before $p->Load('id=2').
- Then you use the following static function
- ADODB_Active_Record::TableHasMany($table, $relation, $foreignKey = '', $foreignClass = 'ADODB_Active_Record') like this:
- Then you use the following static function
- ADODB_Active_Record::TableKeyHasMany($table, $tablePKey, $relation, $foreignKey = '', $foreignClass = 'ADODB_Active_Record') like this:
- Here is sample usage using mysql:
- This older method is deprecated and ClassHasMany/TableHasMany/TableKeyHasMany should be used.
- The older way to define a one-to-many relationship is to use $parentobj->HasMany($relation, $foreignKey = ''). For example, we have 2 tables, persons (parent table) and children (child table)
-linked by persons.id = children.person_id. The variable $person->children is an array that holds the children. To define this relationship:
- This HasMany() definition is global for the current script. This means that you only need to define it once. In the following example, $person2 knows about children.
- You can define the parent of the current object using ADODB_Active_Record::ClassBelongsTo($class, $relationName, $foreignKey, $parentPrimaryKey = 'id', $parentClass = 'ADODB_Active_Record'). In the example below,
-we have a child table kids, and a parent table person. We have a link kids.person_id = persons.id. We create a child first, then link it to the parent:
-
- Note that relationships are case-sensitive, so ClassBelongsTo('kid','PARENT', 'parent_id') and ClassBelongsTo('kid', 'parent', 'parent_id') are not the same.
- Also if no data is loaded into the child instance, then $p will return null;
- Another way to define the class of the parent (which otherwise defaults to ADODB_Active_Record) as follows:
- If the child table differs from the convention that the child table name is the plural of the child class name, use this function:
-ADODB_Active_Record::TableBelongsTo($childTable, $relationName, $foreignKey, $parentPrimaryKey = 'id', $parentClass = 'ADODB_Active_Record').
- E.g. the class is child, but the table name is children, and the link between the two tables is children.person_id = person.id:
- If the child table differs from the convention that the child table name is the plural of the child class name or the primary key is not 'id', use this function:
-ADODB_Active_Record::TableKeyBelongsTo($childTable, $childKey, $relationName, $foreignKey, $parentPrimaryKey = 'id', $parentClass = 'ADODB_Active_Record').
- E.g. the class is child, but the table name is children and primary key is ch_id, and the link between the two tables is children.person_id = person.id:
- The following is deprecated. Use ClassBelongsTo/TableBelongsTo/TableKeyBelongsTo instead.
- The older way to define the parent of the current object is using BelongsTo($relationName, $foreignKey, $parentPrimaryKey = 'id'). In the example below,
-we have a child table children, and a parent table person. We have a link children.person_id = persons.id. We create a child first, then link it to the parent:
- Returns last error message.
- Returns last error number.
-
- The following works with PHP4 and PHP5
- This is the original one-to-many Active Record implementation submitted by
-Chris Ravenscroft (chris#voilaweb.com). The reason why we are offering both versions is that the Extended version
-is more powerful but more complex. My personal preference is to keep it simpler, but your view may vary.
- To use, just include adodb-active-recordx.inc.php instead of adodb-active-record.inc.php.
- It provides a new function called Find() that is quite intuitive to use as shown in the example below. It also supports loading all relationships using a single query (using joins).
- Check _original and current field values before update, only update changes. Also if the primary key value is changed, then on update, we should save and use the original primary key values in the WHERE clause!
-
- PHP5 specific: Make GetActiveRecords*() return an Iterator.
- PHP5 specific: Change PHP5 implementation of Active Record to use __get() and __set() for better performance.
-
- 0.93
- You can force column names to be quoted in INSERT and UPDATE statements, typically because you are using reserved words as column names by setting
-ADODB_Active_Record::$_quoteNames = true;
-
- 0.92
- Fixed some issues with incompatible fetch modes (ADODB_FETCH_ASSOC) causing problems in UpdateActiveTable.
- Added support for functions that support predefining one-to-many relationships: You can also define your child/parent class in these functions, instead of the default ADODB_Active_Record.
-
- 0.91
- HasMany hardcoded primary key field name to "id". Fixed.
-
- 0.90
- Support for belongsTo and hasMany. Thanks to Chris Ravenscroft (chris#voilaweb.com).
- Added LoadRelations().
-
- 0.08
-Added support for assoc arrays in Set().
-
- 0.07
- $ADODB_ASSOC_CASE=2 did not work properly. Fixed.
- Added === check in ADODB_SetDatabaseAdapter for $db, adodb-active-record.inc.php. Thx Christian Affolter.
-
- 0.06
- Added ErrorNo().
- Fixed php 5.2.0 compat issues.
-
- 0.05
- If inserting a record and the value of a primary key field is null, then we do not insert that field in as
-we assume it is an auto-increment field. Needed by mssql.
-
- 0.04 5 June 2006 Added support for declaring table name in $_table in class declaration. Thx Bill Dueber for idea.
- Added find($where,$bindarr=false) method to retrieve an array of active record objects.
-
- 0.03 0.02
- 0.01 6 Mar 2006
- 0.00 5 Mar 2006 V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com) This software is dual licensed using BSD-Style
-and LGPL. This means you can use it in compiled proprietary and commercial
-products. Useful ADOdb links: Download
- Other Docs Introduction Variables: $ADODB_COUNTRECS
-$ADODB_ANSI_PADDING_OFF $ADODB_CACHE_DIR rs2html example PHP's database access functions are not standardised. This creates a need
-for a database class library to hide the differences between the different
-database API's (encapsulate the differences) so we can easily switch databases.
-PHP 4.0.5 or later is now required (because we use array-based str_replace). We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL
-Anywhere, Informix, PostgreSQL, FrontBase, SQLite, Interbase (Firebird and
-Borland variants), Foxpro, Access, PHP4 supports session variables. You can store your session information
-using ADOdb for true portability and scalability. See adodb-session.php for
-more information. Also read tips_portable_sql.htm
-for tips on writing portable SQL. Here are some examples of how people are using ADOdb (for a
-much longer list, visit adodb-cool-apps): Feature requests and bug reports can be emailed to jlim#natsoft.com or posted to the ADOdb Help
-forums at http://phplens.com/lens/lensforum/topics.php?id=4. Make sure you are running PHP 4.0.5 or later. Unpack all the files into a
-directory accessible by your webserver. To test, try modifying some of the tutorial examples. Make sure you
-customize the connection settings correctly. You can debug using $db->debug
-= true as shown below: For developers who want to release a minimal install of ADOdb, you will
-need: Optional: When running ADOdb, at least two files are loaded. First is
-adodb/adodb.inc.php, which contains all functions used by all database classes.
-The code specific to a particular database is in the
-adodb/driver/adodb-????.inc.php file. For example, to connect to a mysql database: Whenever you need to connect to a database, you create a Connection object
-using the ADONewConnection($driver) function. NewADOConnection($driver)
-is an alternative name for the same function. At this point, you are not connected to the database (no longer true if you
-pass in a dsn). You will first need to decide whether
-to use persistent or non-persistent connections. The advantage of
-persistent connections is that they are faster, as the database
-connection is never closed (even when you call Close()). Non-persistent connections
-take up much fewer resources though, reducing the risk of your database and
-your web-server becoming overloaded. For persistent connections, use $conn->PConnect(),
-or $conn->Connect() for non-persistent connections.
-Some database drivers also support NConnect(), which
-forces the creation of a new connection. Connection Gotcha: If you create two connections, but both use the
-same userid and password, PHP will share the same connection. This can cause
-problems if the connections are meant to different databases. The solution is
-to always use different userid's for different databases, or use NConnect(). Since ADOdb 4.51, you can connect to a database by passing a dsn to
-NewADOConnection() (or ADONewConnection, which is the same function). The dsn
-format is: NewADOConnection() calls Connect() or PConnect() internally for you. If the
-connection fails, false is returned. If you have special characters such as /:?_ in your dsn, then you need to
-rawurlencode them first: Legal options are: For all drivers 'persist', 'persistent', 'debug', 'fetchmode', 'new' , 'cachesecs', 'memcache' Interbase/Firebird 'dialect','charset','buffers','role' M'soft 'charpage' MySQL 'clientflags' MySQLi 'port', 'socket', 'clientflags' Oci8 'nls_date_format','charset' For all drivers, when the options persist or persistent are
-set, a persistent connection is forced; similarly, when new is set, then
-a new connection will be created using NConnect if the underlying driver
-supports it. The debug option enables debugging. The fetchmode
-calls SetFetchMode(). If no value is defined for an
-option, then the value is set to 1. Since ADOdb 5.09, we added 2 new parameters: ADOdb DSN's are compatible with version 1.0 of PEAR DB's DSN format. MySQL connections are very
-straightforward, and the parameters are identical to mysql_connect: For most drivers, you can use the
-standard function: Connect($server, $user, $password, $database), or a DSN since ADOdb 4.51. Exceptions to this are listed
-below. PDO, which only works with PHP5, accepts a
-driver specific connection string: The DSN mechanism is also supported: PostgreSQL 7 and 8 accepts connections using:
- a. the standard connection string: b. the classical 4 parameters: c. dsn: Here is an example of querying a LDAP server. Thanks to Josh Eldridge for
-the driver and this example: Using DSN: You define the database in the $host parameter: Or dsn: Sqlite will create the database file if it does not exist. Or dsn: With oci8, you can connect in multiple ways. Note that oci8 works fine with
-newer versions of the Oracle, eg. 9i and 10g. a. PHP and Oracle reside on the same machine, use default SID. b. TNS Name defined in tnsnames.ora (or ONAMES or HOSTNAMES), eg. 'myTNS' or c. Host Address and SID d. Host Address and Service Name e. Oracle connection string: f. ADOdb dsn: You can also set the charSet for Oracle 9.2 and later, supported since PHP
-4.3.2, ADOdb 4.54: ODBC DSN's can be created in the ODBC control panel, or you can use a
-DSN-less connection.To use DSN-less connections with ODBC you need PHP 4.3 or
-later. For Microsoft Access: For Microsoft SQL Server: or if you prefer to use the mssql extension (which is
-limited to mssql 6.5 functionality): For DB2: DSN-less Connections with ADOdb is a big class library, yet it consistently
-beats all other PHP class libraries in performance. This is because it is
-designed in a layered fashion, like an onion, with the fastest functions in the
-innermost layer. Stick to the following functions for best performance: Innermost Layer Connect, PConnect, NConnect The fastest way to access the field data is by accessing the array
-$recordset->fields directly. Also set the global variables $ADODB_FETCH_MODE = ADODB_FETCH_NUM, and (for
-oci8, ibase/firebird and odbc) $ADODB_COUNTRECS
-= false before you connect to your database. Consider using bind parameters if your database supports it, as it improves
-query plan reuse. Use ADOdb's performance tuning system to identify bottlenecks
-quickly. At the time of writing (Dec 2003), this means oci8 and odbc drivers. Lastly make sure you have a PHP accelerator cache installed such as APC,
-Turck MMCache, Zend Accelerator or ionCube. Some examples: Fastest data retrieval using PHP Fastest data retrieval using ADOdb extension Advanced Tips If you have the ADOdb C
-extension installed, you can replace your calls to $rs->MoveNext() with
-adodb_movenext($rs). This doubles the speed of this operation. For retrieving
-entire recordsets at once, use GetArray(), which uses the high speed extension
-function adodb_getall($rs) internally. Execute() is the default way to run queries. You can use the low-level
-functions _Execute() and _query() to reduce query overhead. Both these
-functions share the same parameters as Execute(). If you do not have any bind parameters or your database supports binding
-(without emulation), then you can call _Execute() directly. Calling this
-function bypasses bind emulation. Debugging is still supported in _Execute(). If you do not require debugging facilities nor emulated binding, and do not
-require a recordset to be returned, then you can call _query. This is great for
-inserts, updates and deletes. Calling this function bypasses emulated binding,
-debugging, and recordset handling. Either the resultid, true or false are
-returned by _query(). For Informix, you can disable scrollable cursors with $db->cursorType =
-0. You might want to modify ADOdb for your own purposes. Luckily you can still
-maintain backward compatibility by sub-classing ADOdb and using the
-$ADODB_NEWCONNECTION variable. $ADODB_NEWCONNECTION allows you to override the
-behaviour of ADONewConnection(). ADOConnection() checks for this variable and
-will call the function-name stored in this variable if it is defined. In the following example, new functionality for the connection object is
-placed in the hack_mysql and hack_postgres7 classes. The
-recordset class naming convention can be controlled using $rsPrefix. Here we
-set it to 'hack_rs_', which will make ADOdb use hack_rs_mysql and hack_rs_postgres7
-as the recordset classes. Don't forget to call the constructor of the parent class in your
-constructor. If you want to use the default ADOdb drivers return false in the
-above hack_factory() function. Also you can define your own
-ADORecordSet_empty() class, by defining a class $$this->rsPrefix.'empty'
-since 4.96/5.02. ADOdb 4.02 or later will transparently determine which
-version of PHP you are using. If PHP5 is detected, the following features become
-available: Note that reaching EOF is not considered
-an error nor an exception. The name below is the value you pass to
-NewADOConnection($name) to create a connection object for that database. Name Tested Database RecordCount() usable Prerequisites Operating Systems access B Microsoft Access/Jet. You
- need to create an ODBC DSN. Y/N ODBC Windows only ado B Generic You can set $db->codePage before
- connecting. ? depends on database Windows only ado_access B Microsoft Access/Jet using Y/N Windows only ado_mssql B Microsoft SQL Server using Y/N Windows only db2 B Uses PHP's db2-specific
- extension for better performance. Y/N DB2 CLI/ODBC interface Unix and Windows. Requires IBM DB2
- Universal Database client. db2oci C Based on db2 driver. Allows use of oracle style :0, :1, :2 bind variables. Used with DB2 9.7 or later with PL/SQL mode turned on. Y/N DB2 CLI/ODBC interface Unix and Windows. Requires IBM DB2
- Universal Database client. odbc_db2 C Connects to DB2 using
- generic ODBC extension. Y/N DB2 CLI/ODBC interface Unix and Windows. Unix
- install hints. I have had reports that the $host and $database params
- have to be reversed in Connect() when using the CLI interface. vfp A Microsoft Visual FoxPro.
- You need to create an ODBC DSN. Y/N ODBC Windows only fbsql C FrontBase. Y ? Unix and Windows ibase B Interbase 6 or earlier.
- Some users report you might need to use this Y/N Interbase client Unix and Windows firebird C Firebird version of
- interbase. Y/N Interbase client Unix and Windows borland_ibase C Borland version of
- Interbase 6.5 or later. Very sad that the forks differ. Y/N Interbase client Unix and Windows informix C Generic informix driver.
- Use this if you are using Informix 7.3 or later. Y/N Informix client Unix and Windows informix72 C Informix databases before
- Informix 7.3 that do no support SELECT FIRST. Y/N Informix client Unix and Windows ldap C LDAP driver. See this
- example for usage information. LDAP extension ? mssql A Microsoft SQL Server 7 and later. Works
- with Microsoft SQL Server 2000 also. Note that date formating is problematic
- with this driver. For example, the PHP mssql extension does not return the
- seconds for datetime! Y/N Mssql client Unix and Windows. mssqlpo A Portable mssql driver. Identical to above mssql
- driver, except that '||', the concatenation operator, is converted to '+'.
- Useful for porting scripts from most other sql variants that use ||. Y/N Mssql client Unix and Windows. mssqlnative C Native mssql driver from M'soft. ? ? Windows. Tq Garrett Serack of M'soft. mysql A MySQL without transaction
- support. You can also set $db->clientFlags before connecting. Y MySQL client Unix and Windows mysqlt or maxsql A MySQL with transaction support. We
- recommend using || as the concat operator for best portability. This can be
- done by running MySQL using: Y/N MySQL client Unix and Windows oci8 A Oracle 8/9. Has more
- functionality than oracle driver (eg. Affected_Rows). You might have
- to putenv('ORACLE_HOME=...') before Connect/PConnect. There are 2 ways of connecting - with
- server IP and service name: Since 2.31, we support Oracle REF cursor
- variables directly (see ExecuteCursor). Y/N Oracle client Unix and Windows oci805 C Supports reduced Oracle
- functionality for Oracle 8.0.5. SelectLimit is not as efficient as in the
- oci8 or oci8po drivers. Y/N Oracle client Unix and Windows oci8po A Oracle 8/9 portable driver.
- This is nearly identical with the oci8 driver except (a) bind variables in
- Prepare() use the ? convention, instead of :bindvar, (b) field names use the
- more common PHP convention of lowercase names. Use this driver if porting from other
- databases is important. Otherwise the oci8 driver offers better performance. Y/N Oracle client Unix and Windows odbc A Generic ODBC, not tuned for
- specific databases. To connect, use ? depends on database ODBC Unix and Windows. Unix hints. odbc_mssql C Uses ODBC to connect to
- MSSQL Y/N ODBC Unix and Windows. odbc_oracle C Uses ODBC to connect to
- Oracle Y/N ODBC Unix and Windows. odbtp C Generic odbtp driver. Odbtp is a software for accessing
- Windows ODBC data sources from other operating systems. Y/N odbtp Unix and Windows odbtp_unicode C Odtbp with unicode support Y/N odbtp Unix and Windows oracle C Implements old Oracle 7
- client API. Use oci8 driver if possible for better performance. Y/N Oracle client Unix and Windows netezza C Netezza driver. Netezza is
- based on postgres code-base. Y ? ? pdo C Generic PDO driver for
- PHP5. Y PDO extension and database
- specific drivers Unix and Windows. postgres A Generic PostgreSQL driver.
- Currently identical to postgres7 driver. Y PostgreSQL client Unix and Windows. postgres64 A For PostgreSQL 6.4 and
- earlier which does not support LIMIT internally. Y PostgreSQL client Unix and Windows. postgres7 A PostgreSQL which supports
- LIMIT and other version 7 functionality. Y PostgreSQL client Unix and Windows. postgres8 A PostgreSQL which supports
- version 8 functionality. Y PostgreSQL client Unix and Windows. sapdb C SAP DB. Should work
- reliably as based on ODBC driver. Y/N SAP ODBC client ? sqlanywhere C Sybase SQL Anywhere. Should
- work reliably as based on ODBC driver. Y/N SQL Anywhere ODBC client ? sqlite B SQLite. Y - Unix and Windows. sqlitepo B Portable SQLite driver. This
- is because assoc mode does not work like other drivers in sqlite. Namely,
- when selecting (joining) multiple tables, the table names are included in the
- assoc keys in the "sqlite" driver. In "sqlitepo" driver, the table
- names are stripped from the returned column names. When this results in a
- conflict, the first field get preference. Y - Unix and Windows. sybase C Sybase. Y/N Sybase client Unix and Windows. sybase_ase C Sybase ASE. Y/N Sybase client Unix and Windows. The "Tested" column indicates how extensively the code has been
-tested and used. The column "RecordCount() usable" indicates whether RecordCount()
-return the number of rows, or returns -1 when a SELECT statement is executed.
-If this column displays Y/N then the RecordCount() is emulated when the global
-variable $ADODB_COUNTRECS=true (this is the default). Note that for large
-recordsets, it might be better to disable RecordCount() emulation because
-substantial amounts of memory are required to cache the recordset for counting.
-Also there is a speed penalty of 40-50% if emulation is required. This is
-emulated in most databases except for PostgreSQL and MySQL. This variable is
-checked every time a query is executed, so you can selectively choose which
-recordsets to count. Task: Connect to the Access Northwind DSN, display the first 2 columns of
-each row. In this example, we create a ADOConnection object, which represents the
-connection to the database. The connection is initiated with PConnect, which is a persistent
-connection. Whenever we want to query the database, we call the ADOConnection.Execute()
-function. This returns an ADORecordSet object which is actually a cursor that
-holds the current row in the array fields[].
-We use MoveNext()
-to move from row to row. NB: A useful function that is not used in this example is SelectLimit,
-which allows us to limit the number of rows shown. The $recordSet returned
-stores the current row in the $recordSet->fields
-array, indexed by column number (starting from zero). We use the MoveNext()
-function to move to the next row. The EOF
-property is set to true when end-of-file is reached. If an error occurs in
-Execute(), we return false instead of a recordset. The To get the number of rows in the select statement, you can use $recordSet->RecordCount().
-Note that it can return -1 if the number of rows returned cannot be determined. Select a table, display the first two columns. If the second column is a
-date or timestamp, reformat the date to In this example, we check the field type of the second column using FetchField().
-This returns an object with at least 3 fields. We then use MetaType()
-to translate the native type to a generic type. Currently the following generic
-types are defined: If the metatype is of type date or timestamp, then we print it using the
-user defined date format with UserDate(), which converts the PHP SQL date string
-format to a user defined one. Another use for MetaType() is data validation before doing an SQL
-insert or update. Insert a row to the Orders table containing dates and strings that need to
-be quoted before they can be accepted by the database, eg: the single-quote in
-the word John's. In this example, we see the advanced date and quote handling facilities of
-ADOdb. The unix timestamp (which is a long integer) is appropriately formated
-for Access with DBDate(),
-and the right escape character is used for quoting the John's Old Shoppe,
-which is John''s Old Shoppe and not PHP's default John's
-Old Shoppe with qstr().
- Observe the error-handling of the Execute statement. False is returned by Execute() if
-an error occured. The error message for the last error that occurred is
-displayed in ErrorMsg().
-Note: php_track_errors might have to be enabled for error messages to be
-saved. In the above example, we have turned on debugging by setting debug = true.
-This will display the SQL statement before execution, and also show any error
-messages. There is no need to call ErrorMsg() in this case. For displaying the
-recordset, see the rs2html()
-example. Also see the section on Custom Error Handlers. Connect to MySQL database agora, and generate a <select> menu
-from an SQL statement where the <option> captions are in the 1st column,
-and the value to send back to the server is in the 2nd column. Here we define a menu named GetCust, with the menu option 'Mary Rosli'
-selected. See GetMenu(). We also have functions that return
-the recordset as an array: GetArray(), and as an associative array with the
-key being the first column: GetAssoc(). Since ADOdb 4.56, we support AutoExecute(),
-which simplifies things by providing an advanced wrapper for GetInsertSQL() and
-GetUpdateSQL(). For example, an INSERT can be carried out with: and an UPDATE with: The rest of this section is out-of-date: ADOdb 1.31 and later supports two new recordset functions: GetUpdateSQL( )
-and GetInsertSQL( ). This allow you to perform a "SELECT * FROM table
-query WHERE...", make a copy of the $rs->fields, modify the fields, and
-then generate the SQL to update or insert into the table automatically. We show how the functions can be used when accessing a table with the
-following fields: (ID, FirstName, LastName, Created). Before these functions can be called, you need to initialize the recordset by
-performing a select on the table. Idea and code by Jonathan Younger
-jyounger#unilab.com. Since ADOdb 2.42, you can pass a table name instead of a
-recordset into GetInsertSQL (in $rs), and it will generate an insert statement
-for that table. The behaviour of AutoExecute(), GetUpdateSQL() and GetInsertSQL() when
-converting empty or null PHP variables to SQL is controlled by the global
-$ADODB_FORCE_TYPE variable. Set it to one of the values below. Default is
-ADODB_FORCE_VALUE (3): Thanks to Niko (nuko#mbnet.fi) for the $ADODB_FORCE_TYPE code. Note: the constant ADODB_FORCE_NULLS is obsolete since 4.52 and is ignored.
-Set $ADODB_FORCE_TYPE = ADODB_FORCE_NULL for equivalent behaviour. Since 4.62, the table name to be used can be overridden by setting
-$rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is
-called. The following code creates a very simple recordset pager, where you can
-scroll from page to page of a recordset. This will create a basic record pager that looks like this: ID First Name Last Name Date Created 36 Alan Turing Sat 06, Oct 2001 37 Serena Williams Sat 06, Oct 2001 38 Yat Sun Sun Sat 06, Oct 2001 39 Wai Hun See Sat 06, Oct 2001 40 Steven Oey Sat 06, Oct 2001 Page 8/10 The number of rows to display at one time is controled by the Render($rows)
-method. If you do not pass any value to Render(), ADODB_Pager will default to
-10 records per page. You can control the column titles by modifying your SQL (supported by most
-databases): The above code can be found in the adodb/tests/testpaging.php example
-included with this release, and the class ADODB_Pager in adodb/adodb-pager.inc.php.
-The ADODB_Pager code can be adapted by a programmer so that the text links can
-be replaced by images, and the dull white background be replaced with more
-interesting colors. You can also allow display of html by setting $pager->htmlSpecialChars =
-false. Some of the code used here was contributed by Ivn Oliva and Cornel G. We provide some helper functions to export in comma-separated-value (CSV)
-and tab-delimited formats: print '<hr>'; Carriage-returns or newlines are converted to spaces. Field names are
-returned in the first line of text. Strings containing the delimiter character
-are quoted with double-quotes. Double-quotes are double-quoted again. This
-conforms to Excel import and export guide-lines. All the above functions take as an optional last parameter, $addtitles which
-defaults to true. When set to false field names in the first line
-are suppressed. Sometimes we want to pre-process all rows in a recordset before we use it.
-For example, we want to ucwords all text in recordset. The RSFilter function takes 2 parameters, the recordset, and the name
-of the filter function. It returns the processed recordset scrolled to
-the first record. The filter function takes two parameters, the current
-row as an array, and the recordset object. For future compatibility, you should
-not use the original recordset object. The old way of doing transactions required you to use This is very complicated for large projects because you have
-to track the error status. Smart Transactions is much simpler. You start a
-smart transaction by calling StartTrans(): CompleteTrans() detects when an SQL error occurs, and will
-Rollback/Commit as appropriate. To specificly force a rollback even if no error
-occured, use FailTrans(). Note that the rollback is done in CompleteTrans(),
-and not in FailTrans(). You can also check if a transaction has failed, using HasFailedTrans(),
-which returns true if FailTrans() was called, or there was an error in the SQL
-execution. Make sure you call HasFailedTrans() before you call CompleteTrans(),
-as it is only works between StartTrans/CompleteTrans. Lastly, StartTrans/CompleteTrans is nestable, and only the outermost block
-is executed. In contrast, BeginTrans/CommitTrans/RollbackTrans is NOT nestable.
- Note: Savepoints are currently not supported. ADOdb supports PHP5 exceptions. Just include adodb-exceptions.inc.php
-and you can now catch exceptions on errors as they occur. ADOdb also provides two custom handlers which you can modify for your needs.
-The first one is in the adodb-errorhandler.inc.php file. This makes use
-of the standard PHP functions error_reporting
-to control what error messages types to display, and trigger_error which invokes the default
-PHP error handler. Including the above file will cause trigger_error($errorstring,E_USER_ERROR)
-to be called when The $errorstring is generated by ADOdb and will contain useful debugging
-information similar to the error.log data generated below. This file
-adodb-errorhandler.inc.php should be included before you create any
-ADOConnection objects. If you define error_reporting(0), no errors will be passed to the error
-handler. If you set error_reporting(E_ALL), all errors will be passed to the
-error handler. You still need to use ini_set("display_errors",
-"0" or "1") to control the display of errors. If you want to log the error message, you can do so by defining the
-following optional constants ADODB_ERROR_LOG_TYPE and ADODB_ERROR_LOG_DEST.
-ADODB_ERROR_LOG_TYPE is the error log message type (see error_log in the PHP manual). In this case
-we set it to 3, which means log to the file defined by the constant
-ADODB_ERROR_LOG_DEST. The following message will be logged in the error.log file: The second error handler is adodb-errorpear.inc.php.
-This will create a PEAR_Error derived object whenever an error occurs. The last
-PEAR_Error object created can be retrieved using ADODB_Pear_Error(). You can use a PEAR_Error derived class by defining the constant
-ADODB_PEAR_ERROR_CLASS before the adodb-errorpear.inc.php file is included. For
-easy debugging, you can set the default error handler in the beginning of the
-PHP script to PEAR_ERROR_DIE, which will cause an error message to be printed,
-then halt script execution: Note that we do not explicitly return a PEAR_Error object to you when an
-error occurs. We return false instead. You have to call ADODB_Pear_Error() to
-get the last error or use the PEAR_ERROR_DIE technique. If you need error messages that work across multiple databases, then use MetaError(), which returns a virtualized error number,
-based on PEAR DB's error number system, and MetaErrMsg().
- Error messages are outputted using the static method
-ADOConnnection::outp($msg,$newline=true). By default, it sends the messages to
-the client. You can override this to perform error-logging. We now support connecting using PEAR style DSN's. A DSN is a connection
-string of the form: $dsn = "$driver://$username:$password@$hostname/$databasename"; An example: More info and connection examples on the DSN
-format. We support DSN's (see above), and the following functions: ADOdb now supports caching of recordsets in the file system using the
-CacheExecute( ), CachePageExecute( ) and CacheSelectLimit( ) functions. There
-are similar to the non-cache functions, except that they take a new first
-parameter, $secs2cache. An example: The first parameter is the number of seconds to cache the query. Subsequent
-calls to that query will used the cached version stored in $ADODB_CACHE_DIR. To
-force a query to execute and flush the cache, call CacheExecute() with the
-first parameter set to zero. Alternatively, use the CacheFlush($sql) call. For the sake of security, we recommend you set register_globals=off in
-php.ini if you are using $ADODB_CACHE_DIR. In ADOdb 1.80 onwards, the secs2cache parameter is optional in
-CacheSelectLimit() and CacheExecute(). If you leave it out, it will use the
-$connection->cacheSecs parameter, which defaults to 60 minutes. The following
-are equivalent: Please note that magic_quotes_runtime should be turned off. Do not change
-$ADODB_FETCH_MODE (or SetFetchMode) as the cached recordset will use the
-$ADODB_FETCH_MODE set when the query was executed. You can also share cached recordsets on
-a memcache server. The memcache API supports one or more pooled hosts. Only if
-none of the pooled servers can be contacted will a connect error be generated.
-Example below: More info on memcache can be found at http://www.danga.com/memcached/. There is also a caching API since
-4.99/5.05. Two implementations of the API are already available providing file
-and memcache support. The new API for creating your custom
-caching class uses 2 globals: Since ADOdb 2.30, we support the generation of SQL to create pivot tables,
-also known as cross-tabulations. For further explanation read this DevShed Cross-Tabulation tutorial.
-We assume that your database supports the SQL case-when expression. In this example, we will use the Northwind database from Microsoft. In the
-database, we have a products table, and we want to analyze this table by suppliers
-versus product categories. We will place the suppliers on each row, and
-pivot on categories. So from the table on the left, we generate the pivot-table
-on the right: Supplier Category supplier1 category1 supplier2 category1 supplier2 category2 --> category1 category2 total supplier1 1 0 1 supplier2 1 1 2 The following code will generate the SQL for a cross-tabulation: This will generate the following SQL: You can also pivot on numerical columns and generate totals by
-using ranges. This code was revised in ADODB 2.41 and is not backward
-compatible. The second example shows this: Which generates: Function parameters with [ ] around them are optional. If the database driver API does not support counting the number of records
-returned in a SELECT statement, the function RecordCount() is emulated when the
-global variable $ADODB_COUNTRECS is set to true, which is the default. We
-emulate this by buffering the records, which can take up large amounts of
-memory for big recordsets. Set this variable to false for the best performance.
-This variable is checked every time a query is executed, so you can selectively
-choose which recordsets to count. If you are using recordset caching, this is the directory to save your
-recordsets in. Define this before you call any caching functions such as
-CacheExecute( ). We recommend setting register_globals=off in php.ini if
-you use this feature for security reasons. If you are using Unix and apache, you might need to set your cache directory
-permissions to something similar to the following: chown -R apache /path/to/adodb/cache Determines whether to right trim CHAR fields (and also VARCHAR for
-ibase/firebird). Set to true to trim. Default is false. Currently works for
-oci8po, ibase and firebird drivers. Added in ADOdb 4.01. Determines the language used in MetaErrorMsg(). The default is 'en', for
-English. To find out what languages are supported, see the files in
-adodb/lang/adodb-$lang.inc.php, where $lang is the supported langauge. This is a global variable that determines how arrays are retrieved by recordsets.
-The recordset saves this value on creation (eg. in Execute( ) or SelectLimit(
-)), and any subsequent changes to $ADODB_FETCH_MODE have no affect on existing
-recordsets, only on recordsets created in the future. The following constants are defined: define('ADODB_FETCH_DEFAULT',0); An example: As you can see in the above example, both recordsets store and use different
-fetch modes based on the $ADODB_FETCH_MODE setting when the recordset was
-created by Execute(). If no fetch mode is predefined, the fetch mode defaults to
-ADODB_FETCH_DEFAULT. The behaviour of this default mode varies from driver to
-driver, so do not rely on ADODB_FETCH_DEFAULT. For portability, we recommend
-sticking to ADODB_FETCH_NUM or ADODB_FETCH_ASSOC. Many drivers do not support
-ADODB_FETCH_BOTH. SetFetchMode Function If you have multiple connection objects, and want to have different fetch
-modes for each connection, then use SetFetchMode.
-Once this function is called for a connection object, that connection object
-will ignore the global variable $ADODB_FETCH_MODE and will use the internal
-fetchMode property exclusively. To retrieve the previous fetch mode, you can use check the $db->fetchMode
-property, or use the return value of SetFetchMode( ). You can control the associative fetch case for certain drivers which behave
-differently. For the sybase, oci8po, mssql, odbc and ibase drivers and all
-drivers derived from them, ADODB_ASSOC_CASE will by default generate recordsets
-where the field name keys are lower-cased. Use the constant ADODB_ASSOC_CASE to
-change the case of the keys. There are 3 possible values: 0 = assoc lowercase field names. $rs->fields['orderid'] To use it, declare it before you incldue adodb.inc.php. define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC See the GetUpdateSQL tutorial. Auto-quotes field names when using AutoExecute() when set to true. Object that performs the connection to the database, executes SQL statements
-and has a set of utility functions for standardising the format of SQL
-statements for issues such as concatenation and date formats. databaseType: Name of the database system we are connecting to. Eg. odbc
-or mssql or mysql. dataProvider: The underlying mechanism used to connect to the
-database. Normally set to native, unless using odbc or ado. host: Name of server or data source name (DSN) to connect to. database: Name of the database or to connect to. If ado is used, it
-will hold the ado data provider. user: Login id to connect to database. Password is not saved for
-security reasons. raiseErrorFn: Allows you to define an error handling function. See
-adodb-errorhandler.inc.php for an example. debug: Set to true to make debug statements to appear. concat_operator: Set to '+' or '||' normally. The operator used to
-concatenate strings in SQL. Used by the Concat
-function. fmtDate: The format used by the DBDate
-function to send dates to the database. is '#Y-m-d#' for Microsoft Access, and
-''Y-m-d'' for MySQL. fmtTimeStamp: The format used by the DBTimeStamp
-function to send timestamps to the database. true: The value used to represent true.Eg. '.T.'. for Foxpro, '1' for
-Microsoft SQL. false: The value used to represent false. Eg. '.F.'. for Foxpro, '0'
-for Microsoft SQL. replaceQuote: The string used to escape quotes. Eg. double
-single-quotes for Microsoft SQL, and backslash-quote for MySQL. Used by qstr. autoCommit: indicates whether automatic commit is enabled. Default is
-true. charSet: set the default charset to use. Currently only
-interbase/firebird supports this. dialect: set the default sql dialect to use. Currently only interbase/firebird
-supports this. role: set the role. Currently only interbase/firebird supports this. metaTablesSQL: SQL statement to return a list of available tables.
-Eg. SHOW TABLES in MySQL. genID: The latest id generated by GenID() if supported by the
-database. cacheSecs: The number of seconds to cache recordsets if
-CacheExecute() or CacheSelectLimit() omit the $secs2cache parameter. Defaults
-to 60 minutes. sysDate: String that holds the name of the database function to call
-to get the current date. Useful for inserts and updates. sysTimeStamp: String that holds the name of the database function to
-call to get the current timestamp/datetime value. leftOuter: String that holds operator for left outer join, if known.
-Otherwise set to false. rightOuter: String that holds operator for left outer join, if known.
-Otherwise set to false. ansiOuter: Boolean that if true indicates that ANSI style outer joins
-are permitted. Eg. select * from table1 left join table2 on p1=p2. connectSID: Boolean that indicates whether to treat the $database
-parameter in connects as the SID for the oci8 driver. Defaults to false. Useful
-for Oracle 8.0.5 and earlier. autoRollback: Persistent connections are auto-rollbacked in PConnect(
-) if this is set to true. Default is false. ADOConnection( ) Constructor function. Do not call this directly. Use ADONewConnection( )
-instead. Connect($host,[$user],[$password],[$database]) Non-persistent connect to data source or server $host, using userid $user
-and password $password. If the server supports multiple databases,
-connect to database $database. Returns true/false depending on connection success. Since 4.23, null is
-returned if the extension is not loaded. PostgreSQL: An alternative way of connecting to the database is to pass the
-standard PostgreSQL connection string in the first parameter $host, and the
-other parameters will be ignored. For Oracle and Oci8, there are two ways to connect. First is to use the TNS
-name defined in your local tnsnames.ora (or ONAMES or HOSTNAMES). Place the
-name in the $database field, and set the $host field to false. Alternatively,
-set $host to the server, and $database to the database SID, this bypassed
-tnsnames.ora. Examples: There are many examples of connecting to a database. See Connection Examples for many examples. PConnect($host,[$user],[$password],[$database]) Persistent connect to data source or server $host, using userid $user
-and password $password. If the server supports multiple databases,
-connect to database $database. We now perform a rollback on persistent connection for selected databases
-since 2.21, as advised in the PHP manual. See change log or source code for
-which databases are affected. Returns true/false depending on connection. Since 4.23, 0 is returned if the
-extension is not loaded. See Connect( ) above for more info. Since ADOdb 2.21, we also support autoRollback. If you set: Then when doing a persistent connection with PConnect( ), ADOdb will perform
-a rollback first. This is because it is documented that PHP is not guaranteed
-to rollback existing failed transactions when persistent connections are used.
-This is implemented in Oracle, MySQL, PgSQL, MSSQL, ODBC currently. Since ADOdb 3.11, you can force non-persistent connections even if PConnect
-is called by defining the constant ADODB_NEVER_PERSIST before you call
-PConnect. Since 4.23, null is returned if the extension is not loaded. NConnect($host,[$user],[$password],[$database]) Always force a new connection. In contrast, PHP sometimes reuses connections
-when you use Connect() or PConnect(). Currently works only on mysql (PHP 4.3.0
-or later), postgresql and oci8-derived drivers. For other drivers, NConnect()
-works like Connect(). Returns true if connected to database. Added in 4.53. Execute SQL statement $sql and return derived class of ADORecordSet
-if successful. Note that a record set is always returned on success, even if we
-are executing an insert or update statement. You can also pass in $sql a
-statement prepared in Prepare(). Returns derived class of ADORecordSet. Eg. if connecting via mysql, then
-ADORecordSet_mysql would be returned. False is returned if there was an error
-in executing the sql. The $inputarr parameter can be used for binding variables to parameters.
-Below is an Oracle example: Another example, using ODBC,which uses the ? convention: Variable binding speeds the compilation and caching of SQL statements,
-leading to higher performance. Currently Oracle, Interbase and ODBC supports
-variable binding. Interbase/ODBC style ? binding is emulated in databases that
-do not support binding. Note that you do not have to quote strings if you use
-binding. Variable binding in the odbc, interbase and oci8po drivers. Variable binding in the oci8 driver: Since ADOdb 3.80, we support bulk binding in Execute(), in which you pass in
-a 2-dimensional array to be bound to an INSERT/UPDATE or DELETE statement. And since ADOdb 5.11 this is
-disabled by default due to security issues. To enable, set $conn->bulkBind = true. This provides very high performance as the SQL statement is prepared first.
-The prepared statement is executed repeatedly for each array row until all rows
-are completed, or until the first error. Very useful for importing data. CacheExecute([$secs2cache,]$sql,$inputarr=false) Similar to Execute, except that the recordset is cached for $secs2cache
-seconds in the $ADODB_CACHE_DIR directory, and $inputarr only accepts
-1-dimensional arrays. If CacheExecute() is called again with the same $sql,
-$inputarr, and also the same database, same userid, and the cached recordset
-has not expired, the cached recordset is returned. Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional: If $secs2cache is omitted, we use the value in
-$connection->cacheSecs (default is 3600 seconds, or 1 hour). Use
-CacheExecute() only with SELECT statements. Performance note: I have done some benchmarks and found that they vary so
-greatly that it's better to talk about when caching is of benefit. When your
-database server is much slower than your Web server or the database is very
-overloaded then ADOdb's caching is good because it reduces the load on your
-database server. If your database server is lightly loaded or much faster than
-your Web server, then caching could actually reduce performance. ExecuteCursor($sql,$cursorName='rs',$parameters=false) Execute an Oracle stored procedure, and returns an Oracle REF cursor
-variable as a regular ADOdb recordset. Does not work with any other database
-except oci8. Thanks to Robert Tuttle for the design. ExecuteCursor() is a helper function that does the following internally: ExecuteCursor only accepts 1 out parameter. So if you have 2 out parameters,
-use: for the following PL/SQL: SelectLimit($sql,$numrows=-1,$offset=-1,$inputarr=false) Returns a recordset if successful. Returns false otherwise. Performs a
-select statement, simulating PostgreSQL's SELECT statement, LIMIT $numrows
-OFFSET $offset clause. In PostgreSQL, SELECT * FROM TABLE LIMIT 3 will return the first 3 records
-only. The equivalent is And SELECT * FROM TABLE LIMIT 3 OFFSET 2 will return records 3, 4 and 5 (eg.
-after record 2, return 3 rows). The equivalent in ADOdb is Note that this is the opposite of MySQL's LIMIT clause. You can also
-set The last parameter $inputarr is for databases that support variable binding
-such as Oracle oci8. This substantially reduces SQL compilation overhead. Below
-is an Oracle example: The oci8po driver (oracle portable driver) uses the more standard bind
-variable of ?: Ron Wilson reports that SelectLimit does not work with UNIONs. CacheSelectLimit([$secs2cache,] $sql,
-$numrows=-1,$offset=-1,$inputarr=false) Similar to SelectLimit, except that the recordset returned is cached for
-$secs2cache seconds in the $ADODB_CACHE_DIR directory. Since 1.80, $secs2cache has been optional, and you can define the caching
-time in $connection->cacheSecs. CacheFlush($sql=false,$inputarr=false) Flush (delete) any cached recordsets for the SQL statement $sql in
-$ADODB_CACHE_DIR. If no parameter is passed in, then all adodb_*.cache files are deleted. CacheSelectLimit() rewrites the SQL query, so you won't be able to pass the
-SQL to CacheFlush. In this case, to flush the cached SQL recordset returned by
-CacheSelectLimit(), set $secs2cache to -1: If you want to flush all cached recordsets manually, execute the following
-PHP code (works only under Unix): For general cleanup of all expired files, you should use crontab on Unix,
-or at.exe on Windows, and a shell script similar to the following: Returns a virtualized error number, based on PEAR DB's error number system.
-You might need to include adodb-error.inc.php before you call this function.
-The parameter $errno is the native error number you want to convert. If you do
-not pass any parameter, MetaError will call ErrorNo() for you and convert it.
-If the error number cannot be virtualized, MetaError will return -1 (DB_ERROR). Pass the error number returned by MetaError() for the equivalent textual
-error message. Returns the last status or error message. The error message is reset after
-every call to Execute(). This can return a string even if no error occurs. In general you do not need
-to call this function unless an ADOdb function returns false on an error. Note: If debug is enabled, the SQL error message is always displayed
-when the Execute function is called. Returns the last error number. The error number is reset after every call to
-Execute(). If 0 is returned, no error occurred. Note that old versions of PHP (pre 4.0.6) do not support error number for
-ODBC. In general you do not need to call this function unless an ADOdb function
-returns false on an error. IgnoreErrors($saveErrHandlers) Allows you to ignore errors so that StartTrans()/CompleteTrans() is not
-affected, nor is the default error handler called if an error occurs. Useful
-when you want to check if a field or table exists in a database without
-invoking an error if it does not exist. Usage: Warning: do not call StartTrans()/CompleteTrans() inside a code block that
-is using IgnoreErrors(). Sets the current fetch mode for the connection and stores it in
-$db->fetchMode. Legal modes are ADODB_FETCH_ASSOC and ADODB_FETCH_NUM. For
-more info, see $ADODB_FETCH_MODE. Returns the previous fetch mode, which could be false if SetFetchMode( ) has
-not been called before. CreateSequence($seqName = 'adodbseq',$startID=1) Create a sequence. The next time GenID( ) is called, the value returned will
-be $startID. Added in 2.60. DropSequence($seqName = 'adodbseq') Delete a sequence. Added in 2.60. GenID($seqName = 'adodbseq',$startID=1) Generate a sequence number . Works for interbase, mysql, postgresql, oci8,
-oci8po, mssql, ODBC based (access,vfp,db2,etc) drivers currently. Uses $seqName
-as the name of the sequence. GenID() will automatically create the sequence for
-you if it does not exist (provided the userid has permission to do so).
-Otherwise you will have to create the sequence yourself. If your database driver emulates sequences, the name of the table is the
-sequence name. The table has one column, "id" which should be of type
-integer, or if you need something larger - numeric(16). For ODBC and databases that do not support sequences natively (eg mssql,
-mysql), we create a table for each sequence. If the sequence has not been
-defined earlier, it is created with the starting value set in $startID. Note that the mssql driver's GenID() before 1.90 used to generate 16 byte
-GUID's. UpdateBlob($table,$column,$val,$where) Allows you to store a blob (in $val) into $table into
-$column in a row at $where. Usage: Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL,
-Oci8, Oci8po and Interbase drivers. Other drivers might work, depending on the
-state of development. Note that when an Interbase blob is retrieved using SELECT, it still needs
-to be decoded using $connection->DecodeBlob($blob); to derive the original
-value in versions of PHP before 4.1.0. For PostgreSQL, you can store your blob using blob oid's or as a bytea field.
-You can use bytea fields but not blob oid's currently with UpdateBlob( ).
-Conversely UpdateBlobFile( ) supports oid's, but not bytea data. If you do not have any blob fields, you can improve you can improve general
-SQL query performance by disabling blob handling with
-$connection->disableBlobs = true. UpdateClob($table,$column,$val,$where) Allows you to store a clob (in $val) into $table into
-$column in a row at $where. Similar to UpdateBlob (see above), but for
-Character Large OBjects. Usage: UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') Similar to UpdateBlob, except that we pass in a file path to where the blob
-resides. For PostgreSQL, if you are using blob oid's, use this interface. This
-interface does not support bytea fields. Returns true if successful, false otherwise. Some databases require blob's to be encoded manually before upload. Note if
-you use UpdateBlob( ) or UpdateBlobFile( ) the conversion is done automatically
-for you and you do not have to call this function. For PostgreSQL, currently,
-BlobEncode() can only be used for bytea fields. Returns the encoded blob value. Note that there is a connection property called blobEncodeType
-which has 3 legal values: false - no need to perform encoding or decoding. This is purely for documentation purposes, so that programs that accept
-multiple database drivers know what is the right thing to do when processing
-blobs. BlobDecode($blob, $maxblobsize = false)
- Some databases require blob's to be decoded manually after doing a select
-statement. If the database does not require decoding, then this function will
-return the blob unchanged. Currently BlobDecode is only required for one
-database, PostgreSQL, and only if you are using blob oid's (if you are using
-bytea fields, we auto-decode for you). The default maxblobsize is set in
-$connection->maxblobsize, which is set to 256K in adodb 4.54. In ADOdb 4.54 and later, the blob is the return value. In earlier versions,
-the blob data is sent to stdout. Replace($table, $arrFields,
-$keyCols,$autoQuote=false) Try to update a record, and if the record is not found, an insert statement
-is generated and executed. Returns 0 on failure, 1 if update statement worked,
-2 if no record was found and the insert was executed successfully. This differs
-from MySQL's replace which deletes the record and inserts a new record. This
-also means you cannot update the primary key. The only exception to this is
-Interbase and its derivitives, which uses delete and insert because of some
-Interbase API limitations. The parameters are $table which is the table name, the $arrFields which is
-an associative array where the keys are the field names, and $keyCols is the
-name of the primary key, or an array of field names if it is a compound key. If
-$autoQuote is set to true, then Replace() will quote all values that are
-non-numeric; auto-quoting will not quote nulls. Note that auto-quoting will not
-work if you use SQL functions or operators. Examples: AutoExecute($table, $arrFields, $mode,
-$where=false, $forceUpdate=true,$magicq=false) Since ADOdb 4.56, you can automatically generate and execute INSERTs and
-UPDATEs on a given table with this function, which is a wrapper for
-GetInsertSQL() and GetUpdateSQL(). AutoExecute() inserts or updates $table given an array of $arrFields, where
-the keys are the field names and the array values are the field values to
-store. Note that there is some overhead because the table is first queried to
-extract key information before the SQL is generated. We generate an INSERT or
-UPDATE based on $mode (see below). Legal values for $mode are You have to define the constants DB_AUTOQUERY_UPDATE and DB_AUTOQUERY_INSERT
-yourself or include adodb-pear.inc.php. The $where clause is required if $mode == 'UPDATE'. If $forceUpdate=false
-then we will query the database first and check if the field value returned by
-the query matches the current field value; only if they differ do we update
-that field. Returns true on success, false on error. An example of its use is: Note: One of the strengths of ADOdb's AutoExecute() is that only valid field
-names for $table are updated. If $arrFields contains keys that are invalid
-field names for $table, they are ignored. There is some overhead in doing this
-as we have to query the database to get the field names, but given that you are
-not directly coding the SQL yourself, you probably aren't interested in speed
-at all, but convenience. Since 4.62, the table name to be used can be overridden by setting
-$rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is
-called. Since 4.94, setting the global variable $ADODB_QUOTE_FIELDNAMES to true will
-force field names to be auto-quoted in AutoExecute(), GetInsertSQL() and
-GetUpdateSQL(). GetUpdateSQL(&$rs, $arrFields,
-$forceUpdate=false,$magicq=false, $force=null) Generate SQL to update a table given a recordset $rs, and the modified
-fields of the array $arrFields (which must be an associative array holding the
-column names and the new values) are compared with the current recordset. If
-$forceUpdate is true, then we also generate the SQL even if $arrFields is
-identical to $rs->fields. Requires the recordset to be associative. $magicq
-is used to indicate whether magic quotes are enabled (see qstr()). The field
-names in the array are case-insensitive. Since 4.52, we allow you to pass the $force type parameter, and this
-overrides the $ADODB_FORCE_TYPE global
-variable. Since 4.62, the table name to be used can be overridden by setting
-$rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is
-called. GetInsertSQL(&$rs, $arrFields,$magicq=false,$force_type=false) Generate SQL to insert into a table given a recordset $rs. Requires the
-query to be associative. $magicq is used to indicate whether magic quotes are
-enabled (for qstr()). The field names in the array are case-insensitive. Since 2.42, you can pass a table name instead of a recordset into
-GetInsertSQL (in $rs), and it will generate an insert statement for that table.
- Since 4.52, we allow you to pass the $force_type parameter, and this
-overrides the $ADODB_FORCE_TYPE global
-variable. Since 4.62, the table name to be used can be overridden by setting
-$rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is
-called. PageExecute($sql, $nrows, $page, $inputarr=false)
- Used for pagination of recordset. $page is 1-based. See Example
-8. CachePageExecute($secs2cache, $sql, $nrows,
-$page, $inputarr=false) Used for pagination of recordset. $page is 1-based. See Example
-8. Caching version of PageExecute. Close the database connection. PHP4 proudly states that we no longer have to
-clean up at the end of the connection because the reference counting mechanism
-of PHP4 will automatically clean up for us. Start a monitored transaction. As SQL statements are executed, ADOdb will
-monitor for SQL errors, and if any are detected, when CompleteTrans() is
-called, we auto-rollback. To understand why StartTrans() is superior to BeginTrans(), let us examine a
-few ways of using BeginTrans(). The following is the wrong way to use
-transactions: because you perform no error checking. It is possible to update table1 and
-for the update on table2 to fail. Here is a better way: Another way is (since ADOdb 2.0): Now it is a headache monitoring $ok all over the place. StartTrans() is an
-improvement because it monitors all SQL errors for you. This is particularly
-useful if you are calling black-box functions in which SQL queries might be
-executed. Also all BeginTrans, CommitTrans and RollbackTrans calls inside a
-StartTrans block will be disabled, so even if the black box function does a
-commit, it will be ignored. Note that a StartTrans blocks are nestable, the inner blocks are ignored. CompleteTrans($autoComplete=true) Complete a transaction called with StartTrans(). This function monitors for
-SQL errors, and will commit if no errors have occured, otherwise it will
-rollback. Returns true on commit, false on rollback. If the parameter
-$autoComplete is true monitor sql errors and commit and rollback as
-appropriate. Set $autoComplete to false to force rollback even if no SQL error
-detected. Fail a transaction started with StartTrans(). The rollback will only occur
-when CompleteTrans() is called. Check whether smart transaction has failed, eg. returns true if there was an
-error in SQL execution or FailTrans() was called. If not within smart
-transaction, returns false. Begin a transaction. Turns off autoCommit. Returns true if successful. Some
-databases will always return false if transaction support is not available. Any
-open transactions will be rolled back when the connection is closed. Among the
-databases that support transactions are Oracle, PostgreSQL, Interbase, MSSQL,
-certain versions of MySQL, DB2, Informix, Sybase, etc. Note that StartTrans() and CompleteTrans() is a
-superior method of handling transactions, available since ADOdb 3.40. For a
-explanation, see the StartTrans() documentation. You can also use the ADOdb error handler to die
-and rollback your transactions for you transparently. Some buggy database
-extensions are known to commit all outstanding tranasactions, so you might want
-to explicitly do a $DB->RollbackTrans() in your error handler for safety. Since ADOdb 2.50, you are able to detect when you are inside a transaction.
-Check that $connection->transCnt > 0. This variable is incremented whenever
-BeginTrans() is called, and decremented whenever RollbackTrans() or
-CommitTrans() is called. End a transaction successfully. Returns true if successful. If the database
-does not support transactions, will return true also as data is always
-committed. If you pass the parameter $ok=false, the data is rolled back. See example in
-BeginTrans(). End a transaction, rollback all changes. Returns true if successful. If the
-database does not support transactions, will return false as data is never
-rollbacked. SetTransactionMode allows you to pass in the transaction mode to use for all
-subsequent transactions. Note: if you have persistent connections and using
-mssql or mysql, you might have to explicitly reset your transaction mode at the
-beginning of each page request. This is only supported in postgresql, mssql,
-mysql with InnoDB and oci8 currently. For example: Supported values to pass in: You can also pass in database specific values such as 'SNAPSHOT' for mssql
-or 'READ ONLY' for oci8/postgres. See transaction levels for PostgreSQL,
-Oracle,
-MySQL,
-and MS SQL Server.
- GetAssoc($sql,$inputarr=false,$force_array=false,$first2cols=false) Returns an associative array for the given query $sql with optional bind
-parameters in $inputarr. If the number of columns returned is greater to two, a
-2-dimensional array is returned, with the first column of the recordset becomes
-the keys to the rest of the rows. If the columns is equal to two, a 1-dimensional
-array is created, where the the keys directly map to the values (unless
-$force_array is set to true, when an array is created for each value). We have the following data in a recordset: row1: Apple, Fruit, Edible GetAssoc will generate the following 2-dimensional associative array: Apple => array[Fruit, Edible] If the dataset is: row1: Apple, Fruit GetAssoc will generate the following 1-dimensional associative array (with
-$force_array==false): Apple => Fruit The function returns: The associative array, or false if an error occurs. CacheGetAssoc([$secs2cache,] $sql,$inputarr=false,$force_array=false,$first2cols=false) Caching version of GetAssoc function above. GetMedian($table, $field, $where='') Returns the median value of $field for $table. The $where clause is
-optional. If used, make sure the WHERE is included, as in "WHERE name >
-'A'". If an error occurs, false is returned. Since ADOdb 5.06 and PHP
-4.991. Executes the SQL and returns the first field of the first row. The recordset
-and remaining rows are discarded for you automatically. If an error occur,
-false is returned; use ErrorNo() or ErrorMsg() to get the error details. Since
-4.96/5.00, we return null if no records were found. And since 4.991/5.06, you
-can have change the return value if no records are found using the global
-variable $ADODB_GETONE_EOF: $ADODB_GETONE_EOF = false; Executes the SQL and returns the first row as an array. The recordset and
-remaining rows are discarded for you automatically. If no records are returned,
-an empty array is returned. If an error occurs, false is returned. Executes the SQL and returns the all the rows as a 2-dimensional array. The
-recordset is discarded for you automatically. If an error occurs, false is
-returned. GetArray is a synonym for GetAll. GetCol($sql,$inputarr=false,$trim=false) Executes the SQL and returns all elements of the first column as a
-1-dimensional array. The recordset is discarded for you automatically. If an
-error occurs, false is returned. CacheGetOne([$secs2cache,] $sql,$inputarr=false),
-CacheGetRow([$secs2cache,] $sql,$inputarr=false),
-CacheGetAll([$secs2cache,] $sql,$inputarr=false),
-CacheGetCol([$secs2cache,]
-$sql,$inputarr=false,$trim=false) Similar to above Get* functions, except that the recordset is serialized and
-cached in the $ADODB_CACHE_DIR directory for $secs2cache seconds. Good for
-speeding up queries on rarely changing data. Note that the $secs2cache
-parameter is optional. If omitted, we use the value in
-$connection->cacheSecs (default is 3600 seconds, or 1 hour). Prepares (compiles) an SQL query for repeated execution. Bind parameters are
-denoted by ?, except for the oci8 driver, which uses the traditional Oracle
-:varname convention. Returns an array containing the original sql statement in the first array
-element; the remaining elements of the array are driver dependent. If there is
-an error, or we are emulating Prepare( ), we return the original $sql string.
-This is because all error-handling has been centralized in Execute( ). Prepare( ) cannot be used with functions that use SQL query rewriting
-techniques, e.g. PageExecute( ) and SelectLimit( ). Example: Also see InParameter(), OutParameter() and PrepareSP() below. Only supported
-internally by interbase, oci8 and selected ODBC-based drivers, otherwise it is
-emulated. There is no performance advantage to using Prepare() with emulation. Important: Due to limitations or bugs in PHP, if you are getting errors when
-you using prepared queries, try setting $ADODB_COUNTRECS = false before
-preparing. This behaviour has been observed with ODBC. IfNull($field, $nullReplacementValue) Portable IFNULL function (NVL in Oracle). Returns a string that represents
-the function that checks whether a $field is null for the given database, and
-if null, change the value returned to $nullReplacementValue. Eg. This is not a function, but a property. Some databases have
-"length" and others "len" as the function to measure the
-length of a string. To use this property: This is not a function, but a property. This is a string that holds the sql
-to generate a random number between 0.0 and 1.0 inclusive. This is not a function, but a property. Some databases have
-"substr" and others "substring" as the function to retrieve
-a sub-string. To use this property: For all databases, the 1st parameter of substr is the field, the 2nd
-is the offset (1-based) to the beginning of the sub-string, and the 3rd is the
-length of the sub-string. Generates a bind placeholder portably. For most databases, the bind
-placeholder is "?". However some databases use named bind parameters
-such as Oracle, eg ":somevar". This allows us to portably define an
-SQL statement with bind parameters: PrepareSP($sql, $cursor=false ) When calling stored procedures in mssql and oci8 (oracle), and you might
-want to directly bind to parameters that return values, or for special LOB
-handling. PrepareSP() allows you to do so. Returns the same array or $sql string as Prepare( ) above. If you do not
-need to bind to return values, you should use Prepare( ) instead. The 2nd parameter, $cursor is not used except with oci8. Setting it to true
-will force OCINewCursor to be called; this is to support output REF CURSORs. For examples of usage of PrepareSP( ), see InParameter( ) below. Note: in the mssql driver, preparing stored procedures requires a special
-function call, mssql_init( ), which is called by this function. PrepareSP( ) is
-available in all other drivers, and is emulated by calling Prepare( ). InParameter($stmt, $var, $name, $maxLen = 4000,
-$type = false ) Binds a PHP variable as input to a stored procedure
-variable. The parameter $stmt is the value returned by PrepareSP(), $var
-is the PHP variable you want to bind, $name is the name of the stored procedure
-variable. Optional is $maxLen, the maximum length of the data to bind,
-and $type which is database dependant. Consult mssql_bind and ocibindbyname docs at php.net for more
-info on legal values for $type. InParameter() is a wrapper function that calls Parameter() with
-$isOutput=false. The advantage of this function is that it is self-documenting,
-because the $isOutput parameter is no longer needed. Only for mssql and oci8
-currently. Here is an example using oci8: The same example using mssql: Note that the only difference between the oci8 and mssql implementations is
-$sql. If $type parameter is set to false, in mssql, $type will be dynamicly
-determined based on the type of the PHP variable passed (string => SQLCHAR, boolean =>SQLINT1, integer
-=>SQLINT4 or float/double=>SQLFLT8). In oci8, $type can be set to OCI_B_FILE (Binary-File), OCI_B_CFILE
-(Character-File), OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and
-OCI_B_ROWID (ROWID). To pass in a null, use
-$db->Parameter($stmt, $null=null, 'param'). OutParameter($stmt, $var, $name, $maxLen = 4000,
-$type = false ) Binds a PHP variable as output from a stored procedure
-variable. The parameter $stmt is the value returned by PrepareSP(), $var
-is the PHP variable you want to bind, $name is the name of the stored
-procedure variable. Optional is $maxLen, the maximum length of the data
-to bind, and $type which is database dependant. OutParameter() is a wrapper function that calls Parameter() with
-$isOutput=true. The advantage of this function is that it is self-documenting,
-because the $isOutput parameter is no longer needed. Only for mssql and oci8
-currently. For an example, see InParameter. Parameter($stmt, $var, $name, $isOutput=false,
-$maxLen = 4000, $type = false ) Note: This function is deprecated, because of the new InParameter() and
-OutParameter() functions. These are superior because they are self-documenting,
-unlike Parameter(). Adds a bind parameter suitable for return values or special data handling
-(eg. LOBs) after a statement has been prepared using PrepareSP(). Only for
-mssql and oci8 currently. The parameters are: Lastly, in oci8, bind parameters can be reused without calling PrepareSP( ) or
-Parameters again. This is not possible with mssql. An oci8 example: Bind($stmt, $var, $size=4001, $type=false, $name=false) This is a low-level function supported only by the oci8 driver. Avoid
-using unless you only want to support Oracle. The Parameter( ) function is
-the recommended way to go with bind variables. Bind( ) allows you to use bind variables in your sql statement. This binds a
-PHP variable to a name defined in an Oracle sql statement that was previously
-prepared using Prepare(). Oracle named variables begin with a colon, and ADOdb
-requires the named variables be called :0, :1, :2, :3, etc. The first
-invocation of Bind() will match :0, the second invocation will match :1, etc.
-Binding can provide 100% speedups for insert, select and update statements. The other variables, $size sets the buffer size for data storage, $type is
-the optional descriptor type OCI_B_FILE (Binary-File), OCI_B_CFILE
-(Character-File), OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and
-OCI_B_ROWID (ROWID). Lastly, instead of using the default :0, :1, etc names,
-you can define your own bind-name using $name. The following example shows 3 bind variables being used: p1, p2 and p3.
-These variables are bound to :0, :1 and :2. You can also use named variables: Call this method to install a SQL logging and timing
-function (using fnExecute). Then all SQL statements are logged into an
-adodb_logsql table in a database. If the adodb_logsql table does not exist,
-ADOdb will create the table if you have the appropriate permissions. Returns
-the previous logging value (true for enabled, false for disabled). Here are
-samples of the DDL for selected databases: Usage: One limitation of logging is that rollback also prevents SQL from being
-logged. If you prefer to use another name for the table used to store the SQL, you
-can override it by calling adodb_perf::table($tablename), where $tablename is
-the new table name (you will still need to manually create the table yourself).
-An example: Also see Performance Monitor. fnExecute and fnCacheExecute properties These two properties allow you to define bottleneck functions for all sql
-statements processed by ADOdb. This allows you to perform statistical analysis
-and query-rewriting of your sql. Examples of fnExecute Here is an example of using fnExecute, to count all cached queries and
-non-cached queries, you can do this: The fnExecute function is called before the sql is parsed and executed, so
-you can perform a query rewrite. If you are passing in a prepared statement,
-then $sql is an array (see Prepare). The fnCacheExecute
-function is only called if the recordset returned was cached. The function
-parameters match the Execute and CacheExecute functions respectively, except
-that $this (the connection object) is passed as the first parameter. Since ADOdb 3.91, the behaviour of fnExecute varies depending on whether the
-defined function returns a value. If it does not return a value, then the $sql
-is executed as before. This is useful for query rewriting or counting sql
-queries. On the other hand, you might want to replace the Execute function with one
-of your own design. If this is the case, then have your function return a
-value. If a value is returned, that value is returned immediately, without any
-further processing. This is used internally by ADOdb to implement LogSQL()
-functionality. No longer available - removed since 1.99. Generates the sql string used to concatenate $s1, $s2, etc together. Uses
-the string in the concat_operator field to generate the concatenation. Override
-this function if a concatenation operator is not used, eg. MySQL. Returns the concatenated string. Format the $date in the format the database accepts - the return
-string is also quoted. This is used when you are sending dates to the database
-(eg INSERT, UPDATE or where clause of SELECT statement). The $date
-parameter can be a PHP DateTime object (since ADOdb 5.09), a Unix integer timestamp or an ISO format Y-m-d. Uses the
-fmtDate field, which holds the format to use. If null or false or '' is passed
-in, it will be converted to an SQL null. Returns the date as a quoted string. Note to retrieve a date column in a specific format, use SQLDate.
- Format the $date in the bind format the database accepts. Normally
-this means that the date string is not quoted, unlike DBDate, which quotes the
-string. Format the timestamp $ts in the format the database accepts; this can
-be a PHP DateTime object (since ADOdb 5.09), a Unix integer timestamp or an ISO format Y-m-d H:i:s. Uses the fmtTimeStamp
-field, which holds the format to use. If null or false or '' is passed in, it
-will be converted to an SQL null. Returns the timestamp as a quoted string. Format the timestamp $ts in the bind format the database accepts.
-Normally this means that the timestamp string is not quoted, unlike
-DBTimeStamp, which quotes the string. qstr($s,[$magic_quotes_enabled=false]) Quotes a string to be sent to the database. The $magic_quotes_enabled
-parameter may look funny, but the idea is if you are quoting a string extracted
-from a POST/GET variable, then pass get_magic_quotes_gpc() as the second
-parameter. This will ensure that the variable is not quoted twice, once by qstr
-and once by the magic_quotes_gpc. Eg. $s = $db->qstr(HTTP_GET_VARS['name'],get_magic_quotes_gpc()); Returns the quoted string. Quotes the string $s, escaping the database specific quote character as
-appropriate. Formerly checked magic quotes setting, but this was disabled since
-3.31 for compatibility with PEAR DB. Returns the number of rows affected by a update or delete statement. Returns
-false if function not supported. Not supported by interbase/firebird currently. Returns the last autonumbering ID inserted. Returns false if function not
-supported. Only supported by databases that support auto-increment or object id's, such
-as PostgreSQL, MySQL and MS SQL Server currently. PostgreSQL returns the OID,
-which can change on a database reload. Lock a table row for the duration of a transaction. For example to lock
-record $id in table1: Supported in db2, interbase, informix, mssql, oci8, postgres, sybase. Returns a list of databases available on the server as an array. You have to
-connect to the server first. Only available for ODBC, MySQL and ADO. MetaTables($ttype = false, $showSchema = false,
-$mask=false) Returns an array of tables and views for the current database as an array.
-The array should exclude system catalog tables if possible. To only show
-tables, use $db->MetaTables('TABLES'). To show only views, use
-$db->MetaTables('VIEWS'). The $showSchema parameter currently works only for
-DB2, and when set to true, will add the schema name to the table, eg.
-"SCHEMA.TABLE". You can define a mask for matching. For example, setting $mask = 'TMP%' will
-match all tables that begin with 'TMP'. Currently only mssql, oci8, odbc_mssql
-and postgres* support $mask. MetaColumns($table,$notcasesensitive=true) Returns an array of ADOFieldObject's, one field object for every column of
-$table. A field object is a class instance with (name, type, max_length)
-defined. Currently Sybase does not recognise date types, and ADO cannot
-identify the correct data type (so we default to varchar). The $notcasesensitive parameter determines whether we uppercase or lowercase
-the table name to normalize it (required for some databases). Does not work
-with MySQL ISAM tables. For schema support, pass in the $table parameter,
-"$schema.$tablename". This is only supported for selected databases. MetaColumnNames($table,$numericIndex=false) Returns an array of column names for $table. Since ADOdb 4.22, this is an
-associative array, with the keys in uppercase. Set $numericIndex=true if you
-want the old behaviour of numeric indexes (since 4.23). e.g. array('FIELD1' => 'Field1', 'FIELD2'=>'Field2') MetaPrimaryKeys($table, $owner=false) Returns an array containing column names that are the primary keys of
-$table. Supported by mysql, odbc (including db2, odbc_mssql, etc), mssql,
-postgres, interbase/firebird, oci8 currently. Views (and some tables) have primary keys, but sometimes this information is
-not available from the database. You can define a function
-ADODB_View_PrimaryKeys($databaseType, $database, $view, $owner) that should
-return an array containing the fields that make up the primary key. If that
-function exists, it will be called when MetaPrimaryKeys() cannot find a primary
-key for a table or view. Returns an array of containing two elements 'description' and 'version'. The
-'description' element contains the string description of the database. The
-'version' naturally holds the version number (which is also a string). MetaForeignKeys($table, $owner=false,
-$upper=false) Returns an associate array of foreign keys, or false if not supported. For
-example, if table profile has a foreign key where profile.deptkey points to
-dept_table.deptid, and profile.posn=posn_table.postionid and
-profile.poscategory=posn_table.category, then
-$conn->MetaForeignKeys('profile') will return The optional schema or owner can be defined in $owner. If $upper is true,
-then the table names (array keys) are upper-cased. When an SQL statement successfully is executed by ADOConnection->Execute($sql),an ADORecordSet object is
-returned. This object contains a virtual cursor so we can move from row to row,
-functions to obtain information about the columns and column types, and helper
-functions to deal with formating the results to show to the user. fields: Array containing the current row. This is not associative,
-but is an indexed array from 0 to columns-1. See also the function Fields, which behaves like an associative array. dataProvider: The underlying mechanism used to connect to the
-database. Normally set to native, unless using odbc or ado. blobSize: Maximum size of a char, string or varchar object before it
-is treated as a Blob (Blob's should be shown with textarea's). See the MetaType function. sql: Holds the sql statement used to generate this record set. canSeek: Set to true if Move( ) function works. EOF: True if we have scrolled the cursor past the last record. ADORecordSet( ) Constructer. Normally you never call this function yourself. Generates an associative array from the recordset. Note that is this
-function is also available in the connection object.
-More details can be found there. Generate a 2-dimensional array of records from the current cursor position,
-indexed from 0 to $number_of_rows - 1. If $number_of_rows is undefined, till
-EOF. Generate a 2-dimensional array of records from the current
-cursor position. Synonym for GetArray() for compatibility with Microsoft ADO. GetMenu($name, [$default_str=''],
-[$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr='']) Generate a HTML menu
-(<select><option><option></select>). The first column
-of the recordset (fields[0]) will hold the string to display in the option
-tags. If the recordset has more than 1 column, the second column (fields[1]) is
-the value to send back to the web server.. The menu will be given the name $name.
- If $default_str is defined, then if $default_str == fields[0],
-that field is selected. If $blank1stItem is true, the first option is
-empty. You can also set the first option strings by setting $blank1stItem =
-"$value:$text". $Default_str can be array for a multiple select listbox. To get a listbox, set the $size to a non-zero value (or pass
-$default_str as an array). If $multiple_select is true then a listbox
-will be generated with $size items (or if $size==0, then 5 items)
-visible, and we will return an array to a server. Lastly use $moreAttr to
-add additional attributes such as javascript or styles. Menu Example 1: Menu Example 2: For the same data, GetMenu2($name, [$default_str=''],
-[$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr='']) This is nearly identical to GetMenu, except that the $default_str is
-matched to fields[1] (the option values). Menu Example 3: Given the data in menu example 2, Converts the date string $str to another format. The date format is
-Y-m-d, or Unix timestamp format. The default $fmt is Y-m-d. Converts the timestamp string $str to another format. The timestamp
-format is Y-m-d H:i:s, as in '2002-02-28 23:00:12', or Unix timestamp format.
-UserTimeStamp calls UnixTimeStamp to parse $str, and $fmt
-defaults to Y-m-d H:i:s if not defined. Parses the date string $str and returns it in unix mktime format (eg.
-a number indicating the seconds after January 1st, 1970). Expects the date to
-be in Y-m-d H:i:s format, except for Sybase and Microsoft SQL Server, where M d
-Y is also accepted (the 3 letter month strings are controlled by a global
-array, which might need localisation). This function is available in both ADORecordSet and ADOConnection since
-1.91. Parses the timestamp string $str and returns it in unix mktime format
-(eg. a number indicating the seconds after January 1st, 1970). Expects the date
-to be in "Y-m-d, H:i:s" (1970-12-24, 00:00:00) or "Y-m-d
-H:i:s" (1970-12-24 00:00:00) or "YmdHis" (19701225000000)
-format, except for Sybase and Microsoft SQL Server, where "M d Y
-h:i:sA" (Dec 25 1970 00:00:00AM) is also accepted (the 3 letter month
-strings are controlled by a global array, which might need localisation). This function is available in both ADORecordSet and ADOConnection since
-1.91. OffsetDate($dayFraction, $basedate=false) Returns a string with the native SQL functions to calculate future and past
-dates based on $basedate in a portable fashion. If $basedate is not defined,
-then the current date (at 12 midnight) is used. Returns the SQL string that
-performs the calculation when passed to Execute(). For example, in Oracle, to find the date and time that is 2.5 days from
-today, you can use: This function is available for mysql, mssql, oracle, oci8 and postgresql
-drivers since 2.13. It might work with other drivers provided they allow
-performing numeric day arithmetic on dates. SQLDate($dateFormat, $basedate=false) Returns a string which contains the native SQL functions to
-format a date or date column $basedate. This is used when retrieving date
-columns in SELECT statements. For sending dates to the database (eg. in UPDATE,
-INSERT or the where clause of SELECT statements) use DBDate.
-It uses a case-sensitive $dateFormat, which supports: All other characters are treated as strings. You can also use \ to escape
-characters. Available on selected databases, including mysql, postgresql,
-mssql, oci8 and DB2. This is useful in writing portable sql statements that GROUP BY on dates.
-For example to display total cost of goods sold broken by quarter (dates are
-stored in a field called postdate): Move the internal cursor to the next row. The $this->fields array
-is automatically updated. Returns false if unable to do so (normally because
-EOF has been reached), otherwise true. If EOF is reached, then the $this->fields array is set to false (this was
-only implemented consistently in ADOdb 3.30). For the pre-3.30 behaviour of
-$this->fields (at EOF), set the global variable $ADODB_COMPAT_FETCH = true. Example: Moves the internal cursor to a specific row $to. Rows are zero-based
-eg. 0 is the first row. The fields array is automatically updated. For
-databases that do not support scrolling internally, ADOdb will simulate forward
-scrolling. Some databases do not support backward scrolling. If the $to
-position is after the EOF, $to will move to the end of the RecordSet for
-most databases. Some obscure databases using odbc might not behave this way. Note: This function uses absolute positioning, unlike Microsoft's
-ADO. Returns true or false. If false, the internal cursor is not moved in most
-implementations, so AbsolutePosition( ) will return the last cursor position
-before the Move( ). Internally calls Move(0). Note that some databases do not support this function. Internally calls Move(RecordCount()-1). Note that some databases do not
-support this function. Returns an associative array containing the current row. The keys to the
-array are the column names. The column names are upper-cased for easy access.
-To get the next row, you will still need to call MoveNext(). For example: Note: do not use GetRowAssoc() with $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC.
-Because they have the same functionality, they will interfere with each other. Returns the current page. Requires PageExecute()/CachePageExecute() to be
-called. See Example 8. AtFirstPage($status='') Returns true if at first page (1-based). Requires
-PageExecute()/CachePageExecute() to be called. See Example 8. AtLastPage($status='') Returns true if at last page (1-based). Requires
-PageExecute()/CachePageExecute() to be called. See Example 8. Returns the value of the associated column $colname for the current
-row. The column name is case-insensitive. This is a convenience function. For higher performance, use $ADODB_FETCH_MODE. Returns array containing current row, or false if EOF. FetchRow( )
-internally moves to the next record after returning the current row. Warning: Do not mix using FetchRow() with MoveNext(). Usage: Sets $array to the current row. Returns PEAR_Error object if EOF, 1 if ok
-(DB_OK constant). If PEAR is undefined, false is returned when EOF. FetchInto(
-) internally moves to the next record after returning the current row. FetchRow() is easier to use. See above. Returns an object containing the name, type and max_length
-of the associated field. If the max_length cannot be determined reliably, it
-will be set to -1. The column numbers are zero-based. See example
-2. Returns the number of fields (columns) in the record set. Returns the number of rows in the record set. If the number of records
-returned cannot be determined from the database driver API, we will buffer all
-rows and return a count of the rows after all the records have been retrieved.
-This buffering can be disabled (for performance reasons) by setting the global
-variable $ADODB_COUNTRECS = false. When disabled, RecordCount( ) will return -1
-for certain databases. See the supported databases list above for more details.
- RowCount is a synonym for RecordCount. PO_RecordCount($table, $where) Returns the number of rows in the record set. If the database does not
-support this, it will perform a SELECT COUNT(*) on the table $table, with the
-given $where condition to return an estimate of the recordset size. $numrows = $rs->PO_RecordCount("articles_table",
-"group=$group"); For databases that allow multiple recordsets to be returned in one query,
-this function allows you to switch to the next recordset. Currently only
-supported by mssql driver. Returns the current row as an object. If you set $toupper to true, then the
-object fields are set to upper-case. Note: The newer FetchNextObject() is the
-recommended way of accessing rows as objects. See below. FetchNextObject($toupper=true) Gets the current row as an object and moves to the next row automatically.
-Returns false if at end-of-file. If you set $toupper to true, then the object
-fields are set to upper-case. Note that for some drivers such as mssql, you
-need to SetFetchMode(ADODB_FETCH_ASSOC) or SetFetchMode(ADODB_FETCH_BOTH). There is some trade-off in speed in using FetchNextObject(). If performance
-is important, you should access rows with the Returns the current record as an object. Fields are not upper-cased, unlike
-FetchObject. Returns the current record as an object and moves to the next record. If
-EOF, false is returned. Fields are not upper-cased, unlike FetctNextObject. Returns the current row of the record set. 0 is the first row. Synonym for CurrentRow for compatibility with ADO. Returns the
-current row of the record set. 0 is the first row. MetaType($nativeDBType[,$field_max_length],[$fieldobj]) Determine what generic meta type a database field type is given its
-native type $nativeDBType as a string and the length of the field $field_max_length.
-Note that field_max_length can be -1 if it is not known. The field object
-returned by FetchField() can be passed in $fieldobj or as the 1st
-parameter $nativeDBType. This is useful for databases such as mysql
-which has additional properties in the field object such as primary_key.
- Uses the field blobSize and compares it with $field_max_length
-to determine whether the character field is actually a blob. For example, $db->MetaType('char') will return 'C'. Returns: Since ADOdb 3.0, MetaType accepts $fieldobj as the first parameter, instead
-of $nativeDBType. Closes the recordset, cleaning all memory and resources associated with the
-recordset. If memory management is not an issue, you do not need to call this function
-as recordsets are closed for you by PHP at the end of the script. SQL
-statements such as INSERT/UPDATE/DELETE do not really return a recordset, so you
-do not have to call Close() for such SQL statements. This is a standalone function (rs2html = recordset to html) that is similar
-to PHP's odbc_result_all function, it prints a ADORecordSet, $adorecordset
-as a HTML table. $tableheader_attributes allow you to control the table cellpadding,
-cellspacing and border attributes. Lastly you can replace the
-database column names with your own column titles with the array $col_titles.
-This is designed more as a quick debugging mechanism, not a production table
-recordset viewer. You will need to include the file tohtml.inc.php. This describes how to create a class to connect to a new database. To ensure
-there is no duplication of work, kindly email me at jlim#natsoft.com if you
-decide to create such a class. First decide on a name in lower case to call the database type. Let's say we
-call it xbase. Then we need to create two classes ADODB_xbase and ADORecordSet_xbase in the
-file adodb-xbase.inc.php. The simplest form of database driver is an adaptation of an existing ODBC
-driver. Then we just need to create the class ADODB_xbase extends ADODB_odbc
-to support the new date and timestamp formats, the concatenation
-operator used, true and false. For the ADORecordSet_xbase
-extends ADORecordSet_odbc we need to change the MetaType function.
-See adodb-vfp.inc.php as an example. More complicated is a totally new database driver that connects to a new PHP
-extension. Then you will need to implement several functions. Fortunately, you
-do not have to modify most of the complex code. You only need to override a few
-stub functions. See adodb-mysql.inc.php for example. The default date format of ADOdb internally is YYYY-MM-DD (Ansi-92). All
-dates should be converted to that format when passing to an ADOdb date
-function. See Oracle for an example how we use ALTER SESSION to change the
-default date format in _pconnect _connect. ADOConnection Functions to Override Defining a constructor for your ADOConnection derived function is optional.
-There is no need to call the base class constructor. _connect: Low level implementation of Connect. Returns true or false.
-Should set the _connectionID. _pconnect: Low level implemention of PConnect. Returns true or false.
-Should set the _connectionID. _query: Execute a query. Returns the queryID, or false. _close: Close the connection -- PHP should clean up all recordsets. ErrorMsg: Stores the error message in the private variable _errorMsg.
- ADOConnection Fields to Set _bindInputArray: Set to true if binding of parameters for SQL inserts
-and updates is allowed using ?, eg. as with ODBC. fmtDate fmtTimeStamp true false concat_operator replaceQuote hasLimit support SELECT * FROM TABLE LIMIT 10 of MySQL. hasTop support Microsoft style SELECT TOP 10 * FROM TABLE. ADORecordSet Functions to Override You will need to define a constructor for your ADORecordSet derived class
-that calls the parent class constructor. FetchField: as documented above in ADORecordSet _initrs: low level initialization of the recordset: setup the _numOfRows
-and _numOfFields fields -- called by the constructor. _seek: seek to a particular row. Do not load the data into the fields
-array. This is done by _fetch. Returns true or false. Note that some
-implementations such as Interbase do not support seek. Set canSeek to false. _fetch: fetch a row using the database extension function and then
-move to the next row. Sets the fields array. If the parameter
-$ignore_fields is true then there is no need to populate the fields
-array, just move to the next row. then Returns true or false. _close: close the recordset Fields: If the array row returned by the PHP extension is not an
-associative one, you will have to override this. See adodb-odbc.inc.php for an
-example. For databases such as MySQL and MSSQL where an associative array is
-returned, there is no need to override this function. ADOConnection Fields to Set canSeek: Set to true if the _seek function works. For info on tuning PHP, read this article on Optimizing
-PHP. mysql: Fixed GetOne() to return null if no records returned.
- oci8 perf: added stats on sga, rman, memory usage, and flash in performance tab.
- odbtp: Now you can define password in $password field of Connect()/PConnect(), and it will add it to DSN.
- Datadict: altering columns did not consider the scale of the column. Now it does.
- mssql: Fixed problem with ADODB_CASE_ASSOC causing multiple versions of column name appearing in recordset fields.
- oci8: Added missing & to refLob.
- oci8: Added obj->scale to FetchField().
- oci8: Now you can get column info of a table in a different schema, e.g. MetaColumns("schema.table") is supported.
- odbc_mssql: Fixed missing $metaDatabasesSQL.
- xmlschema: Changed declaration of create() to create($xmls) to fix compat problems. Also changed constructor adoSchema() to pass in variable instead of variable reference.
- ado5: Fixed ado5 exceptions to only display errors when $this->debug=true;
- Added DSN support to sessions2.inc.php.
- adodb-lib.inc.php. Fixed issue with _adodb_getcount() not using $secs2cache parameter.
- adodb active record. Fixed caching bug. See http://phplens.com/lens/lensforum/msgs.php?id=18288.
- db2: fixed ServerInfo().
- adodb_date: Added support for format 'e' for TZ as in adodb_date('e')
- Active Record: If you have a field which is a string field (with numbers in) and you add preceding 0's to it the adodb library does not pick up the fact that the field has changed because of the way php's == works (dodgily). The end result is that it never gets updated into the database - fix by Matthew Forrester (MediaEquals). [matthew.forrester#mediaequals.com]
-
- Fixes RowLock() and MetaIndexes() inconsistencies. See http://phplens.com/lens/lensforum/msgs.php?id=18236
- Active record support for postgrseql boolean. See http://phplens.com/lens/lensforum/msgs.php?id=18246
- By default, Execute 2D array is disabled for security reasons. Set $conn->bulkBind = true to enable. See http://phplens.com/lens/lensforum/msgs.php?id=18270. Note this breaks backward compat.
- MSSQL: fixes for 5.2 compat. http://phplens.com/lens/lensforum/msgs.php?id=18325
- Changed Version() to return a string instead of a float so it correctly returns 5.10 instead of 5.1.
-
- Fixed memcache to properly support $rs->timeCreated.
- adodb-ado.inc.php: Added BigInt support for PHP5. Will return float instead to support large numbers. Thx nasb#mail.goo.ne.jp.
- adodb-mysqli.inc.php: mysqli_multi_query is now turned off by default. To turn it on, use $conn->multiQuery = true; This is because of the risks of sql injection. See http://phplens.com/lens/lensforum/msgs.php?id=18144
- New db2oci driver for db2 9.7 when using PL/SQL mode. Allows oracle style :0, :1, :2 bind parameters which are remapped to ? ? ?.
- adodb-db2.inc.php: fixed bugs in MetaTables. SYS owner field not checked properly. Also in $conn->Connect($dsn, null, null, $schema) and PConnect($dsn, null, null, $schema), we do a SET SCHEMA=$schema if successful connection.
- adodb-mysqli.inc.php: Now $rs->Close() closes all pending next resultsets. Thx Clifton mesmackgod#gmail.com
- Moved _CreateCache() from PConnect()/Connect() to CacheExecute(). Suggested by Dumka.
- Many bug fixes to adodb-pdo_sqlite.inc.php and new datadict-sqlite.inc.php. Thx Andrei B. [andreutz#mymail.ro]
- Removed usage of split (deprecated in php 5.3). Thx david#horizon-nigh.org.
- Fixed RowLock() parameters to comply with PHP5 strict mode in multiple drivers.
-
- Active Record: You can force column names to be quoted in INSERT and UPDATE statements, typically because you are using reserved words as column names by setting
-ADODB_Active_Record::$_quoteNames = true;
- Added memcache and cachesecs to DSN. e.g.
- Fixed up MetaColumns and MetaPrimaryIndexes() for php 5.3 compat. Thx http://adodb.pastebin.com/m52082b16
- The postgresql driver's OffsetDate() apparently does not work with postgres 8.3. Fixed.
- Added support for magic_quotes_sybase in qstr() and addq(). Thanks Eloy and Sam Moffat.
- The oci8 driver did not handle LOBs properly when binding. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=17991.
- Datadict: In order to support TIMESTAMP with subsecond accuracy, added to datadict the new TS type. Supported by mssql, postgresql and oci8 (oracle).
-Also changed oci8 $conn->sysTimeStamp to use 'SYSTIMESTAMP' instead of 'SYSDATE'. Should be backwards compat.
- Added support for PHP 5.1+ DateTime objects in DBDate and DBTimeStamp. This means that dates and timestamps will be managed by DateTime objects if you are running PHP 5.1+.
- Added new property to postgres64 driver to support returning I if type is unique int called $db->uniqueIisR, defaulting to true. See http://phplens.com/lens/lensforum/msgs.php?id=17963
- Added support for bindarray in adodb_GetActiveRecordsClass with SelectLimit in adodb-active-record.inc.php.
- Transactions now allowed in ado_access driver. Thx to petar.petrov.georgiev#gmail.com.
- Sessions2 garbage collection is now much more robust. We perform ORDER BY to prevent deadlock in adodb-sessions2.inc.php.
- Fixed typo in pdo_sqlite driver.
-
- Fixes wrong version number string.
- Incorrect + in adodb-datadict.inc.php removed.
- Fixes missing OffsetDate() function in pdo. Thx paul#mantisforge.org.
-
- adodb-sybase.inc.php driver. Added $conn->charSet support. Thx Luis Henrique Mulinari (luis.mulinari#gmail.com)
- adodb-ado5.inc.php. Fixed some bind param issues. Thx Jirka Novak.
- adodb-ado5.inc.php. Now has improved error handling.
- Fixed typo in adodb-xmlschema03.inc.php. See XMLS_EXISTING_DATA, line 1501. Thx james johnson.
- Made $inputarr optional for _query() in all drivers.
- Fixed spelling mistake in flushall() in adodb.inc.ophp.
- Fixed handling of quotes in adodb_active_record::doquote. Thx Jonathan Hohle (jhohle#godaddy.com).
- Added new index parameter to adodb_active_record::setdatabaseadaptor. Thx Jonathan Hohle
- Fixed & readcache() reference compat problem with php 5.3 in adodb.Thx Jonathan Hohle.
- Some minor $ADODB_CACHE_CLASS definition issues in adodb.inc.php.
- Added Reset() function to adodb_active_record. Thx marcus.
- Minor dsn fix for pdo_sqlite in adodb.inc.php. Thx Sergey Chvalyuk.
- Fixed adodb-datadict _CreateSuffix() inconsistencies. Thx Chris Miller.
- Option to delete old fields $dropOldFlds in datadict ChangeTableSQL($table, $flds, $tableOptions, $dropOldFlds=false) added. Thx Philipp Niethammer.
- Memcache caching did not expire properly. Fixed.
- MetaForeignKeys for postgres7 driver changed from adodb_movenext to $rs->MoveNext (also in 4.99)
- Added support for ldap and ldaps url format in ldap driver. E.g. ldap://host:port/dn?attributes?scope?filter?extensions
- BeginTrans/CommitTrans/RollbackTrans return true/false correctly on
-success/failure now for mssql, odbc, oci8, mysqlt, mysqli, postgres, pdo. Replace() now quotes all non-null values including numeric ones. Postgresql qstr() now returns booleans as true and false
-without quotes. MetaForeignKeys in mysql and mysqli drivers had this problem: A table can
-have two foreign keys pointing to the same column in the same table. The
-original code will incorrectly report only the last column. Fixed.
-https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
- Passing in full ado connection string in $argHostname with ado drivers was
-failing in adodb5 due to bug. Fixed. Fixed memcachelib flushcache and flushall bugs. Also fixed possible
-timeCreated = 0 problem in readcache. (Also in adodb 4.992). Thanks AlexB_UK
-(alexbarnes#hotmail.com). Fixed a notice in adodb-sessions2.inc.php, in _conn(). Thx bober
-m.derlukiewicz#rocktech.remove_me.pl; ADOdb Active Record: Fixed some issues with incompatible fetch modes
-(ADODB_FETCH_ASSOC) causing problems in UpdateActiveTable(). ADOdb Active Record: Added support for functions that support predefining
-one-to-many relationships: ADOdb Active Record: HasMany hardcoded primary key to "id". Fixed.
- Many pdo and pdo-sqlite fixes from Sid Dunayer [sdunayer#interserv.com]. CacheSelectLimit not working for mssql. Fixed. Thx AlexB. The rs2html function did not display hours in timestamps correctly. Now 24hr
-clock used. Changed ereg* functions to use preg* functions as ereg* is deprecated in PHP 5.3. Modified sybase and postgresql drivers. Added driver adodb-pdo_sqlite.inc.php. Thanks Diogo Toscano
-(diogo#scriptcase.net) for the code. Added support for one-to-many relationships
-with BelongsTo() and HasMany() in adodb_active_record. Added BINARY type to mysql.inc.php (also in 4.991). Added support for SelectLimit($sql,-1,100) in oci8. (also in 4.991). New $conn->GetMedian($table, $field, $where='') to get median account no.
-(also in 4.991) The rs2html() function in tohtml.inc.php did not handle dates with ':' in it
-properly. Fixed. (also in 4.991) Added support for connecting to oci8 using $DB->Connect($ip, $user, $pwd,
-"SID=$sid"); (also in 4.991) Added mysql type 'VAR_STRING' to MetaType(). (also in 4.991) The session and session2 code supports setfetchmode assoc properly now (also
-in 4.991). Added concat support to pdo. Thx Andrea Baron. Changed db2 driver to use format "Y-m-d H-i-s" for datetime
-instead of "Y-m-d-H-i-s" which was legacy from odbc_db2 conversion. Removed vestigal break on adodb_tz_offset in adodb-time.inc.php. MetaForeignKeys did not work for views in MySQL 5. Fixed. Changed error handling in GetActiveRecordsClass. Added better support for using existing driver when $ADODB_NEWCONNECTION
-function returns false. In _CreateSuffix in adodb-datadict.inc.php, adding unsigned variable for
-mysql. In adodb-xmlschema03.inc.php, changed addTableOpt to include db name. If bytea blob in postgresql is null, empty string was formerly returned. Now
-null is returned. Changed db2 driver CreateSequence to support $start parameter. rs2html() now does not add nbsp to end if length of string > 0 The oci8po FetchField() now only lowercases field names if ADODB_ASSOC_CASE
-is set to 0. New mssqlnative drivers for php. TQ Garrett Serack of M'soft. Download
-mssqlnative extension. Note that this is still in beta. Fixed bugs in memcache support. You can now change the return value of GetOne if no records are found using
-the global variable $ADODB_GETONE_EOF. The default is null. To change it back
-to the pre-4.99/5.00 behaviour of false, set $ADODB_GETONE_EOF = false; In Postgresql 8.2/8.3 MetaForeignkeys did not work. Fixed William Kolodny
-William.Kolodny#gt-t.net Added support for multiple recordsets in mysqli "Geisel Sierote"
-geisel#4up.com.br. See http://phplens.com/lens/lensforum/msgs.php?id=15917 Malcolm Cook added new Reload() function to Active Record. See
-http://phplens.com/lens/lensforum/msgs.php?id=17474 Thanks Zoltan Monori [monzol#fotoprizma.hu] for bug fixes in iterator,
-SelectLimit, GetRandRow, etc. Under heavy loads, the performance monitor for oci8 disables Ixora views. Fixed sybase driver SQLDate to use str_replace(). Also for adodb5, changed
-sybase driver UnixDate and UnixTimeStamp calls to static. Changed oci8 lob handler to use & reference
-$this->_refLOBs[$numlob]['VAR'] = &$var. We now strtolower the get_class() function in PEAR::isError() for php5
-compat. CacheExecute did not retrieve cache recordsets properly for 5.04 (worked in
-4.98). Fixed. New ADODB_Cache_File class for file caching defined in adodb.inc.php. Farsi language file contribution by Peyman Hooshmandi Raad
-(phooshmand#gmail.com) New API for creating your custom caching class which is stored in
-$ADODB_CACHE: Memcache supports multiple pooled hosts now. Only if none of the pooled
-servers can be contacted will a connect error be generated. Usage example
-below: Fixed adodb_mktime problem which causes a performance bottleneck in $hrs. Added mysqli support to adodb_getcount(). Removed MYSQLI_TYPE_CHAR from MetaType(). Active Record: $ADODB_ASSOC_CASE=1 did not work properly. Fixed. Modified Fields() in recordset class to support display null fields in
-FetchNextObject(). In ADOdb5, active record implementation, we now support column names with
-spaces in them - we autoconvert the spaces to _ using __set(). Thx Daniel Cook.
-http://phplens.com/lens/lensforum/msgs.php?id=17200 Removed $arg3 from mysqli SelectLimit. See
-http://phplens.com/lens/lensforum/msgs.php?id=16243. Thx Zsolt Szeberenyi. Changed oci8 FetchField, which returns the max_length of BLOB/CLOB/NCLOB as
-4000 (incorrectly) to -1. CacheExecute would sometimes return an error on Windows if it was unable to
-lock the cache file. This is harmless and has been changed to a warning that
-can be ignored. Also adodb_write_file() code revised. ADOdb perf code changed to only log sql if execution time >= 0.05
-seconds. New $ADODB_PERF_MIN variable holds min sql timing. Any SQL with timing
-value below this and is not causing an error is not logged. Also adodb_backtrace() now traces 1 level deeper as sometimes actual culprit
-function is not displayed. Fixed a group by problem with adodb_getcount() for db's which are not
-postgres/oci8 based. Changed mssql driver Parameter() from SQLCHAR to SQLVARCHAR: case 'string':
-$type = SQLVARCHAR; break. Problem with mssql driver in php5 (for adodb 5.03) because some functions
-are not static. Fixed. ADOdb perf for oci8 now has non-table-locking code when clearing the sql.
-Slower but better transparency. Added in 4.96a and 5.02a. Fix adodb count optimisation. Preg_match did not work properly. Also rewrote
-the ORDER BY stripping code in _adodb_getcount(), adodb-lib.inc.php. SelectLimit for oci8 not optimal for large recordsets when offset=0. Changed
-$nrows check. Active record optimizations. Added support for assoc arrays in Set(). Now GetOne returns null if EOF (no records found), and false if error
-occurs. Use ErrorMsg()/ErrorNo() to get the error. Also CacheGetRow and CacheGetCol will return false if error occurs, or empty
-array() if EOF, just like GetRow and GetCol. Datadict now allows changing of types which are not resizable, eg. VARCHAR
-to TEXT in ChangeTableSQL. -- Mateo Tibaquir Added BIT data type support to adodb-ado.inc.php and adodb-ado5.inc.php. Ldap driver did not return actual ldap error messages. Fixed. Implemented GetRandRow($sql, $inputarr). Optimized for Oci8. Changed adodb5 active record to use static SetDatabaseAdapter() and removed
-php4 constructor. Bas van Beek bas.vanbeek#gmail.com. Also in adodb5, changed adodb-session2 to use static function declarations
-in class. Thx Daniel Added "Clear SQL Log" to bottom of Performance screen. Sessions2 code echo'ed directly to the screen in debug mode. Now uses
-ADOConnection::outp(). In mysql/mysqli, qstr(null) will return the string "null" instead
-of empty quoted string "''". postgresql optimizeTable in perf-postgres.inc.php added by Daniel Berlin
-(mail#daniel-berlin.de) Added 5.2.1 compat code for oci8. Changed @@identity to SCOPE_IDENTITY() for multiple mssql drivers. Thx
-Stefano Nari. Code sanitization introduced in 4.95 caused problems in European locales (as
-float 3.2 was typecast to 3,2). Now we only sanitize if is_numeric fails. Added support for customizing ADORecordset_empty using
-$this->rsPrefix.'empty'. By Josh Truwin. Added proper support for ALterColumnSQL for Postgresql in datadict code.
-Thx. Josh Truwin. Added better support for MetaType() in mysqli when using an array recordset.
- Changed parser for pgsql error messages in adodb-error.inc.php to
-case-insensitive regex. CacheFlush debug outp() passed in invalid parameters. Fixed. Added Thai language file for adodb. Thx Trirat Petchsingh rosskouk#gmail.com
-and Marcos Pont Added zerofill checking support to MetaColumns for mysql and mysqli. CacheFlush no longer deletes all files/directories. Only *.cache files
-deleted. DB2 timestamp format changed to var $fmtTimeStamp =
-"'Y-m-d-H:i:s'"; Added some code sanitization to AutoExecute in adodb-lib.inc.php. Due to typo, all connections in adodb-oracle.inc.php would become
-persistent, even non-persistent ones. Fixed. Oci8 DBTimeStamp uses 24 hour time for input now, so you can perform string
-comparisons between 2 DBTimeStamp values. Some PHP4.4 compat issues fixed in adodb-session2.inc.php For ADOdb 5.01, fixed some adodb-datadict.inc.php MetaType compat issues
-with PHP5. The $argHostname was wiped out in adodb-ado5.inc.php. Fixed. Adodb5 version, added iterator support for adodb_recordset_empty. Adodb5 version,more error checking code now will use exceptions if
-available. Active Record: $ADODB_ASSOC_CASE=2 did not work properly. Fixed. Thx
-gmane#auxbuss.com. mysqli had bugs in BeginTrans() and EndTrans(). Fixed. Improved error handling when no database is connected for oci8. Thx Andy
-Hassall. Names longer than 30 chars in oci8 datadict will be changed to random name.
-Thx Eugenio. http://phplens.com/lens/lensforum/msgs.php?id=16182 Added var $upperCase = 'ucase' to access and ado_access drivers. Thx Renato
-De Giovanni renato#cria.org.br Postgres64 driver, if preparing plan failed in _query, did not handle error
-properly. Fixed. See http://phplens.com/lens/lensforum/msgs.php?id=16131. Fixed GetActiveRecordsClass() reference bug. See
-http://phplens.com/lens/lensforum/msgs.php?id=16120 Added handling of nulls in adodb-ado_mssql.inc.php for qstr(). Thx to Felix
-Rabinovich. Adodb-dict contributions by Gaetano: Fixed pdo's GetInsertID() support. Thx Ricky Su. oci8 Prepare() now sets error messages if an error occurs. Added 'PT_BR' to SetDateLocale() -- brazilian portugese. charset in oci8 was not set correctly on *Connect() ADOConnection::Transpose() now appends as first column the field names. Added $ADODB_QUOTE_FIELDNAMES. If set to true, will autoquote field names in
-AutoExecute(),GetInsertSQL(), GetUpdateSQL(). Transpose now adds the field names as the first column after transposition. Added === check in ADODB_SetDatabaseAdapter for $db,
-adodb-active-record.inc.php. Thx Christian Affolter. Added ErrorNo() to adodb-active-record.inc.php. Thx ante#novisplet.com. Added support for multiple database connections in performance monitoring
-code (adodb-perf.inc.php). Now all sql in multiple database connections can be
-saved into one database ($ADODB_LOG_CONN). Added MetaIndexes() to odbc_mssql. Added connection property $db->null2null = 'null'. In
-autoexecute/getinsertsql/getupdatesql, this value will be converted to a null.
-Set this to a funny invalid value if you do not want null conversion. See
-http://phplens.com/lens/lensforum/msgs.php?id=15902. Path disclosure problem in mysqli fixed. Thx Andy. Fixed typo in session_schema2.xml. Changed INT in oci8 to return correct precision in $fld->max_length,
-MetaColumns(). Patched postgres64 _connect to handle serverinfo(). see http://phplens.com/lens/lensforum/msgs.php?id=15887.
- Added pdo fix for null columns. See
-http://phplens.com/lens/lensforum/msgs.php?id=15889 For stored procedures, missing connection id now passed into mssql_query().
-Thx Ecsy (ecsy#freemail.hu). Syntax error in postgres7 driver. Minor bug fixes - adodb informix 10 types added to adodb.inc.php. Thx
-Fernando Ortiz. Better odbtp date support. Added IgnoreErrors() to bypass default error handling. The _adodb_getcount() function in adodb-lib.inc.php, some ORDER BY bug
-fixes. For ibase and firebird, set $sysTimeStamp = "CURRENT_TIMESTAMP". Fixed postgres connection bug:
-http://phplens.com/lens/lensforum/msgs.php?id=11057. Changed CacheSelectLimit() to flush cache when $secs2cache==-1 due to
-complaints from other users. Added support for using memcached with CacheExecute/CacheSelectLimit.
-Requires memcache module PECL extension. Usage: Implemented Transpose() for recordsets. Recordset must be retrieved using
-ADODB_FETCH_NUM. First column becomes the column name. Major session code rewrite .... See session docs. PDO bindinputarray was not set properly for MySQL (changed from true to
-false). Changed CacheSelectLimit() to re-cache when $secs2cache==0. This is one way
-to flush the cache when SelectLimit is called. Added to quotes to mysql and mysqli: "SHOW COLUMNS FROM `%s`"; Removed accidental optgroup handling in GetMenu(). Fixed ibase _BlobDecode
-for php5 compat, and also mem alloc issues for small blobs, thx
-salvatori#interia.pl Mysql driver OffsetDate() speedup, useful for adodb-sessions. Fix for GetAssoc() PHP5 compat. See
-http://phplens.com/lens/lensforum/msgs.php?id=15425 Active Record - If inserting a record and the value of a primary key field
-is null, then we do not insert that field in as we assume it is an
-auto-increment field. Needed by mssql. Changed postgres7 MetaForeignKeys() see http://phplens.com/lens/lensforum/msgs.php?id=15531
- DB2 will now return db2_conn_errormsg() when it is a connection error. Changed adodb_countrec() in adodb-lib.inc.php to allow LIMIT to be used as a
-speedup to reduce no of records counted. Added support for transaction modes for postgres and oci8 with
-SetTransactionMode(). These transaction modes affect all subsequent
-transactions of that connection. Thanks to Halmai Csongor for suggestion. Removed $off = $fieldOffset - 1 line in db2 driver, FetchField(). Tx Larry
-Menard. Added support for PHP5 objects as Execute() bind parameters using __toString
-(eg. Simple-XML). Thx Carl-Christian Salvesen. Rounding in tohtml.inc.php did not work properly. Fixed. MetaIndexes in postgres fails when fields are deleted then added in again
-because the attnum has gaps in it. See
-http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976.
-Fixed. MetaForeignkeys in mysql and mysqli did not work when
-fetchMode==ADODB_FETCH_ASSOC used. Fixed. Reference error in AutoExecute() fixed. Added macaddr postgres type to MetaType. Maps to 'C'. Added to _connect() in adodb-ado5.inc.php support for $database and
-$dataProvider parameters. Thx Larry Menard. Added support for sequences in adodb-ado_mssql.inc.php. Thx Larry Menard. Added ADODB_SESSION_READONLY. Added session expiryref support to crc32 mode, and in LOB code. Clear _errorMsg in postgres7 driver, so that ErrorMsg() displays properly
-when no error occurs. Added BindDate and BindTimeStamp Fixed variable ref errors in adodb-ado5.inc.php in _query(). Mysqli setcharset fix using method_exists(). The adodb-perf.inc.php CreateLogTable() code now works for user-defined
-table names. Error in ibase_blob_open() fixed. See
-http://phplens.com/lens/lensforum/msgs.php?id=14997 Added activerecord support. Added mysql $conn->compat323 = true if you want MySQL 3.23 compat
-enabled. Fixes GetOne() Select-Limit problems. Added adodb-xmlschema03.inc.php to support XML Schema version 3 and updated
-adodb-datadict.htm docs. Better memory management in Execute. Thx Mike Fedyk. Added 'new' DSN parameter for NConnect(). Pager now sanitizes $PHP_SELF to protect against XSS. Thx to James Bercegay
-and others. ADOConnection::MetaType changed to setup $rs->connection correctly. New native DB2 driver contributed by Larry Menard, Dan Scott, Andy
-Staudacher, Bharat Mediratta. The mssql CreateSequence() did not BEGIN TRANSACTION correctly. Fixed. Thx
-Sean Lee. The _adodb_countrecs() function in adodb-lib.inc.php has been revised to
-handle more ORDER BY variations. Fixes postgresql security issue related to binary strings. Thx to Andy
-Staudacher. Several DSN bugs found: 1. Fix bugs in DSN connections introduced in 4.70 when underscores are found
-in the DSN. 2. DSN with _ did not work properly in PHP5 (fine in PHP4). Fixed. 3. Added support for PDO DSN connections in NewADOConnection(), and database
-parameter in PDO::Connect(). The oci8 datetime flag not correctly implemented in ADORecordSet_array.
-Fixed. Added BlobDelete() to postgres, as a counterpoint to UpdateBlobFile(). Fixed GetInsertSQL() to support oci8po. Fixed qstr() issue with postgresql with \0 in strings. Fixed some datadict driver loading issues in _adodb_getdriver(). Added register shutdown function session_write_close in
-adodb-session.inc.php for PHP 5 compat. See
-http://phplens.com/lens/lensforum/msgs.php?id=14200. Many fixes from Danila Ulyanov to ibase, oci8, postgres, mssql, odbc_oracle,
-odbtp, etc drivers. Changed usage of binary hint in adodb-session.inc.php for mysql. See
-http://phplens.com/lens/lensforum/msgs.php?id=14160 Fixed invalid variable reference problem in undomq(), adodb-perf.inc.php. Fixed http://phplens.com/lens/lensforum/msgs.php?id=14254 in
-adodb-perf.inc.php, _DBParameter() settings of fetchmode was wrong. Fixed security issues in server.php and tmssql.php discussed by Andreas
-Sandblad in a Secunia security advisory. Added $ACCEPTIP = 127.0.0.1 and
-changed suggested root password to something more secure. Changed pager to close recordset after RenderLayout(). PHP 5 compat for mysqli. MetaForeignKeys repeated twice and
-MYSQLI_BINARY_FLAG missing. PHP 5.1 support for postgresql bind parameters using ? did not work if >=
-10 parameters. Fixed. Thx to Stanislav Shramko. Lots of PDO improvements. Spelling error fixed in mysql MetaForeignKeys, $associative parameter. Postgresql not_null flag not set to false correctly. Thx Cristian MARIN. We now check in Replace() if key is in fieldArray. Thx Sbastien Vanvelthem.
- _file_get_contents() function was missing in xmlschema. fixed. Added week in year support to SQLDate(), using 'W' flag. Thx Spider. In sqlite metacolumns was repeated twice, causing PHP 5 problems. Fixed. Made debug output XHTML compliant. ExecuteCursor() in oci8 did not clean up properly on failure. Fixed. Updated xmlschema.dtd, by "Alec Smecher" asmecher#smecher.bc.ca Hardened SelectLimit, typecasting nrows and offset to integer. Fixed misc bugs in AutoExecute() and GetInsertSQL(). Added $conn->database as the property holding the database name. The
-older $conn->databaseName is retained for backward compat. Changed _adodb_backtrace() compat check to use function_exists(). Bug in postgresql MetaIndexes fixed. Thx Kevin Jamieson. Improved OffsetDate for MySQL, reducing rounding error. Metacolumns added to sqlite. Thx Mark Newnham. PHP 4.4 compat fixes for GetAssoc(). Added postgresql bind support for php 5.1. Thx Cristiano da Cunha Duarte OffsetDate() fixes for postgresql, typecasting strings to date or timestamp.
- DBTimeStamp formats for mssql, odbc_mssql and postgresql made to conform
-with other db's. Changed PDO constants from PDO_ to PDO:: to support latest spec. Reverted 'X' in mssql datadict to 'TEXT' to be compat with mssql driver.
-However now you can set $datadict->typeX = 'varchar(4000)' or 'TEXT' or
-'CLOB' for mssql and oci8 drivers. Added charset support when using DSN for Oracle. _adodb_getmenu did not use fieldcount() to get number of fields. Fixed. MetaForeignKeys() for mysql/mysqli contributed by Juan Carlos Gonzalez. MetaDatabases() now correctly returns an array for mysqli driver. Thx
-Cristian MARIN. CompleteTrans(false) did not return false. Fixed. Thx to JMF. AutoExecute() did not work with Oracle. Fixed. Thx Jos Moreira. MetaType() added to connection object. More PHP 4.4 reference return fixes. Thx Ryan C Bonham and others. In datadict, if the default field value is set to '', then it is not applied
-when the field is created. Fixed by Eugenio. MetaPrimaryKeys for postgres did not work because of true/false change in
-4.63. Fixed. Tested ocifetchstatement in oci8. Rejected at the end. Added port to dsn handling. Supported in postgres, mysql, mysqli,ldap. Added 'w' and 'l' to mysqli SQLDate(). Fixed error handling in ldap _connect() to be more consistent. Also added
-ErrorMsg() handling to ldap. Added support for union in _adodb_getcount, adodb-lib.inc.php for postgres
-and oci8. rs2html() did not work with null dates properly. PHP 4.4 reference return fixes. Added $nrows<0 check to mysqli's SelectLimit().
- Added OptimizeTable() and OptimizeTables() in adodb-perf.inc.php. By Markus Staab.
- PostgreSQL inconsistencies fixed. true and false set to TRUE and FALSE, and boolean type in datadict-postgres.inc.php set
-to 'L' => 'BOOLEAN'. Thx Kevin Jamieson.
- New adodb_session_create_table() function in adodb-session.inc.php. By Markus Staab.
- Added null check to UserTimeStamp().
- Fixed typo in mysqlt driver in adorecordset. Thx to Andy Staudacher.
- GenID() had a bug in the raiseErrorFn handling. Fixed. Thx Marcos Pont.
- Datadict name quoting now handles ( ) in index fields correctly - they aren't part of the index field. > Performance monitoring: (1) oci8 Ixora checks moved down; (2) expensive sql
-changed so that only those sql with count(*)>1 are shown; (3) changed sql1
-field to a length+crc32 checksum - this breaks backward compat. We remap firebird15 to firebird in data dictionary. Added 'w' (dow as 0-6 or 1-7) and 'l' (dow as string) for SQLDate for oci8,
-postgres and mysql. Rolled back MetaType() changes for mysqli done in prev version. Datadict change by chris, cblin#tennaxia.com data mappings from: to: Added $connection->disableBlobs to postgresql to improve performance when
-no bytea is used (2-5% improvement). Removed all HTTP_* vars. Added $rs->tableName to be set before calling AutoExecute(). Alex Rootoff rootoff#pisem.net contributed ukrainian language file. Added new mysql_option() support using $conn->optionFlags array. Added support for ldap_set_option() using the $LDAP_CONNECT_OPTIONS global
-variable. Contributed by Josh Eldridge. Added LDAP_* constant definitions to ldap. Added support for boolean bind variables. We use $conn->false and
-$conn->true to hold values to set false/true to. We now do not close the session connection in adodb-session.inc.php as other
-objects could be using this connection. We now strip off \0 at end of Ixora SQL strings in $perf->tohtml() for
-oci8. MySQLi added support for mysqli_connect_errno() and mysqli_connect_error(). Massive improvements to alpha PDO driver. Quote string bind parameters logged by performance monitor for easy type
-checking. Thx Jason Judge. Added support for $role when connecting with Interbase/firebird. Added support for enum recognition in MetaColumns() mysql and mysqli. Thx
-Amedeo Petrella. The sybase_ase driver contributed by Interakt Online. Thx Cristian Marin
-cristic#interaktonline.com. Removed not_null, has_default, and default_value from ADOFieldObject. Sessions code, fixed quoting of keys when handling LOBs in session write()
-function. Sessions code, added adodb_session_regenerate_id(), to reduce risk of
-session hijacking by changing session cookie dynamically. Thx Joe Li. Perf monitor, polling for CPU did not work for PHP 4.3.10 and 5.0.0-5.0.3
-due to PHP bugs, so we special case these versions. Postgresql, UpdateBlob() added code to handle type==CLOB. Implemented PEAR DB's autoExecute(). Simplified design because I don't like
-using constants when strings work fine. _rs2serialize will now update $rs->sql and $rs->oldProvider. Added autoExecute(). Added support for postgres8 driver. Currently just remapped to postgres7
-driver. Changed oci8 _query(), so that OCIBindByName() sets the length to -1 if
-element size is > 4000. This provides better support for LONGs. Added SetDateLocale() support for Spelling error in pivot code ($iff should be $iif). mysql insert_id() did not work with mysql 3.x. Fixed. "\r\n" not converted to spaces correctly in exporting data. Fixed.
- _nconnect() in mysqli did not return value correctly. Fixed. Arne Eckmann contributed danish language file. Added clone() support to FetchObject() for PHP5. Removed SQL_CUR_USE_ODBC from odbc_mssql. Found bug in Execute() with bind params for db's that do not support binding
-natively. DropSequence() now correctly uses default parameter. Now Execute() ignores locale for floats, so 1.23 is NEVER converted to 1,23.
- SetFetchMode() not properly saved in adodb-perf, suspicious sql and
-expensive sql. Fixed. Added INET to postgresql metatypes. Thx motzel. Allow oracle hints to work when counting with _adodb_getcount in
-adodb-lib.inc.php. Thx Chris Wrye. Changed mysql insert_id() to use SELECT LAST_INSERT_ID(). If alter col in datadict does not modify col type/size of actual col, then
-it is removed from alter col code. By Mark Newham. Not perfect as MetaType()
-!== ActualType(). Added handling of view fields in metacolumns() for postgresql. Thx Renato De
-Giovanni. Added to informix MetaPrimaryKeys and MetaColumns fixes for null bit. Thx to
-Cecilio Albero. Removed obsolete connection_timeout() from perf code. Added support for arrayClass in adodb-csv.inc.php. RSFilter now accepts methods of the form $array($obj, 'methodname'). Thx to
-blake#near-time.com. Changed CacheFlush to $cmd = 'rm -rf
-'.$ADODB_CACHE_DIR.'/[0-9a-f][0-9a-f]/'; For better cursor concurrency, added code to free ref cursors in oci8 when
-$rs->Close() is called. Note that CLose() is called internally by the Get*
-functions too. Added IIF support for access when pivoting. Thx Volodia Krupach. Added mssql datadict support for timestamp. Thx Alexios. Informix pager fix. By Mario Ramirez. ADODB_TABLE_REGEX now includes ':'. By Mario Ramirez. Mark Newnham contributed MetaIndexes for oci8 and db2. Now you can set $db->charSet = ?? before doing a Connect() in oci8. Added adodbFetchMode to sqlite. Perf code, added a string typecast to substr in adodb_log_sql(). Postgres: Changed BlobDecode() to use po_loread, added new $maxblobsize
-parameter, and now it returns the blob instead of sending it to stdout - make
-sure to mention that as a compat warning. Also added $db->IsOID($oid)
-function; uses a heuristic, not guaranteed to work 100%. Contributed arabic language file by "El-Shamaa, Khaled"
-k.el-shamaa#cgiar.org PHP5 exceptions did not handle @ protocol properly. Fixed. Added ifnull handling for postgresql (using coalesce). Added metatables() support for Postgresql 8.0 (no longer uses pg_%
-dictionary tables). Improved Sybase ErrorMsg() function. By Gaetano Giunta. Improved oci8 SelectLimit() to use Prepare(). By Cristiano Duarte. Type-cast $row parameter in ifx_fetch_row() to int. Thx stefan bodgan. Ralf becker contributed improvements in postgresql, sapdb, mysql data
-dictionary handling: Ralf also changed Postgresql datadict: Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict
-code. FetchMode cached in recordset is sometimes mapped to native db fetchMode.
-Normally this does not matter, but when using cached recordsets, we need to
-switch back to using adodb fetchmode. So we cache this in
-$rs->adodbFetchMode if it differs from the db's fetchMode. For informix we now set canSeek = false driver because stefan bodgan tells
-me that seeking doesn't work. SetDateLocale() never worked till now ;-) Thx david#tomato.it Set $_bindInputArray = true in sapdb driver. Required for clob support. Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to
-Gert-Rainer Bitterlich. Empty() used in getupdatesql without strlen() check. Fixed. Added unsigned detection to mysql and mysqli drivers. Thx to dan cech. Added hungarian language file. Thx to Halszvri Gbor. Improved fieldname-type formatting of datadict SQL generated (adding
-$widespacing parameter to _GenField). Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham. Changed odbtp to dynamically change databaseType based on connection, eg.
-from 'odbtp' to 'odbtp_mssql' when connecting to mssql database. In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3.
-Fixed. Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike
-mysql extension. Thx Francesco Riosa. VFP odbc driver curmode set wrongly, causing problems with memo fields.
-Fixed. Odbc driver did not recognize odbc version 2 driver date types properly.
-Fixed. Thx Bostjan. ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham. Perf monitoring with odbc improved. Now we try in perf code to manually set
-the sysTimeStamp using date() if sysTimeStamp is empty. All Added IsConnected(). Returns true if connection object connected. By
-Luca.Gioppo. "Ralf Becker" RalfBecker#digitalROCK.de contributed new sapdb
-data-dictionary driver and a large patch that implements field and table
-renaming for oracle, mssql, postgresql, mysql and sapdb. See the new RenameTableSQL()
-and RenameColumnSQL() functions. We now check ExecuteCursor to see if PrepareSP was initially called. Changed oci8 datadict to use MODIFY for $dd->alterCol. Thx Mark Newnham. Bug found in Replace() when performance logging enabled, introduced in ADOdb
-4.50. Fixed. Replace() checks update stmt. If update stmt fails, we now return
-immediately. Thx to alex. Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to
-niko. Added ADODB_ASSOC_CASE support to postgres/postgres7 driver. Support for DECLARE stmt in oci8. Thx Lochbrunner. Added adodb-xmlschema 1.0.2. Thx dan and richard. Added new adorecordset_ext_* classes. If ADOdb extension installed for
-mysql, mysqlt and oci8 (but not oci8po), we use the superfast ADOdb extension
-code for movenext. Added schema support to mssql and odbc_mssql MetaPrimaryKeys(). Patched MSSQL driver to support PHP NULL and Boolean values while binding
-the input array parameters in the _query() function. By Stephen Farmer. Added support for clob's for mssql, UpdateBlob(). Thx to
-gfran#directa.com.br Added normalize support for postgresql (true=lowercase table name, or
-false=case-sensitive table names) to MetaColumns($table, $normalize=true). PHP5 variant dates in Constant ADODB_FORCE_NULLS was not working properly for many releases (for
-GetUpdateSQL). Fixed. Also GetUpdateSQL strips off ORDER BY now - thx Elieser
-Leo. Perf Monitor for oci8 now dynamically highlights optimizer_* params if too
-high/low. Added dsn support to NewADOConnection/ADONewConnection. Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to
-"Sergio Strampelli" sergio#rir.it Speedup of movenext for mysql and oci8 drivers. Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php. Fixed postgresql bytea detection bug. See
-http://phplens.com/lens/lensforum/msgs.php?id=9849. Fixed ibase datetimestamp typo in PHP5. Thx stefan. Removed whitespace at end of odbtp drivers. Added db2 metaprimarykeys fix. Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get*
-functions. Bumped it to 4.50 to avoid confusion with PHP 4.3.x series. Added db2 metatables and metacolumns extensions. Added alpha PDO driver. Very buggy, only works with odbc. Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and
-_fetch(). PageExecute does not work properly with php5 (return val not a variable).
-Reported Dmytro Sychevsky sych#php.com.ua. Fixed. MetaTables() for mysql, $showschema parameter was not backward compatible
-with older versions of adodb. Fixed. Changed mysql GetOne() to work with mysql 3.23 when using with non-select
-stmts (e.g. SHOW TABLES). Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to
-Luca.Gioppo#csi.it. New to adodb-time code. We allow you to define your own daylights savings
-function, adodb_daylight_sv for pre-1970 dates. If the function is defined
-(somewhere in an include), then you can correct for daylights savings. See
-http://phplens.com/phpeverywhere/node/view/16#daylightsavings for more info. New sqlitepo driver. This is because assoc mode does not work like other
-drivers in sqlite. Namely, when selecting (joining) multiple tables, in assoc
-mode the table names are included in the assoc keys in the "sqlite"
-driver. In "sqlitepo" driver, the table names are stripped from the
-returned column names. When this results in a conflict, the first field get
-preference. Contributed by Herman Kuiper herman#ozuzo.net Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco
-Aurelio Silva. More XHTML changes for GetMenu. By Jeremy Evans. Fixes some ibase date issues. Thx to stefan bogdan. Improvements to mysqli driver to support $ADODB_COUNTRECS. Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need
-to poll stream continiously. New interbase/firebird fixes thx to Lester Caine. Driver fixes a problem
-with getting field names in the result array, and corrects a couple of data
-conversions. Also we default to dialect3 for firebird. Also ibase sysDate
-property was wrong. Changed to cast as timestamp. The datadict driver is set up to give quoted tables and fields as this was
-the only way round reserved words being used as field names in TikiWiki.
-TikiPro is tidying that up, and I hope to be able to produce a build of THAT
-which uses what I consider proper UPPERCASE field and table names. The
-conversion of TikiWiki to ADOdb helped in that, but until the database is
-completely tidied up in TikiPro ... Modified _gencachename() to include fetchmode in name hash. This means you
-should clear your cache directory after installing this release as the cache
-name algorithm has changed. Now Cache* functions work in safe mode, because we do not create
-sub-directories in the $ADODB_CACHE_DIR in safe mode. In non-safe mode we still
-create sub-directories. Done by modifying _gencachename(). Added $gmt parameter (true/false) to UserDate and UserTimeStamp in
-connection class, to force conversion of input (in local time) to be converted
-to UTC/GMT. Mssql datadict did not support INT types properly (no size param allowed).
-Added _GetSize() to datadict-mssql.inc.php. For borland_ibase, BeginTrans(), changed: to Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl). LogSQL did not work with Firebird/Interbase. Fixed. Postgres: made errorno() handling more consistent. Thx to Michael Jahn,
-Michael.Jahn#mailbox.tu-dresden.de. Added informix patch to better support metatables, metacolumns by
-"Cecilio Albero" c-albero#eos-i.com Cyril Malevanov contributed patch to oci8 to support passing of LOB
-parameters: As he says, the LOBs limitations are: Simplified Connect() and PConnect() error handling. When extension not loaded, Connect() and PConnect() will return null. On
-connect error, the fns will return false. CacheGetArray() added to code. Added Init() to adorecordset_empty(). Changed postgres64 driver, MetaColumns() to not strip off quotes in default
-value if :: detected (type-casting of default). Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from
-detecting file paths. Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*). New polish language file by Grzegorz Pacan Added support for Added security check for ADODB_DIR to limit path disclosure issues.
-Requested by postnuke team. Added better error message support to oracle driver. Thx to Gaetano Giunta. Added showSchema support to mysql. Bind in oci8 did not handle $name=false properly. Fixed. If extension not loaded, Connect(), PConnect(), NConnect() will return null.
- 4.22 15 Apr 2004 Moved docs to own adodb/docs folder. Fixed session bug when quoting compressed/encrypted data in Replace(). Netezza Driver and LDAP drivers contributed by Josh Eldridge. GetMenu now uses rtrim() on values instead of trim(). Changed MetaColumnNames to return an associative array, keys being the field
-names in uppercase. Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants.
-Thx to Alexios Fakos. Contributed bulgarian language file by Valentin Sheiretsky
-valio#valio.eu.org. Contributed romanian language file by stefan bogdan. GetInsertSQL now checks for table name (string) in $rs, and will create a
-recordset for that table automatically. Contributed by Walt Boring. Also added
-OCI_B_BLOB in bind on Walt's request - hope it doesn't break anything :-) Some minor postgres speedups in _initrs(). ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge. Added ADOConnection::Time(), returns current database time in unix timestamp
-format, or false. 4.21 20 Mar 2004 We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER
-BY exists. Pim Koeman contributed dutch language file adodb-nl.inc.php. Rick Hickerson added CLOB support to db2 datadict. Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro. Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly
-false). Fixes oci8 backward compat problems with OUT params. Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared
-as 2102-May-32. Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to
-valid(). Changed internal format of serialized cache recordsets. As we store a
-version number, this should be backward compatible. Error handling when driver file not found was flawed in ADOLoadCode().
-Fixed. 4.20 27 Feb 2004 Updated to AXMLS 1.01. MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
- Now numbers accepts function calls or sequences for
-GetInsertSQL/GetUpdateSQL numeric fields. Changed quotes of 'delete from $perf_table' to "". Thx Kehui
-(webmaster#kehui.net) Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz. Added addq(), which is analogous to addslashes(). Tested with php5b4. Fix some php5 compat problems with exceptions and
-sybase. Carl-Christian Salvesen added patch to mssql _query to support binds greater
-than 4000 chars. Mike suggested patch to PHP5 exception handler. $errno must be numeric. Added double quotes (") to ADODB_TABLE_REGEX. For oci8, Prepare(...,$cursor), $cursor's meaning was accidentally inverted
-in 4.11. This causes problems with ExecuteCursor() too, which calls Prepare()
-internally. Thx to William Lovaton. Now dateHasTime property in connection object renamed to datetime for
-consistency. This could break bc. Csongor Halmai reports that db2 SelectLimit with input array is not working.
-Fixed.. 4.11 27 Jan 2004 Csongor Halmai reports db2 binding not working. Reverted back to emulated
-binding. Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
- Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to
-v$db_cache_advice. Reported by Steve W. UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly.
-Reported by Mike Muir. Fixed. Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically,
-unless 2nd param is set to true. This will break backward compat, if
-Prepare/Execute is used instead of ExecuteCursor. Reported by Chris Jones. Added InParameter() and OutParameter(). Wrapper functions to Parameter(),
-but nicer because they are self-documenting. Added 'R' handling in ActualType() to datadict-mysql.inc.php Added ADOConnection::SerializableRS($rs). Returns a recordset that can be
-serialized in a session. Added "Run SQL" to performance UI(). Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and
-datadict-oci8.inc.php, from Heinz Hombergs. MetaIndexes() for ibase contributed by Heinz Hombergs. 4.10 12 Jan 2004 Dan Cech contributed extensive changes to data dictionary to support name
-quoting (with `), and drop table/index. Informix added cursorType property. Default remains IFX_SCROLL, but you can
-change to 0 (non-scrollable cursor) for performance. Added ADODB_View_PrimaryKeys() for returning view primary keys to
-MetaPrimaryKeys(). Simplified chinese file, adodb-cn.inc.php from cysoft. Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge. Added connection parameter to ibase Prepare(). Fix by Daniel Hassan. Added nameQuote for quoting identifiers and names to connection obj.
-Requested by Jason Judge. Also the data dictionary parser now detects `field
-name` and generates column names with spaces correctly. BOOL type not recognised correctly as L. Fixed. Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15
-Dec 2003) Added Schema to postgresql MetaTables. Thx to col#gear.hu Empty postgresql recordsets that had blob fields did not set EOF properly.
-Fixed. CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio. Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg.
-no html). Fixed some fr and it lang errors. Thx to Gaetano G. Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G. Fixed array recordset bugs when _skiprow1 is true. Thx to Gaetano G. Fixed pivot table code when count is false. 4.05 13 Dec 2003 Added MetaIndexes to data-dict code - thx to Dan Cech. Rewritten session code by Ross Smith. Moved code to adodb/session directory.
- Added function exists check on connecting to most drivers, so we don't crash
-with the unknown function error. Smart Transactions failed with GenID() when it no seq table has been created
-because the sql statement fails. Fix by Mark Newnham. Added $db->length, which holds name of function that returns strlen. Fixed error handling for bad driver in ADONewConnection - passed too few
-params to error-handler. Datadict did not handle types like 16.0 properly in _GetSize. Fixed. Oci8 driver SelectLimit() bug &= instead of =& used. Thx to Swen
-Thmmler. Jesse Mullan suggested not flushing outp when output buffering enabled. Due
-to Apache 2.0 bug. Added. MetaTables/MetaColumns return ref bug with PHP5 fixed in
-adodb-datadict.inc.php. New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver.
-Then jlim added BeginTrans, CommitTrans, RollbackTrans, IfNull, SQLDate. Also
-fixed return ref bug. $ADODB_FLUSH added, if true then force flush in debugging outp. Default is
-false. In earlier versions, outp defaulted to flush, which is not compat with
-apache 2.0. Mysql driver's GenID() function did not work when when sql logging is on.
-Fixed. $ADODB_SESSION_TBL not declared as global var. Not available if
-adodb-session.inc.php included in function. Fixed. The input array not passed to Execute() in _adodb_getcount(). Fixed. 4.04 13 Nov 2003 Switched back to foreach - faster than list-each. Fixed bug in ado driver - wiping out $this->fields with date fields. Performance Monitor, View SQL, Explain Plan did not work if
-strlen($SQL)>max($_GET length). Fixed. Performance monitor, oci8 driver added memory sort ratio. Added random property, returns SQL to generate a floating point number
-between 0 and 1; 4.03 6 Nov 2003 The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup
-properly. Patched SQLDate in interbase to support hours/mins/secs. Thx to ari
-kuorikoski. Force autorollback for pgsql persistent connections - apparently pgsql did
-not autorollback properly before 4.3.4. See http://bugs.php.net/bug.php?id=25404
- 4.02 5 Nov 2003 Some errors in adodb_error_pg() fixed. Thx to Styve. Spurious Insert_ID() error was generated by LogSQL(). Fixed. Insert_ID was interfering with Affected_Rows() and Replace() when LogSQL()
-enabled. Fixed. More foreach loops optimized with list/each. Null dates not handled properly in Heinz Hombergs contributed patches for mysql MetaColumns - adding scale,
-made interbase MetaColumns work with firebird/interbase, and added
-lang/adodb-de.inc.php. Added INFORMIXSERVER environment variable. Added $ADODB_ANSI_PADDING_OFF for interbase/firebird. PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support. 4.01 23 Oct 2003 Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells. Fixed insert_id() incorrectly generated when logsql() enabled. Modified PostgreSQL _fixblobs to use list/each instead of foreach. Informix ErrorNo() implemented correctly. Modified several places to use list/each, including GetRowAssoc(). Added UserTimeStamp() to connection class. Added $ADODB_ANSI_PADDING_OFF for oci8po. 4.00 20 Oct 2003 Upgraded adodb-xmlschema to 1 Oct 2003 snapshot. Fix to rs2html warning message. Thx to Filo. Fix for odbc_mssql/mssql SQLDate(), hours was wrong. Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson. Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by
-Karsten Dambekalns 3.94 11 Oct 2003 Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's
-must be removed. ErrorMsg()/ErrorNo() did not work for many databases when logging enabled.
-Fixed. Removed global variable $ADODB_LOGSQL as it does not work properly with
-multiple connections. Added SQLDate support for sybase. Thx to Chris Phillipson Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat
-Mediratta bharat#menalto.com. Same patch applied to _insertid and _affectedrows
-for adodb-postgres64.inc.php. Added support for NConnect for postgresql. Added Sybase data dict support. Thx to Chris Phillipson Extensive improvements in $perf->UI(), eg. Explain now opens in new
-window, we show scripts which call sql, etc. Perf Monitor UI works with magic quotes enabled. rsPrefix was declared twice. Removed. Oci8 stored procedure support, eg. "begin func(); end;" was
-incorrect in _query. Fixed. Tiraboschi Massimiliano contributed italian language file. Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance
-monitor. Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT
-Stphane. 0.10 Sept 9 2000 First release V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com). This software is dual licensed using BSD-Style and
-LGPL. This means you can use it in compiled proprietary and commercial
-products. Useful ADOdb links: Download
- Other Docs
- This documentation describes a PHP class library to automate the
-creation of tables, indexes and foreign key constraints portably for
-multiple databases. Richard Tango-Lowy and Dan Cech have been kind
-enough to contribute AXMLS, an XML schema
-system for defining databases. You can contact them at
-dcech#phpwerx.net and richtl#arscognita.com. Currently the following databases are supported: Well-tested: PostgreSQL, MySQL, Oracle, MSSQL.
-The following string will create a table with a primary key event_id and multiple indexes, including one compound index idx_ev1. The ability to define indexes using the INDEX keyword was added in ADOdb 4.94 by Gaetano Giunta.
- Creates a new data dictionary object. You pass a database connection object in $connection. The $connection does not have to be actually connected to the database. Some database connection objects are generic (eg. odbtp and odbc). Since 4.53, you can tell ADOdb the actual database with $drivername. E.g. Create a database with the name $dbname; The new format of $fldarray uses a free text format, where each
-field is comma-delimited.
-The first token for each field is the field name, followed by the type
-and optional
-field size. Then optional keywords in $otheroptions: The older (and still supported) format of $fldarray is a
-2-dimensional array, where each row in the 1st dimension represents one
-field. Each row has this format: The first 2 fields must be the field name and the field type. The
-field type can be a portable type codes or the actual type for that
-database. Legal portable type codes include: The $colsize field represents the size of the field. If a decimal
-number is used, then it is assumed that the number following the dot is
-the precision, so 6.2 means a number of size 6 digits and 2 decimal
-places. It is recommended that the default for number types be
-represented as a string to avoid any rounding errors. The $otheroptions include the following keywords (case-insensitive): The Data Dictonary accepts two formats, the older array
-specification: Or the simpler declarative format: Note that if you have special characters in the field name (e.g. My
-Date), you should enclose it in back-quotes. Normally field names are
-not case-sensitive, but if you enclose it in back-quotes, some
-databases will treat the names as case-sensitive (eg. Oracle) , and
-others won't. So be careful. The $taboptarray is the 3rd parameter of the CreateTableSQL
-function. This contains table specific settings. Legal keywords include: Database specific table options can be defined also using the name
-of the database type as the array key. In the following example, create
-the table as ISAM with MySQL, and store the table in the "users"
-tablespace if using Oracle. And because we specified REPLACE, drop
-the table first. You can also define foreign key constraints. The following is syntax
-for postgresql:
- Returns the SQL to drop the specified table. Checks to see if table exists, if table does not exist, behaves like
-CreateTableSQL. If table exists, generates appropriate ALTER TABLE
-MODIFY COLUMN commands if field already exists, or ALTER TABLE ADD
-$column if field does not exist. The class must be connected to the database for ChangeTableSQL to
-detect the existence of the table. Idea and code contributed by Florian
-Buzin. Old fields not defined in $flds are not dropped by default. To drop old fields, set $dropOldFlds to true.
- Rename a table. Returns the an array of strings, which is the SQL required to rename a table. Since ADOdb 4.53. Contributed by Ralf Becker. Rename a table field. Returns the an array of strings, which is the SQL required to rename a column. The optional $flds is a complete column-defintion-string like for AddColumnSQL, only used by mysql at the moment. Since ADOdb 4.53. Contributed by Ralf Becker. $idxoptarray is similar to $taboptarray in that index specific
-information can be embedded in the array. Other options include: Returns the SQL to drop the specified index. Add one or more columns. Not guaranteed to work under all situations. Warning, not all databases support this feature. Drop 1 or more columns. Set the schema. These functions are wrappers for the corresponding functions in the
-connection object. However, the table names will be autoquoted by the
-TableName function (see below) before being passed to the connection
-object. If the provided name is quoted with backquotes (`) or contains
-special characters, returns the name quoted with the appropriate quote
-character, otherwise the name is returned unchanged. The same as NameQuote, but will prepend the current schema if
-specified Convert between database-independent 'Meta' and database-specific
-'Actual' type codes. Executes an array of SQL strings returned by CreateTableSQL or
-CreateIndexSQL. This is a class contributed by Richard Tango-Lowy and Dan Cech that
-allows the user to quickly
-and easily build a database using the excellent ADODB database library
-and a simple XML formatted file.
-You can download
-the latest version of AXMLS here. Adodb-xmlschema, or AXMLS, is a set of classes that allow the user
-to quickly and easily build or upgrade a database on almost any RDBMS
-using the excellent ADOdb database library and a simple XML formatted
-schema file. Our goal is to give developers a tool that's simple to
-use, but that will allow them to create a single file that can build,
-upgrade, and manipulate databases on most RDBMS platforms. The easiest way to install AXMLS to download and install any recent
-version of the ADOdb database abstraction library. To install AXMLS
-manually, simply copy the adodb-xmlschema.inc.php file and the xsl
-directory into your adodb directory. There are two steps involved in using AXMLS in your application:
-first, you must create a schema, or XML representation of your
-database, and second, you must create the PHP code that will parse and
-execute the schema. Let's begin with a schema that describes a typical, if simplistic
-user management table for an application. Let's take a detailed look at this schema. The opening <?xml version="1.0"?> tag is required by XML. The
-<schema> tag tells the parser that the enclosed markup defines an
-XML schema. The version="0.2" attribute sets the version of the
-AXMLS DTD used by the XML schema. All versions of AXMLS prior to version 1.0 have a schema version of
-"0.1". The current schema version is "0.2". Next we define one or more tables. A table consists of a fields (and
-other objects) enclosed by <table> tags. The name="" attribute
-specifies the name of the table that will be created in the database. This table is called "users" and has a description and two fields.
-The description is optional, and is currently only for your own
-information; it is not applied to the database. The first <field> tag will create a field named "userId" of
-type "I", or integer. (See the ADOdb Data Dictionary documentation for
-a list of valid types.) This <field> tag encloses two special
-field options: <KEY/>, which specifies this field as a primary
-key, and <AUTOINCREMENT/>, which specifies that the database
-engine should automatically fill this field with the next available
-value when a new row is inserted. The second <field> tag will create a field named "userName" of
-type "C", or character, and of length 16 characters. The
-<NOTNULL/> option specifies that this field does not allow NULLs. There are two ways to add indexes to a table. The simplest is to
-mark a field with the <KEY/> option as described above; a primary
-key is a unique index. The second and more powerful method uses the
-<index> tags. The <index> tag specifies that an index should be created on
-the enclosing table. The name="" attribute provides the name of the
-index that will be created in the database. The description, as above,
-is for your information only. The <col> tags list each column
-that will be included in the index. Finally, the <UNIQUE/> tag
-specifies that this will be created as a unique index. Finally, AXMLS allows you to include arbitrary SQL that will be
-applied to the database when the schema is executed. The <sql> tag encloses any number of SQL queries that you
-define for your own use. Now that we've defined an XML schema, you need to know how to apply
-it to your database. Here's a simple PHP script that shows how to load
-the schema. Let's look at each part of the example in turn. After you manually
-create the database, there are three steps required to load (or
-upgrade) your schema. First, create a normal ADOdb connection. The variables and values
-here should be those required to connect to your database. Second, create the adoSchema object that load and manipulate your
-schema. You must pass an ADOdb database connection object in order to
-create the adoSchema object. Third, call ParseSchema() to parse the schema and then
-ExecuteSchema() to apply it to the database. You must pass
-ParseSchema() the path and filename of your schema file. Execute the above code and then log into your database. If you've
-done all this right, you should see your tables, indexes, and SQL. You can find the source files for this tutorial in the examples
-directory as tutorial_shema.xml and tutorial.php. See the class
-documentation for a more detailed description of the adoSchema methods,
-including methods and schema elements that are not described in this
-tutorial. In March 2006, we added adodb-xmlschema03.inc.php to the release, which supports version 3 of XML Schema.
-The adodb-xmlschema.inc.php remains the same as previous releases, and supports version 2 of XML Schema.
-Version 3 provides some enhancements:
-
- Example usage:
- To use it, change your code to include adodb-xmlschema03.inc.php.
-
-
-If your schema version is older, than XSLT is used to transform the
-schema to the newest version. This means that if you are using an older
-XML schema format, you need to have the XSLT extension installed.
-If you do not want to require your users to have the XSLT extension
-installed, make sure you modify your XML schema to conform to the
-latest version.
- (c)2004-2005 John Lim. All rights reserved. Oracle is the most popular commercial database used with PHP. There are many ways of accessing Oracle databases in PHP. These include: The wide range of choices is confusing to someone just starting with Oracle and PHP. I will briefly summarize the differences, and show you the advantages of using ADOdb. First we have the C extensions which provide low-level access to Oracle functionality. These C extensions are precompiled into PHP, or linked in dynamically when the web server starts up. Just in case you need it, here's a guide to installing Oracle and PHP on Linux. Here is an example of using the oci8 extension to query the emp table of the scott schema with bind parameters:
- This generates the following output:
- We also have many higher level PHP libraries that allow you to simplify the above code. The most popular are PEAR DB and ADOdb. Here are some of the differences between these libraries: PEAR DB is good enough for simple web apps. But if you need more power, you can see ADOdb offers more sophisticated functionality. The rest of this article will concentrate on using ADOdb with Oracle. You can find out more about connecting to Oracle later in this guide. In ADOdb, the above oci8 example querying the emp table could be written as: The Execute( ) function returns a recordset object, and you can retrieve the rows returned using $recordset->FetchRow( ). If we ignore the initial connection preamble, we can see the ADOdb version is much easier and simpler: You can also query the database using the standard Microsoft ADO MoveNext( ) metaphor. The data array for the current row is stored in the fields property of the recordset object, $rs.
-MoveNext( ) offers the highest performance among all the techniques for iterating through a recordset:
- And if you are interested in having the data returned in a 2-dimensional array, you can use:
- Now to obtain only the first row as an array:
- Or to retrieve only the first field of the first row:
- For easy pagination support, we provide the SelectLimit function. The following will perform a select query, limiting it to 100 rows, starting from row 201 (row 1 being the 1st row):
- The $offset parameter is optional.
- When data is being returned in an array, you can choose the type of array the data is returned in.
- The default is ADODB_FETCH_BOTH for Oracle. You can define a database cache directory using $ADODB_CACHE_DIR, and cache the results of frequently used queries that rarely change. This is particularly useful for SQL with complex where clauses and group-by's and order-by's. It is also good for relieving heavily-loaded database servers. This example will cache the following select statement for 3600 seconds (1 hour): There is an alternative syntax for the caching functions. The first parameter is omitted, and you set the cacheSecs
- property of the connection object:
- Prepare( ) is for compiling frequently used SQL statement for reuse. For example, suppose we have a large array which needs to be inserted into an Oracle database. The following will result in a massive speedup in query execution (at least 20-40%), as the SQL statement only needs to be compiled once: Oracle treats data which is more than 4000 bytes in length specially. These are called Large Objects, or LOBs for short. Binary LOBs are BLOBs, and character LOBs are CLOBs. In most Oracle libraries, you need to do a lot of work to process LOBs, probably because Oracle designed it to work in systems with little memory. ADOdb tries to make things easy by assuming the LOB can fit into main memory. ADOdb will transparently handle LOBs in select statements. The LOBs are automatically converted to PHP variables without any special coding. For updating records with LOBs, the functions UpdateBlob( ) and UpdateClob( ) are provided. Here's a BLOB example. The parameters should be self-explanatory:
- and the analogous CLOB example:
- Note that LogError( ) is a user-defined function, and not part of ADOdb.
- Inserting LOBs is more complicated. Since ADOdb 4.55, we allow you to do this
- (assuming that the photo field is a BLOB, and we want to store $blob_data into
- this field, and the primary key is the id field):
-
- Oracle recordsets can be passed around as variables called REF Cursors. For example, in PL/SQL, we could define a function open_tab that returns a REF CURSOR in the first parameter: In ADOdb, we could access this REF Cursor using the ExecuteCursor() function. The following will find
- all table names that begin with 'A' in the current schema:
- The first parameter is the PL/SQL statement, and the second parameter is the name of the REF Cursor.
- The following PL/SQL
-stored procedure requires an input variable, and returns a result into an output variable:
- The following ADOdb code allows you to call the stored procedure: PrepareSP( ) is a special function that knows about bind parameters.
-The main limitation currently is that IN OUT parameters do not work.
- We could also rewrite the REF CURSOR example to use InParameter (requires ADOdb 4.53 or later):
- You can also operate on LOBs. In this example, we have IN and OUT parameters using CLOBs.
- Similarly, you can use the constant OCI_B_BLOB to indicate that you are using BLOBs.
- Many web programmers do not care to use bind parameters, and prefer to enter the SQL directly. So instead of: They prefer entering the values inside the SQL:
- This reduces Oracle performance because Oracle will reuse compiled SQL which is identical to previously compiled SQL. The above example with the values inside the SQL
-is unlikely to be reused. As an optimization, from Oracle 8.1 onwards, you can set the following session parameter after you login:
- This will force Oracle to convert all such variables (eg. the 7900 value) into constant bind parameters, improving SQL reuse. More speedup tips. There are two things you need to know about dates in ADOdb. First, to ensure cross-database compability, ADOdb assumes that dates are returned in ISO format (YYYY-MM-DD H24:MI:SS). Secondly, since Oracle treats dates and datetime as the same data type, we decided not to display the time in the default date format. So on login, ADOdb will set the NLS_DATE_FORMAT to 'YYYY-MM-DD'. If you prefer to show the date and time by default, do this: Or execute: If you are not concerned about date portability and do not use ADOdb's portability layer, you can use your preferred date format instead.
-
- ADOdb provides the following functions for portably generating SQL functions
- as strings to be merged into your SQL statements: ADOdb also provides multiple oracle oci8 drivers for different scenarios: Here's an example of calling the oci8po driver. Note that the bind variables use question-mark: Before you can use ADOdb, you need to have the Oracle client installed and setup the oci8 extension. This extension comes pre-compiled for Windows (but you still need to enable it in the php.ini file). For information on compiling the oci8 extension for PHP and Apache on Unix, there is an excellent guide at oracle.com. One question that is frequently asked is should you use persistent connections to Oracle. Persistent connections allow PHP to recycle existing connections, reusing them after the previous web pages have completed. Non-persistent connections close automatically after the web page has completed. Persistent connections are faster because the cost of reconnecting is expensive, but there is additional resource overhead. As an alternative, Oracle allows you to pool and reuse server processes; this is called Shared Server (also known as MTS). The author's benchmarks suggest that using non-persistent connections and the Shared Server configuration offer the best performance. If Shared Server is not an option, only then consider using persistent connections. Just in case you are having problems connecting to Oracle, here are some examples: a. PHP and Oracle reside on the same machine, use default SID, with non-persistent connections: b. TNS Name defined in tnsnames.ora (or ONAMES or HOSTNAMES), eg. 'myTNS', using persistent connections: or c. Host Address and SID d. Host Address and Service Name e. Oracle connection string:
- f. ADOdb data source names (dsn):
- With ADOdb data source names,
-you don't have to call Connect( ) or PConnect( ).
- The examples in this article are easy to read but a bit simplistic because we ignore error-handling. Execute( ) and Connect( ) will return false on error. So a more realistic way to call Connect( ) and Execute( ) is:
- You can retrieve the error message and error number of the last SQL statement executed from ErrorMsg( ) and ErrorNo( ). You can also define a custom error handler function.
-ADOdb also supports throwing exceptions in PHP5.
-
-This variable is checked every time a query is executed, so you can selectively choose which recordsets to count.
- Schema generation. This allows you to define a schema using XML and import it into different RDBMS systems portably. Performance monitoring and tracing. Highlights of performance monitoring include identification of poor and suspicious SQL, with explain plan support, and identifying which web pages the SQL ran on. You can download ADOdb from sourceforge. ADOdb uses a BSD style license. That means that it is free for commercial use, and redistribution without source code is allowed. V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com) This software is dual licensed using BSD-Style and
-LGPL. This means you can use it in compiled proprietary and commercial
-products. Useful ADOdb links: Download
- Other Docs
- This module, part of the ADOdb package, provides both CLI and HTML
-interfaces for viewing key performance indicators of your database.
-This is very useful because web apps such as the popular phpMyAdmin
-currently do not provide effective database health monitoring tools.
-The module provides the following: ADOdb also has the ability to log all SQL executed, using LogSQL. All SQL logged can be
-analyzed through the performance monitor UI. In the View
-SQL mode, we categorize the SQL into 3 types:
- Each query is hyperlinked to a description of the query plan, and
-every PHP script that executed that query is also shown. Please note that the information presented is a very basic database
-health check, and does not provide a complete overview of database
-performance. Although some attempt has been made to make it work across
-multiple databases in the same way, it is impossible to do so. For the
-health check, we do try to display the following key database
-parameters for all drivers: You will need to connect to the database as an administrator to view
-most of the parameters. Code improvements as very welcome, particularly adding new database
-parameters and automated tuning hints. Currently, the following drivers: mysql, postgres,
-oci8, mssql, informix and db2 are
-supported. To create a new performance monitor, call NewPerfMonitor( )
-as demonstrated below: It is also possible to retrieve a single database parameter:
-Thx to Fernando Ortiz for the informix module. function UI($pollsecs=5) Creates a web-based user interface for performance monitoring. When
-you click on Poll, server statistics will be displayed every $pollsecs
-seconds. See Usage above. Since 4.11, we allow users to enter and run SQL interactively via
-the "Run SQL" link. To disable this for security reasons, set this
-constant before calling $perf->UI(). Sample output follows below: function HealthCheck() Returns database health check parameters as a HTML table. You will
-need to echo or print the output of this function, function HealthCheckCLI() Returns database health check parameters formatted for a command
-line interface. You will need to echo or print the output of this
-function. Sample output for mysql: function Poll($pollSecs=5)
- Run in infinite loop, displaying the following information every
-$pollSecs. This will not work properly if output buffering is enabled.
-In the example below, $pollSecs=3:
- WS-CPU% is the Web Server CPU load of the server that PHP is
-running from (eg. the database client), and not the database. The Hit%
-is the data cache hit ratio. Sess is the current number of
-sessions connected to the database. If you are using persistent
-connections, this should not change much. The Reads/s and Writes/s
-are synthetic values to give the viewer a rough guide to I/O, and are
-not to be taken literally. function SuspiciousSQL($numsql=10) Returns SQL which have high average execution times as a HTML table.
-Each sql statement
-is hyperlinked to a new window which details the execution plan and the
-scripts that execute this SQL.
- The number of statements returned is determined by $numsql. Data is
-taken from the adodb_logsql table, where the sql statements are logged
-when
-$connection->LogSQL(true) is enabled. The adodb_logsql table is
-populated using $conn->LogSQL.
- For Oracle, Ixora Suspicious SQL returns a list of SQL statements
-that are most cache intensive as a HTML table. These are data intensive
-SQL statements that could benefit most from tuning. function ExpensiveSQL($numsql=10) Returns SQL whose total execution time (avg time * #executions) is
-high as a HTML table. Each sql statement
-is hyperlinked to a new window which details the execution plan and the
-scripts that execute this SQL.
- The number of statements returned is determined by $numsql. Data is
-taken from the adodb_logsql table, where the sql statements are logged
-when
-$connection->LogSQL(true) is enabled. The adodb_logsql table is
-populated using $conn->LogSQL.
- For Oracle, Ixora Expensive SQL returns a list of SQL statements
-that are taking the most CPU load when run.
- function InvalidSQL($numsql=10) Returns a list of invalid SQL as an HTML table.
- Data is taken from the adodb_logsql table, where the sql statements
-are logged when
-$connection->LogSQL(true) is enabled.
- function Tables($orderby=1) Returns information on all tables in a database, with the first two
-fields containing the table name and table size, the remaining fields
-depend on the database driver. If $orderby is set to 1, it will sort by
-name. If $orderby is set to 2, then it will sort by table size. Some
-database drivers (mssql and mysql) will ignore the $orderby clause. For
-postgresql, the information is up-to-date since the last vacuum.
-Not supported currently for db2. Raw functions return values without any formatting. function DBParameter($paramname) Returns the value of a database parameter, such as
-$this->DBParameter("data cache size"). function CPULoad() Returns the CPU load of the database client (NOT THE SERVER) as a
-percentage. Only works for Linux and Windows. For Windows, WMI must be
-available. New in adodb 4.97/5.03 is this global variable, which controls whether sql timings which are too small are not saved. Currently it defaults
-to 0.05 (seconds). This means that all sql's which are faster than 0.05 seconds to execute are not saved.
- To create new database parameters, you need to understand
-$settings. The $settings data structure is an associative array. Each
-element of the array defines a database parameter. The key is the name
-of the database parameter. If no key is defined, then it is assumed to
-be a section break, and the value is the name of the section break. If
-this is too confusing, looking at the source code will help a lot! Each database parameter is itself an array consisting of the
-following elements: Example from MySQL, table_cache database parameter: db2 informix mysql mssql oci8
-postgres '.htmlspecialchars($ss).'';
- }
- if ($zthis->debug === -1)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else if ($zthis->debug !== -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- } else {
- $ss = "\n ".$ss;
- if ($zthis->debug !== -99)
- ADOConnection::outp("-----
\n($dbt): ".$sqlTxt." $ss\n-----
\n",false);
- }
-
- $qID = $zthis->_query($sql,$inputarr);
-
- /*
- Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql
- because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion
- */
- if ($zthis->databaseType == 'mssql') {
- // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6
-
- if($emsg = $zthis->ErrorMsg()) {
- if ($err = $zthis->ErrorNo()) {
- if ($zthis->debug === -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
-
- ADOConnection::outp($err.': '.$emsg);
- }
- }
- } else if (!$qID) {
-
- if ($zthis->debug === -99)
- if ($inBrowser) ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else ADOConnection::outp("-----
\n($dbt): ".$sqlTxt."$ss\n-----
\n",false);
-
- ADOConnection::outp($zthis->ErrorNo() .': '. $zthis->ErrorMsg());
- }
-
- if ($zthis->debug === 99) _adodb_backtrace(true,9999,2);
- return $qID;
-}
-
-# pretty print the debug_backtrace function
-function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0,$ishtml=null)
-{
- if (!function_exists('debug_backtrace')) return '';
-
- if ($ishtml === null) $html = (isset($_SERVER['HTTP_USER_AGENT']));
- else $html = $ishtml;
-
- $fmt = ($html) ? " %% line %4d, file: %s" : "%% line %4d, file: %s";
-
- $MAXSTRLEN = 128;
-
- $s = ($html) ? '' : '';
-
- if (is_array($printOrArr)) $traceArr = $printOrArr;
- else $traceArr = debug_backtrace();
- array_shift($traceArr);
- array_shift($traceArr);
- $tabs = sizeof($traceArr)-2;
-
- foreach ($traceArr as $arr) {
- if ($skippy) {$skippy -= 1; continue;}
- $levels -= 1;
- if ($levels < 0) break;
-
- $args = array();
- for ($i=0; $i < $tabs; $i++) $s .= ($html) ? ' ' : "\t";
- $tabs -= 1;
- if ($html) $s .= '';
- if (isset($arr['class'])) $s .= $arr['class'].'.';
- if (isset($arr['args']))
- foreach($arr['args'] as $v) {
- if (is_null($v)) $args[] = 'null';
- else if (is_array($v)) $args[] = 'Array['.sizeof($v).']';
- else if (is_object($v)) $args[] = 'Object:'.get_class($v);
- else if (is_bool($v)) $args[] = $v ? 'true' : 'false';
- else {
- $v = (string) @$v;
- $str = htmlspecialchars(str_replace(array("\r","\n"),' ',substr($v,0,$MAXSTRLEN)));
- if (strlen($v) > $MAXSTRLEN) $str .= '...';
- $args[] = $str;
- }
- }
- $s .= $arr['function'].'('.implode(', ',$args).')';
-
-
- $s .= @sprintf($fmt, $arr['line'],$arr['file'],basename($arr['file']));
-
- $s .= "\n";
- }
- if ($html) $s .= '';
- if ($printOrArr) print $s;
-
- return $s;
-}
-/*
-function _adodb_find_from($sql)
-{
-
- $sql = str_replace(array("\n","\r"), ' ', $sql);
- $charCount = strlen($sql);
-
- $inString = false;
- $quote = '';
- $parentheseCount = 0;
- $prevChars = '';
- $nextChars = '';
-
-
- for($i = 0; $i < $charCount; $i++) {
-
- $char = substr($sql,$i,1);
- $prevChars = substr($sql,0,$i);
- $nextChars = substr($sql,$i+1);
-
- if((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === false) {
- $quote = $char;
- $inString = true;
- }
-
- elseif((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === true && $quote == $char) {
- $quote = "";
- $inString = false;
- }
-
- elseif($char == "(" && $inString === false)
- $parentheseCount++;
-
- elseif($char == ")" && $inString === false && $parentheseCount > 0)
- $parentheseCount--;
-
- elseif($parentheseCount <= 0 && $inString === false && $char == " " && strtoupper(substr($prevChars,-5,5)) == " FROM")
- return $i;
-
- }
-}
-*/
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-memcache.lib.inc.php b/src/adodb512/adodb-memcache.lib.inc.php
deleted file mode 100644
index e666d56a..00000000
--- a/src/adodb512/adodb-memcache.lib.inc.php
+++ /dev/null
@@ -1,190 +0,0 @@
-memCache = true; /// should we use memCache instead of caching in files
-$db->memCacheHost = array($ip1, $ip2, $ip3);
-$db->memCachePort = 11211; /// this is default memCache port
-$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
-$db->Connect(...);
-$db->CacheExecute($sql);
-
- Note the memcache class is shared by all connections, is created during the first call to Connect/PConnect.
-
- Class instance is stored in $ADODB_CACHE
-*/
-
- class ADODB_Cache_MemCache {
- var $createdir = false; // create caching directory structure?
-
- //-----------------------------
- // memcache specific variables
-
- var $hosts; // array of hosts
- var $port = 11211;
- var $compress = false; // memcache compression with zlib
-
- var $_connected = false;
- var $_memcache = false;
-
- function ADODB_Cache_MemCache(&$obj)
- {
- $this->hosts = $obj->memCacheHost;
- $this->port = $obj->memCachePort;
- $this->compress = $obj->memCacheCompress;
- }
-
- // implement as lazy connection. The connection only occurs on CacheExecute call
- function connect(&$err)
- {
- if (!function_exists('memcache_pconnect')) {
- $err = 'Memcache module PECL extension not found!';
- return false;
- }
-
- $memcache = new MemCache;
-
- if (!is_array($this->hosts)) $this->hosts = array($this->hosts);
-
- $failcnt = 0;
- foreach($this->hosts as $host) {
- if (!@$memcache->addServer($host,$this->port,true)) {
- $failcnt += 1;
- }
- }
- if ($failcnt == sizeof($this->hosts)) {
- $err = 'Can\'t connect to any memcache server';
- return false;
- }
- $this->_connected = true;
- $this->_memcache = $memcache;
- return true;
- }
-
- // returns true or false. true if successful save
- function writecache($filename, $contents, $debug, $secs2cache)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- if (!$this->_memcache->set($filename, $contents, $this->compress, $secs2cache)) {
- if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!
\n");
- return false;
- }
-
- return true;
- }
-
- // returns a recordset
- function readcache($filename, &$err, $secs2cache, $rsClass)
- {
- $false = false;
- if (!$this->_connected) $this->connect($err);
- if (!$this->_memcache) return $false;
-
- $rs = $this->_memcache->get($filename);
- if (!$rs) {
- $err = 'Item with such key doesn\'t exists on the memcached server.';
- return $false;
- }
-
- // hack, should actually use _csv2rs
- $rs = explode("\n", $rs);
- unset($rs[0]);
- $rs = join("\n", $rs);
- $rs = unserialize($rs);
- if (! is_object($rs)) {
- $err = 'Unable to unserialize $rs';
- return $false;
- }
- if ($rs->timeCreated == 0) return $rs; // apparently have been reports that timeCreated was set to 0 somewhere
-
- $tdiff = intval($rs->timeCreated+$secs2cache - time());
- if ($tdiff <= 2) {
- switch($tdiff) {
- case 2:
- if ((rand() & 15) == 0) {
- $err = "Timeout 2";
- return $false;
- }
- break;
- case 1:
- if ((rand() & 3) == 0) {
- $err = "Timeout 1";
- return $false;
- }
- break;
- default:
- $err = "Timeout 0";
- return $false;
- }
- }
- return $rs;
- }
-
- function flushall($debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->flush();
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushall: failed!
\n");
- else ADOConnection::outp("flushall: succeeded!
\n");
-
- return $del;
- }
-
- function flushcache($filename, $debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->delete($filename);
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushcache: $key entry doesn't exist on memcached server!
\n");
- else ADOConnection::outp("flushcache: $key entry flushed from memcached server!
\n");
-
- return $del;
- }
-
- // not used for memcache
- function createdir($dir, $hash)
- {
- return true;
- }
- }
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-pager.inc.php b/src/adodb512/adodb-pager.inc.php
deleted file mode 100644
index b57ee953..00000000
--- a/src/adodb512/adodb-pager.inc.php
+++ /dev/null
@@ -1,290 +0,0 @@
- implemented Render_PageLinks().
-
- Please note, this class is entirely unsupported,
- and no free support requests except for bug reports
- will be entertained by the author.
-
-*/
-class ADODB_Pager {
- var $id; // unique id for pager (defaults to 'adodb')
- var $db; // ADODB connection object
- var $sql; // sql used
- var $rs; // recordset generated
- var $curr_page; // current page number before Render() called, calculated in constructor
- var $rows; // number of rows per page
- var $linksPerPage=10; // number of links per page in navigation bar
- var $showPageLinks;
-
- var $gridAttributes = 'width=100% border=1 bgcolor=white';
-
- // Localize text strings here
- var $first = '|<';
- var $prev = '<<';
- var $next = '>>';
- var $last = '>|';
- var $moreLinks = '...';
- var $startLinks = '...';
- var $gridHeader = false;
- var $htmlSpecialChars = true;
- var $page = 'Page';
- var $linkSelectedColor = 'red';
- var $cache = 0; #secs to cache with CachePageExecute()
-
- //----------------------------------------------
- // constructor
- //
- // $db adodb connection object
- // $sql sql statement
- // $id optional id to identify which pager,
- // if you have multiple on 1 page.
- // $id should be only be [a-z0-9]*
- //
- function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false)
- {
- global $PHP_SELF;
-
- $curr_page = $id.'_curr_page';
- if (!empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
-
- $this->sql = $sql;
- $this->id = $id;
- $this->db = $db;
- $this->showPageLinks = $showPageLinks;
-
- $next_page = $id.'_next_page';
-
- if (isset($_GET[$next_page])) {
- $_SESSION[$curr_page] = (integer) $_GET[$next_page];
- }
- if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page
-
- $this->curr_page = $_SESSION[$curr_page];
-
- }
-
- //---------------------------
- // Display link to first page
- function Render_First($anchor=true)
- {
- global $PHP_SELF;
- if ($anchor) {
- ?>
- first;?>
- first ";
- }
- }
-
- //--------------------------
- // Display link to next page
- function render_next($anchor=true)
- {
- global $PHP_SELF;
-
- if ($anchor) {
- ?>
- next;?>
- next ";
- }
- }
-
- //------------------
- // Link to last page
- //
- // for better performance with large recordsets, you can set
- // $this->db->pageExecuteCountRows = false, which disables
- // last page counting.
- function render_last($anchor=true)
- {
- global $PHP_SELF;
-
- if (!$this->db->pageExecuteCountRows) return;
-
- if ($anchor) {
- ?>
- last;?>
- last ";
- }
- }
-
- //---------------------------------------------------
- // original code by "Pablo Costa" Query failed: $this->sql
";
- return;
- }
-
- if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage()))
- $header = $this->RenderNav();
- else
- $header = " ";
-
- $grid = $this->RenderGrid();
- $footer = $this->RenderPageCount();
-
- $this->RenderLayout($header,$grid,$footer);
-
- $rs->Close();
- $this->rs = false;
- }
-
- //------------------------------------------------------
- // override this to control overall layout and formating
- function RenderLayout($header,$grid,$footer,$attributes='border=1 bgcolor=beige')
- {
- echo "
";
- }
-}
-
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-pear.inc.php b/src/adodb512/adodb-pear.inc.php
deleted file mode 100644
index 04441a70..00000000
--- a/src/adodb512/adodb-pear.inc.php
+++ /dev/null
@@ -1,374 +0,0 @@
- |
- * and Tomas V.V.Cox ",
- $header,
- " ",
- $grid,
- " ",
- $footer,
- "
'.$_SERVER['HTTP_HOST'];
- if (isset($_SERVER['PHP_SELF'])) $tracer .= htmlspecialchars($_SERVER['PHP_SELF']);
- } else
- if (isset($_SERVER['PHP_SELF'])) $tracer .= '
'.htmlspecialchars($_SERVER['PHP_SELF']);
- //$tracer .= (string) adodb_backtrace(false);
-
- $tracer = (string) substr($tracer,0,500);
-
- if (is_array($inputarr)) {
- if (is_array(reset($inputarr))) $params = 'Array sizeof='.sizeof($inputarr);
- else {
- // Quote string parameters so we can see them in the
- // performance stats. This helps spot disabled indexes.
- $xar_params = $inputarr;
- foreach ($xar_params as $xar_param_key => $xar_param) {
- if (gettype($xar_param) == 'string')
- $xar_params[$xar_param_key] = '"' . $xar_param . '"';
- }
- $params = implode(', ', $xar_params);
- if (strlen($params) >= 3000) $params = substr($params, 0, 3000);
- }
- } else {
- $params = '';
- }
-
- if (is_array($sql)) $sql = $sql[0];
- if ($prefix) $sql = $prefix.$sql;
- $arr = array('b'=>strlen($sql).'.'.crc32($sql),
- 'c'=>substr($sql,0,3900), 'd'=>$params,'e'=>$tracer,'f'=>adodb_round($time,6));
- //var_dump($arr);
- $saved = $conn->debug;
- $conn->debug = 0;
-
- $d = $conn->sysTimeStamp;
- if (empty($d)) $d = date("'Y-m-d H:i:s'");
- if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {
- $isql = "insert into $perf_table values($d,:b,:c,:d,:e,:f)";
- } else if ($dbT == 'odbc_mssql' || $dbT == 'informix' || strncmp($dbT,'odbtp',4)==0) {
- $timer = $arr['f'];
- if ($dbT == 'informix') $sql2 = substr($sql2,0,230);
-
- $sql1 = $conn->qstr($arr['b']);
- $sql2 = $conn->qstr($arr['c']);
- $params = $conn->qstr($arr['d']);
- $tracer = $conn->qstr($arr['e']);
-
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values($d,$sql1,$sql2,$params,$tracer,$timer)";
- if ($dbT == 'informix') $isql = str_replace(chr(10),' ',$isql);
- $arr = false;
- } else {
- if ($dbT == 'db2') $arr['f'] = (float) $arr['f'];
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values( $d,?,?,?,?,?)";
- }
-
- global $ADODB_PERF_MIN;
- if ($errN != 0 || $time >= $ADODB_PERF_MIN) {
- $ok = $conn->Execute($isql,$arr);
- } else
- $ok = true;
-
- $conn->debug = $saved;
-
- if ($ok) {
- $conn->_logsql = true;
- } else {
- $err2 = $conn->ErrorMsg();
- $conn->_logsql = true; // enable logsql error simulation
- $perf = NewPerfMonitor($conn);
- if ($perf) {
- if ($perf->CreateLogTable()) $ok = $conn->Execute($isql,$arr);
- } else {
- $ok = $conn->Execute("create table $perf_table (
- created varchar(50),
- sql0 varchar(250),
- sql1 varchar(4000),
- params varchar(3000),
- tracer varchar(500),
- timer decimal(16,6))");
- }
- if (!$ok) {
- ADOConnection::outp( "
$err2';
- var $titles = '
\n";
- $this->conn->fnExecute = $saveE;
-
- return $html;
- }
-
- function Tables($orderby='1')
- {
- if (!$this->tablesSQL) return false;
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->Execute($this->tablesSQL.' order by '.$orderby);
- $this->conn->LogSQL($savelog);
- $html = rs2html($rs,false,false,false,false);
- return $html;
- }
-
-
- function CreateLogTable()
- {
- if (!$this->createTableSQL) return false;
-
- $table = $this->table();
- $sql = str_replace('adodb_logsql',$table,$this->createTableSQL);
- $savelog = $this->conn->LogSQL(false);
- $ok = $this->conn->Execute($sql);
- $this->conn->LogSQL($savelog);
- return ($ok) ? true : false;
- }
-
- function DoSQLForm()
- {
-
-
- $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']);
- $sql = isset($_REQUEST['sql']) ? $_REQUEST['sql'] : '';
-
- if (isset($_SESSION['phplens_sqlrows'])) $rows = $_SESSION['phplens_sqlrows'];
- else $rows = 3;
-
- if (isset($_REQUEST['SMALLER'])) {
- $rows /= 2;
- if ($rows < 3) $rows = 3;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
- if (isset($_REQUEST['BIGGER'])) {
- $rows *= 2;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
-
-?>
-
-
-
-undomq(trim($sql));
- if (substr($sql,strlen($sql)-1) === ';') {
- $print = true;
- $sqla = $this->SplitSQL($sql);
- } else {
- $print = false;
- $sqla = array($sql);
- }
- foreach($sqla as $sqls) {
-
- if (!$sqls) continue;
-
- if ($print) {
- print " ';
- var $warnRatio = 90;
- var $tablesSQL = false;
- var $cliFormat = "%32s => %s \r\n";
- var $sql1 = 'sql1'; // used for casting sql1 to text for mssql
- var $explain = true;
- var $helpurl = "LogSQL help";
- var $createTableSQL = false;
- var $maxLength = 2000;
-
- // Sets the tablename to be used
- static function table($newtable = false)
- {
- static $_table;
-
- if (!empty($newtable)) $_table = $newtable;
- if (empty($_table)) $_table = 'adodb_logsql';
- return $_table;
- }
-
- // returns array with info to calculate CPU Load
- function _CPULoad()
- {
-/*
-
-cpu 524152 2662 2515228 336057010
-cpu0 264339 1408 1257951 168025827
-cpu1 259813 1254 1257277 168031181
-page 622307 25475680
-swap 24 1891
-intr 890153570 868093576 6 0 4 4 0 6 1 2 0 0 0 124 0 8098760 2 13961053 0 0 0 0 0 0 0 0 0 0 0 0 0 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-disk_io: (3,0):(3144904,54369,610378,3090535,50936192) (3,1):(3630212,54097,633016,3576115,50951320)
-ctxt 66155838
-btime 1062315585
-processes 69293
-
-*/
- // Algorithm is taken from
- // http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/414b0e1b-499c-411e-8a02-6a12e339c0f1/
- if (strncmp(PHP_OS,'WIN',3)==0) {
- if (PHP_VERSION == '5.0.0') return false;
- if (PHP_VERSION == '5.0.1') return false;
- if (PHP_VERSION == '5.0.2') return false;
- if (PHP_VERSION == '5.0.3') return false;
- if (PHP_VERSION == '4.3.10') return false; # see http://bugs.php.net/bug.php?id=31737
-
- static $FAIL = false;
- if ($FAIL) return false;
-
- $objName = "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\CIMV2";
- $myQuery = "SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name = '_Total'";
-
- try {
- @$objWMIService = new COM($objName);
- if (!$objWMIService) {
- $FAIL = true;
- return false;
- }
-
- $info[0] = -1;
- $info[1] = 0;
- $info[2] = 0;
- $info[3] = 0;
- foreach($objWMIService->ExecQuery($myQuery) as $objItem) {
- $info[0] = $objItem->PercentProcessorTime();
- }
-
- } catch(Exception $e) {
- $FAIL = true;
- echo $e->getMessage();
- return false;
- }
-
- return $info;
- }
-
- // Algorithm - Steve Blinch (BlitzAffe Online, http://www.blitzaffe.com)
- $statfile = '/proc/stat';
- if (!file_exists($statfile)) return false;
-
- $fd = fopen($statfile,"r");
- if (!$fd) return false;
-
- $statinfo = explode("\n",fgets($fd, 1024));
- fclose($fd);
- foreach($statinfo as $line) {
- $info = explode(" ",$line);
- if($info[0]=="cpu") {
- array_shift($info); // pop off "cpu"
- if(!$info[0]) array_shift($info); // pop off blank space (if any)
- return $info;
- }
- }
-
- return false;
-
- }
-
- /* NOT IMPLEMENTED */
- function MemInfo()
- {
- /*
-
- total: used: free: shared: buffers: cached:
-Mem: 1055289344 917299200 137990144 0 165437440 599773184
-Swap: 2146775040 11055104 2135719936
-MemTotal: 1030556 kB
-MemFree: 134756 kB
-MemShared: 0 kB
-Buffers: 161560 kB
-Cached: 581384 kB
-SwapCached: 4332 kB
-Active: 494468 kB
-Inact_dirty: 322856 kB
-Inact_clean: 24256 kB
-Inact_target: 168316 kB
-HighTotal: 131064 kB
-HighFree: 1024 kB
-LowTotal: 899492 kB
-LowFree: 133732 kB
-SwapTotal: 2096460 kB
-SwapFree: 2085664 kB
-Committed_AS: 348732 kB
- */
- }
-
-
- /*
- Remember that this is client load, not db server load!
- */
- var $_lastLoad;
- function CPULoad()
- {
- $info = $this->_CPULoad();
- if (!$info) return false;
-
- if (strncmp(PHP_OS,'WIN',3)==0) {
- return (integer) $info[0];
- }else {
- if (empty($this->_lastLoad)) {
- sleep(1);
- $this->_lastLoad = $info;
- $info = $this->_CPULoad();
- }
-
- $last = $this->_lastLoad;
- $this->_lastLoad = $info;
-
- $d_user = $info[0] - $last[0];
- $d_nice = $info[1] - $last[1];
- $d_system = $info[2] - $last[2];
- $d_idle = $info[3] - $last[3];
-
- //printf("Delta - User: %f Nice: %f System: %f Idle: %fParameter Value Description
",$d_user,$d_nice,$d_system,$d_idle);
-
- $total=$d_user+$d_nice+$d_system+$d_idle;
- if ($total<1) $total=1;
- return 100*($d_user+$d_nice+$d_system)/$total;
- }
- }
-
- function Tracer($sql)
- {
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $sqlq = $this->conn->qstr($sql);
- $arr = $this->conn->GetArray(
-"select count(*),tracer
- from $perf_table where sql1=$sqlq
- group by tracer
- order by 1 desc");
- $s = '';
- if ($arr) {
- $s .= 'Scripts Affected
';
- foreach($arr as $k) {
- $s .= sprintf("%4d",$k[0]).' '.strip_tags($k[1]).'
';
- }
- }
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
- $this->conn->fnExecute = $saveE;
- return $s;
- }
-
- /*
- Explain Plan for $sql.
- If only a snippet of the $sql is passed in, then $partial will hold the crc32 of the
- actual sql.
- */
- function Explain($sql,$partial=false)
- {
- return false;
- }
-
- function InvalidSQL($numsql = 10)
- {
-
- if (isset($_GET['sql'])) return;
- $s = 'Invalid SQL
';
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
- $perf_table = adodb_perf::table();
- $rs = $this->conn->SelectLimit("select distinct count(*),sql1,tracer as error_msg from $perf_table where tracer like 'ERROR:%' group by sql1,tracer order by 1 desc",$numsql);//,$numsql);
- $this->conn->fnExecute = $saveE;
- if ($rs) {
- $s .= rs2html($rs,false,false,false,false);
- } else
- return "Suspicious SQL
-The following SQL have high average execution times
-
";
-
- }
-
- function CheckMemory()
- {
- return '';
- }
-
-
- function SuspiciousSQL($numsql=10)
- {
- return adodb_perf::_SuspiciousSQL($numsql);
- }
-
- function ExpensiveSQL($numsql=10)
- {
- return adodb_perf::_ExpensiveSQL($numsql);
- }
-
-
- /*
- This reports the percentage of load on the instance due to the most
- expensive few SQL statements. Tuning these statements can often
- make huge improvements in overall system performance.
- */
- function _ExpensiveSQL($numsql = 10)
- {
- global $ADODB_FETCH_MODE;
-
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- if (isset($_GET['expe']) && isset($_GET['sql'])) {
- $partial = !empty($_GET['part']);
- echo "".$this->Explain($_GET['sql'],$partial)."\n";
- }
-
- if (isset($_GET['sql'])) return;
-
- $sql1 = $this->sql1;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->SelectLimit(
- "select sum(timer) as total,$sql1,count(*),max(timer) as max_timer,min(timer) as min_timer
- from $perf_table
- where {$this->conn->upperCase}({$this->conn->substr}(sql0,1,5)) not in ('DROP ','INSER','COMMI','CREAT')
- and (tracer is null or tracer not like 'ERROR:%')
- group by sql1
- having count(*)>1
- order by 1 desc",$numsql);
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $this->conn->fnExecute = $saveE;
- $ADODB_FETCH_MODE = $save;
- if (!$rs) return " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if ($this->explain == false || strlen($prefix)>$max) {
- $suffix = ' ... String too long for GET parameter: '.strlen($prefix).'';
- $prefix = '';
- }
- $s .= "Avg Time Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." Expensive SQL
-Tuning the following SQL could reduce the server load substantially
-
";
- }
-
- /*
- Raw function to return parameter value from $settings.
- */
- function DBParameter($param)
- {
- if (empty($this->settings[$param])) return false;
- $sql = $this->settings[$param][1];
- return $this->_DBParameter($sql);
- }
-
- /*
- Raw function returning array of poll paramters
- */
- function PollParameters()
- {
- $arr[0] = (float)$this->DBParameter('data cache hit ratio');
- $arr[1] = (float)$this->DBParameter('data reads');
- $arr[2] = (float)$this->DBParameter('data writes');
- $arr[3] = (integer) $this->DBParameter('current connections');
- return $arr;
- }
-
- /*
- Low-level Get Database Parameter
- */
- function _DBParameter($sql)
- {
- $savelog = $this->conn->LogSQL(false);
- if (is_array($sql)) {
- global $ADODB_FETCH_MODE;
-
- $sql1 = $sql[0];
- $key = $sql[1];
- if (sizeof($sql)>2) $pos = $sql[2];
- else $pos = 1;
- if (sizeof($sql)>3) $coef = $sql[3];
- else $coef = false;
- $ret = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute($sql1);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- while (!$rs->EOF) {
- $keyf = reset($rs->fields);
- if (trim($keyf) == $key) {
- $ret = $rs->fields[$pos];
- if ($coef) $ret *= $coef;
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
- }
- $this->conn->LogSQL($savelog);
- return $ret;
- } else {
- if (strncmp($sql,'=',1) == 0) {
- $fn = substr($sql,1);
- return $this->$fn();
- }
- $sql = str_replace('$DATABASE',$this->conn->database,$sql);
- $ret = $this->conn->GetOne($sql);
- $this->conn->LogSQL($savelog);
-
- return $ret;
- }
- }
-
- /*
- Warn if cache ratio falls below threshold. Displayed in "Description" column.
- */
- function WarnCacheRatio($val)
- {
- if ($val < $this->warnRatio)
- return 'Cache ratio should be at least '.$this->warnRatio.'%';
- else return '';
- }
-
- function clearsql()
- {
- $perf_table = adodb_perf::table();
- $this->conn->Execute("delete from $perf_table where created<".$this->conn->sysTimeStamp);
- }
- /***********************************************************************************************/
- // HIGH LEVEL UI FUNCTIONS
- /***********************************************************************************************/
-
-
- function UI($pollsecs=5)
- {
- global $ADODB_LOG_CONN;
-
- $perf_table = adodb_perf::table();
- $conn = $this->conn;
-
- $app = $conn->host;
- if ($conn->host && $conn->database) $app .= ', db=';
- $app .= $conn->database;
-
- if ($app) $app .= ', ';
- $savelog = $this->conn->LogSQL(false);
- $info = $conn->ServerInfo();
- if (isset($_GET['clearsql'])) {
- $this->clearsql();
- }
- $this->conn->LogSQL($savelog);
-
- // magic quotes
-
- if (isset($_GET['sql']) && get_magic_quotes_gpc()) {
- $_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']);
- }
-
- if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;
- else $nsql = $_SESSION['ADODB_PERF_SQL'];
-
- $app .= $info['description'];
-
-
- if (isset($_GET['do'])) $do = $_GET['do'];
- else if (isset($_POST['do'])) $do = $_POST['do'];
- else if (isset($_GET['sql'])) $do = 'viewsql';
- else $do = 'stats';
-
- if (isset($_GET['nsql'])) {
- if ($_GET['nsql'] > 0) $nsql = $_SESSION['ADODB_PERF_SQL'] = (integer) $_GET['nsql'];
- }
- echo " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if($this->explain == false || strlen($prefix>$max)) {
- $prefix = '';
- $suffix = '';
- }
- $s .= "Load Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." ";
- else $form = " ";
-
- $allowsql = !defined('ADODB_PERF_NO_RUN_SQL');
- global $ADODB_PERF_MIN;
- $app .= " (Min sql timing \$ADODB_PERF_MIN=$ADODB_PERF_MIN secs)";
-
- if (empty($_GET['hidem']))
- echo "
";
-
-
- switch ($do) {
- default:
- case 'stats':
- if (empty($ADODB_LOG_CONN))
- echo "
- ADOdb Performance Monitor for $app
- Performance Stats View SQL
- View Tables Poll Stats",
- $allowsql ? ' Run SQL' : '',
- "$form",
- "
";
- echo $this->HealthCheck();
- //$this->conn->debug=1;
- echo $this->CheckMemory();
- break;
- case 'poll':
- $self = htmlspecialchars($_SERVER['PHP_SELF']);
- echo "";
- break;
- case 'poll2':
- echo "";
- $this->Poll($pollsecs);
- break;
-
- case 'dosql':
- if (!$allowsql) break;
-
- $this->DoSQLForm();
- break;
- case 'viewsql':
- if (empty($_GET['hidem']))
- echo " Clear SQL Log
";
- echo($this->SuspiciousSQL($nsql));
- echo($this->ExpensiveSQL($nsql));
- echo($this->InvalidSQL($nsql));
- break;
- case 'tables':
- echo $this->Tables(); break;
- }
- global $ADODB_vers;
- echo " '.$this->titles;
-
- $oldc = false;
- $bgc = '';
- foreach($this->settings as $name => $arr) {
- if ($arr === false) break;
-
- if (!is_string($name)) {
- if ($cli) $html .= " -- $arr -- \n";
- else $html .= "'.$this->conn->databaseType.'
color> ";
- continue;
- }
-
- if (!is_array($arr)) break;
- $category = $arr[0];
- $how = $arr[1];
- if (sizeof($arr)>2) $desc = $arr[2];
- else $desc = ' ';
-
-
- if ($category == 'HIDE') continue;
-
- $val = $this->_DBParameter($how);
-
- if ($desc && strncmp($desc,"=",1) === 0) {
- $fn = substr($desc,1);
- $desc = $this->$fn($val);
- }
-
- if ($val === false) {
- $m = $this->conn->ErrorMsg();
- $val = "Error: $m";
- } else {
- if (is_numeric($val) && $val >= 256*1024) {
- if ($val % (1024*1024) == 0) {
- $val /= (1024*1024);
- $val .= 'M';
- } else if ($val % 1024 == 0) {
- $val /= 1024;
- $val .= 'K';
- }
- //$val = htmlspecialchars($val);
- }
- }
- if ($category != $oldc) {
- $oldc = $category;
- //$bgc = ($bgc == ' bgcolor='.$this->color) ? ' bgcolor=white' : ' bgcolor='.$this->color;
- }
- if (strlen($desc)==0) $desc = ' ';
- if (strlen($val)==0) $val = ' ';
- if ($cli) {
- $html .= str_replace(' ','',sprintf($this->cliFormat,strip_tags($name),strip_tags($val),strip_tags($desc)));
-
- }else {
- $html .= "$arr \n";
- }
- }
-
- if (!$cli) $html .= "".$name.' '.$val.' '.$desc."
";
- rs2html($rs);
- }
- } else {
- $e1 = (integer) $this->conn->ErrorNo();
- $e2 = $this->conn->ErrorMsg();
- if (($e1) || ($e2)) {
- if (empty($e1)) $e1 = '-1'; // postgresql fix
- print ' '.$e1.': '.$e2;
- } else {
- print "
- * optimizeTables( 'tableA');
- *
- *
- * optimizeTables( 'tableA', 'tableB', 'tableC');
- *
- *
- * optimizeTables( 'tableA', 'tableB', ADODB_OPT_LOW);
- *
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH for full optimization
- * ADODB_OPT_LOW for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function OptimizeTables()
- {
- $args = func_get_args();
- $numArgs = func_num_args();
-
- if ( $numArgs == 0) return false;
-
- $mode = ADODB_OPT_LOW;
- $lastArg = $args[ $numArgs - 1];
- if ( !is_string($lastArg)) {
- $mode = $lastArg;
- unset( $args[ $numArgs - 1]);
- }
-
- foreach( $args as $table) {
- $this->optimizeTable( $table, $mode);
- }
- }
-
- /**
- * Reorganise the table-indices/statistics/.. depending on the given mode.
- * Default Implementation throws an error.
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH for full optimization
- * ADODB_OPT_LOW for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function OptimizeTable( $table, $mode = ADODB_OPT_LOW)
- {
- ADOConnection::outp( sprintf( "MetaTables() and
- * optimize each using optmizeTable()
- *
- * @author Markus Staab
- * @return Returns true on success and false on error
- */
- function optimizeDatabase()
- {
- $conn = $this->conn;
- if ( !$conn) return false;
-
- $tables = $conn->MetaTables( 'TABLES');
- if ( !$tables ) return false;
-
- foreach( $tables as $table) {
- if ( !$this->optimizeTable( $table)) {
- return false;
- }
- }
-
- return true;
- }
- // end hack
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-php4.inc.php b/src/adodb512/adodb-php4.inc.php
deleted file mode 100644
index e46a74d8..00000000
--- a/src/adodb512/adodb-php4.inc.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/adodb-time.inc.php b/src/adodb512/adodb-time.inc.php
deleted file mode 100644
index d62f6784..00000000
--- a/src/adodb512/adodb-time.inc.php
+++ /dev/null
@@ -1,1429 +0,0 @@
- 4 digit year conversion. The maximum is billions of years in the
-future, but this is a theoretical limit as the computation of that year
-would take too long with the current implementation of adodb_mktime().
-
-This library replaces native functions as follows:
-
-
- getdate() with adodb_getdate()
- date() with adodb_date()
- gmdate() with adodb_gmdate()
- mktime() with adodb_mktime()
- gmmktime() with adodb_gmmktime()
- strftime() with adodb_strftime()
- strftime() with adodb_gmstrftime()
-
-
-The parameters are identical, except that adodb_date() accepts a subset
-of date()'s field formats. Mktime() will convert from local time to GMT,
-and date() will convert from GMT to local time, but daylight savings is
-not handled currently.
-
-This library is independant of the rest of ADOdb, and can be used
-as standalone code.
-
-PERFORMANCE
-
-For high speed, this library uses the native date functions where
-possible, and only switches to PHP code when the dates fall outside
-the 32-bit signed integer range.
-
-GREGORIAN CORRECTION
-
-Pope Gregory shortened October of A.D. 1582 by ten days. Thursday,
-October 4, 1582 (Julian) was followed immediately by Friday, October 15,
-1582 (Gregorian).
-
-Since 0.06, we handle this correctly, so:
-
-adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582)
- == 24 * 3600 (1 day)
-
-=============================================================================
-
-COPYRIGHT
-
-(c) 2003-2005 John Lim and released under BSD-style license except for code by
-jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year
-and originally found at http://www.php.net/manual/en/function.mktime.php
-
-=============================================================================
-
-BUG REPORTS
-
-These should be posted to the ADOdb forums at
-
- http://phplens.com/lens/lensforum/topics.php?id=4
-
-=============================================================================
-
-FUNCTION DESCRIPTIONS
-
-
-** FUNCTION adodb_getdate($date=false)
-
-Returns an array containing date information, as getdate(), but supports
-dates greater than 1901 to 2038. The local date/time format is derived from a
-heuristic the first time adodb_getdate is called.
-
-
-** FUNCTION adodb_date($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-The format fields that adodb_date supports:
-
-
- a - "am" or "pm"
- A - "AM" or "PM"
- d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
- D - day of the week, textual, 3 letters; e.g. "Fri"
- F - month, textual, long; e.g. "January"
- g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
- G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
- h - hour, 12-hour format; i.e. "01" to "12"
- H - hour, 24-hour format; i.e. "00" to "23"
- i - minutes; i.e. "00" to "59"
- j - day of the month without leading zeros; i.e. "1" to "31"
- l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
- L - boolean for whether it is a leap year; i.e. "0" or "1"
- m - month; i.e. "01" to "12"
- M - month, textual, 3 letters; e.g. "Jan"
- n - month without leading zeros; i.e. "1" to "12"
- O - Difference to Greenwich time in hours; e.g. "+0200"
- Q - Quarter, as in 1, 2, 3, 4
- r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200"
- s - seconds; i.e. "00" to "59"
- S - English ordinal suffix for the day of the month, 2 characters;
- i.e. "st", "nd", "rd" or "th"
- t - number of days in the given month; i.e. "28" to "31"
- T - Timezone setting of this machine; e.g. "EST" or "MDT"
- U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
- w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
- Y - year, 4 digits; e.g. "1999"
- y - year, 2 digits; e.g. "99"
- z - day of the year; i.e. "0" to "365"
- Z - timezone offset in seconds (i.e. "-43200" to "43200").
- The offset for timezones west of UTC is always negative,
- and for those east of UTC is always positive.
-
-
-Unsupported:
-
- B - Swatch Internet time
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- W - ISO-8601 week number of year, weeks starting on Monday
-
-
-
-
-** FUNCTION adodb_date2($fmt, $isoDateString = false)
-Same as adodb_date, but 2nd parameter accepts iso date, eg.
-
- adodb_date2('d-M-Y H:i','2003-12-25 13:01:34');
-
-
-** FUNCTION adodb_gmdate($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-
-** FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])
-
-Converts a local date to a unix timestamp. Unlike the function mktime(), it supports
-dates outside the 1901 to 2038 range. All parameters are optional.
-
-
-** FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year])
-
-Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports
-dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters
-are currently compulsory.
-
-** FUNCTION adodb_gmstrftime($fmt, $timestamp = false)
-Convert a timestamp to a formatted GMT date.
-
-** FUNCTION adodb_strftime($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. Internally converts $fmt into
-adodb_date format, then echo result.
-
-For best results, you can define the local date format yourself. Define a global
-variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using
-adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax.
-
- eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s');
-
- Supported format codes:
-
-
- %a - abbreviated weekday name according to the current locale
- %A - full weekday name according to the current locale
- %b - abbreviated month name according to the current locale
- %B - full month name according to the current locale
- %c - preferred date and time representation for the current locale
- %d - day of the month as a decimal number (range 01 to 31)
- %D - same as %m/%d/%y
- %e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
- %h - same as %b
- %H - hour as a decimal number using a 24-hour clock (range 00 to 23)
- %I - hour as a decimal number using a 12-hour clock (range 01 to 12)
- %m - month as a decimal number (range 01 to 12)
- %M - minute as a decimal number
- %n - newline character
- %p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
- %r - time in a.m. and p.m. notation
- %R - time in 24 hour notation
- %S - second as a decimal number
- %t - tab character
- %T - current time, equal to %H:%M:%S
- %x - preferred date representation for the current locale without the time
- %X - preferred time representation for the current locale without the date
- %y - year as a decimal number without a century (range 00 to 99)
- %Y - year as a decimal number including the century
- %Z - time zone or name or abbreviation
- %% - a literal `%' character
-
-
- Unsupported codes:
-
- %C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
- %g - like %G, but without the century.
- %G - The 4-digit year corresponding to the ISO week number (see %V).
- This has the same format and value as %Y, except that if the ISO week number belongs
- to the previous or next year, that year is used instead.
- %j - day of the year as a decimal number (range 001 to 366)
- %u - weekday as a decimal number [1,7], with 1 representing Monday
- %U - week number of the current year as a decimal number, starting
- with the first Sunday as the first day of the first week
- %V - The ISO 8601:1988 week number of the current year as a decimal number,
- range 01 to 53, where week 1 is the first week that has at least 4 days in the
- current year, and with Monday as the first day of the week. (Use %G or %g for
- the year component that corresponds to the week number for the specified timestamp.)
- %w - day of the week as a decimal, Sunday being 0
- %W - week number of the current year as a decimal number, starting with the
- first Monday as the first day of the first week
-
-
-=============================================================================
-
-NOTES
-
-Useful url for generating test timestamps:
- http://www.4webhelp.net/us/timestamp.php
-
-Possible future optimizations include
-
-a. Using an algorithm similar to Plauger's in "The Standard C Library"
-(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not
-work outside 32-bit signed range, so i decided not to implement it.
-
-b. Implement daylight savings, which looks awfully complicated, see
- http://webexhibits.org/daylightsaving/
-
-
-CHANGELOG
-
-- 11 Feb 2008 0.33
-* Bug in 0.32 fix for hour handling. Fixed.
-
-- 1 Feb 2008 0.32
-* Now adodb_mktime(0,0,0,12+$m,20,2040) works properly.
-
-- 10 Jan 2008 0.31
-* Now adodb_mktime(0,0,0,24,1,2037) works correctly.
-
-- 15 July 2007 0.30
-Added PHP 5.2.0 compatability fixes.
- * gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the
- * timezone, otherwise we use the current year as the baseline to retrieve the timezone.
- * Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but
- in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8.
- *
-
-- 19 March 2006 0.24
-Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used.
-
-- 10 Feb 2006 0.23
-PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000.
- In PHP4, we will still use -0000 for 100% compat with PHP4.
-
-- 08 Sept 2005 0.22
-In adodb_date2(), $is_gmt not supported properly. Fixed.
-
-- 18 July 2005 0.21
-In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
-Added support for negative months in adodb_mktime().
-
-- 24 Feb 2005 0.20
-Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
-
-- 21 Dec 2004 0.17
-In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false.
-Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro.
-
-- 17 Nov 2004 0.16
-Removed intval typecast in adodb_mktime() for secs, allowing:
- adodb_mktime(0,0,0 + 2236672153,1,1,1934);
-Suggested by Ryan.
-
-- 18 July 2004 0.15
-All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory.
-This brings it more in line with mktime (still not identical).
-
-- 23 June 2004 0.14
-
-Allow you to define your own daylights savings function, adodb_daylight_sv.
-If the function is defined (somewhere in an include), then you can correct for daylights savings.
-
-In this example, we apply daylights savings in June or July, adding one hour. This is extremely
-unrealistic as it does not take into account time-zone, geographic location, current year.
-
-function adodb_daylight_sv(&$arr, $is_gmt)
-{
- if ($is_gmt) return;
- $m = $arr['mon'];
- if ($m == 6 || $m == 7) $arr['hours'] += 1;
-}
-
-This is only called by adodb_date() and not by adodb_mktime().
-
-The format of $arr is
-Array (
- [seconds] => 0
- [minutes] => 0
- [hours] => 0
- [mday] => 1 # day of month, eg 1st day of the month
- [mon] => 2 # month (eg. Feb)
- [year] => 2102
- [yday] => 31 # days in current year
- [leap] => # true if leap year
- [ndays] => 28 # no of days in current month
- )
-
-
-- 28 Apr 2004 0.13
-Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov.
-
-- 20 Mar 2004 0.12
-Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32.
-
-- 26 Oct 2003 0.11
-Because of daylight savings problems (some systems apply daylight savings to
-January!!!), changed adodb_get_gmt_diff() to ignore daylight savings.
-
-- 9 Aug 2003 0.10
-Fixed bug with dates after 2038.
-See http://phplens.com/lens/lensforum/msgs.php?id=6980
-
-- 1 July 2003 0.09
-Added support for Q (Quarter).
-Added adodb_date2(), which accepts ISO date in 2nd param
-
-- 3 March 2003 0.08
-Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS
-if you want PHP to handle negative timestamps between 1901 to 1969.
-
-- 27 Feb 2003 0.07
-All negative numbers handled by adodb now because of RH 7.3+ problems.
-See http://bugs.php.net/bug.php?id=20048&edit=2
-
-- 4 Feb 2003 0.06
-Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates
-are now correctly handled.
-
-- 29 Jan 2003 0.05
-
-Leap year checking differs under Julian calendar (pre 1582). Also
-leap year code optimized by checking for most common case first.
-
-We also handle month overflow correctly in mktime (eg month set to 13).
-
-Day overflow for less than one month's days is supported.
-
-- 28 Jan 2003 0.04
-
-Gregorian correction handled. In PHP5, we might throw an error if
-mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10.
-Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582.
-
-- 27 Jan 2003 0.03
-
-Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION.
-Fixed calculation of days since start of year for <1970.
-
-- 27 Jan 2003 0.02
-
-Changed _adodb_getdate() to inline leap year checking for better performance.
-Fixed problem with time-zones west of GMT +0000.
-
-- 24 Jan 2003 0.01
-
-First implementation.
-*/
-
-
-/* Initialization */
-
-/*
- Version Number
-*/
-define('ADODB_DATE_VERSION',0.33);
-
-$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
-
-/*
- This code was originally for windows. But apparently this problem happens
- also with Linux, RH 7.3 and later!
-
- glibc-2.2.5-34 and greater has been changed to return -1 for dates <
- 1970. This used to work. The problem exists with RedHat 7.3 and 8.0
- echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
-
- References:
- http://bugs.php.net/bug.php?id=20048&edit=2
- http://lists.debian.org/debian-glibc/2002/debian-glibc-200205/msg00010.html
-*/
-
-if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1);
-
-function adodb_date_test_date($y1,$m,$d=13)
-{
- $h = round(rand()% 24);
- $t = adodb_mktime($h,0,0,$m,$d,$y1);
- $rez = adodb_date('Y-n-j H:i:s',$t);
- if ($h == 0) $h = '00';
- else if ($h < 10) $h = '0'.$h;
- if ("$y1-$m-$d $h:00:00" != $rez) {
- print "$y1 error, expected=$y1-$m-$d $h:00:00, adodb=$rez
";
- return false;
- }
- return true;
-}
-
-function adodb_date_test_strftime($fmt)
-{
- $s1 = strftime($fmt);
- $s2 = adodb_strftime($fmt);
-
- if ($s1 == $s2) return true;
-
- echo "error for $fmt, strftime=$s1, adodb=$s2
";
- return false;
-}
-
-/**
- Test Suite
-*/
-function adodb_date_test()
-{
-
- for ($m=-24; $m<=24; $m++)
- echo "$m :",adodb_date('d-m-Y',adodb_mktime(0,0,0,1+$m,20,2040)),"
";
-
- error_reporting(E_ALL);
- print "Testing adodb_date and adodb_mktime. version=".ADODB_DATE_VERSION.' PHP='.PHP_VERSION."
";
- @set_time_limit(0);
- $fail = false;
-
- // This flag disables calling of PHP native functions, so we can properly test the code
- if (!defined('ADODB_TEST_DATES')) define('ADODB_TEST_DATES',1);
-
- $t = time();
-
-
- $fmt = 'Y-m-d H:i:s';
- echo '';
- echo 'adodb: ',adodb_date($fmt,$t),'
';
-
- adodb_date_test_strftime('%Y %m %x %X');
- adodb_date_test_strftime("%A %d %B %Y");
- adodb_date_test_strftime("%H %M S");
-
- $t = adodb_mktime(0,0,0);
- if (!(adodb_date('Y-m-d') == date('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'
';
- echo 'php : ',date($fmt,$t),'
';
- echo '
';
-
- $t = adodb_mktime(0,0,0,6,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-06-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
- $t = adodb_mktime(0,0,0,2,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-02-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
-
- print "
';
-
- $t = adodb_mktime(0,0,0,2,29,1500);
- if (!(adodb_date('Y-m-d',$t) == '1500-02-29')) print 'Error in julian leap years
';
-
- $t = adodb_mktime(0,0,0,2,29,1700);
- if (!(adodb_date('Y-m-d',$t) == '1700-03-01')) print 'Error in gregorian leap years
';
-
- print adodb_mktime(0,0,0,10,4,1582).' ';
- print adodb_mktime(0,0,0,10,15,1582);
- $diff = (adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582));
- if ($diff != 3600*24) print " Error in gregorian correction = ".($diff/3600/24)." days
";
-
- print " 15 Oct 1582, Fri=".(adodb_dow(1582,10,15) == 5 ? 'Fri' : 'Error')."
";
- print " 4 Oct 1582, Thu=".(adodb_dow(1582,10,4) == 4 ? 'Thu' : 'Error')."
";
-
- print "
';
- $t = adodb_mktime(0,0,0,4,33,1971);
- if (!(adodb_date('Y-m-d',$t) == '1971-05-03')) print 'Error in day overflow 2
';
- $t = adodb_mktime(0,0,0,1,60,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-03-01')) print 'Error in day overflow 3 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,32,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-01')) print 'Error in day overflow 4 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,63,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-02-01')) print 'Error in day overflow 5 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,13,3,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-03')) print 'Error in mth overflow 1
';
-
- print "Testing 2-digit => 4-digit year conversion
";
- if (adodb_year_digit_check(10) != 2010) print "Err 2-digit 2010
";
- if (adodb_year_digit_check(20) != 2020) print "Err 2-digit 2020
";
- if (adodb_year_digit_check(30) != 2030) print "Err 2-digit 2030
";
- if (adodb_year_digit_check(40) != 1940) print "Err 2-digit 1940
";
- if (adodb_year_digit_check(50) != 1950) print "Err 2-digit 1950
";
- if (adodb_year_digit_check(90) != 1990) print "Err 2-digit 1990
";
-
- // Test string formating
- print "
$s1
$s2
";
- }
- flush();
- for ($i=100; --$i > 0; ) {
-
- $ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000);
- $s1 = date($fmt,$ts);
- $s2 = adodb_date($fmt,$ts);
- //print "$s1
$s2
- \"$s1\" (date len=".strlen($s1).")
- \"$s2\" (adodb_date len=".strlen($s2).")
";
- $fail = true;
- }
-
- $a1 = getdate($ts);
- $a2 = adodb_getdate($ts);
- $rez = array_diff($a1,$a2);
- if (sizeof($rez)>0) {
- print "Error getdate() $ts
";
- print_r($a1);
- print "
";
- print_r($a2);
- print "
";
- if (!$fail) print "
";
- }
-}
-adodb_date_gentable();
-
-for ($i=1970; $i > 1500; $i--) {
-
-echo "
$i ";
- adodb_date_test_date($i,1,1);
-}
-
-*/
-
-
-$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
-$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
-function adodb_validdate($y,$m,$d)
-{
-global $_month_table_normal,$_month_table_leaf;
-
- if (_adodb_is_leap_year($y)) $marr = $_month_table_leaf;
- else $marr = $_month_table_normal;
-
- if ($m > 12 || $m < 1) return false;
-
- if ($d > 31 || $d < 1) return false;
-
- if ($marr[$m] < $d) return false;
-
- if ($y < 1000 && $y > 3000) return false;
-
- return true;
-}
-
-/**
- Low-level function that returns the getdate() array. We have a special
- $fast flag, which if set to true, will return fewer array values,
- and is much faster as it does not calculate dow, etc.
-*/
-function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
-{
-static $YRS;
-global $_month_table_normal,$_month_table_leaf;
-
- $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff_ts($origd));
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $d366 = $_day_power * 366;
- $d365 = $_day_power * 365;
-
- if ($d < 0) {
-
- if (empty($YRS)) $YRS = array(
- 1970 => 0,
- 1960 => -315619200,
- 1950 => -631152000,
- 1940 => -946771200,
- 1930 => -1262304000,
- 1920 => -1577923200,
- 1910 => -1893456000,
- 1900 => -2208988800,
- 1890 => -2524521600,
- 1880 => -2840140800,
- 1870 => -3155673600,
- 1860 => -3471292800,
- 1850 => -3786825600,
- 1840 => -4102444800,
- 1830 => -4417977600,
- 1820 => -4733596800,
- 1810 => -5049129600,
- 1800 => -5364662400,
- 1790 => -5680195200,
- 1780 => -5995814400,
- 1770 => -6311347200,
- 1760 => -6626966400,
- 1750 => -6942499200,
- 1740 => -7258118400,
- 1730 => -7573651200,
- 1720 => -7889270400,
- 1710 => -8204803200,
- 1700 => -8520336000,
- 1690 => -8835868800,
- 1680 => -9151488000,
- 1670 => -9467020800,
- 1660 => -9782640000,
- 1650 => -10098172800,
- 1640 => -10413792000,
- 1630 => -10729324800,
- 1620 => -11044944000,
- 1610 => -11360476800,
- 1600 => -11676096000);
-
- if ($is_gmt) $origd = $d;
- // The valid range of a 32bit signed timestamp is typically from
- // Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT
- //
-
- # old algorithm iterates through all years. new algorithm does it in
- # 10 year blocks
-
- /*
- # old algo
- for ($a = 1970 ; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- */
-
- $lastsecs = 0;
- $lastyear = 1970;
- foreach($YRS as $year => $secs) {
- if ($d >= $secs) {
- $a = $lastyear;
- break;
- }
- $lastsecs = $secs;
- $lastyear = $year;
- }
-
- $d -= $lastsecs;
- if (!isset($a)) $a = $lastyear;
-
- //echo ' yr=',$a,' ', $d,'.';
-
- for (; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- /**/
-
- $secsInYear = 86400 * ($leaf ? 366 : 365) + $lastd;
-
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 13 ; --$a > 0;) {
- $lastd = $d;
- $d += $mtab[$a] * $_day_power;
- if ($d >= 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
-
- $d = $lastd;
- $day = $ndays + ceil(($d+1) / ($_day_power));
-
- $d += ($ndays - $day+1)* $_day_power;
- $hour = floor($d/$_hour_power);
-
- } else {
- for ($a = 1970 ;; $a++) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d -= $d366;
- else $d -= $d365;
- if ($d < 0) {
- $year = $a;
- break;
- }
- }
- $secsInYear = $lastd;
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 1 ; $a <= 12; $a++) {
- $lastd = $d;
- $d -= $mtab[$a] * $_day_power;
- if ($d < 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
- $d = $lastd;
- $day = ceil(($d+1) / $_day_power);
- $d = $d - ($day-1) * $_day_power;
- $hour = floor($d /$_hour_power);
- }
-
- $d -= $hour * $_hour_power;
- $min = floor($d/$_min_power);
- $secs = $d - $min * $_min_power;
- if ($fast) {
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'leap' => $leaf,
- 'ndays' => $ndays
- );
- }
-
-
- $dow = adodb_dow($year,$month,$day);
-
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'wday' => $dow,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'weekday' => gmdate('l',$_day_power*(3+$dow)),
- 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)),
- 0 => $origd
- );
-}
-/*
- if ($isphp5)
- $dates .= sprintf('%s%04d',($gmt<=0)?'+':'-',abs($gmt)/36);
- else
- $dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36);
- break;*/
-function adodb_tz_offset($gmt,$isphp5)
-{
- $zhrs = abs($gmt)/3600;
- $hrs = floor($zhrs);
- if ($isphp5)
- return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
- else
- return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
-}
-
-
-function adodb_gmdate($fmt,$d=false)
-{
- return adodb_date($fmt,$d,true);
-}
-
-// accepts unix timestamp and iso date format in $d
-function adodb_date2($fmt, $d=false, $is_gmt=false)
-{
- if ($d !== false) {
- if (!preg_match(
- "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|",
- ($d), $rr)) return adodb_date($fmt,false,$is_gmt);
-
- if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt);
-
- // h-m-s-MM-DD-YY
- if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt);
- else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt);
- }
-
- return adodb_date($fmt,$d,$is_gmt);
-}
-
-
-/**
- Return formatted date based on timestamp $d
-*/
-function adodb_date($fmt,$d=false,$is_gmt=false)
-{
-static $daylight;
-global $ADODB_DATETIME_CLASS;
-
- if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
- if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer
- return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);
-
- }
- }
- $_day_power = 86400;
-
- $arr = _adodb_getdate($d,true,$is_gmt);
-
- if (!isset($daylight)) $daylight = function_exists('adodb_daylight_sv');
- if ($daylight) adodb_daylight_sv($arr, $is_gmt);
-
- $year = $arr['year'];
- $month = $arr['mon'];
- $day = $arr['mday'];
- $hour = $arr['hours'];
- $min = $arr['minutes'];
- $secs = $arr['seconds'];
-
- $max = strlen($fmt);
- $dates = '';
-
- $isphp5 = PHP_VERSION >= 5;
-
- /*
- at this point, we have the following integer vars to manipulate:
- $year, $month, $day, $hour, $min, $secs
- */
- for ($i=0; $i < $max; $i++) {
- switch($fmt[$i]) {
- case 'e':
- $dates .= date('e');
- break;
- case 'T':
- if ($ADODB_DATETIME_CLASS) {
- $dt = new DateTime();
- $dt->SetDate($year,$month,$day);
- $dates .= $dt->Format('T');
- } else
- $dates .= date('T');
- break;
- // YEAR
- case 'L': $dates .= $arr['leap'] ? '1' : '0'; break;
- case 'r': // Thu, 21 Dec 2000 16:01:07 +0200
-
- // 4.3.11 uses '04 Jun 2004'
- // 4.3.8 uses ' 4 Jun 2004'
- $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', '
- . ($day<10?'0'.$day:$day) . ' '.date('M',mktime(0,0,0,$month,2,1971)).' '.$year.' ';
-
- if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour;
-
- if ($min < 10) $dates .= ':0'.$min; else $dates .= ':'.$min;
-
- if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs;
-
- $gmt = adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= ' '.adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'Y': $dates .= $year; break;
- case 'y': $dates .= substr($year,strlen($year)-2,2); break;
- // MONTH
- case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break;
- case 'Q': $dates .= ($month+3)>>2; break;
- case 'n': $dates .= $month; break;
- case 'M': $dates .= date('M',mktime(0,0,0,$month,2,1971)); break;
- case 'F': $dates .= date('F',mktime(0,0,0,$month,2,1971)); break;
- // DAY
- case 't': $dates .= $arr['ndays']; break;
- case 'z': $dates .= $arr['yday']; break;
- case 'w': $dates .= adodb_dow($year,$month,$day); break;
- case 'l': $dates .= gmdate('l',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'D': $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'j': $dates .= $day; break;
- case 'd': if ($day<10) $dates .= '0'.$day; else $dates .= $day; break;
- case 'S':
- $d10 = $day % 10;
- if ($d10 == 1) $dates .= 'st';
- else if ($d10 == 2 && $day != 12) $dates .= 'nd';
- else if ($d10 == 3) $dates .= 'rd';
- else $dates .= 'th';
- break;
-
- // HOUR
- case 'Z':
- $dates .= ($is_gmt) ? 0 : -adodb_get_gmt_diff($year,$month,$day); break;
- case 'O':
- $gmt = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'H':
- if ($hour < 10) $dates .= '0'.$hour;
- else $dates .= $hour;
- break;
- case 'h':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
-
- if ($hh < 10) $dates .= '0'.$hh;
- else $dates .= $hh;
- break;
-
- case 'G':
- $dates .= $hour;
- break;
-
- case 'g':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
- $dates .= $hh;
- break;
- // MINUTES
- case 'i': if ($min < 10) $dates .= '0'.$min; else $dates .= $min; break;
- // SECONDS
- case 'U': $dates .= $d; break;
- case 's': if ($secs < 10) $dates .= '0'.$secs; else $dates .= $secs; break;
- // AM/PM
- // Note 00:00 to 11:59 is AM, while 12:00 to 23:59 is PM
- case 'a':
- if ($hour>=12) $dates .= 'pm';
- else $dates .= 'am';
- break;
- case 'A':
- if ($hour>=12) $dates .= 'PM';
- else $dates .= 'AM';
- break;
- default:
- $dates .= $fmt[$i]; break;
- // ESCAPE
- case "\\":
- $i++;
- if ($i < $max) $dates .= $fmt[$i];
- break;
- }
- }
- return $dates;
-}
-
-/**
- Returns a timestamp given a GMT/UTC time.
- Note that $is_dst is not implemented and is ignored.
-*/
-function adodb_gmmktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false)
-{
- return adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst,true);
-}
-
-/**
- Return a timestamp given a local time. Originally by jackbbs.
- Note that $is_dst is not implemented and is ignored.
-
- Not a very fast algorithm - O(n) operation. Could be optimized to O(1).
-*/
-function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false)
-{
- if (!defined('ADODB_TEST_DATES')) {
-
- if ($mon === false) {
- return $is_gmt? @gmmktime($hr,$min,$sec): @mktime($hr,$min,$sec);
- }
-
- // for windows, we don't check 1970 because with timezone differences,
- // 1 Jan 1970 could generate negative timestamp, which is illegal
- $usephpfns = (1970 < $year && $year < 2038
- || !defined('ADODB_NO_NEGATIVE_TS') && (1901 < $year && $year < 2038)
- );
-
-
- if ($usephpfns && ($year + $mon/12+$day/365.25+$hr/(24*365.25) >= 2038)) $usephpfns = false;
-
- if ($usephpfns) {
- return $is_gmt ?
- @gmmktime($hr,$min,$sec,$mon,$day,$year):
- @mktime($hr,$min,$sec,$mon,$day,$year);
- }
- }
-
- $gmt_different = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$mon,$day);
-
- /*
- # disabled because some people place large values in $sec.
- # however we need it for $mon because we use an array...
- $hr = intval($hr);
- $min = intval($min);
- $sec = intval($sec);
- */
- $mon = intval($mon);
- $day = intval($day);
- $year = intval($year);
-
-
- $year = adodb_year_digit_check($year);
-
- if ($mon > 12) {
- $y = floor(($mon-1)/ 12);
- $year += $y;
- $mon -= $y*12;
- } else if ($mon < 1) {
- $y = ceil((1-$mon) / 12);
- $year -= $y;
- $mon += $y*12;
- }
-
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $_total_date = 0;
- if ($year >= 1970) {
- for ($a = 1970 ; $a <= $year; $a++) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a < $year) {
- $_total_date += $_add_date;
- } else {
- for($b=1;$b<$mon;$b++) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date +=$day-1;
- $ret = $_total_date * $_day_power + $hr * $_hour_power + $min * $_min_power + $sec + $gmt_different;
-
- } else {
- for ($a = 1969 ; $a >= $year; $a--) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a > $year) { $_total_date += $_add_date;
- } else {
- for($b=12;$b>$mon;$b--) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date += $loop_table[$mon] - $day;
-
- $_day_time = $hr * $_hour_power + $min * $_min_power + $sec;
- $_day_time = $_day_power - $_day_time;
- $ret = -( $_total_date * $_day_power + $_day_time - $gmt_different);
- if ($ret < -12220185600) $ret += 10*86400; // if earlier than 5 Oct 1582 - gregorian correction
- else if ($ret < -12219321600) $ret = -12219321600; // if in limbo, reset to 15 Oct 1582.
- }
- //print " dmy=$day/$mon/$year $hr:$min:$sec => " .$ret;
- return $ret;
-}
-
-function adodb_gmstrftime($fmt, $ts=false)
-{
- return adodb_strftime($fmt,$ts,true);
-}
-
-// hack - convert to adodb_date
-function adodb_strftime($fmt, $ts=false,$is_gmt=false)
-{
-global $ADODB_DATE_LOCALE;
-
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
- if (!defined('ADODB_NO_NEGATIVE_TS') || $ts >= 0) // if windows, must be +ve integer
- return ($is_gmt)? @gmstrftime($fmt,$ts): @strftime($fmt,$ts);
-
- }
- }
-
- if (empty($ADODB_DATE_LOCALE)) {
- /*
- $tstr = strtoupper(gmstrftime('%c',31366800)); // 30 Dec 1970, 1 am
- $sep = substr($tstr,2,1);
- $hasAM = strrpos($tstr,'M') !== false;
- */
- # see http://phplens.com/lens/lensforum/msgs.php?id=14865 for reasoning, and changelog for version 0.24
- $dstr = gmstrftime('%x',31366800); // 30 Dec 1970, 1 am
- $sep = substr($dstr,2,1);
- $tstr = strtoupper(gmstrftime('%X',31366800)); // 30 Dec 1970, 1 am
- $hasAM = strrpos($tstr,'M') !== false;
-
- $ADODB_DATE_LOCALE = array();
- $ADODB_DATE_LOCALE[] = strncmp($tstr,'30',2) == 0 ? 'd'.$sep.'m'.$sep.'y' : 'm'.$sep.'d'.$sep.'y';
- $ADODB_DATE_LOCALE[] = ($hasAM) ? 'h:i:s a' : 'H:i:s';
-
- }
- $inpct = false;
- $fmtdate = '';
- for ($i=0,$max = strlen($fmt); $i < $max; $i++) {
- $ch = $fmt[$i];
- if ($ch == '%') {
- if ($inpct) {
- $fmtdate .= '%';
- $inpct = false;
- } else
- $inpct = true;
- } else if ($inpct) {
-
- $inpct = false;
- switch($ch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'E':
- case 'O':
- /* ignore format modifiers */
- $inpct = true;
- break;
-
- case 'a': $fmtdate .= 'D'; break;
- case 'A': $fmtdate .= 'l'; break;
- case 'h':
- case 'b': $fmtdate .= 'M'; break;
- case 'B': $fmtdate .= 'F'; break;
- case 'c': $fmtdate .= $ADODB_DATE_LOCALE[0].$ADODB_DATE_LOCALE[1]; break;
- case 'C': $fmtdate .= '\C?'; break; // century
- case 'd': $fmtdate .= 'd'; break;
- case 'D': $fmtdate .= 'm/d/y'; break;
- case 'e': $fmtdate .= 'j'; break;
- case 'g': $fmtdate .= '\g?'; break; //?
- case 'G': $fmtdate .= '\G?'; break; //?
- case 'H': $fmtdate .= 'H'; break;
- case 'I': $fmtdate .= 'h'; break;
- case 'j': $fmtdate .= '?z'; $parsej = true; break; // wrong as j=1-based, z=0-basd
- case 'm': $fmtdate .= 'm'; break;
- case 'M': $fmtdate .= 'i'; break;
- case 'n': $fmtdate .= "\n"; break;
- case 'p': $fmtdate .= 'a'; break;
- case 'r': $fmtdate .= 'h:i:s a'; break;
- case 'R': $fmtdate .= 'H:i:s'; break;
- case 'S': $fmtdate .= 's'; break;
- case 't': $fmtdate .= "\t"; break;
- case 'T': $fmtdate .= 'H:i:s'; break;
- case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break;
- case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break;
- case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'y': $fmtdate .= 'y'; break;
- case 'Y': $fmtdate .= 'Y'; break;
- case 'Z': $fmtdate .= 'T'; break;
- }
- } else if (('A' <= ($ch) && ($ch) <= 'Z' ) || ('a' <= ($ch) && ($ch) <= 'z' ))
- $fmtdate .= "\\".$ch;
- else
- $fmtdate .= $ch;
- }
- //echo "fmt=",$fmtdate,"
";
- if ($ts === false) $ts = time();
- $ret = adodb_date($fmtdate, $ts, $is_gmt);
- return $ret;
-}
-
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-xmlschema.inc.php b/src/adodb512/adodb-xmlschema.inc.php
deleted file mode 100644
index 706126e8..00000000
--- a/src/adodb512/adodb-xmlschema.inc.php
+++ /dev/null
@@ -1,2225 +0,0 @@
-parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
-
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
-
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
-
- }
-
- function create(&$xmls) {
- return array();
- }
-
- /**
- * Destroys the object
- */
- function destroy() {
- unset( $this );
- }
-
- /**
- * Checks whether the specified RDBMS is supported by the current
- * database object or its ranking ancestor.
- *
- * @param string $platform RDBMS platform name (from ADODB platform list).
- * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
- */
- function supportedPlatform( $platform = NULL ) {
- return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
- }
-
- /**
- * Returns the prefix set by the ranking ancestor of the database object.
- *
- * @param string $name Prefix string.
- * @return string Prefix.
- */
- function prefix( $name = '' ) {
- return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
- }
-
- /**
- * Extracts a field ID from the specified field.
- *
- * @param string $field Field.
- * @return string Field ID.
- */
- function FieldID( $field ) {
- return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
- }
-}
-
-/**
-* Creates a table object in ADOdb's datadict format
-*
-* This class stores information about a database table. As charactaristics
-* of the table are loaded from the external source, methods and properties
-* of this class are used to build up the table description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbTable extends dbObject {
-
- /**
- * @var string Table name
- */
- var $name;
-
- /**
- * @var array Field specifier: Meta-information about each field
- */
- var $fields = array();
-
- /**
- * @var array List of table indexes.
- */
- var $indexes = array();
-
- /**
- * @var array Table options: Table-level options
- */
- var $opts = array();
-
- /**
- * @var string Field index: Keeps track of which field is currently being processed
- */
- var $current_field;
-
- /**
- * @var boolean Mark table for destruction
- * @access private
- */
- var $drop_table;
-
- /**
- * @var boolean Mark field for destruction (not yet implemented)
- * @access private
- */
- var $drop_field = array();
-
- /**
- * Iniitializes a new table object.
- *
- * @param string $prefix DB Object prefix
- * @param array $attributes Array of table attributes.
- */
- function dbTable( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- $this->name = $this->prefix($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'INDEX':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addIndex( $attributes ) );
- }
- break;
- case 'DATA':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addData( $attributes ) );
- }
- break;
- case 'DROP':
- $this->drop();
- break;
- case 'FIELD':
- // Add a field
- $fieldName = $attributes['NAME'];
- $fieldType = $attributes['TYPE'];
- $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
- $fieldOpts = isset( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;
-
- $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
- break;
- case 'KEY':
- case 'NOTNULL':
- case 'AUTOINCREMENT':
- // Add a field option
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- case 'DEFAULT':
- // Add a field option to the table object
-
- // Work around ADOdb datadict issue that misinterprets empty strings.
- if( $attributes['VALUE'] == '' ) {
- $attributes['VALUE'] = " '' ";
- }
-
- $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
- break;
- case 'DEFDATE':
- case 'DEFTIMESTAMP':
- // Add a field option to the table object
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Table constraint
- case 'CONSTRAINT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- // Table option
- case 'OPT':
- $this->addTableOpt( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'TABLE':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- case 'FIELD':
- unset($this->current_field);
- break;
-
- }
- }
-
- /**
- * Adds an index to a table object
- *
- * @param array $attributes Index attributes
- * @return object dbIndex object
- */
- function addIndex( $attributes ) {
- $name = strtoupper( $attributes['NAME'] );
- $this->indexes[$name] = new dbIndex( $this, $attributes );
- return $this->indexes[$name];
- }
-
- /**
- * Adds data to a table object
- *
- * @param array $attributes Data attributes
- * @return object dbData object
- */
- function addData( $attributes ) {
- if( !isset( $this->data ) ) {
- $this->data = new dbData( $this, $attributes );
- }
- return $this->data;
- }
-
- /**
- * Adds a field to a table object
- *
- * $name is the name of the table to which the field should be added.
- * $type is an ADODB datadict field type. The following field types
- * are supported as of ADODB 3.40:
- * - C: varchar
- * - X: CLOB (character large object) or largest varchar size
- * if CLOB is not supported
- * - C2: Multibyte varchar
- * - X2: Multibyte CLOB
- * - B: BLOB (binary large object)
- * - D: Date (some databases do not support this, and we return a datetime type)
- * - T: Datetime or Timestamp
- * - L: Integer field suitable for storing booleans (0 or 1)
- * - I: Integer (mapped to I4)
- * - I1: 1-byte integer
- * - I2: 2-byte integer
- * - I4: 4-byte integer
- * - I8: 8-byte integer
- * - F: Floating point number
- * - N: Numeric or decimal number
- *
- * @param string $name Name of the table to which the field will be added.
- * @param string $type ADODB datadict field type.
- * @param string $size Field size
- * @param array $opts Field options array
- * @return array Field specifier array
- */
- function addField( $name, $type, $size = NULL, $opts = NULL ) {
- $field_id = $this->FieldID( $name );
-
- // Set the field index so we know where we are
- $this->current_field = $field_id;
-
- // Set the field name (required)
- $this->fields[$field_id]['NAME'] = $name;
-
- // Set the field type (required)
- $this->fields[$field_id]['TYPE'] = $type;
-
- // Set the field size (optional)
- if( isset( $size ) ) {
- $this->fields[$field_id]['SIZE'] = $size;
- }
-
- // Set the field options
- if( isset( $opts ) ) {
- $this->fields[$field_id]['OPTS'][] = $opts;
- }
- }
-
- /**
- * Adds a field option to the current field specifier
- *
- * This method adds a field option allowed by the ADOdb datadict
- * and appends it to the given field.
- *
- * @param string $field Field name
- * @param string $opt ADOdb field option
- * @param mixed $value Field option value
- * @return array Field specifier array
- */
- function addFieldOpt( $field, $opt, $value = NULL ) {
- if( !isset( $value ) ) {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;
- // Add the option and value
- } else {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );
- }
- }
-
- /**
- * Adds an option to the table
- *
- * This method takes a comma-separated list of table-level options
- * and appends them to the table object.
- *
- * @param string $opt Table option
- * @return array Options
- */
- function addTableOpt( $opt ) {
- if(isset($this->currentPlatform)) {
- $this->opts[$this->parent->db->databaseType] = $opt;
- }
- return $this->opts;
- }
-
-
- /**
- * Generates the SQL that will create the table in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing table creation SQL
- */
- function create( &$xmls ) {
- $sql = array();
-
- // drop any existing indexes
- if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {
- foreach( $legacy_indexes as $index => $index_details ) {
- $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );
- }
- }
-
- // remove fields to be dropped from table object
- foreach( $this->drop_field as $field ) {
- unset( $this->fields[$field] );
- }
-
- // if table exists
- if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {
- // drop table
- if( $this->drop_table ) {
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
-
- return $sql;
- }
-
- // drop any existing fields not in schema
- foreach( $legacy_fields as $field_id => $field ) {
- if( !isset( $this->fields[$field_id] ) ) {
- $sql[] = $xmls->dict->DropColumnSQL( $this->name, '`'.$field->name.'`' );
- }
- }
- // if table doesn't exist
- } else {
- if( $this->drop_table ) {
- return $sql;
- }
-
- $legacy_fields = array();
- }
-
- // Loop through the field specifier array, building the associative array for the field options
- $fldarray = array();
-
- foreach( $this->fields as $field_id => $finfo ) {
- // Set an empty size if it isn't supplied
- if( !isset( $finfo['SIZE'] ) ) {
- $finfo['SIZE'] = '';
- }
-
- // Initialize the field array with the type and size
- $fldarray[$field_id] = array(
- 'NAME' => $finfo['NAME'],
- 'TYPE' => $finfo['TYPE'],
- 'SIZE' => $finfo['SIZE']
- );
-
- // Loop through the options array and add the field options.
- if( isset( $finfo['OPTS'] ) ) {
- foreach( $finfo['OPTS'] as $opt ) {
- // Option has an argument.
- if( is_array( $opt ) ) {
- $key = key( $opt );
- $value = $opt[key( $opt )];
- @$fldarray[$field_id][$key] .= $value;
- // Option doesn't have arguments
- } else {
- $fldarray[$field_id][$opt] = $opt;
- }
- }
- }
- }
-
- if( empty( $legacy_fields ) ) {
- // Create the new table
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- logMsg( end( $sql ), 'Generated CreateTableSQL' );
- } else {
- // Upgrade an existing table
- logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );
- switch( $xmls->upgrade ) {
- // Use ChangeTableSQL
- case 'ALTER':
- logMsg( 'Generated ChangeTableSQL (ALTERing table)' );
- $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );
- break;
- case 'REPLACE':
- logMsg( 'Doing upgrade REPLACE (testing)' );
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- break;
- // ignore table
- default:
- return array();
- }
- }
-
- foreach( $this->indexes as $index ) {
- $sql[] = $index->create( $xmls );
- }
-
- if( isset( $this->data ) ) {
- $sql[] = $this->data->create( $xmls );
- }
-
- return $sql;
- }
-
- /**
- * Marks a field or table for destruction
- */
- function drop() {
- if( isset( $this->current_field ) ) {
- // Drop the current field
- logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );
- // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );
- $this->drop_field[$this->current_field] = $this->current_field;
- } else {
- // Drop the current table
- logMsg( "Dropping table '{$this->name}'" );
- // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );
- $this->drop_table = TRUE;
- }
- }
-}
-
-/**
-* Creates an index object in ADOdb's datadict format
-*
-* This class stores information about a database index. As charactaristics
-* of the index are loaded from the external source, methods and properties
-* of this class are used to build up the index description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbIndex extends dbObject {
-
- /**
- * @var string Index name
- */
- var $name;
-
- /**
- * @var array Index options: Index-level options
- */
- var $opts = array();
-
- /**
- * @var array Indexed fields: Table columns included in this index
- */
- var $columns = array();
-
- /**
- * @var boolean Mark index for destruction
- * @access private
- */
- var $drop = FALSE;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function dbIndex( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- $this->name = $this->prefix ($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'DROP':
- $this->drop();
- break;
- case 'CLUSTERED':
- case 'BITMAP':
- case 'UNIQUE':
- case 'FULLTEXT':
- case 'HASH':
- // Add index Option
- $this->addIndexOpt( $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'COL':
- $this->addField( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'INDEX':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $name ) {
- $this->columns[$this->FieldID( $name )] = $name;
-
- // Return the field list
- return $this->columns;
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addIndexOpt( $opt ) {
- $this->opts[] = $opt;
-
- // Return the options list
- return $this->opts;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- if( $this->drop ) {
- return NULL;
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->columns as $id => $col ) {
- if( !isset( $this->parent->fields[$id] ) ) {
- unset( $this->columns[$id] );
- }
- }
-
- return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );
- }
-
- /**
- * Marks an index for destruction
- */
- function drop() {
- $this->drop = TRUE;
- }
-}
-
-/**
-* Creates a data object in ADOdb's datadict format
-*
-* This class stores information about table data.
-*
-* @package axmls
-* @access private
-*/
-class dbData extends dbObject {
-
- var $data = array();
-
- var $row;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function dbData( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'ROW':
- $this->row = count( $this->data );
- $this->data[$this->row] = array();
- break;
- case 'F':
- $this->addField($attributes);
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'F':
- $this->addData( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'DATA':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $attributes ) {
- if( isset( $attributes['NAME'] ) ) {
- $name = $attributes['NAME'];
- } else {
- $name = count($this->data[$this->row]);
- }
-
- // Set the field index so we know where we are
- $this->current_field = $this->FieldID( $name );
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addData( $cdata ) {
- if( !isset( $this->data[$this->row] ) ) {
- $this->data[$this->row] = array();
- }
-
- if( !isset( $this->data[$this->row][$this->current_field] ) ) {
- $this->data[$this->row][$this->current_field] = '';
- }
-
- $this->data[$this->row][$this->current_field] .= $cdata;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- $table = $xmls->dict->TableName($this->parent->name);
- $table_field_count = count($this->parent->fields);
- $sql = array();
-
- // eliminate any columns that aren't in the table
- foreach( $this->data as $row ) {
- $table_fields = $this->parent->fields;
- $fields = array();
-
- foreach( $row as $field_id => $field_data ) {
- if( !array_key_exists( $field_id, $table_fields ) ) {
- if( is_numeric( $field_id ) ) {
- $field_id = reset( array_keys( $table_fields ) );
- } else {
- continue;
- }
- }
-
- $name = $table_fields[$field_id]['NAME'];
-
- switch( $table_fields[$field_id]['TYPE'] ) {
- case 'C':
- case 'C2':
- case 'X':
- case 'X2':
- $fields[$name] = $xmls->db->qstr( $field_data );
- break;
- case 'I':
- case 'I1':
- case 'I2':
- case 'I4':
- case 'I8':
- $fields[$name] = intval($field_data);
- break;
- default:
- $fields[$name] = $field_data;
- }
-
- unset($table_fields[$field_id]);
- }
-
- // check that at least 1 column is specified
- if( empty( $fields ) ) {
- continue;
- }
-
- // check that no required columns are missing
- if( count( $fields ) < $table_field_count ) {
- foreach( $table_fields as $field ) {
- if (isset( $field['OPTS'] ))
- if( ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {
- continue(2);
- }
- }
- }
-
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- }
-
- return $sql;
- }
-}
-
-/**
-* Creates the SQL to execute a list of provided SQL queries
-*
-* @package axmls
-* @access private
-*/
-class dbQuerySet extends dbObject {
-
- /**
- * @var array List of SQL queries
- */
- var $queries = array();
-
- /**
- * @var string String used to build of a query line by line
- */
- var $query;
-
- /**
- * @var string Query prefix key
- */
- var $prefixKey = '';
-
- /**
- * @var boolean Auto prefix enable (TRUE)
- */
- var $prefixMethod = 'AUTO';
-
- /**
- * Initializes the query set.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- */
- function dbQuerySet( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- // Overrides the manual prefix key
- if( isset( $attributes['KEY'] ) ) {
- $this->prefixKey = $attributes['KEY'];
- }
-
- $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
-
- // Enables or disables automatic prefix prepending
- switch( $prefixMethod ) {
- case 'AUTO':
- $this->prefixMethod = 'AUTO';
- break;
- case 'MANUAL':
- $this->prefixMethod = 'MANUAL';
- break;
- case 'NONE':
- $this->prefixMethod = 'NONE';
- break;
- }
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: QUERY.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'QUERY':
- // Create a new query in a SQL queryset.
- // Ignore this query set if a platform is specified and it's different than the
- // current connection platform.
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $this->newQuery();
- } else {
- $this->discardQuery();
- }
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Line of queryset SQL data
- case 'QUERY':
- $this->buildQuery( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'QUERY':
- // Add the finished query to the open query set.
- $this->addQuery();
- break;
- case 'SQL':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- default:
-
- }
- }
-
- /**
- * Re-initializes the query.
- *
- * @return boolean TRUE
- */
- function newQuery() {
- $this->query = '';
-
- return TRUE;
- }
-
- /**
- * Discards the existing query.
- *
- * @return boolean TRUE
- */
- function discardQuery() {
- unset( $this->query );
-
- return TRUE;
- }
-
- /**
- * Appends a line to a query that is being built line by line
- *
- * @param string $data Line of SQL data or NULL to initialize a new query
- * @return string SQL query string.
- */
- function buildQuery( $sql = NULL ) {
- if( !isset( $this->query ) OR empty( $sql ) ) {
- return FALSE;
- }
-
- $this->query .= $sql;
-
- return $this->query;
- }
-
- /**
- * Adds a completed query to the query list
- *
- * @return string SQL of added query
- */
- function addQuery() {
- if( !isset( $this->query ) ) {
- return FALSE;
- }
-
- $this->queries[] = $return = trim($this->query);
-
- unset( $this->query );
-
- return $return;
- }
-
- /**
- * Creates and returns the current query set
- *
- * @param object $xmls adoSchema object
- * @return array Query set
- */
- function create( &$xmls ) {
- foreach( $this->queries as $id => $query ) {
- switch( $this->prefixMethod ) {
- case 'AUTO':
- // Enable auto prefix replacement
-
- // Process object prefix.
- // Evaluate SQL statements to prepend prefix to objects
- $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
-
- // SELECT statements aren't working yet
- #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
-
- case 'MANUAL':
- // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
- // If prefixKey is not set, we use the default constant XMLS_PREFIX
- if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
- // Enable prefix override
- $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
- } else {
- // Use default replacement
- $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
- }
- }
-
- $this->queries[$id] = trim( $query );
- }
-
- // Return the query set array
- return $this->queries;
- }
-
- /**
- * Rebuilds the query with the prefix attached to any objects
- *
- * @param string $regex Regex used to add prefix
- * @param string $query SQL query string
- * @param string $prefix Prefix to be appended to tables, indices, etc.
- * @return string Prefixed SQL query string.
- */
- function prefixQuery( $regex, $query, $prefix = NULL ) {
- if( !isset( $prefix ) ) {
- return $query;
- }
-
- if( preg_match( $regex, $query, $match ) ) {
- $preamble = $match[1];
- $postamble = $match[5];
- $objectList = explode( ',', $match[3] );
- // $prefix = $prefix . '_';
-
- $prefixedList = '';
-
- foreach( $objectList as $object ) {
- if( $prefixedList !== '' ) {
- $prefixedList .= ', ';
- }
-
- $prefixedList .= $prefix . trim( $object );
- }
-
- $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
- }
-
- return $query;
- }
-}
-
-/**
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
-*
-* This class is used to load and parse the XML file, to create an array of SQL statements
-* that can be used to build a database, and to build the database using the SQL array.
-*
-* @tutorial getting_started.pkg
-*
-* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.12 $
-*
-* @package axmls
-*/
-class adoSchema {
-
- /**
- * @var array Array containing SQL queries to generate all objects
- * @access private
- */
- var $sqlArray;
-
- /**
- * @var object ADOdb connection object
- * @access private
- */
- var $db;
-
- /**
- * @var object ADOdb Data Dictionary
- * @access private
- */
- var $dict;
-
- /**
- * @var string Current XML element
- * @access private
- */
- var $currentElement = '';
-
- /**
- * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database
- * @access private
- */
- var $upgrade = '';
-
- /**
- * @var string Optional object prefix
- * @access private
- */
- var $objectPrefix = '';
-
- /**
- * @var long Original Magic Quotes Runtime value
- * @access private
- */
- var $mgq;
-
- /**
- * @var long System debug
- * @access private
- */
- var $debug;
-
- /**
- * @var string Regular expression to find schema version
- * @access private
- */
- var $versionRegex = '/' . "\n";
-
- foreach( $msg as $label => $details ) {
- $error_details .= '
';
-
- trigger_error( $error_details, E_USER_ERROR );
- }
-
- /**
- * Returns the AXMLS Schema Version of the requested XML schema file.
- *
- * Call this method to obtain the AXMLS DTD version of the requested XML schema file.
- * @see SchemaStringVersion()
- *
- * @param string $filename AXMLS schema file
- * @return string Schema version number or FALSE on error
- */
- function SchemaFileVersion( $filename ) {
- // Open the file
- if( !($fp = fopen( $filename, 'r' )) ) {
- // die( 'Unable to open file' );
- return FALSE;
- }
-
- // Process the file
- while( $data = fread( $fp, 4096 ) ) {
- if( preg_match( $this->versionRegex, $data, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Returns the AXMLS Schema Version of the provided XML schema string.
- *
- * Call this method to obtain the AXMLS DTD version of the provided XML schema string.
- * @see SchemaFileVersion()
- *
- * @param string $xmlstring XML schema string
- * @return string Schema version number or FALSE on error
- */
- function SchemaStringVersion( $xmlstring ) {
- if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {
- return FALSE;
- }
-
- if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
-
- return FALSE;
- }
-
- /**
- * Extracts an XML schema from an existing database.
- *
- * Call this method to create an XML schema string from an existing database.
- * If the data parameter is set to TRUE, AXMLS will include the data from the database
- * in the schema.
- *
- * @param boolean $data Include data in schema dump
- * @return string Generated XML schema
- */
- function ExtractSchema( $data = FALSE ) {
- $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
-
- $schema = '' . "\n"
- . ' ' . "\n";
- }
-
- $error_details .= '' . $label . ': ' . htmlentities( $details ) . ' ' . "\n";
-
- // grab details from database
- $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE 1=1' );
- $fields = $this->db->MetaColumns( $table );
- $indexes = $this->db->MetaIndexes( $table );
-
- if( is_array( $fields ) ) {
- foreach( $fields as $details ) {
- $extra = '';
- $content = array();
-
- if( $details->max_length > 0 ) {
- $extra .= ' size="' . $details->max_length . '"';
- }
-
- if( $details->primary_key ) {
- $content[] = '
' . "\n";
- }
- }
-
- $this->db->SetFetchMode( $old_mode );
-
- $schema .= '';
-
- if( isset( $title ) ) {
- echo '';
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb-xmlschema03.inc.php b/src/adodb512/adodb-xmlschema03.inc.php
deleted file mode 100644
index 6e9ff353..00000000
--- a/src/adodb512/adodb-xmlschema03.inc.php
+++ /dev/null
@@ -1,2406 +0,0 @@
-parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
-
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
-
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
-
- }
-
- function create(&$xmls) {
- return array();
- }
-
- /**
- * Destroys the object
- */
- function destroy() {
- unset( $this );
- }
-
- /**
- * Checks whether the specified RDBMS is supported by the current
- * database object or its ranking ancestor.
- *
- * @param string $platform RDBMS platform name (from ADODB platform list).
- * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
- */
- function supportedPlatform( $platform = NULL ) {
- return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
- }
-
- /**
- * Returns the prefix set by the ranking ancestor of the database object.
- *
- * @param string $name Prefix string.
- * @return string Prefix.
- */
- function prefix( $name = '' ) {
- return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
- }
-
- /**
- * Extracts a field ID from the specified field.
- *
- * @param string $field Field.
- * @return string Field ID.
- */
- function FieldID( $field ) {
- return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
- }
-}
-
-/**
-* Creates a table object in ADOdb's datadict format
-*
-* This class stores information about a database table. As charactaristics
-* of the table are loaded from the external source, methods and properties
-* of this class are used to build up the table description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbTable extends dbObject {
-
- /**
- * @var string Table name
- */
- var $name;
-
- /**
- * @var array Field specifier: Meta-information about each field
- */
- var $fields = array();
-
- /**
- * @var array List of table indexes.
- */
- var $indexes = array();
-
- /**
- * @var array Table options: Table-level options
- */
- var $opts = array();
-
- /**
- * @var string Field index: Keeps track of which field is currently being processed
- */
- var $current_field;
-
- /**
- * @var boolean Mark table for destruction
- * @access private
- */
- var $drop_table;
-
- /**
- * @var boolean Mark field for destruction (not yet implemented)
- * @access private
- */
- var $drop_field = array();
-
- /**
- * @var array Platform-specific options
- * @access private
- */
- var $currentPlatform = true;
-
-
- /**
- * Iniitializes a new table object.
- *
- * @param string $prefix DB Object prefix
- * @param array $attributes Array of table attributes.
- */
- function dbTable( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- $this->name = $this->prefix($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'INDEX':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addIndex( $attributes ) );
- }
- break;
- case 'DATA':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addData( $attributes ) );
- }
- break;
- case 'DROP':
- $this->drop();
- break;
- case 'FIELD':
- // Add a field
- $fieldName = $attributes['NAME'];
- $fieldType = $attributes['TYPE'];
- $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
- $fieldOpts = !empty( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;
-
- $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
- break;
- case 'KEY':
- case 'NOTNULL':
- case 'AUTOINCREMENT':
- case 'DEFDATE':
- case 'DEFTIMESTAMP':
- case 'UNSIGNED':
- // Add a field option
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- case 'DEFAULT':
- // Add a field option to the table object
-
- // Work around ADOdb datadict issue that misinterprets empty strings.
- if( $attributes['VALUE'] == '' ) {
- $attributes['VALUE'] = " '' ";
- }
-
- $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
- break;
- case 'OPT':
- case 'CONSTRAINT':
- // Accept platform-specific options
- $this->currentPlatform = ( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Table/field constraint
- case 'CONSTRAINT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- // Table/field option
- case 'OPT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'TABLE':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- case 'FIELD':
- unset($this->current_field);
- break;
- case 'OPT':
- case 'CONSTRAINT':
- $this->currentPlatform = true;
- break;
- default:
-
- }
- }
-
- /**
- * Adds an index to a table object
- *
- * @param array $attributes Index attributes
- * @return object dbIndex object
- */
- function addIndex( $attributes ) {
- $name = strtoupper( $attributes['NAME'] );
- $this->indexes[$name] = new dbIndex( $this, $attributes );
- return $this->indexes[$name];
- }
-
- /**
- * Adds data to a table object
- *
- * @param array $attributes Data attributes
- * @return object dbData object
- */
- function addData( $attributes ) {
- if( !isset( $this->data ) ) {
- $this->data = new dbData( $this, $attributes );
- }
- return $this->data;
- }
-
- /**
- * Adds a field to a table object
- *
- * $name is the name of the table to which the field should be added.
- * $type is an ADODB datadict field type. The following field types
- * are supported as of ADODB 3.40:
- * - C: varchar
- * - X: CLOB (character large object) or largest varchar size
- * if CLOB is not supported
- * - C2: Multibyte varchar
- * - X2: Multibyte CLOB
- * - B: BLOB (binary large object)
- * - D: Date (some databases do not support this, and we return a datetime type)
- * - T: Datetime or Timestamp
- * - L: Integer field suitable for storing booleans (0 or 1)
- * - I: Integer (mapped to I4)
- * - I1: 1-byte integer
- * - I2: 2-byte integer
- * - I4: 4-byte integer
- * - I8: 8-byte integer
- * - F: Floating point number
- * - N: Numeric or decimal number
- *
- * @param string $name Name of the table to which the field will be added.
- * @param string $type ADODB datadict field type.
- * @param string $size Field size
- * @param array $opts Field options array
- * @return array Field specifier array
- */
- function addField( $name, $type, $size = NULL, $opts = NULL ) {
- $field_id = $this->FieldID( $name );
-
- // Set the field index so we know where we are
- $this->current_field = $field_id;
-
- // Set the field name (required)
- $this->fields[$field_id]['NAME'] = $name;
-
- // Set the field type (required)
- $this->fields[$field_id]['TYPE'] = $type;
-
- // Set the field size (optional)
- if( isset( $size ) ) {
- $this->fields[$field_id]['SIZE'] = $size;
- }
-
- // Set the field options
- if( isset( $opts ) ) {
- $this->fields[$field_id]['OPTS'] = array($opts);
- } else {
- $this->fields[$field_id]['OPTS'] = array();
- }
- }
-
- /**
- * Adds a field option to the current field specifier
- *
- * This method adds a field option allowed by the ADOdb datadict
- * and appends it to the given field.
- *
- * @param string $field Field name
- * @param string $opt ADOdb field option
- * @param mixed $value Field option value
- * @return array Field specifier array
- */
- function addFieldOpt( $field, $opt, $value = NULL ) {
- if( $this->currentPlatform ) {
- if( !isset( $value ) ) {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;
- // Add the option and value
- } else {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );
- }
- }
- }
-
- /**
- * Adds an option to the table
- *
- * This method takes a comma-separated list of table-level options
- * and appends them to the table object.
- *
- * @param string $opt Table option
- * @return array Options
- */
- function addTableOpt( $opt ) {
- if(isset($this->currentPlatform)) {
- $this->opts[$this->parent->db->databaseType] = $opt;
- }
- return $this->opts;
- }
-
-
- /**
- * Generates the SQL that will create the table in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing table creation SQL
- */
- function create( &$xmls ) {
- $sql = array();
-
- // drop any existing indexes
- if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {
- foreach( $legacy_indexes as $index => $index_details ) {
- $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );
- }
- }
-
- // remove fields to be dropped from table object
- foreach( $this->drop_field as $field ) {
- unset( $this->fields[$field] );
- }
-
- // if table exists
- if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {
- // drop table
- if( $this->drop_table ) {
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
-
- return $sql;
- }
-
- // drop any existing fields not in schema
- foreach( $legacy_fields as $field_id => $field ) {
- if( !isset( $this->fields[$field_id] ) ) {
- $sql[] = $xmls->dict->DropColumnSQL( $this->name, $field->name );
- }
- }
- // if table doesn't exist
- } else {
- if( $this->drop_table ) {
- return $sql;
- }
-
- $legacy_fields = array();
- }
-
- // Loop through the field specifier array, building the associative array for the field options
- $fldarray = array();
-
- foreach( $this->fields as $field_id => $finfo ) {
- // Set an empty size if it isn't supplied
- if( !isset( $finfo['SIZE'] ) ) {
- $finfo['SIZE'] = '';
- }
-
- // Initialize the field array with the type and size
- $fldarray[$field_id] = array(
- 'NAME' => $finfo['NAME'],
- 'TYPE' => $finfo['TYPE'],
- 'SIZE' => $finfo['SIZE']
- );
-
- // Loop through the options array and add the field options.
- if( isset( $finfo['OPTS'] ) ) {
- foreach( $finfo['OPTS'] as $opt ) {
- // Option has an argument.
- if( is_array( $opt ) ) {
- $key = key( $opt );
- $value = $opt[key( $opt )];
- @$fldarray[$field_id][$key] .= $value;
- // Option doesn't have arguments
- } else {
- $fldarray[$field_id][$opt] = $opt;
- }
- }
- }
- }
-
- if( empty( $legacy_fields ) ) {
- // Create the new table
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- logMsg( end( $sql ), 'Generated CreateTableSQL' );
- } else {
- // Upgrade an existing table
- logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );
- switch( $xmls->upgrade ) {
- // Use ChangeTableSQL
- case 'ALTER':
- logMsg( 'Generated ChangeTableSQL (ALTERing table)' );
- $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );
- break;
- case 'REPLACE':
- logMsg( 'Doing upgrade REPLACE (testing)' );
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- break;
- // ignore table
- default:
- return array();
- }
- }
-
- foreach( $this->indexes as $index ) {
- $sql[] = $index->create( $xmls );
- }
-
- if( isset( $this->data ) ) {
- $sql[] = $this->data->create( $xmls );
- }
-
- return $sql;
- }
-
- /**
- * Marks a field or table for destruction
- */
- function drop() {
- if( isset( $this->current_field ) ) {
- // Drop the current field
- logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );
- // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );
- $this->drop_field[$this->current_field] = $this->current_field;
- } else {
- // Drop the current table
- logMsg( "Dropping table '{$this->name}'" );
- // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );
- $this->drop_table = TRUE;
- }
- }
-}
-
-/**
-* Creates an index object in ADOdb's datadict format
-*
-* This class stores information about a database index. As charactaristics
-* of the index are loaded from the external source, methods and properties
-* of this class are used to build up the index description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbIndex extends dbObject {
-
- /**
- * @var string Index name
- */
- var $name;
-
- /**
- * @var array Index options: Index-level options
- */
- var $opts = array();
-
- /**
- * @var array Indexed fields: Table columns included in this index
- */
- var $columns = array();
-
- /**
- * @var boolean Mark index for destruction
- * @access private
- */
- var $drop = FALSE;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function dbIndex( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- $this->name = $this->prefix ($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'DROP':
- $this->drop();
- break;
- case 'CLUSTERED':
- case 'BITMAP':
- case 'UNIQUE':
- case 'FULLTEXT':
- case 'HASH':
- // Add index Option
- $this->addIndexOpt( $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'COL':
- $this->addField( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'INDEX':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $name ) {
- $this->columns[$this->FieldID( $name )] = $name;
-
- // Return the field list
- return $this->columns;
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addIndexOpt( $opt ) {
- $this->opts[] = $opt;
-
- // Return the options list
- return $this->opts;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- if( $this->drop ) {
- return NULL;
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->columns as $id => $col ) {
- if( !isset( $this->parent->fields[$id] ) ) {
- unset( $this->columns[$id] );
- }
- }
-
- return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );
- }
-
- /**
- * Marks an index for destruction
- */
- function drop() {
- $this->drop = TRUE;
- }
-}
-
-/**
-* Creates a data object in ADOdb's datadict format
-*
-* This class stores information about table data, and is called
-* when we need to load field data into a table.
-*
-* @package axmls
-* @access private
-*/
-class dbData extends dbObject {
-
- var $data = array();
-
- var $row;
-
- /**
- * Initializes the new dbData object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function dbData( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: ROW and F (field).
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'ROW':
- $this->row = count( $this->data );
- $this->data[$this->row] = array();
- break;
- case 'F':
- $this->addField($attributes);
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'F':
- $this->addData( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'DATA':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the insert
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $attributes ) {
- // check we're in a valid row
- if( !isset( $this->row ) || !isset( $this->data[$this->row] ) ) {
- return;
- }
-
- // Set the field index so we know where we are
- if( isset( $attributes['NAME'] ) ) {
- $this->current_field = $this->FieldID( $attributes['NAME'] );
- } else {
- $this->current_field = count( $this->data[$this->row] );
- }
-
- // initialise data
- if( !isset( $this->data[$this->row][$this->current_field] ) ) {
- $this->data[$this->row][$this->current_field] = '';
- }
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addData( $cdata ) {
- // check we're in a valid field
- if ( isset( $this->data[$this->row][$this->current_field] ) ) {
- // add data to field
- $this->data[$this->row][$this->current_field] .= $cdata;
- }
- }
-
- /**
- * Generates the SQL that will add/update the data in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- $table = $xmls->dict->TableName($this->parent->name);
- $table_field_count = count($this->parent->fields);
- $tables = $xmls->db->MetaTables();
- $sql = array();
-
- $ukeys = $xmls->db->MetaPrimaryKeys( $table );
- if( !empty( $this->parent->indexes ) and !empty( $ukeys ) ) {
- foreach( $this->parent->indexes as $indexObj ) {
- if( !in_array( $indexObj->name, $ukeys ) ) $ukeys[] = $indexObj->name;
- }
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->data as $row ) {
- $table_fields = $this->parent->fields;
- $fields = array();
- $rawfields = array(); // Need to keep some of the unprocessed data on hand.
-
- foreach( $row as $field_id => $field_data ) {
- if( !array_key_exists( $field_id, $table_fields ) ) {
- if( is_numeric( $field_id ) ) {
- $field_id = reset( array_keys( $table_fields ) );
- } else {
- continue;
- }
- }
-
- $name = $table_fields[$field_id]['NAME'];
-
- switch( $table_fields[$field_id]['TYPE'] ) {
- case 'I':
- case 'I1':
- case 'I2':
- case 'I4':
- case 'I8':
- $fields[$name] = intval($field_data);
- break;
- case 'C':
- case 'C2':
- case 'X':
- case 'X2':
- default:
- $fields[$name] = $xmls->db->qstr( $field_data );
- $rawfields[$name] = $field_data;
- }
-
- unset($table_fields[$field_id]);
-
- }
-
- // check that at least 1 column is specified
- if( empty( $fields ) ) {
- continue;
- }
-
- // check that no required columns are missing
- if( count( $fields ) < $table_field_count ) {
- foreach( $table_fields as $field ) {
- if( isset( $field['OPTS'] ) and ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {
- continue(2);
- }
- }
- }
-
- // The rest of this method deals with updating existing data records.
-
- if( !in_array( $table, $tables ) or ( $mode = $xmls->existingData() ) == XMLS_MODE_INSERT ) {
- // Table doesn't yet exist, so it's safe to insert.
- logMsg( "$table doesn't exist, inserting or mode is INSERT" );
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- continue;
- }
-
- // Prepare to test for potential violations. Get primary keys and unique indexes
- $mfields = array_merge( $fields, $rawfields );
- $keyFields = array_intersect( $ukeys, array_keys( $mfields ) );
-
- if( empty( $ukeys ) or count( $keyFields ) == 0 ) {
- // No unique keys in schema, so safe to insert
- logMsg( "Either schema or data has no unique keys, so safe to insert" );
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- continue;
- }
-
- // Select record containing matching unique keys.
- $where = '';
- foreach( $ukeys as $key ) {
- if( isset( $mfields[$key] ) and $mfields[$key] ) {
- if( $where ) $where .= ' AND ';
- $where .= $key . ' = ' . $xmls->db->qstr( $mfields[$key] );
- }
- }
- $records = $xmls->db->Execute( 'SELECT * FROM ' . $table . ' WHERE ' . $where );
- switch( $records->RecordCount() ) {
- case 0:
- // No matching record, so safe to insert.
- logMsg( "No matching records. Inserting new row with unique data" );
- $sql[] = $xmls->db->GetInsertSQL( $records, $mfields );
- break;
- case 1:
- // Exactly one matching record, so we can update if the mode permits.
- logMsg( "One matching record..." );
- if( $mode == XMLS_MODE_UPDATE ) {
- logMsg( "...Updating existing row from unique data" );
- $sql[] = $xmls->db->GetUpdateSQL( $records, $mfields );
- }
- break;
- default:
- // More than one matching record; the result is ambiguous, so we must ignore the row.
- logMsg( "More than one matching record. Ignoring row." );
- }
- }
- return $sql;
- }
-}
-
-/**
-* Creates the SQL to execute a list of provided SQL queries
-*
-* @package axmls
-* @access private
-*/
-class dbQuerySet extends dbObject {
-
- /**
- * @var array List of SQL queries
- */
- var $queries = array();
-
- /**
- * @var string String used to build of a query line by line
- */
- var $query;
-
- /**
- * @var string Query prefix key
- */
- var $prefixKey = '';
-
- /**
- * @var boolean Auto prefix enable (TRUE)
- */
- var $prefixMethod = 'AUTO';
-
- /**
- * Initializes the query set.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- */
- function dbQuerySet( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- // Overrides the manual prefix key
- if( isset( $attributes['KEY'] ) ) {
- $this->prefixKey = $attributes['KEY'];
- }
-
- $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
-
- // Enables or disables automatic prefix prepending
- switch( $prefixMethod ) {
- case 'AUTO':
- $this->prefixMethod = 'AUTO';
- break;
- case 'MANUAL':
- $this->prefixMethod = 'MANUAL';
- break;
- case 'NONE':
- $this->prefixMethod = 'NONE';
- break;
- }
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: QUERY.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'QUERY':
- // Create a new query in a SQL queryset.
- // Ignore this query set if a platform is specified and it's different than the
- // current connection platform.
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $this->newQuery();
- } else {
- $this->discardQuery();
- }
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Line of queryset SQL data
- case 'QUERY':
- $this->buildQuery( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'QUERY':
- // Add the finished query to the open query set.
- $this->addQuery();
- break;
- case 'SQL':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- default:
-
- }
- }
-
- /**
- * Re-initializes the query.
- *
- * @return boolean TRUE
- */
- function newQuery() {
- $this->query = '';
-
- return TRUE;
- }
-
- /**
- * Discards the existing query.
- *
- * @return boolean TRUE
- */
- function discardQuery() {
- unset( $this->query );
-
- return TRUE;
- }
-
- /**
- * Appends a line to a query that is being built line by line
- *
- * @param string $data Line of SQL data or NULL to initialize a new query
- * @return string SQL query string.
- */
- function buildQuery( $sql = NULL ) {
- if( !isset( $this->query ) OR empty( $sql ) ) {
- return FALSE;
- }
-
- $this->query .= $sql;
-
- return $this->query;
- }
-
- /**
- * Adds a completed query to the query list
- *
- * @return string SQL of added query
- */
- function addQuery() {
- if( !isset( $this->query ) ) {
- return FALSE;
- }
-
- $this->queries[] = $return = trim($this->query);
-
- unset( $this->query );
-
- return $return;
- }
-
- /**
- * Creates and returns the current query set
- *
- * @param object $xmls adoSchema object
- * @return array Query set
- */
- function create( &$xmls ) {
- foreach( $this->queries as $id => $query ) {
- switch( $this->prefixMethod ) {
- case 'AUTO':
- // Enable auto prefix replacement
-
- // Process object prefix.
- // Evaluate SQL statements to prepend prefix to objects
- $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
-
- // SELECT statements aren't working yet
- #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
-
- case 'MANUAL':
- // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
- // If prefixKey is not set, we use the default constant XMLS_PREFIX
- if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
- // Enable prefix override
- $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
- } else {
- // Use default replacement
- $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
- }
- }
-
- $this->queries[$id] = trim( $query );
- }
-
- // Return the query set array
- return $this->queries;
- }
-
- /**
- * Rebuilds the query with the prefix attached to any objects
- *
- * @param string $regex Regex used to add prefix
- * @param string $query SQL query string
- * @param string $prefix Prefix to be appended to tables, indices, etc.
- * @return string Prefixed SQL query string.
- */
- function prefixQuery( $regex, $query, $prefix = NULL ) {
- if( !isset( $prefix ) ) {
- return $query;
- }
-
- if( preg_match( $regex, $query, $match ) ) {
- $preamble = $match[1];
- $postamble = $match[5];
- $objectList = explode( ',', $match[3] );
- // $prefix = $prefix . '_';
-
- $prefixedList = '';
-
- foreach( $objectList as $object ) {
- if( $prefixedList !== '' ) {
- $prefixedList .= ', ';
- }
-
- $prefixedList .= $prefix . trim( $object );
- }
-
- $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
- }
-
- return $query;
- }
-}
-
-/**
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
-*
-* This class is used to load and parse the XML file, to create an array of SQL statements
-* that can be used to build a database, and to build the database using the SQL array.
-*
-* @tutorial getting_started.pkg
-*
-* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.62 $
-*
-* @package axmls
-*/
-class adoSchema {
-
- /**
- * @var array Array containing SQL queries to generate all objects
- * @access private
- */
- var $sqlArray;
-
- /**
- * @var object ADOdb connection object
- * @access private
- */
- var $db;
-
- /**
- * @var object ADOdb Data Dictionary
- * @access private
- */
- var $dict;
-
- /**
- * @var string Current XML element
- * @access private
- */
- var $currentElement = '';
-
- /**
- * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database
- * @access private
- */
- var $upgrade = '';
-
- /**
- * @var string Optional object prefix
- * @access private
- */
- var $objectPrefix = '';
-
- /**
- * @var long Original Magic Quotes Runtime value
- * @access private
- */
- var $mgq;
-
- /**
- * @var long System debug
- * @access private
- */
- var $debug;
-
- /**
- * @var string Regular expression to find schema version
- * @access private
- */
- var $versionRegex = '/' . htmlentities( $title ) . '
';
- }
-
- if( is_object( $this ) ) {
- echo '[' . get_class( $this ) . '] ';
- }
-
- print_r( $msg );
-
- echo '' . "\n";
-
- foreach( $msg as $label => $details ) {
- $error_details .= '
';
-
- trigger_error( $error_details, E_USER_ERROR );
- }
-
- /**
- * Returns the AXMLS Schema Version of the requested XML schema file.
- *
- * Call this method to obtain the AXMLS DTD version of the requested XML schema file.
- * @see SchemaStringVersion()
- *
- * @param string $filename AXMLS schema file
- * @return string Schema version number or FALSE on error
- */
- function SchemaFileVersion( $filename ) {
- // Open the file
- if( !($fp = fopen( $filename, 'r' )) ) {
- // die( 'Unable to open file' );
- return FALSE;
- }
-
- // Process the file
- while( $data = fread( $fp, 4096 ) ) {
- if( preg_match( $this->versionRegex, $data, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Returns the AXMLS Schema Version of the provided XML schema string.
- *
- * Call this method to obtain the AXMLS DTD version of the provided XML schema string.
- * @see SchemaFileVersion()
- *
- * @param string $xmlstring XML schema string
- * @return string Schema version number or FALSE on error
- */
- function SchemaStringVersion( $xmlstring ) {
- if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {
- return FALSE;
- }
-
- if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
-
- return FALSE;
- }
-
- /**
- * Extracts an XML schema from an existing database.
- *
- * Call this method to create an XML schema string from an existing database.
- * If the data parameter is set to TRUE, AXMLS will include the data from the database
- * in the schema.
- *
- * @param boolean $data Include data in schema dump
- * @indent string indentation to use
- * @prefix string extract only tables with given prefix
- * @stripprefix strip prefix string when storing in XML schema
- * @return string Generated XML schema
- */
- function ExtractSchema( $data = FALSE, $indent = ' ', $prefix = '' , $stripprefix=false) {
- $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
-
- $schema = '' . "\n"
- . ' ' . "\n";
- }
-
- $error_details .= '' . $label . ': ' . htmlentities( $details ) . ' ' . "\n";
-
- // grab details from database
- $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE -1' );
- $fields = $this->db->MetaColumns( $table );
- $indexes = $this->db->MetaIndexes( $table );
-
- if( is_array( $fields ) ) {
- foreach( $fields as $details ) {
- $extra = '';
- $content = array();
-
- if( isset($details->max_length) && $details->max_length > 0 ) {
- $extra .= ' size="' . $details->max_length . '"';
- }
-
- if( isset($details->primary_key) && $details->primary_key ) {
- $content[] = '
\n";
- }
- }
-
- $this->db->SetFetchMode( $old_mode );
-
- $schema .= '';
-
- if( isset( $title ) ) {
- echo '';
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/adodb.inc.php b/src/adodb512/adodb.inc.php
deleted file mode 100644
index 242df9d3..00000000
--- a/src/adodb512/adodb.inc.php
+++ /dev/null
@@ -1,4441 +0,0 @@
-fields is available on EOF
- $ADODB_FETCH_MODE, // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default...
- $ADODB_GETONE_EOF,
- $ADODB_QUOTE_FIELDNAMES; // Allows you to force quotes (backticks) around field names in queries generated by getinsertsql and getupdatesql.
-
- //==============================================================================================
- // GLOBAL SETUP
- //==============================================================================================
-
- $ADODB_EXTENSION = defined('ADODB_EXTENSION');
-
- //********************************************************//
- /*
- Controls $ADODB_FORCE_TYPE mode. Default is ADODB_FORCE_VALUE (3).
- Used in GetUpdateSql and GetInsertSql functions. Thx to Niko, nuko#mbnet.fi
-
- 0 = ignore empty fields. All empty fields in array are ignored.
- 1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
- 2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
- 3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and empty fields '' are set to empty '' sql values.
- */
- define('ADODB_FORCE_IGNORE',0);
- define('ADODB_FORCE_NULL',1);
- define('ADODB_FORCE_EMPTY',2);
- define('ADODB_FORCE_VALUE',3);
- //********************************************************//
-
-
- if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) {
-
- define('ADODB_BAD_RS','' . htmlentities( $title ) . '
';
- }
-
- if( @is_object( $this ) ) {
- echo '[' . get_class( $this ) . '] ';
- }
-
- print_r( $msg );
-
- echo '\n". $rez."
");
- }
- return $rez;
- }
-
- // flush one file in cache
- function flushcache($f, $debug=false)
- {
- if (!@unlink($f)) {
- if ($debug) ADOConnection::outp( "flushcache: failed for $f");
- }
- }
-
- function getdirname($hash)
- {
- global $ADODB_CACHE_DIR;
- if (!isset($this->notSafeMode)) $this->notSafeMode = !ini_get('safe_mode');
- return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR;
- }
-
- // create temp directories
- function createdir($hash, $debug)
- {
- $dir = $this->getdirname($hash);
- if ($this->notSafeMode && !file_exists($dir)) {
- $oldu = umask(0);
- if (!@mkdir($dir,0771)) if(!is_dir($dir) && $debug) ADOConnection::outp("Cannot create $dir");
- umask($oldu);
- }
-
- return $dir;
- }
-
- /**
- * Private function to erase all of the files and subdirectories in a directory.
- *
- * Just specify the directory, and tell it if you want to delete the directory or just clear it out.
- * Note: $kill_top_level is used internally in the function to flush subdirectories.
- */
- function _dirFlush($dir, $kill_top_level = false)
- {
- if(!$dh = @opendir($dir)) return;
-
- while (($obj = readdir($dh))) {
- if($obj=='.' || $obj=='..') continue;
- $f = $dir.'/'.$obj;
-
- if (strpos($obj,'.cache')) @unlink($f);
- if (is_dir($f)) $this->_dirFlush($f, true);
- }
- if ($kill_top_level === true) @rmdir($dir);
- return true;
- }
- }
-
- //==============================================================================================
- // CLASS ADOConnection
- //==============================================================================================
-
- /**
- * Connection object. For connecting to databases, and executing queries.
- */
- class ADOConnection {
- //
- // PUBLIC VARS
- //
- var $dataProvider = 'native';
- var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
- var $database = ''; /// Name of database to be used.
- var $host = ''; /// The hostname of the database server
- var $user = ''; /// The username which is used to connect to the database server.
- var $password = ''; /// Password for the username. For security, we no longer store it.
- var $debug = false; /// if set to true will output sql statements
- var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
- var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase
- var $substr = 'substr'; /// substring operator
- var $length = 'length'; /// string length ofperator
- var $random = 'rand()'; /// random function
- var $upperCase = 'upper'; /// uppercase function
- var $fmtDate = "'Y-m-d'"; /// used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /// used by DBTimeStamp as the default timestamp fmt.
- var $true = '1'; /// string that represents TRUE for a database
- var $false = '0'; /// string that represents FALSE for a database
- var $replaceQuote = "\\'"; /// string to use to replace quotes
- var $nameQuote = '"'; /// string to use to quote identifiers and names
- var $charSet=false; /// character set to use - only for interbase, postgres and oci8
- var $metaDatabasesSQL = '';
- var $metaTablesSQL = '';
- var $uniqueOrderBy = false; /// All order by columns have to be unique
- var $emptyDate = ' ';
- var $emptyTimeStamp = ' ';
- var $lastInsID = false;
- //--
- var $hasInsertID = false; /// supports autoincrement ID?
- var $hasAffectedRows = false; /// supports affected rows for update/delete?
- var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE
- var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- var $readOnly = false; /// this is a readonly database - used by phpLens
- var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards
- var $hasGenID = false; /// can generate sequences using GenID();
- var $hasTransactions = true; /// has transactions
- //--
- var $genID = 0; /// sequence id used by GenID();
- var $raiseErrorFn = false; /// error function to call
- var $isoDates = false; /// accepts dates in ISO format
- var $cacheSecs = 3600; /// cache for 1 hour
-
- // memcache
- var $memCache = false; /// should we use memCache instead of caching in files
- var $memCacheHost; /// memCache host
- var $memCachePort = 11211; /// memCache port
- var $memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
- var $sysDate = false; /// name of function that returns the current date
- var $sysTimeStamp = false; /// name of function that returns the current timestamp
- var $sysUTimeStamp = false; // name of function that returns the current timestamp accurate to the microsecond or nearest fraction
- var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets
-
- var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' '
- var $numCacheHits = 0;
- var $numCacheMisses = 0;
- var $pageExecuteCountRows = true;
- var $uniqueSort = false; /// indicates that all fields in order by must be unique
- var $leftOuter = false; /// operator to use for left outer join in WHERE clause
- var $rightOuter = false; /// operator to use for right outer join in WHERE clause
- var $ansiOuter = false; /// whether ansi outer join syntax supported
- var $autoRollback = false; // autoRollback on PConnect().
- var $poorAffectedRows = false; // affectedRows not working or unreliable
-
- var $fnExecute = false;
- var $fnCacheExecute = false;
- var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char
- var $rsPrefix = "ADORecordSet_";
-
- var $autoCommit = true; /// do not modify this yourself - actually private
- var $transOff = 0; /// temporarily disable transactions
- var $transCnt = 0; /// count of nested transactions
-
- var $fetchMode=false;
-
- var $null2null = 'null'; // in autoexecute/getinsertsql/getupdatesql, this value will be converted to a null
- var $bulkBind = false; // enable 2D Execute array
- //
- // PRIVATE VARS
- //
- var $_oldRaiseFn = false;
- var $_transOK = null;
- var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made.
- var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will
- /// then returned by the errorMsg() function
- var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8
- var $_queryID = false; /// This variable keeps the last created result link identifier
-
- var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */
- var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters.
- var $_evalAll = false;
- var $_affected = false;
- var $_logsql = false;
- var $_transmode = ''; // transaction mode
-
-
-
- /**
- * Constructor
- */
- function ADOConnection()
- {
- die('Virtual Class -- cannot instantiate');
- }
-
- static function Version()
- {
- global $ADODB_vers;
-
- $ok = preg_match( '/^[Vv]([0-9\.]+)/', $ADODB_vers, $matches );
- if (!$ok) return (float) substr($ADODB_vers,1);
- else return $matches[1];
- }
-
- /**
- Get server version info...
-
- @returns An array with 2 elements: $arr['string'] is the description string,
- and $arr[version] is the version (also a string).
- */
- function ServerInfo()
- {
- return array('description' => '', 'version' => '');
- }
-
- function IsConnected()
- {
- return !empty($this->_connectionID);
- }
-
- function _findvers($str)
- {
- if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) return $arr[1];
- else return '';
- }
-
- /**
- * All error messages go through this bottleneck function.
- * You can define your own handler by defining the function name in ADODB_OUTP.
- */
- static function outp($msg,$newline=true)
- {
- global $ADODB_FLUSH,$ADODB_OUTP;
-
- if (defined('ADODB_OUTP')) {
- $fn = ADODB_OUTP;
- $fn($msg,$newline);
- return;
- } else if (isset($ADODB_OUTP)) {
- $fn = $ADODB_OUTP;
- $fn($msg,$newline);
- return;
- }
-
- if ($newline) $msg .= "
\n";
-
- if (isset($_SERVER['HTTP_USER_AGENT']) || !$newline) echo $msg;
- else echo strip_tags($msg);
-
-
- if (!empty($ADODB_FLUSH) && ob_get_length() !== false) flush(); // do not flush if output buffering enabled - useless - thx to Jesse Mullan
-
- }
-
- function Time()
- {
- $rs = $this->_Execute("select $this->sysTimeStamp");
- if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
-
- return false;
- }
-
- /**
- * Connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- * @param [forceNew] force new connection
- *
- * @return true or false
- */
- function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false)
- {
- if ($argHostname != "") $this->host = $argHostname;
- if ($argUsername != "") $this->user = $argUsername;
- if ($argPassword != "") $this->password = 'not stored'; // not stored for security reasons
- if ($argDatabaseName != "") $this->database = $argDatabaseName;
-
- $this->_isPersistentConnection = false;
-
- if ($forceNew) {
- if ($rez=$this->_nconnect($this->host, $this->user, $argPassword, $this->database)) return true;
- } else {
- if ($rez=$this->_connect($this->host, $this->user, $argPassword, $this->database)) return true;
- }
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'";
- $ret = false;
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $ret = 0;
- }
- if ($fn = $this->raiseErrorFn)
- $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
-
-
- $this->_connectionID = false;
- if ($this->debug) ADOConnection::outp( $this->host.': '.$err);
- return $ret;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName);
- }
-
-
- /**
- * Always force a new connection to database - currently only works with oracle
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return true or false
- */
- function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "")
- {
- return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true);
- }
-
- /**
- * Establish persistent connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return return true or false
- */
- function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "")
- {
-
- if (defined('ADODB_NEVER_PERSIST'))
- return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName);
-
- if ($argHostname != "") $this->host = $argHostname;
- if ($argUsername != "") $this->user = $argUsername;
- if ($argPassword != "") $this->password = 'not stored';
- if ($argDatabaseName != "") $this->database = $argDatabaseName;
-
- $this->_isPersistentConnection = true;
-
- if ($rez = $this->_pconnect($this->host, $this->user, $argPassword, $this->database)) return true;
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'";
- $ret = false;
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $ret = 0;
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
- }
-
- $this->_connectionID = false;
- if ($this->debug) ADOConnection::outp( $this->host.': '.$err);
- return $ret;
- }
-
- function outp_throw($msg,$src='WARN',$sql='')
- {
- if (defined('ADODB_ERROR_HANDLER') && ADODB_ERROR_HANDLER == 'adodb_throw') {
- adodb_throw($this->databaseType,$src,-9999,$msg,$sql,false,$this);
- return;
- }
- ADOConnection::outp($msg);
- }
-
- // create cache class. Code is backward compat with old memcache implementation
- function _CreateCache()
- {
- global $ADODB_CACHE, $ADODB_CACHE_CLASS;
-
- if ($this->memCache) {
- global $ADODB_INCLUDED_MEMCACHE;
-
- if (empty($ADODB_INCLUDED_MEMCACHE)) include(ADODB_DIR.'/adodb-memcache.lib.inc.php');
- $ADODB_CACHE = new ADODB_Cache_MemCache($this);
- } else
- $ADODB_CACHE = new $ADODB_CACHE_CLASS($this);
-
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysDate;
- return $col; // child class implement
- }
-
- /**
- * Should prepare the sql statement and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * $stmt = $db->Prepare("insert into table (id, name) values (?,?)");
- * $db->Execute($stmt,array(1,'Jill')) or die('insert failed');
- * $db->Execute($stmt,array(2,'Joe')) or die('insert failed');
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function Prepare($sql)
- {
- return $sql;
- }
-
- /**
- * Some databases, eg. mssql require a different function for preparing
- * stored procedures. So we cannot use Prepare().
- *
- * Should prepare the stored procedure and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function PrepareSP($sql,$param=true)
- {
- return $this->Prepare($sql,$param);
- }
-
- /**
- * PEAR DB Compat
- */
- function Quote($s)
- {
- return $this->qstr($s,false);
- }
-
- /**
- Requested by "Karsten Dambekalns"
- b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
- c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block
- are disabled, making it backward compatible.
- */
- function StartTrans($errfn = 'ADODB_TransMonitor')
- {
- if ($this->transOff > 0) {
- $this->transOff += 1;
- return true;
- }
-
- $this->_oldRaiseFn = $this->raiseErrorFn;
- $this->raiseErrorFn = $errfn;
- $this->_transOK = true;
-
- if ($this->debug && $this->transCnt > 0) ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans");
- $ok = $this->BeginTrans();
- $this->transOff = 1;
- return $ok;
- }
-
-
- /**
- Used together with StartTrans() to end a transaction. Monitors connection
- for sql errors, and will commit or rollback as appropriate.
-
- @autoComplete if true, monitor sql errors and commit and rollback as appropriate,
- and if set to false force rollback even if no SQL error detected.
- @returns true on commit, false on rollback.
- */
- function CompleteTrans($autoComplete = true)
- {
- if ($this->transOff > 1) {
- $this->transOff -= 1;
- return true;
- }
- $this->raiseErrorFn = $this->_oldRaiseFn;
-
- $this->transOff = 0;
- if ($this->_transOK && $autoComplete) {
- if (!$this->CommitTrans()) {
- $this->_transOK = false;
- if ($this->debug) ADOConnection::outp("Smart Commit failed");
- } else
- if ($this->debug) ADOConnection::outp("Smart Commit occurred");
- } else {
- $this->_transOK = false;
- $this->RollbackTrans();
- if ($this->debug) ADOCOnnection::outp("Smart Rollback occurred");
- }
-
- return $this->_transOK;
- }
-
- /*
- At the end of a StartTrans/CompleteTrans block, perform a rollback.
- */
- function FailTrans()
- {
- if ($this->debug)
- if ($this->transOff == 0) {
- ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans");
- } else {
- ADOConnection::outp("FailTrans was called");
- adodb_backtrace();
- }
- $this->_transOK = false;
- }
-
- /**
- Check if transaction has failed, only for Smart Transactions.
- */
- function HasFailedTrans()
- {
- if ($this->transOff > 0) return $this->_transOK == false;
- return false;
- }
-
- /**
- * Execute SQL
- *
- * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
- * @param [inputarr] holds the input data to bind to. Null elements will be set to null.
- * @return RecordSet or false
- */
- function Execute($sql,$inputarr=false)
- {
- if ($this->fnExecute) {
- $fn = $this->fnExecute;
- $ret = $fn($this,$sql,$inputarr);
- if (isset($ret)) return $ret;
- }
- if ($inputarr) {
- if (!is_array($inputarr)) $inputarr = array($inputarr);
-
- $element0 = reset($inputarr);
- # is_object check because oci8 descriptors can be passed in
- $array_2d = $this->bulkBind && is_array($element0) && !is_object(reset($element0));
- //remove extra memory copy of input -mikefedyk
- unset($element0);
-
- if (!is_array($sql) && !$this->_bindInputArray) {
- $sqlarr = explode('?',$sql);
- $nparams = sizeof($sqlarr)-1;
- if (!$array_2d) $inputarr = array($inputarr);
- foreach($inputarr as $arr) {
- $sql = ''; $i = 0;
- //Use each() instead of foreach to reduce memory usage -mikefedyk
- while(list(, $v) = each($arr)) {
- $sql .= $sqlarr[$i];
- // from Ron Baldwin \n";print_r($var);echo "
\n";
- } else
- print_r($var);
-
- if ($as_string) {
- $s = ob_get_contents();
- ob_end_clean();
- return $s;
- }
- }
-
- /*
- Perform a stack-crawl and pretty print it.
-
- @param printOrArr Pass in a boolean to indicate print, or an $exception->trace array (assumes that print is true then).
- @param levels Number of levels to display
- */
- function adodb_backtrace($printOrArr=true,$levels=9999,$ishtml=null)
- {
- global $ADODB_INCLUDED_LIB;
- if (empty($ADODB_INCLUDED_LIB)) include(ADODB_DIR.'/adodb-lib.inc.php');
- return _adodb_backtrace($printOrArr,$levels,0,$ishtml);
- }
-
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/contrib/toxmlrpc.inc.php b/src/adodb512/contrib/toxmlrpc.inc.php
deleted file mode 100644
index 3711bdac..00000000
--- a/src/adodb512/contrib/toxmlrpc.inc.php
+++ /dev/null
@@ -1,183 +0,0 @@
-GetArray()) would work with:
- * - ADODB_FETCH_BOTH
- * - null values
- */
-
- /**
- * Include the main libraries
- */
- require_once('xmlrpc.inc');
- if (!defined('ADODB_DIR')) require_once('adodb.inc.php');
-
- /**
- * Builds an xmlrpc struct value out of an AdoDB recordset
- */
- function rs2xmlrpcval(&$adodbrs) {
-
- $header = rs2xmlrpcval_header($adodbrs);
- $body = rs2xmlrpcval_body($adodbrs);
-
- // put it all together and build final xmlrpc struct
- $xmlrpcrs = new xmlrpcval ( array(
- "header" => $header,
- "body" => $body,
- ), "struct");
-
- return $xmlrpcrs;
-
- }
-
- /**
- * Builds an xmlrpc struct value describing an AdoDB recordset
- */
- function rs2xmlrpcval_header($adodbrs)
- {
- $numfields = $adodbrs->FieldCount();
- $numrecords = $adodbrs->RecordCount();
-
- // build structure holding recordset information
- $fieldstruct = array();
- for ($i = 0; $i < $numfields; $i++) {
- $fld = $adodbrs->FetchField($i);
- $fieldarray = array();
- if (isset($fld->name))
- $fieldarray["name"] = new xmlrpcval ($fld->name);
- if (isset($fld->type))
- $fieldarray["type"] = new xmlrpcval ($fld->type);
- if (isset($fld->max_length))
- $fieldarray["max_length"] = new xmlrpcval ($fld->max_length, "int");
- if (isset($fld->not_null))
- $fieldarray["not_null"] = new xmlrpcval ($fld->not_null, "boolean");
- if (isset($fld->has_default))
- $fieldarray["has_default"] = new xmlrpcval ($fld->has_default, "boolean");
- if (isset($fld->default_value))
- $fieldarray["default_value"] = new xmlrpcval ($fld->default_value);
- $fieldstruct[$i] = new xmlrpcval ($fieldarray, "struct");
- }
- $fieldcount = new xmlrpcval ($numfields, "int");
- $recordcount = new xmlrpcval ($numrecords, "int");
- $sql = new xmlrpcval ($adodbrs->sql);
- $fieldinfo = new xmlrpcval ($fieldstruct, "array");
-
- $header = new xmlrpcval ( array(
- "fieldcount" => $fieldcount,
- "recordcount" => $recordcount,
- "sql" => $sql,
- "fieldinfo" => $fieldinfo
- ), "struct");
-
- return $header;
- }
-
- /**
- * Builds an xmlrpc struct value out of an AdoDB recordset
- * (data values only, no data definition)
- */
- function rs2xmlrpcval_body($adodbrs)
- {
- $numfields = $adodbrs->FieldCount();
-
- // build structure containing recordset data
- $adodbrs->MoveFirst();
- $rows = array();
- while (!$adodbrs->EOF) {
- $columns = array();
- // This should work on all cases of fetch mode: assoc, num, both or default
- if ($adodbrs->fetchMode == 'ADODB_FETCH_BOTH' || count($adodbrs->fields) == 2 * $adodbrs->FieldCount())
- for ($i = 0; $i < $numfields; $i++)
- if ($adodbrs->fields[$i] === null)
- $columns[$i] = new xmlrpcval ('');
- else
- $columns[$i] = xmlrpc_encode ($adodbrs->fields[$i]);
- else
- foreach ($adodbrs->fields as $val)
- if ($val === null)
- $columns[] = new xmlrpcval ('');
- else
- $columns[] = xmlrpc_encode ($val);
-
- $rows[] = new xmlrpcval ($columns, "array");
-
- $adodbrs->MoveNext();
- }
- $body = new xmlrpcval ($rows, "array");
-
- return $body;
- }
-
- /**
- * Returns an xmlrpc struct value as string out of an AdoDB recordset
- */
- function rs2xmlrpcstring (&$adodbrs) {
- $xmlrpc = rs2xmlrpcval ($adodbrs);
- if ($xmlrpc)
- return $xmlrpc->serialize();
- else
- return null;
- }
-
- /**
- * Given a well-formed xmlrpc struct object returns an AdoDB object
- *
- * @todo add some error checking on the input value
- */
- function xmlrpcval2rs (&$xmlrpcval) {
-
- $fields_array = array();
- $data_array = array();
-
- // rebuild column information
- $header = $xmlrpcval->structmem('header');
-
- $numfields = $header->structmem('fieldcount');
- $numfields = $numfields->scalarval();
- $numrecords = $header->structmem('recordcount');
- $numrecords = $numrecords->scalarval();
- $sqlstring = $header->structmem('sql');
- $sqlstring = $sqlstring->scalarval();
-
- $fieldinfo = $header->structmem('fieldinfo');
- for ($i = 0; $i < $numfields; $i++) {
- $temp = $fieldinfo->arraymem($i);
- $fld = new ADOFieldObject();
- while (list($key,$value) = $temp->structeach()) {
- if ($key == "name") $fld->name = $value->scalarval();
- if ($key == "type") $fld->type = $value->scalarval();
- if ($key == "max_length") $fld->max_length = $value->scalarval();
- if ($key == "not_null") $fld->not_null = $value->scalarval();
- if ($key == "has_default") $fld->has_default = $value->scalarval();
- if ($key == "default_value") $fld->default_value = $value->scalarval();
- } // while
- $fields_array[] = $fld;
- } // for
-
- // fetch recordset information into php array
- $body = $xmlrpcval->structmem('body');
- for ($i = 0; $i < $numrecords; $i++) {
- $data_array[$i]= array();
- $xmlrpcrs_row = $body->arraymem($i);
- for ($j = 0; $j < $numfields; $j++) {
- $temp = $xmlrpcrs_row->arraymem($j);
- $data_array[$i][$j] = $temp->scalarval();
- } // for j
- } // for i
-
- // finally build in-memory recordset object and return it
- $rs = new ADORecordSet_array();
- $rs->InitArrayFields($data_array,$fields_array);
- return $rs;
-
- }
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/cute_icons_for_site/adodb.gif b/src/adodb512/cute_icons_for_site/adodb.gif
deleted file mode 100644
index c5e8dfc6..00000000
Binary files a/src/adodb512/cute_icons_for_site/adodb.gif and /dev/null differ
diff --git a/src/adodb512/cute_icons_for_site/adodb2.gif b/src/adodb512/cute_icons_for_site/adodb2.gif
deleted file mode 100644
index f12ae203..00000000
Binary files a/src/adodb512/cute_icons_for_site/adodb2.gif and /dev/null differ
diff --git a/src/adodb512/datadict/datadict-access.inc.php b/src/adodb512/datadict/datadict-access.inc.php
deleted file mode 100644
index 294b8aea..00000000
--- a/src/adodb512/datadict/datadict-access.inc.php
+++ /dev/null
@@ -1,96 +0,0 @@
-debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
- }
- if ($fnotnull) $suffix .= ' NOT NULL';
- if ($fconstraint) $suffix .= ' '.$fconstraint;
- return $suffix;
- }
-
- function CreateDatabase($dbname,$options=false)
- {
- return array();
- }
-
-
- function SetSchema($schema)
- {
- }
-
- function AlterColumnSQL($tabname, $flds)
- {
- if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds)
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-}
-
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/datadict/datadict-db2.inc.php b/src/adodb512/datadict/datadict-db2.inc.php
deleted file mode 100644
index 2aec30fb..00000000
--- a/src/adodb512/datadict/datadict-db2.inc.php
+++ /dev/null
@@ -1,144 +0,0 @@
-debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds)
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-
- function ChangeTableSQL($tablename, $flds, $tableoptions = false)
- {
-
- /**
- Allow basic table changes to DB2 databases
- DB2 will fatally reject changes to non character columns
-
- */
-
- $validTypes = array("CHAR","VARC");
- $invalidTypes = array("BIGI","BLOB","CLOB","DATE", "DECI","DOUB", "INTE", "REAL","SMAL", "TIME");
- // check table exists
- $cols = $this->MetaColumns($tablename);
- if ( empty($cols)) {
- return $this->CreateTableSQL($tablename, $flds, $tableoptions);
- }
-
- // already exists, alter table instead
- list($lines,$pkey) = $this->_GenFields($flds);
- $alter = 'ALTER TABLE ' . $this->TableName($tablename);
- $sql = array();
-
- foreach ( $lines as $id => $v ) {
- if ( isset($cols[$id]) && is_object($cols[$id]) ) {
- /**
- If the first field of $v is the fieldname, and
- the second is the field type/size, we assume its an
- attempt to modify the column size, so check that it is allowed
- $v can have an indeterminate number of blanks between the
- fields, so account for that too
- */
- $vargs = explode(' ' , $v);
- // assume that $vargs[0] is the field name.
- $i=0;
- // Find the next non-blank value;
- for ($i=1;$iADOdb Active Record
-
-
-
-
-
-
-
-
-require_once('adodb/adodb-active-record.inc.php');
-
-$db = NewADOConnection('mysql://root:pwd@localhost/dbname');
-ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-
-
-$db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-
-class person extends ADOdb_Active_Record{}
-$person = new person();
-
-
-
-var_dump($person->getAttributeNames());
-
-/**
- * Outputs the following:
- * array(4) {
- * [0]=>
- * string(2) "id"
- * [1]=>
- * string(9) "name_first"
- * [2]=>
- * string(8) "name_last"
- * [3]=>
- * string(13) "favorite_color"
- * }
- */
-
-
-$person = new person();
-$person->name_first = 'Andi';
-$person->name_last = 'Gutmans';
-$person->save();
-
-
-1048: Column 'favorite_color' cannot be null
-
-
-/**
- * Calling the save() method will successfully INSERT
- * this $person into the database table.
- */
-$person = new person();
-$person->name_first = 'Andi';
-$person->name_last = 'Gutmans';
-$person->favorite_color = 'blue';
-$person->save();
-
-
-var_dump($person->id);
-
-/**
- * Outputs the following:
- * string(1)
- */
-
-
-$person->favorite_color = 'red';
-$person->save();
-
-ADOdb Specific Functionality
-
- class person extends ADOdb_Active_Record{}
- $person = new person('People');
-
-
- class person extends ADOdb_Active_Record
- {
- var $_table = 'People';
- }
- $person = new person();
-
-
-
- 0: lower-case
- 1: upper-case
- 2: native-case
-
-
-$ADODB_ASSOC_CASE = 0;
-$person = new person('People');
-$person->name = 'Lily';
-$ADODB_ASSOC_CASE = 2;
-$person2 = new person('People');
-$person2->NAME = 'Lily';
-
-
-
-$rec = new ADOdb_Active_Record("product");
-$rec->name = 'John';
-$rec->tel_no = '34111145';
-$ok = $rec->replace(); // 0=failure, 1=update, 2=insert
-
-
-
-
-$person->load("id=3");
-
-// or using bind parameters
-
-$person->load("id=?", array(3));
-
-
-class person extends ADOdb_Active_Record {
-var $_table = 'people';
-}
-
-$person = new person();
-$peopleArray = $person->Find("name like ? order by age", array('Sm%'));
-
-
-
-ADODB_Active_Record::$_quoteNames = true;
-
-
-# right!
-$ok = $rec->Save();
-if (!$ok) $err = $rec->ErrorMsg();
-
-# wrong :(
-$rec->Save();
-if ($rec->ErrorMsg()) echo "Wrong way to detect error";
-
-
-$row = $db->GetRow("select * from tablex where id=$id");
-
-# PHP4 or PHP5 without enabling exceptions
-$obj = new ADOdb_Active_Record('Products');
-if ($obj->ErrorMsg()){
- echo $obj->ErrorMsg();
-} else {
- $obj->Set($row);
-}
-
-# in PHP5, with exceptions enabled:
-
-include('adodb-exceptions.inc.php');
-try {
- $obj = new ADOdb_Active_Record('Products');
- $obj->Set($row);
-} catch(exceptions $e) {
- echo $e->getMessage();
-}
-
-
- $pkeys = array('category','prodcode');
-
- // set primary key using constructor
- $rec = new ADOdb_Active_Record('Products', $pkeys);
-
- // or define a new class
- class Product extends ADOdb_Active_Record {
- function __construct()
- {
- parent::__construct('Products', array('prodid'));
- }
- }
-
- $rec = new Product();
-
-
-
-
-$db = NewADOConnection(...);
-$db2 = NewADOConnection(...);
-
-ADOdb_Active_Record::SetDatabaseAdapter($db2);
-
-$activeRecs = $db->GetActiveRecords('table1');
-
-foreach($activeRecs as $rec) {
- $rec2 = new ADOdb_Active_Record('table2',$db2);
- $rec2->id = $rec->id;
- $rec2->name = $rec->name;
-
- $rec2->Save();
-}
-
-
-$rec = new ADOdb_Active_Record("table1",array("id"),$db2);
-
-
-$db1 = NewADOConnection(...); // some ADOdb DB
-ADOdb_Active_Record::SetDatabaseAdapter($db1, 'mysql');
-$db2 = NewADOConnection(...); // some ADOdb DB
-ADOdb_Active_Record::SetDatabaseAdapter($db2, 'oracle');
-
-class FooRecord extends ADOdb_Active_Record
-{
-var $_dbat = 'mysql'; // uses 'mysql' connection
-...
-}
-
-
- $recs = $db->GetActiveRecords("Products","category='Furniture'");
- foreach($recs as $rec) {
- $rec->price *= 1.1; // increase price by 10% for all Furniture products
- $rec->save();
- }
-
-Of course an UPDATE statement is superior because it's simpler and much more efficient (probably by a factor of x10 or more):
-
- $db->Execute("update Products set price = price * 1.1 where category='Furniture'");
-
-
-$conn->StartTrans();
-$parent->save();
-$child->save();
-$conn->CompleteTrans();
-
-
-
-One to Many Relations
-
- class person extends ADOdb_Active_Record{}
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
-
- $person = new person();
- $person->Load("id=1");
- foreach($person->children as $c) {
- echo " $c->name_first ";
- $c->name_first .= ' K.';
- $c->Save(); ## each child record must be saved individually
- }
-
-
- $person2 = new person();
- $p = $person2->children; ## $p is an empty array()
-
-
-
- class person extends ADOdb_Active_Record{}
- class children extends ADOdb_Active_Record{}
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
-
- $person = new person();
-
- for ($i=0; $i<10; $i++)
- $person->children[0] = new children('children');
-
- // modify fields of $person, then...
- $person->save();
-
- foreach($person->children as $c) {
- // modify fields of $c then...
- $c->save();
- }
-
-
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
- ADODB_Active_Record::ClassHasMany('person', 'siblings','person_id');
- $person = new person();
- $person->Load('id=1');
- var_dump($person->children);
- var_dump($person->siblings);
-
-
- class person extends ADOdb_Active_Record{}
- class child extends ADOdb_Active_Record { .... some modifications here ... }
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id', 'child');
-
-
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
- $p = new person();
- $p->Load('id=1');
- # $p->children points to person_id = 1
- var_dump($p->children);
-
- $p->Load('id=2');
- # $p->children still points to person_id = 1
- var_dump($p->children);
-
-
-ADODB_Active_Record::TableHasMany('people', 'children', 'person_id')
-
-
-ADODB_Active_Record::TableKeyHasMany('people', 'pid', 'children', 'person_id')
-
-
-
-
- include_once('../adodb.inc.php');
- include_once('../adodb-active-record.inc.php');
-
- $db = NewADOConnection('mysql://root@localhost/northwind');
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `gender` varchar(10) default 'F',
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- class person extends ADOdb_Active_Record{}
- ADODB_Active_Record::ClassHasMany('person', 'children','person_id');
-
- $person = new person();
-
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person2 = new person(); # no need to define HasMany() again, adodb remembers definition
- $person2->Load('id=1');
-
- $c = $person2->children;
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany<br>";
- else {
- echo "Error loading hasMany should have 3 array elements Jill Joan Jamie<br>";
- }
-
-
-
- class person extends ADOdb_Active_Record{}
-
- $person = new person();
- $person->HasMany('children','person_id');
- $person->Load("id=1");
- foreach($person->children as $c) {
- echo " $c->name_first ";
- $c->name_first .= ' K.';
- $c->Save(); ## each child record must be saved individually
- }
-
-
- $person = new person();
- $person->HasMany('children','person_id');
-
- $person2 = new person();
- $person->Load("id=1");
- $p = $person2->children;
-
-
-
-
- class kid extends ADOdb_Active_Record{};
- ADODB_Active_Record::ClassBelongsTo('kid','person','person_id','id');
-
- $ch = new kid(); // default tablename will be 'kids', with primary key 'id'
- $ch->Load('id=1');
- $p = $ch->person;
- if (!$p || $p->name_first != 'John') echo "Error loading belongsTo<br>";
- else echo "OK loading BelongTo<br>";
-
-
- ADODB_Active_Record::ClassBelongsTo('kid','person','person_id','id');
-
- $ch = new kid();
- $p = $ch->person; # $p is null
-
-
-
- class kid extends ADOdb_Active_Record{};
- class person extends ADOdb_Active_Record{... your modifications ... };
- ADODB_Active_Record::ClassBelongsTo('kid','person','person_id','id', 'person');
-
-
- ADODB_Active_Record::TableBelongsTo('children','person','person_id','id');
-
-
- ADODB_Active_Record::TableKeyBelongsTo('children','ch_id', 'person','person_id','id');
-
-
- class Child extends ADOdb_Active_Record{};
- $ch = new Child('children',array('id'));
- $ch->BelongsTo('person','person_id','id'); ## this can be simplified to $ch->BelongsTo('person')
- ## as foreign key defaults to $table.'_id' and
- ## parent pkey defaults to 'id'
- $ch->Load('id=1');
- $p = $ch->person;
- if (!$p || $p->name_first != 'John') echo "Error loading belongsTo<br>";
- else echo "OK loading BelongTo<br>";
-
-ActiveRecord Code Sample
-
-include('../adodb.inc.php');
-include('../adodb-active-record.inc.php');
-
-// uncomment the following if you want to test exceptions
-#if (PHP_VERSION >= 5) include('../adodb-exceptions.inc.php');
-
-$db = NewADOConnection('mysql://root@localhost/northwind');
-$db->debug=1;
-ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-$db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-class person extends ADOdb_Active_Record{}
-$person = new person();
-
-echo "<p>Output of getAttributeNames: ";
-var_dump($person->getAttributeNames());
-
-/**
- * Outputs the following:
- * array(4) {
- * [0]=>
- * string(2) "id"
- * [1]=>
- * string(9) "name_first"
- * [2]=>
- * string(8) "name_last"
- * [3]=>
- * string(13) "favorite_color"
- * }
- */
-
-$person = new person();
-$person->name_first = 'Andi';
-$person->name_last = 'Gutmans';
-$person->save(); // this save() will fail on INSERT as favorite_color is a must fill...
-
-
-$person = new person();
-$person->name_first = 'Andi';
-$person->name_last = 'Gutmans';
-$person->favorite_color = 'blue';
-$person->save(); // this save will perform an INSERT successfully
-
-echo "<p>The Insert ID generated:"; print_r($person->id);
-
-$person->favorite_color = 'red';
-$person->save(); // this save() will perform an UPDATE
-
-$person = new person();
-$person->name_first = 'John';
-$person->name_last = 'Lim';
-$person->favorite_color = 'lavender';
-$person->save(); // this save will perform an INSERT successfully
-
-// load record where id=2 into a new ADOdb_Active_Record
-$person2 = new person();
-$person2->Load('id=2');
-var_dump($person2);
-
-// retrieve an array of records
-$activeArr = $db->GetActiveRecordsClass($class = "person",$table = "persons","id=".$db->Param(0),array(2));
-$person2 = $activeArr[0];
-echo "<p>Name first (should be John): ",$person->name_first, "<br>Class = ",get_class($person2);
-
-
-
-
-
-Active Record eXtended
-
-<?php
- function ar_assert($obj, $cond)
- {
- global $err_count;
- $res = var_export($obj, true);
- return (strpos($res, $cond));
- }
-
- include_once('../adodb.inc.php');
- include_once('../adodb-active-recordx.inc.php');
-
-
- $db = NewADOConnection('mysql://root@localhost/northwind');
- $db->debug=0;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
- echo "<pre>\n";
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "Preparing database using SQL queries (creating 'people', 'children')\n";
-
- $db->Execute("DROP TABLE `people`");
- $db->Execute("DROP TABLE `children`");
-
- $db->Execute("CREATE TABLE `people` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
- $db->Execute("CREATE TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-
- $db->Execute("insert into children (person_id,name_first,name_last,favorite_pet) values (1,'Jill','Lim','tortoise')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- // This class _implicitely_ relies on the 'people' table (pluralized form of 'person')
- class Person extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->hasMany('children');
- }
- }
- // This class _implicitely_ relies on the 'children' table
- class Child extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table and shares its metadata with Child
- class Kid extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children');
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table but does not share its metadata
- class Rugrat extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children', false, false, array('new' => true));
- }
- }
-
- echo "Inserting person in 'people' table ('John Lim, he likes lavender')\n";
- echo "---------------------------------------------------------------------------\n";
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $err_count = 0;
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "person->Find('id=1') [Lazy Method]\n";
- echo "person is loaded but its children will be loaded on-demand later on\n";
- echo "---------------------------------------------------------------------------\n";
- $person5 = new Person();
- $people5 = $person5->Find('id=1');
- echo (ar_assert($people5, "'name_first' => 'John'")) ? "[OK] Found John\n" : "[!!] Find failed\n";
- echo (ar_assert($people5, "'favorite_pet' => 'tortoise'")) ? "[!!] Found relation when I shouldn't\n" : "[OK] No relation yet\n";
- foreach($people5 as $person)
- {
- foreach($person->children as $child)
- {
- if($child->name_first);
- }
- }
- echo (ar_assert($people5, "'favorite_pet' => 'tortoise'")) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "person->Find('id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "person is loaded, and so are its children\n";
- echo "---------------------------------------------------------------------------\n";
- $person6 = new Person();
- $people6 = $person6->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- echo (ar_assert($people6, "'name_first' => 'John'")) ? "[OK] Found John\n" : "[!!] Find failed\n";
- echo (ar_assert($people6, "'favorite_pet' => 'tortoise'")) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "person->Find('id=1' ... ADODB_JOIN_AR) [Join Method]\n";
- echo "person and its children are loaded using a single query\n";
- echo "---------------------------------------------------------------------------\n";
- $person7 = new Person();
- // When I specifically ask for a join, I have to specify which table id I am looking up
- // otherwise the SQL parser will wonder which table's id that would be.
- $people7 = $person7->Find('people.id=1', false, false, array('loading' => ADODB_JOIN_AR));
- echo (ar_assert($people7, "'name_first' => 'John'")) ? "[OK] Found John\n" : "[!!] Find failed\n";
- echo (ar_assert($people7, "'favorite_pet' => 'tortoise'")) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "person->Load('people.id=1') [Join Method]\n";
- echo "Load() always uses the join method since it returns only one row\n";
- echo "---------------------------------------------------------------------------\n";
- $person2 = new Person();
- // Under the hood, Load(), since it returns only one row, always perform a join
- // Therefore we need to clarify which id we are talking about.
- $person2->Load('people.id=1');
- echo (ar_assert($person2, "'name_first' => 'John'")) ? "[OK] Found John\n" : "[!!] Find failed\n";
- echo (ar_assert($person2, "'favorite_pet' => 'tortoise'")) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "child->Load('children.id=1') [Join Method]\n";
- echo "We are now loading from the 'children' table, not from 'people'\n";
- echo "---------------------------------------------------------------------------\n";
- $ch = new Child();
- $ch->Load('children.id=1');
- echo (ar_assert($ch, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ch, "'favorite_color' => 'lavender'")) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "child->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "---------------------------------------------------------------------------\n";
- $ch2 = new Child();
- $ach2 = $ch2->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- echo (ar_assert($ach2, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach2, "'favorite_color' => 'lavender'")) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "Where we see that kid shares relationships with child because they are stored\n";
- echo "in the common table's metadata structure.\n";
- echo "---------------------------------------------------------------------------\n";
- $ch3 = new Kid('children');
- $ach3 = $ch3->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- echo (ar_assert($ach3, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach3, "'favorite_color' => 'lavender'")) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "kid->Find('children.id=1' ... ADODB_LAZY_AR) [Lazy Method]\n";
- echo "Of course, lazy loading also retrieve medata information...\n";
- echo "---------------------------------------------------------------------------\n";
- $ch32 = new Kid('children');
- $ach32 = $ch32->Find('children.id=1', false, false, array('loading' => ADODB_LAZY_AR));
- echo (ar_assert($ach32, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach32, "'favorite_color' => 'lavender'")) ? "[!!] Found relation when I shouldn't\n" : "[OK] No relation yet\n";
- foreach($ach32 as $akid)
- {
- if($akid->person);
- }
- echo (ar_assert($ach32, "'favorite_color' => 'lavender'")) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "In rugrat's constructor it is specified that\nit must forget any existing relation\n";
- echo "---------------------------------------------------------------------------\n";
- $ch4 = new Rugrat('children');
- $ach4 = $ch4->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- echo (ar_assert($ach4, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach4, "'favorite_color' => 'lavender'")) ? "[!!] Found relation when I shouldn't\n" : "[OK] No relation found\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "Note how only rugrat forgot its relations - kid is fine.\n";
- echo "---------------------------------------------------------------------------\n";
- $ch5 = new Kid('children');
- $ach5 = $ch5->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- echo (ar_assert($ach5, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach5, "'favorite_color' => 'lavender'")) ? "[OK] I did not forget relation: person\n" : "[!!] I should not have forgotten relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n";
- echo "---------------------------------------------------------------------------\n";
- $ch6 = new Rugrat('children');
- $ch6s = $ch6->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- $ach6 = $ch6s[0];
- echo (ar_assert($ach6, "'name_first' => 'Jill'")) ? "[OK] Found Jill\n" : "[!!] Find failed\n";
- echo (ar_assert($ach6, "'favorite_color' => 'lavender'")) ? "[!!] Found relation when I shouldn't\n" : "[OK] No relation yet\n";
- echo "\nLoading relations:\n";
- $ach6->belongsTo('person');
- $ach6->LoadRelations('person', 'order by id', 0, 2);
- echo (ar_assert($ach6, "'favorite_color' => 'lavender'")) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n";
-
- echo "\n\n---------------------------------------------------------------------------\n";
- echo "Test suite complete.\n";
- echo "---------------------------------------------------------------------------\n";
-?>
-
- Todo (Code Contributions welcome)
- Change Log
-
- ClassHasMany ClassBelongsTo TableHasMany TableBelongsTo TableKeyHasMany TableKeyBelongsTo.
-
-
-- Now we only update fields that have changed, using $this->_original.
-- We do not include auto_increment fields in replace(). Thx Travis Cline
-- Added ADODB_ACTIVE_CACHESECS.
-
-
-- Much better error handling. ErrorMsg() implemented. Throw implemented if adodb-exceptions.inc.php detected.
-- You can now define the primary keys of the view or table you are accessing manually.
-- The Active Record allows you to create an object which does not have a primary key. You can INSERT but not UPDATE in this case.
-- Set() documented.
-- Fixed _pluralize bug with y suffix.
-
-
-- Fixed handling of nulls when saving (it didn't save nulls, saved them as '').
-- Better error handling messages.
-- Factored out a new method GetPrimaryKeys().
-
- 1st release
-
-
\ No newline at end of file
diff --git a/src/adodb512/docs/docs-adodb.htm b/src/adodb512/docs/docs-adodb.htm
deleted file mode 100644
index 7acca2f4..00000000
--- a/src/adodb512/docs/docs-adodb.htm
+++ /dev/null
@@ -1,7796 +0,0 @@
-
-
-ADOdb Library for PHP
-
-
-Unique Features
-How People are using ADOdb
-Feature Requests and Bug Reports
-Installation
-Minimum Install
-Initializing Code and Connectioning to Databases
- Data Source
-Name (DSN) Support Connection Examples
-
-High Speed ADOdb - tuning tips
-Hacking and Modifying ADOdb Safely
-PHP5 Features
-foreach iterators exceptions
-Supported Databases
-Tutorials
-Example 1: Select
-Example 2: Advanced Select
-Example 3: Insert
-Example 4: Debugging rs2html
-example
-Example 5: MySQL and Menus
-Example 6: Connecting to Multiple Databases at once
-Example 7: Generating Update and Insert SQL
-Example 8: Implementing Scrolling with Next and Previous
-Example 9: Exporting in CSV or Tab-Delimited Format
-Example 10: Custom filters
-Example 11: Smart Transactions
-
-Using Custom Error Handlers and PEAR_Error
-Data Source Names
-Caching
- MemCache
- Caching API
-Pivot Tables
- $ADODB_FORCE_TYPE $ADODB_FETCH_MODE $ADODB_LANG
-ADODB_QUOTE_FIELDNAMES
-Constants: ADODB_ASSOC_CASE
-ADOConnection
-Connections: Connect PConnect NConnect IsConnected
-Executing SQL: Execute CacheExecute
-SelectLimit CacheSelectLimit
-Param Prepare PrepareSP
-InParameter OutParameter
-AutoExecute
- GetOne CacheGetOne GetRow CacheGetRow GetAll CacheGetAll GetCol CacheGetCol GetAssoc CacheGetAssoc
-Replace GetMedian
- ExecuteCursor (oci8 only)
-Generates SQL strings: GetUpdateSQL GetInsertSQL Concat IfNull length random
-substr qstr Param
-OffsetDate SQLDate DBDate DBTimeStamp BindDate BindTimeStamp
-Blobs: UpdateBlob UpdateClob
-UpdateBlobFile BlobEncode
-BlobDecode
-Paging/Scrolling: PageExecute CachePageExecute
-Cleanup: CacheFlush Close
-Transactions: StartTrans CompleteTrans
-FailTrans HasFailedTrans
-BeginTrans CommitTrans RollbackTrans SetTransactionMode
-Fetching Data: SetFetchMode
-Strings: concat length qstr quote substr
-Dates: DBDate DBTimeStamp UnixDate BindDate BindTimeStamp UnixTimeStamp
-OffsetDate SQLDate
-Row Management: Affected_Rows Insert_ID RowLock GenID CreateSequence DropSequence
-Error Handling: ErrorMsg ErrorNo
-MetaError MetaErrorMsg IgnoreErrors
-Data Dictionary (metadata): MetaDatabases MetaTables MetaColumns MetaColumnNames MetaPrimaryKeys
-MetaForeignKeys ServerInfo
-
-Statistics and Query-Rewriting: LogSQL fnExecute and fnCacheExecute
-Deprecated: Bind BlankRecordSet
-Parameter
-ADORecordSet
-Returns one field: Fields
-Returns one row:FetchRow FetchInto
-FetchObject FetchNextObject
-FetchObj FetchNextObj GetRowAssoc
-Returns all rows:GetArray GetRows
-GetAssoc
-Scrolling:Move MoveNext MoveFirst MoveLast AbsolutePosition CurrentRow AtFirstPage AtLastPage AbsolutePage
-Menu generation:GetMenu GetMenu2
-Dates:UserDate UserTimeStamp
-UnixDate UnixTimeStamp
-Recordset Info:RecordCount PO_RecordCount NextRecordSet
-Field Info:FieldCount FetchField
-MetaType
-Cleanup: Close
-Differences between ADOdb and ADO
-Database Driver Guide
-Change LogIntroduction
-
-Unique Features of ADOdb
-
-
-
-
-How People are using ADOdb
-
-
-
-
-Feature Requests and Bug Reports
-
-Installation Guide
-
-<?php
- include('adodb/adodb.inc.php');
- $db = ADONewConnection($dbdriver); # eg 'mysql' or 'postgres'
- $db->debug = true;
- $db->Connect($server, $user, $password, $database);
- $rs = $db->Execute('select * from some_small_table');
- print "<pre>";
- print_r($rs->GetRows());
- print "</pre>";
-?>Minimum Install
-
-
-
-
-
-
-
-Code Initialization Examples
-
-include('/path/to/set/here/adodb.inc.php');
-$conn = &ADONewConnection('mysql');Data Source Name (DSN) Support
-
- $driver://$username:$password@hostname/$database?options[=value] # non-persistent connection
$dsn = 'mysql://root:pwd@localhost/mydb'; $db = NewADOConnection($dsn); if (!$db) die("Connection failed");
# no need to call connect/pconnect!
$arr = $db->GetArray("select * from table"); # persistent connection
- $dsn2 = 'mysql://root:pwd@localhost/mydb?persist';
-
- # non-persistent connection on port 3000
- $dsn2 = 'mysqli://root:pwd@localhost/mydb?persist=0&port=3000';
- $pwd = rawurlencode($pwd);
- $dsn = "mysql://root:$pwd@localhost/mydb"; $dsn2=rawurlencode("sybase_ase")."://user:pass@host/path?query";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # we have a memcache server at 10.1.1.22 using default port 11211, no compression
- $dsn = 'mysql://user:pwd@localhost/mydb?memcache=10.1.1.22';
-
- # we have a memcache server 10.1.1.22 port 8888, compression=on
- $dsn = 'mysql://user:pwd@localhost/mydb?memcache=10.1.1.22:8888:1';
-
- # we have a memcache servers mem1,mem2 on port 8888, compression=off
- $dsn = 'mysql://user:pwd@localhost/mydb?memcache=mem1,mem2:8888:0';
-
- # we have a memcache servers mem1,mem2 on port 8888, compression=off and cachesecs=120
- $dsn = 'mysql://user:pwd@localhost/mydb?memcache=mem1,mem2:8888:0&cachesecs=120';
-
-Examples of Connecting to Databases
-
-MySQL and Most Other Database Drivers
-
- $conn = &ADONewConnection('mysql');
- $conn->PConnect('localhost','userid','password','database');
-
- # or dsn $dsn = 'mysql://user:pwd@localhost/mydb'; $conn = ADONewConnection($dsn); # no need for Connect() # or persistent dsn
$dsn = 'mysql://user:pwd@localhost/mydb?persist'; $conn = ADONewConnection($dsn); # no need for PConnect() # a more complex example:
$pwd = urlencode($pwd); $flags = MYSQL_CLIENT_COMPRESS; $dsn = "mysql://user:$pwd@localhost/mydb?persist&clientflags=$flags"; $conn = ADONewConnection($dsn); # no need for PConnect() PDO
-
- $conn =& NewADConnection('pdo'); $conn->Connect('mysql:host=localhost',$user,$pwd,$mydb); $conn->Connect('mysql:host=localhost;dbname=mydb',$user,$pwd); $conn->Connect("mysql:host=localhost;dbname=mydb;username=$user;password=$pwd"); $conn =& NewADConnection("pdo_mysql://user:pwd@localhost/mydb?persist"); # persist is optionalPostgreSQL
-
- $conn = &ADONewConnection('postgres');
- $conn->PConnect('host=localhost port=5432 dbname=mary'); $conn->PConnect('localhost','userid','password','database');
- $dsn = 'postgres://user:pwd@localhost/mydb?persist'; # persist is optional $conn = ADONewConnection($dsn); # no need for Connect/PConnectLDAP
-
-require('/path/to/adodb.inc.php');/* Make sure to set this BEFORE calling Connect() */
$LDAP_CONNECT_OPTIONS = Array(
Array ("OPTION_NAME"=>LDAP_OPT_DEREF, "OPTION_VALUE"=>2), Array ("OPTION_NAME"=>LDAP_OPT_SIZELIMIT,"OPTION_VALUE"=>100), Array ("OPTION_NAME"=>LDAP_OPT_TIMELIMIT,"OPTION_VALUE"=>30), Array ("OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,"OPTION_VALUE"=>3), Array ("OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,"OPTION_VALUE"=>13), Array ("OPTION_NAME"=>LDAP_OPT_REFERRALS,"OPTION_VALUE"=>FALSE), Array ("OPTION_NAME"=>LDAP_OPT_RESTART,"OPTION_VALUE"=>FALSE));
$host = 'ldap.baylor.edu';
$ldapbase = 'ou=People,o=
$ldap = NewADOConnection( 'ldap' );
$ldap->Connect( $host, $user_name='', $password='', $ldapbase );
echo "<pre>";
print_r( $ldap->ServerInfo() );
$ldap->SetFetchMode(ADODB_FETCH_ASSOC);
$userName = 'eldridge';
$filter="(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))";
$rs = $ldap->Execute( $filter );
if ($rs)
while ($arr = $rs->FetchRow()) { print_r($arr);
}$rs = $ldap->Execute( $filter );
if ($rs)
while (!$rs->EOF) { print_r($rs->fields);
$rs->MoveNext(); } print_r( $ldap->GetArray( $filter ) );
print_r( $ldap->GetRow( $filter ) );
$ldap->Close();
echo "</pre>";
$dsn = "ldap://ldap.baylor.edu/ou=People,o=
$db = NewADOConnection($dsn);
Interbase/Firebird
-
- $conn = &ADONewConnection('ibase');
- $conn->PConnect('localhost:c:\ibase\profile.gdb','sysdba','masterkey'); $dsn = 'firebird://user:pwd@localhost/mydb?persist&dialect=3'; # persist is optional
- $conn = ADONewConnection($dsn); # no need for Connect/PConnectSQLite
-
- $conn = &ADONewConnection('sqlite'); $conn->PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist $path = urlencode('c:\path\to\sqlite.db'); $dsn = "sqlite://$path/?persist"; # persist is optional
$conn = ADONewConnection($dsn); # no need for Connect/PConnect
Oracle (oci8)
-
- $conn->Connect(false, 'scott', 'tiger'); $conn->PConnect(false, 'scott', 'tiger', 'myTNS'); $conn->PConnect('myTNS', 'scott', 'tiger'); # with adodb 5.06 or 4.991 and later $conn->Connect('192.168.0.1', 'scott', 'tiger', "SID=$SID"); # OR with all versions of ADOdb $conn->connectSID = true; $conn->Connect('192.168.0.1', 'scott', 'tiger', $SID); $conn->Connect('192.168.0.1', 'scott', 'tiger', 'servicename'); $cstr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$host)(PORT=$port))
- (CONNECT_DATA=(SID=$sid)))";
- $conn->Connect($cstr, 'scott', 'tiger'); $dsn = 'oci8://user:pwd@tnsname/?persist'; # persist is optional
- $conn = ADONewConnection($dsn); # no need for Connect/PConnect
-
- $dsn = 'oci8://user:pwd@host/sid';
- $conn = ADONewConnection($dsn);
-
- $dsn = 'oci8://user:pwd@/'; # oracle on local machine
- $conn = ADONewConnection($dsn); $conn->charSet = 'we8iso8859p1';
- $conn->Connect(...);
-
- # or
- $dsn = 'oci8://user:pwd@tnsname/?charset=WE8MSWIN1252';
- $db = ADONewConnection($dsn);DSN-less ODBC ( Access, MSSQL and DB2 examples)
-
- $db =& ADONewConnection('access');
- $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\northwind.mdb;Uid=Admin;Pwd=;"; $db->Connect($dsn); $db =& ADONewConnection('odbc_mssql');
- $dsn = "Driver={SQL Server};Server=localhost;Database=northwind;";
- $db->Connect($dsn,'userid','password'); $db =& ADONewConnection('mssql');
- $db->Execute('localhost', 'userid', 'password', 'northwind'); $dbms = 'db2'; # or 'odbc_db2' if db2 extension not available $db =& ADONewConnection($dbms); $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP;". "uid=root; pwd=secret";
-
- $db->Connect($dsn);
- # or connect and set schema
- $db->Connect($dsn,null,null,$schema);
-If you are using versions of PHP earlier than PHP 4.3.0, DSN-less connections
-only work with Microsoft's <?php
- include('adodb.inc.php');
- $db = &ADONewConnection("ado_mssql");
- print "<h1>Connecting DSN-less $db->databaseType...</h1>";
-
- $myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
- . "SERVER=flipper;DATABASE=ai;UID=sa;PWD=;" ; $db->Connect($myDSN); $rs = $db->Execute("select * from table"); $arr = $rs->GetArray(); print_r($arr);?>
High Speed ADOdb - tuning tips
-
-
-
-
-
-
-
-
-
-
-
-
-
- Execute, CacheExecute
- SelectLimit, CacheSelectLimit
- MoveNext, Close
- qstr, Affected_Rows, Insert_ID
-
-
-
-
-
-
-
-
-
-
-
-
- $rs =& $rs->Execute($sql);
-while (!$rs->EOF) {
- var_dump($rs->fields);
- $rs->MoveNext();
-}
-
- $rs =& $rs->Execute($sql);
-$array = adodb_getall($rs);
-var_dump($array);
-
- Hacking ADOdb Safely
-
-class hack_mysql extends adodb_mysql {
-var $rsPrefix = 'hack_rs_';
- /* Your mods here */
-}
-
-class hack_rs_mysql extends ADORecordSet_mysql {
- /* Your mods here */
-}
-
-class hack_postgres7 extends adodb_postgres7 {
-var $rsPrefix = 'hack_rs_';
- /* Your mods here */
-}
-
-class hack_rs_postgres7 extends ADORecordSet_postgres7 {
-/* Your mods here */
-}
-
-$ADODB_NEWCONNECTION = 'hack_factory';
-
-function& hack_factory($driver)
-{
- if ($driver !== 'mysql' && $driver !== 'postgres7') return false;
-
- $driver = 'hack_'.$driver;
- $obj = new $driver();
- return $obj;
-}
-
-include_once('adodb.inc.php');PHP5 Features
-
-
-
-
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs = $db->Execute($sql);
- foreach($rs as $k => $row) {
- echo "r1=".$row[0]." r2=".$row[1]."<br>";
- }
-
-
- include("../adodb-exceptions.inc.php");
- include("../adodb.inc.php");
- try {
- $db = NewADOConnection("oci8");
- $db->Connect('','scott','bad-password');
- } catch (exception $e) {
- var_dump($e);
- adodb_backtrace($e->gettrace());
- } Databases Supported
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $db->PConnect('localhost:c:/ibase/profile.gdb', "sysdba",
- "masterkey") to connect. Lacks Affected_Rows currently.
-
- You can set $db->role, $db->dialect, $db->buffers and
- $db->charSet before connecting.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Unix install
- howto and another
- one.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Unix install howto.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mysqld --ansi or mysqld --sql-mode=PIPES_AS_CONCAT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PConnect('serverip:1521','scott','tiger','service')
- or using an entry in TNSNAMES.ORA or ONAMES or HOSTNAMES:
- PConnect(false, 'scott', 'tiger', $oraname).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PConnect('DSN','user','pwd'). This is the base class for all odbc derived
- drivers.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A = well tested and used by many people
-B = tested and usable, but some features might not be implemented
-C = user contributed or experimental driver. Might not fully support all of the
-latest features of ADOdb.
-
-Tutorials
-
-Example 1: Select Statement
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('access'); # create a connection
-$conn->PConnect('northwind'); # connect to MS-Access, northwind DSN
-$recordSet = &$conn->Execute('select * from products');
-if (!$recordSet)
- print $conn->ErrorMsg();
-else
-while (!$recordSet->EOF) {
- print $recordSet->fields[0].' '.$recordSet->fields[1].'<BR>';
- $recordSet->MoveNext();
-}$recordSet->Close(); # optional
-$conn->Close(); # optional
-
-?>
$recordSet->fields[]
-array is generated by the PHP database extension. Some database extensions only
-index by number and do not index the array by field name. To force indexing by
-name - that is associative arrays - use the SetFetchMode function. Each
-recordset saves and uses whatever fetch mode was set when the recordset was
-created in Execute() or SelectLimit(). $db->SetFetchMode(ADODB_FETCH_NUM);
- $rs1 = $db->Execute('select * from table');
- $db->SetFetchMode(ADODB_FETCH_ASSOC);
- $rs2 = $db->Execute('select * from table');
- print_r($rs1->fields); # shows array([0]=>'v0',[1] =>'v1') print_r($rs2->fields); # shows array(['col1']=>'v0',['col2'] =>'v1')Example 2: Advanced Select with Field Objects
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('access'); # create a connection
-$conn->PConnect('northwind'); # connect to MS-Access, northwind dsn
-$recordSet = &$conn->Execute('select CustomerID,OrderDate from Orders');
-if (!$recordSet)
- print $conn->ErrorMsg();
-else
-while (!$recordSet->EOF) {
- $fld = $recordSet->FetchField(1); $type = $recordSet->MetaType($fld->type);
-
- if ( $type == 'D' || $type == 'T')
- print $recordSet->fields[0].' '.
- $recordSet->UserDate($recordSet->fields[1],'m/d/Y').'<BR>';
- else print $recordSet->fields[0].' '.$recordSet->fields[1].'<BR>';
-
- $recordSet->MoveNext();
-}$recordSet->Close(); # optional
-$conn->Close(); # optional
-
-?>
-
-
-
-
-
-Example 3: Inserting
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('access'); # create a connection
-
-$conn->PConnect('northwind'); # connect to MS-Access, northwind dsn
-$shipto = $conn->qstr("John's Old Shoppe");
-
-$sql = "insert into orders (customerID,ProfileID,OrderDate,ShipName) ";
-$sql .= "values ('ANATR',2,".$conn->DBDate(time()).",$shipto)";
-
-if ($conn->Execute($sql) === false) {
- print 'error inserting: '.$conn->ErrorMsg().'<BR>';
-}
-?>Example 4: Debugging
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('access'); # create a connection
-$conn->PConnect('northwind'); # connect to MS-Access, northwind dsn
-$shipto = $conn->qstr("John's Old Shoppe");
-$sql = "insert into orders (customerID,ProfileID,OrderDate,ShipName) ";
-$sql .= "values ('ANATR',2,".$conn->FormatDate(time()).",$shipto)";
-$conn->debug = true;if ($conn->Execute($sql) === false) print 'error inserting';?>
Example 5: MySQL and Menus
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('mysql'); # create a connection
-$conn->PConnect('localhost','userid','','agora');# connect to MySQL, agora db
-$sql = 'select CustomerName, CustomerID from customers';
-$rs = $conn->Execute($sql);
-print $rs->GetMenu('GetCust','Mary Rosli');
-?>Example 6: Connecting to 2 Databases At Once
-
-<?
-include('adodb.inc.php'); # load code common to ADOdb
-$conn1 = &ADONewConnection('mysql'); # create a mysql connection
-$conn2 = &ADONewConnection('oracle'); # create a oracle connection
-
-$conn1->PConnect($server, $userid, $password, $database);
-$conn2->PConnect(false, $ora_userid, $ora_pwd, $oraname);
-
-$conn1->Execute('insert ...');
-$conn2->Execute('update ...');
-?>Example 7: Generating Update and Insert SQL
-
- $record["firstname"] = "Bob"; $record["lastname"] = "Smith";
$record["created"] = time();
$insertSQL = $conn->AutoExecute($rs, $record, 'INSERT');
$record["firstname"] = "Caroline"; $record["lastname"] = "Smith"; # Update Caroline's lastname from Miranda to Smith
$insertSQL = $conn->AutoExecute($rs, $record, 'UPDATE', 'id = 1');
<?
-#==============================================
-# SAMPLE GetUpdateSQL() and GetInsertSQL() code
-#==============================================
-include('adodb.inc.php');
-include('tohtml.inc.php');
-
-#==========================
-# This code tests an insert
-
-$sql = "SELECT * FROM ADOXYZ WHERE id = -1";
-# Select an empty record from the database
-
-$conn = &ADONewConnection("mysql"); # create a connection
-$conn->debug=1;
-$conn->PConnect("localhost", "admin", "", "test"); # connect to MySQL, testdb
-$rs = $conn->Execute($sql); # Execute the query and get the empty recordset
-
-$record = array(); # Initialize an array to hold the record data to insert
-
-# Set the values for the fields in the record
-# Note that field names are case-insensitive
-$record["firstname"] = "Bob";
-$record["lastNamE"] = "Smith";
-$record["creaTed"] = time();
-
-# Pass the empty recordset and the array containing the data to insert
-# into the GetInsertSQL function. The function will process the data and return
-# a fully formatted insert sql statement.
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-
-$conn->Execute($insertSQL); # Insert the record into the database
-
-#==========================
-# This code tests an update
-
-$sql = "SELECT * FROM ADOXYZ WHERE id = 1";
-# Select a record to update
-
-$rs = $conn->Execute($sql); # Execute the query and get the existing record to update
-
-$record = array(); # Initialize an array to hold the record data to update
-
-# Set the values for the fields in the record
-# Note that field names are case-insensitive
-$record["firstname"] = "Caroline";
-$record["LasTnAme"] = "Smith"; # Update Caroline's lastname from Miranda to Smith
-
-# Pass the single record recordset and the array containing the data to update
-# into the GetUpdateSQL function. The function will process the data and return
-# a fully formatted update sql statement with the correct WHERE clause.
-# If the data has not changed, no recordset is returned
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-
-$conn->Execute($updateSQL); # Update the record in the database
-$conn->Close();
-?>0 = ignore empty fields. All empty fields in array are ignored.
-1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
-2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
-3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and
- empty fields '' are set to empty '' sql values.
-
-define('ADODB_FORCE_IGNORE',0);
-define('ADODB_FORCE_NULL',1);
-define('ADODB_FORCE_EMPTY',2);
-define('ADODB_FORCE_VALUE',3);Example 8: Implementing Scrolling with Next and Previous
-
-include_once('../adodb.inc.php');
-include_once('../adodb-pager.inc.php');
-session_start();
-
-$db = NewADOConnection('mysql');
-
-$db->Connect('localhost','root','','xphplens');
-
-$sql = "select * from adoxyz ";
-
-$pager = new ADODB_Pager($db,$sql);
-$pager->Render($rows_per_page=5);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $sql = 'select id as "ID", firstname as "First Name",
- lastname as "Last Name", created as "Date Created"
- from adoxyz';Example 9: Exporting in CSV or Tab-Delimited Format
-
-include_once('/path/to/adodb/toexport.inc.php');
-include_once('/path/to/adodb/adodb.inc.php');
-
-$db = &NewADOConnection('mysql');
-
-
-$db->Connect($server, $userid, $password, $database);
-
-$rs = $db->Execute('select fname as "First Name", surname as "Surname" from table');
-
-print "<pre>";
-print rs2csv($rs); # return a string, CSV format
-
-$rs->MoveFirst(); # note, some databases do not support MoveFirst
-print rs2tab($rs,false); # return a string, tab-delimited
- # false == suppress field names in first lineprint '<hr>';
-$rs->MoveFirst();
-rs2tabout($rs); # send to stdout directly (there is also an rs2csvout function)
-print "</pre>";
-
-$rs->MoveFirst();
-$fp = fopen($path, "w");
-if ($fp) {
- rs2csvfile($rs, $fp); # write to file (there is also an rs2tabfile function)
- fclose($fp);
-}Example 10: Recordset Filters
-
-include_once('adodb/rsfilter.inc.php');
-include_once('adodb/adodb.inc.php');
-
-// ucwords() every element in the recordset
-function do_ucwords(&$arr,$rs)
-{
- foreach($arr as $k => $v) {
- $arr[$k] = ucwords($v);
- }
-}
-
-$db = NewADOConnection('mysql');
-$db->PConnect('server','user','pwd','db');
-
-$rs = $db->Execute('select ... from table');
-$rs = RSFilter($rs,'do_ucwords');Example 11: Smart Transactions
-
-$conn->BeginTrans();
-$ok = $conn->Execute($sql);
-if ($ok) $ok = $conn->Execute($sql2);
-if (!$ok) $conn->RollbackTrans();
-else $conn->CommitTrans();$conn->StartTrans();
-$conn->Execute($sql);
-$conn->Execute($Sql2);
-$conn->CompleteTrans();$conn->StartTrans();
-$conn->Execute($sql);
-if (!CheckRecords()) $conn->FailTrans();
-$conn->Execute($Sql2);
-$conn->CompleteTrans();$conn->StartTrans();
-$conn->Execute($sql);
- $conn->StartTrans(); # ignored if (!CheckRecords()) $conn->FailTrans(); $conn->CompleteTrans(); # ignored
$conn->Execute($Sql2);
$conn->CompleteTrans();Using Custom Error Handlers and PEAR_Error
-
- include("../adodb-exceptions.inc.php");
- include("../adodb.inc.php");
- try {
- $db = NewADOConnection("oci8://scott:bad-password@mytns/");
- } catch (exception $e) {
- var_dump($e);
- adodb_backtrace($e->gettrace());
- }
-(a) Connect() or PConnect() fails, or
-(b) a function that executes SQL statements such as Execute() or SelectLimit()
-has an error.
-(c) GenID() appears to go into an infinite loop. <?php
-error_reporting(E_ALL); # pass any error messages triggered to error handler
-include('adodb-errorhandler.inc.php');include('adodb.inc.php');include('tohtml.inc.php');$c = NewADOConnection('mysql');$c->PConnect('localhost','root','','northwind');$rs=$c->Execute('select * from productsz'); #invalid table productsz');if ($rs) rs2html($rs);
?>
<?php
-error_reporting(E_ALL); # report all errors
-ini_set("display_errors", "0"); # but do not echo the errors
-define('ADODB_ERROR_LOG_TYPE',3);
-define('ADODB_ERROR_LOG_DEST','C:/errors.log');
-include('adodb-errorhandler.inc.php');include('adodb.inc.php');include('tohtml.inc.php');$c = NewADOConnection('mysql');$c->PConnect('localhost','root','','northwind');$rs=$c->Execute('select * from productsz'); ## invalid table productszif ($rs) rs2html($rs);
?>
(2001-10-28 14:20:38) mysql error: [1146: Table 'northwind.productsz' doesn't exist] in
-EXECUTE("select * from productsz")PEAR_ERROR
-
-<?php
-include('adodb-errorpear.inc.php');include('adodb.inc.php');include('tohtml.inc.php');$c = NewADOConnection('mysql');$c->PConnect('localhost','root','','northwind');$rs=$c->Execute('select * from productsz'); #invalid table productsz');if ($rs) rs2html($rs);
else { $e = ADODB_Pear_Error();
- echo '<p>',$e->message,'</p>';}
?>
include('PEAR.php');
-PEAR::setErrorHandling('PEAR_ERROR_DIE');MetaError and MetaErrMsg
-
-Error Messages
-
-Data Source Names
-
- $username = 'root';
- $password = '';
- $hostname = 'localhost';
- $databasename = 'xphplens';
- $driver = 'mysql';
- $dsn = "$driver://$username:$password@$hostname/$databasename"
- $db = NewADOConnection();
- # DB::Connect($dsn) also works if you include 'adodb/adodb-pear.inc.php' at the top
- $rs = $db->query('select firstname,lastname from adoxyz');
- $cnt = 0;
- while ($arr = $rs->fetchRow()) {
- print_r($arr); print "<br>";
- }PEAR Compatibility
-
-DB_Common
query - returns PEAR_Error on error limitQuery - return PEAR_Error on error prepare - does not return PEAR_Error on error execute - does not return PEAR_Error on error setFetchMode - supports ASSOC and ORDERED errorNative quote nextID disconnect getOne getAssoc getRow getCol DB_Result
numRows - returns -1 if not supported numCols fetchInto - does not support passing of fetchmode fetchRows - does not support passing of fetchmode freeCaching of Recordsets
-
-include('adodb.inc.php'); # load code common to ADOdb
-$ADODB_CACHE_DIR = '/usr/ADODB_cache';
-$conn = &ADONewConnection('mysql'); # create a connection
-$conn->PConnect('localhost','userid','','agora');# connect to MySQL, agora db
-$sql = 'select CustomerName, CustomerID from customers';
-$rs = $conn->CacheExecute(15,$sql); # (1) $rs = $db->SelectLimit(30, 'select * from table', 10); # (2)
$db->cacheSsecs = 30; $rs = $db->SelectLimit('select * from table', 10); $conn->Connect(...);
- $conn->cacheSecs = 3600*24; # cache 24 hours
- $rs = $conn->CacheExecute('select * from table');MemCache support
-
-$db = NewADOConnection($driver='mysql');$db->memCache = true;$db->memCacheHost = array($ip1, $ip2, $ip3); /// $db->memCacheHost = $ip1; will work too$db->memCachePort = 11211; /// this is default memCache port$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)$db->Connect(...);$db->CacheExecute($sql);Caching API
-
-
-
-
-include "/path/to/adodb.inc.php";$ADODB_CACHE_CLASS = 'MyCacheClass';class MyCacheClass extends ADODB_Cache_File{ var $createdir = false; // do not set this to true unless you use temp directories in cache path function writecache($filename, $contents,$debug=false){...} function &readcache($filename, &$err, $secs2cache, $rsClass){ ...} :}$DB = NewADOConnection($driver);$DB->Connect(...); ## MyCacheClass created here and stored in $ADODB_CACHE global variable.$data = $rs->CacheGetOne($sql); ## MyCacheClass is used here for caching...Pivot Tables
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # Query the main "product" table
-# Set the rows to SupplierName
-# and the columns to the values of Categories
-# and define the joins to link to lookup tables
-# "categories" and "suppliers"
-#
-include "adodb/pivottable.inc.php";
-$sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'SupplierName', # rows (multiple fields allowed)
- 'CategoryName', # column to pivot on
- 'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where
-);SELECT SupplierName,
-SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS
-"Beverages",
-SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS
-"Condiments",
-SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS
-"Confections",
-SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS
-"Dairy Products",
-SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS
-"Grains/Cereals",
-SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS
-"Meat/Poultry",
-SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS
-"Produce",
-SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS
-"Seafood",
-SUM(1) as Total
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID =
-c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY SupplierName$sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'SupplierName', # rows (multiple fields allowed) array( # column ranges
' 0 ' => 'UnitsInStock <= 0',
"1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5',
"6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10',
"11 to 15" => '10 < UnitsInStock and UnitsInStock <= 15', "16+" => '15 < UnitsInStock'
), ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where 'UnitsInStock', # sum this field
'Sum ' # sum label prefix
);
SELECT SupplierName,
-SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS
-"Sum 0 ",
-SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN
-UnitsInStock ELSE 0 END) AS "Sum 1 to 5",
-SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock
-ELSE 0 END) AS "Sum 6 to 10",
-SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN
-UnitsInStock ELSE 0 END) AS "Sum 11 to 15",
-SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS
-"Sum 16+",
-SUM(UnitsInStock) AS "Sum UnitsInStock",
-SUM(1) as Total,
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID =
-c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY SupplierName
-
-Class Reference
-
-Global Variables
-
-$ADODB_COUNTRECS
-
-$ADODB_CACHE_DIR
-
-
-chgrp -R apache /path/to/adodb/cache $ADODB_ANSI_PADDING_OFF
-
-$ADODB_LANG
-
-$ADODB_FETCH_MODE
-
-
-define('ADODB_FETCH_NUM',1);
-define('ADODB_FETCH_ASSOC',2);
-define('ADODB_FETCH_BOTH',3); $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs1 = $db->Execute('select * from table');
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rs2 = $db->Execute('select * from table');
- print_r($rs1->fields); # shows array([0]=>'v0',[1] =>'v1') print_r($rs2->fields); # shows array(['col1']=>'v0',['col2'] =>'v1') $db->SetFetchMode(ADODB_FETCH_NUM);
- $rs1 = $db->Execute('select * from table');
- $db->SetFetchMode(ADODB_FETCH_ASSOC);
- $rs2 = $db->Execute('select * from table');
- print_r($rs1->fields); # shows array([0]=>'v0',[1] =>'v1') print_r($rs2->fields); # shows array(['col1']=>'v0',['col2'] =>'v1')
-1 = assoc uppercase field names. $rs->fields['ORDERID']
-2 = use native-case field names. $rs->fields['OrderID'] -- this is the
-default since ADOdb 2.90
-include('adodb.inc.php'); $ADODB_FORCE_TYPE
-
-$ADODB_QUOTE_FIELDNAMES
-
-
-
-ADOConnection
-
-ADOConnection Fields
-
-
-
-ADOConnection Main Functions
-
-# $oraname in tnsnames.ora/ONAMES/HOSTNAMES
-$conn->Connect(false, 'scott', 'tiger', $oraname);
-$conn->Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora$conn = &NewADOConnection('mysql');
-$conn->autoRollback = true; # default is false
-$conn->PConnect(...); # rollback here$conn->Execute("SELECT * FROM TABLE WHERE COND=:val", array('val'=> $val));
- $conn->Execute("SELECT * FROM TABLE WHERE COND=?", array($val));$rs = $db->Execute('select * from table where val=?', array('10'));$rs = $db->Execute('select name from table where val=:key',
- array('key' => 10));$arr = array(
- array('Ahmad',32),
- array('Zulkifli', 24),
- array('Rosnah', 21)
- );
-$ok = $db->Execute('insert into table (name,age) values (?,?)',$arr); include('adodb.inc.php');
- include('tohtml.inc.php');
- $ADODB_CACHE_DIR = '/usr/local/ADOdbcache';
- $conn = &ADONewConnection('mysql');
- $conn->PConnect('localhost','userid','password','database');
- $rs = $conn->CacheExecute(15, 'select * from table'); # cache 15 secs
- rs2html($rs); /* recordset to html table */ $conn->Connect(...);
- $conn->cacheSecs = 3600*24; // cache 24 hours
- $rs = $conn->CacheExecute('select * from table'); $db = ADONewConnection("oci8");
- $db->Connect("foo.com:1521", "uid", "pwd", "FOO");
- $rs = $db->ExecuteCursor("begin :cursorvar := getdata(:param1); end;",
- 'cursorvar',
- array('param1'=>10));
- # $rs is now just like any other ADOdb recordset object
- rs2html($rs); $stmt = $db->Prepare("begin :cursorvar := getdata(:param1); end;", true);
- $db->Parameter($stmt, $cur, 'cursorvar', false, -1, OCI_B_CURSOR);
- $rs = $db->Execute($stmt,$bindarr); $vv = 'A%';
- $stmt = $db->PrepareSP("BEGIN list_tabs(:crsr,:tt); END;");
- $db->OutParameter($stmt, $cur, 'crsr', -1, OCI_B_CURSOR);
- $db->OutParameter($stmt, $vv, 'tt', 32); # return varchar(32)
- $arr = $db->GetArray($stmt);
- print_r($arr);
- echo " val = $vv"; ## outputs 'TEST' TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;
-
- PROCEDURE list_tabs(tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS
- BEGIN
- OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
- tablenames := 'TEST';
- END list_tabs;$connection->SelectLimit('SELECT
-* FROM TABLE',3). This functionality is simulated for databases
-that do not possess this feature.$connection->SelectLimit('SELECT * FROM TABLE',3,2).$connection->SelectLimit('SELECT *
-FROM TABLE',-1,10) to get rows 11 to the last row.$conn->SelectLimit("SELECT * FROM TABLE WHERE COND=:val", 100,-1,array('val'=> $val));
-$conn->SelectLimit("SELECT * FROM TABLE WHERE COND=?", 100,-1,array('val'=> $val)); $conn->Connect(...);
- $conn->cacheSecs = 3600*24; // cache 24 hours
- $rs = $conn->CacheSelectLimit('select * from table',10); $db->CacheSelectLimit(-1, $sql, $nrows);
- system("rm -f `find
-".$ADODB_CACHE_DIR." -name adodb_*.cache`");
-#------------------------------------------------------
-# This particular example deletes files in the TMPPATH
-# directory with the string ".cache" in their name that
-# are more than 7 days old.
-#------------------------------------------------------
-AGED=7
-find ${TMPPATH} -mtime +$AGED | grep "\.cache" | xargs rm -f $saveErrHandlers = $conn->IgnoreErrors();
$rs = $conn->Execute("select field from some_table_that_might_not_exist");$conn->IgnoreErrors($saveErrHandlers);
# for oracle
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');
- $conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');
-
- # non oracle databases
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');
-
-If you do not pass in an oid, then UpdateBlob() assumes that you are storing in
-bytea fields. # for oracle
- $conn->Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, empty_clob())');
- $conn->UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');
-
- # non oracle databases
- $conn->Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)');
- $conn->UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');
-'I' - blob encoding required, and returned encoded blob is a numeric value (no
-need to quote).
-'C' - blob encoding required, and returned encoded blob is a character value
-(requires quoting). $rs = $db->Execute("select bloboid from postgres_table where id=$key");
-$blob = $db->BlobDecode( reset($rs->fields) );# single field primary key
-$ret = $db->Replace('atable',
- array('id'=>1000,'firstname'=>'Harun','lastname'=>'Al-Rashid'),
- 'id',$autoquote = true);
-# generates UPDATE atable SET firstname='Harun',lastname='Al-Rashid' WHERE id=1000
-# or INSERT INTO atable (id,firstname,lastname) VALUES (1000,'Harun','Al-Rashid')
-
-# compound key
-$ret = $db->Replace('atable2',
- array('firstname'=>'Harun','lastname'=>'Al-Rashid', 'age' => 33, 'birthday' => 'null'),
- array('lastname','firstname'),
- $autoquote = true);
-
-# no auto-quoting
-$ret = $db->Replace('atable2',
- array('firstname'=>"'Harun'",'lastname'=>"'Al-Rashid'", 'age' => 'null'),
- array('lastname','firstname'));
-
-
-$record["firstName"] = "Carol";
$record["lasTname"] = "Smith";
$conn->AutoExecute($table,$record,'INSERT');
# executes "INSERT INTO $table (firstName,lasTname) values ('Carol',Smith')";$record["firstName"] = "Carol";
$record["lasTname"] = "Jones";
$conn->AutoExecute($table,$record,'UPDATE', "lastname like 'Sm%'");
# executes "UPDATE $table SET firstName='Carol',lasTname='Jones' WHERE lastname like 'Sm%'";
$DB->BeginTrans();
-$DB->Execute("update table1 set val=$val1 where id=$id");
-$DB->Execute("update table2 set val=$val2 where id=$id");
-$DB->CommitTrans();$DB->BeginTrans();
-$ok = $DB->Execute("update table1 set val=$val1 where id=$id");
-if ($ok) $ok = $DB->Execute("update table2 set val=$val2 where id=$id");
-if ($ok) $DB->CommitTrans();
-else $DB->RollbackTrans();$DB->BeginTrans();
-$ok = $DB->Execute("update table1 set val=$val1 where id=$id");
-if ($ok) $ok = $DB->Execute("update table2 set val=$val2 where id=$id");
-$DB->CommitTrans($ok);$DB->StartTrans();
-CallBlackBox();
-$DB->Execute("update table1 set val=$val1 where id=$id");
-$DB->Execute("update table2 set val=$val2 where id=$id");
-$DB->CompleteTrans();Detecting Transactions
-
-$db->SetTransactionMode("SERIALIZABLE");$db->BeginTrans();
$db->Execute(...); $db->Execute(...);
$db->CommiTrans();
$db->SetTransactionMode(""); // restore to default$db->StartTrans();
$db->Execute(...); $db->Execute(...);
$db->CompleteTrans();
-
-
-
-row2: Cactus, Plant, Inedible
-row3: Rose, Flower, Edible
-Cactus => array[Plant, Inedible]
-Rose => array[Flower,Edible]
-row2: Cactus, Plant
-row3: Rose, Flower
-Cactus=>Plant
-Rose=>Flower $stmt = $DB->Prepare('insert into table (col1,col2) values (?,?)');
-for ($i=0; $i < $max; $i++)
- $DB->Execute($stmt,array((string) rand(), $i));$sql = 'SELECT '.$db->IfNull('name', "'- unknown -'"). ' FROM table';
$sql = "SELECT ".$db->length."(field) from table";
- $rs = $db->Execute($sql); $sql = "SELECT ".$db->substr."(field, $offset, $length) from table";
- $rs = $db->Execute($sql);$sql = 'insert into table (col1,col2) values ('.$DB->Param('a').','.$DB->Param('b').')';
-# generates 'insert into table (col1,col2) values (?,?)'
-# or 'insert into table (col1,col2) values (:a,:b)'
-$stmt = $DB->Prepare($sql);
-$stmt = $DB->Execute($stmt,array('one','two'));# For oracle, Prepare and PrepareSP are identical$stmt = $db->PrepareSP(
"declare RETVAL integer;
- begin
- :RETVAL := SP_RUNSOMETHING(:myid,:group);
- end;");
-$db->InParameter($stmt,$id,'myid');
-$db->InParameter($stmt,$group,'group',64);
-$db->OutParameter($stmt,$ret,'RETVAL');
-$db->Execute($stmt);# @RETVAL = SP_RUNSOMETHING @myid,@group$stmt = $db->PrepareSP('SP_RUNSOMETHING');
-# note that the parameter name does not have @ in front!$db->InParameter($stmt,$id,'myid');
$db->InParameter($stmt,$group,'group',64);
# return value in mssql - RETVAL is hard-coded name
-$db->OutParameter($stmt,$ret,'RETVAL');
-$db->Execute($stmt);
-
-$stmt Statement returned by Prepare() or PrepareSP().
-$var PHP variable to bind to. Make sure you pre-initialize it!
-$name Name of stored procedure variable name to bind to.
-[$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2=
-IN/OUT. This is ignored in oci8 as this driver auto-detects the direction.
-[$maxLen] Maximum length of the parameter variable.
-[$type] Consult mssql_bind and ocibindbyname docs at php.net for more
-info on legal values for type.$id = 0; $i = 0;
-$stmt = $db->PrepareSP( "update table set val=:i where id=:id");
-$db->Parameter($stmt,$id,'id');
-$db->Parameter($stmt,$i, 'i');
-for ($cnt=0; $cnt < 1000; $cnt++) {
- $id = $cnt;
- $i = $cnt * $cnt; # works with oci8! $db->Execute($stmt);
-}$stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");
-$DB->Bind($stmt, $p1);
-$DB->Bind($stmt, $p2);
-$DB->Bind($stmt, $p3);
-for ($i = 0; $i < $max; $i++) {
- $p1 = ?; $p2 = ?; $p3 = ?;
- $DB->Execute($stmt);
-}$stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:name0, :name1, :name2)");
-$DB->Bind($stmt, $p1, "name0");
-$DB->Bind($stmt, $p2, "name1");
-$DB->Bind($stmt, $p3, "name2");
-for ($i = 0; $i < $max; $i++) {
- $p1 = ?; $p2 = ?; $p3 = ?;
- $DB->Execute($stmt);
-} mysql: CREATE TABLE adodb_logsql ( created datetime NOT NULL,
sql0 varchar(250) NOT NULL,
sql1 text NOT NULL,
params text NOT NULL,
tracer text NOT NULL,
timer decimal(16,6) NOT NULL
) postgres: CREATE TABLE adodb_logsql ( created timestamp NOT NULL,
sql0 varchar(250) NOT NULL,
sql1 text NOT NULL,
params text NOT NULL,
tracer text NOT NULL,
timer decimal(16,6) NOT NULL
) mssql: CREATE TABLE adodb_logsql ( created datetime NOT NULL,
sql0 varchar(250) NOT NULL,
sql1 varchar(4000) NOT NULL,
params varchar(3000) NOT NULL,
tracer varchar(500) NOT NULL,
timer decimal(16,6) NOT NULL
) oci8: CREATE TABLE adodb_logsql ( created date NOT NULL,
sql0 varchar(250) NOT NULL,
sql1 varchar(4000) NOT NULL,
params varchar(4000),
tracer varchar(4000),
timer decimal(16,6) NOT NULL
) $conn->LogSQL(); // turn on logging
- :
- $conn->Execute(...);
- :
- $conn->LogSQL(false); // turn off logging
-
- # output summary of SQL logging results
- $perf = NewPerfMonitor($conn);
- echo $perf->SuspiciousSQL();
- echo $perf->ExpensiveSQL(); include('adodb.inc.php');
- include('adodb-perf.inc.php');
- adodb_perf::table('my_logsql_table');# $db is the connection objectfunction &CountExecs($db, $sql, $inputarray)
{global $EXECS;
if (!is_array(inputarray)) $EXECS++; # handle 2-dimensional input arrays
else if (is_array(reset($inputarray))) $EXECS += sizeof($inputarray); else $EXECS++; # in PHP4.4 and PHP5, we need to return a value by reference
$null = null; return $null;}
# $db is the connection objectfunction CountCachedExecs($db, $secs2cache, $sql, $inputarray)
{
-global $CACHED; $CACHED++;
-}
-
-$db = NewADOConnection('mysql');
-$db->Connect(...);
-$db->fnExecute = 'CountExecs';
-$db->fnCacheExecute = 'CountCachedExecs';
-:
-:
-# After many sql statements:`
-printf("<p>Total queries=%d; total cached=%d</p>",$EXECS+$CACHED, $CACHED);
-
-ADOConnection Utility Functions
-
-
-
- $sql = "select * from atable where created > ".$db->DBDate("$year-$month-$day"); $db->Execute($sql); $sql = "select * from atable where created > ".$db->Param('0'); // or $sql = "select * from atable where created > ?"; $db->Execute($sql,array($db->BindDate("$year-$month-$day")); $sql = "select * from atable where created > ".$db->DBTimeStamp("$year-$month-$day $hr:$min:$secs"); $db->Execute($sql); $sql = "select * from atable where created > ".$db->Param('0'); // or $sql = "select * from atable where created > ?"; $db->Execute($sql,array($db->BindTimeStamp("$year-$month-$day $hr:$min:$secs")); $DB->StartTrans();
- $DB->RowLock("table1","rowid=$id");
- $DB->Execute($sql1);
- $DB->Execute($sql2);
- $DB->CompleteTrans();// In this example: dbtype = 'oci8', $db = 'mydb', $view = 'dataView', $owner = false
-function ADODB_View_PrimaryKeys($dbtype,$db,$view,$owner)
-{
- switch(strtoupper($view)) {
- case 'DATAVIEW': return array('DATAID');
- default: return false;
- }
-}
-
-$db = NewADOConnection('oci8');
-$db->Connect('localhost','root','','mydb');
-$db->MetaPrimaryKeys('dataView'); array(
- 'dept_table' => array('deptkey=deptid'),
- 'posn_table' => array('posn=positionid','poscategory=category')
- )
-
-ADORecordSet
-
-ADORecordSet Fields
-
-ADORecordSet Functions
-
-GetMenu('menu1','A',true)
-will generate a menu: for
-the data (A,1), (B,2), (C,3). Also see example 5.GetMenu('menu1',array('A','B'),false)
-will generate a menu with both A and B selected:
-GetMenu2('menu1',array('1','2'),false)
-will generate a menu with both A and B selected in menu example 2, but this
-time the selection is based on the 2nd column, which holds the values to return
-to the Web server. # get date one week from now
-$fld = $conn->OffsetDate(7); // returns "(trunc(sysdate)+7")# get date and time that is 60 hours from current date and time
-$fld = $conn->OffsetDate(2.5, $conn->sysTimeStamp); // returns "(sysdate+2.5)"
-
-$conn->Execute("UPDATE TABLE SET dodate=$fld WHERE ID=$id"); Y: 4-digit Year Q: Quarter (1-4) M: Month (Jan-Dec) m: Month (01-12) d: Day (01-31) H: Hour (00-23) h: Hour (1-12) i: Minute (00-59) s: Second (00-60) A: AM/PM indicator w: day of week (0-6 or 1-7 depending on DB) l: day of week (as string - lowercase L) W: week in year (0..53 for MySQL, 1..53 for PostgreSQL and Oracle) $sqlfn = $db->SQLDate('Y-\QQ','postdate'); # get sql that formats postdate to output 2002-Q1
-$sql = "SELECT $sqlfn,SUM(cogs) FROM table GROUP BY $sqlfn ORDER BY 1 desc";
-$rs = $db->Execute($sql);
-if ($rs)
- while (!$rs->EOF) {
- ProcessArray($rs->fields);
- $rs->MoveNext();
- }
-Array ( [ID] => 1 [FIRSTNAME] => Caroline [LASTNAME] => Miranda
-[CREATED] => 2001-07-05 ) $rs = $db->Execute($sql);
-if ($rs)
- while ($arr = $rs->FetchRow()) {
- # process $arr
- }$rs = $db->Execute('execute return_multiple_rs');
-$arr1 = $rs->GetArray();
-$rs->NextRecordSet();
-$arr2 = $rs->GetArray();$rs = $db->Execute('select firstname,lastname from table');
-if ($rs) {
- while ($o = $rs->FetchNextObject()) {
- print "$o->FIRSTNAME, $o->LASTNAME<BR>";
- }
-}fields[] array. FetchObj()
-
-
-
-
-
-function rs2html($adorecordset,[$tableheader_attributes],
-[$col_titles])
-
-<?
-include('tohtml.inc.php'); # load code common to ADOdb
-include('adodb.inc.php'); # load code common to ADOdb
-$conn = &ADONewConnection('mysql'); # create a connection
-$conn->PConnect('localhost','userid','','agora');# connect to MySQL, agora db
-$sql = 'select CustomerName, CustomerID from customers';
-$rs = $conn->Execute($sql);
-rs2html($rs,'border=2 cellpadding=3',array('Customer Name','Customer ID'));
-?>
-
-Differences between this ADOdb library and Microsoft ADO
-
-
-
-
-
-
-Database Driver Guide
-
-Optimizing PHP
-
-Change Log
-
-
- # we have a memcache servers mem1,mem2 on port 8888, compression=off and cachesecs=120
- $dsn = 'mysql://user:pwd@localhost/mydb?memcache=mem1,mem2:8888:0&cachesecs=120';
-
-
- ClassHasMany ClassBelongsTo TableHasMany TableBelongsTo
-TableKeyHasMany TableKeyBelongsTo.
-You can also define your child/parent class in these functions, instead of the
-default ADODB_Active_Record. Thx Arialdo Martini & Chris R for idea. include "/path/to/adodb.inc.php";
$ADODB_CACHE_CLASS = 'MyCacheClass';
class MyCacheClass extends ADODB_Cache_File
{ function writecache($filename, $contents,$debug=false){...} function &readcache($filename, &$err, $secs2cache, $rsClass){ ...} :}
$DB = NewADOConnection($driver);
$DB->Connect(...); ## MyCacheClass created here and stored in $ADODB_CACHE global variable.$data = $rs->CacheGetOne($sql); ## MyCacheClass is used here for caching...
$db = NewADOConnection($driver);
$db->memCache = true; /// should we use memCache instead of caching in files
$db->memCacheHost = array($ip1, $ip2, $ip3); /// $db->memCacheHost = $ip1; still works
$db->memCachePort = 11211; /// this is default memCache port
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
$db->Connect(...);
$db->CacheExecute($sql);
-+ Support for INDEX in data-dict. Example: idx_ev1. The ability to define
-indexes using the INDEX keyword was added in ADOdb 4.94. The following example
-features mutiple indexes, including a compound index idx_ev1. event_id I(11) NOTNULL AUTOINCREMENT PRIMARY, event_type I(4) NOTNULL INDEX idx_evt,
event_start_date T DEFAULT NULL INDEX id_esd, event_end_date T DEFAULT '0000-00-00 00:00:00' INDEX id_eted, event_parent I(11) UNSIGNED NOTNULL DEFAULT 0 INDEX id_evp, event_owner I(11) DEFAULT 0 INDEX idx_ev1, event_project I(11) DEFAULT 0 INDEX idx_ev1, event_times_recuring I(11) UNSIGNED NOTNULL DEFAULT 0, event_icon C(20) DEFAULT 'obj/event', event_description X
-+ Prevents the generated SQL from including double drop-sequence statements for
-REPLACE case of tables with autoincrement columns (on those dbs that emulate it
-via sequences)
-+ makes any date defined as DEFAULT value for D and T columns work
-cross-database, not just the "sysdate" value (as long as it is
-specified using adodb standard format). See above example. $db = NewADOConnection($driver);
$db->memCache = true; /// should we use memCache instead of caching in files
$db->memCacheHost = "126.0.1.1"; /// memCache host
$db->memCachePort = 11211; /// this is default memCache port
$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
$db->Connect(...);
$db->CacheExecute($sql);
$DB = NewADOConnection('mysql');$DB->Connect(...);
$DB->SetFetchMode(ADODB_FETCH_NUM);
$rs = $DB->Execute('select productname,productid,unitprice from products limit 10');$rs2 = $DB->Transpose($rs);
rs2html($rs2);
oci8: X->varchar(4000) XL->CLOBmssql: X->XL->TEXT
mysql: X->XL->LONGTEXT
fbird: X->XL->varchar(4000)
oci8: X->varchar(4000) XL->CLOBmssql: X->VARCHAR(4000) XL->TEXT
mysql: X->TEXT XL->LONGTEXTfbird: X->VARCHAR(4000) XL->VARCHAR(32000)
-- MySql and Postgres MetaType was reporting every int column which was part of
-a primary key and unique as serial
-- Postgres was not reporting the scale of decimal types
-- MaxDB was padding the defaults of none-string types with spaces
-- MySql now correctly converts enum columns to varchar
-- you cant add NOT NULL columns in postgres in one go, they need to be added as
-NULL and then altered to NOT NULL
-- AlterColumnSQL could not change a varchar column with numbers into an integer
-column, postgres need an explicit conversation
-- a re-created sequence was not set to the correct value, if the name was the
-old name (no implicit sequence), now always the new name of the implicit
-sequence is used $this->_transactionID = $this->_connectionID; $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID); $text = 'test test test';
- $sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";
- $stmt = $conn -> PrepareSP($sql);
- $conn -> InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);
- $rs = '';
- $conn -> OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);
- $conn -> Execute($stmt);
- echo "return = ".$rs."<br>";- use OCINewDescriptor before binding
-- if Param is IN, uses save() before each execute. This is done automatically for you.
-- if Param is OUT, uses load() after each execute. This is done automatically for you.
-- when we bind $var as LOB, we create new descriptor and return it as a
- Bind Result, so if we want to use OUT parameters, we have to store
- somewhere &$var to load() data from LOB to it.
-- IN OUT params are not working now (should not be a big problem to fix it)
-- now mass binding not working too (I've wrote about it before)
-
-Old change log history moved to old-changelog.htm.
-
-
-ADOdb Data Dictionary Library for PHP
-
-AXMLS (c) 2004 ars Cognita, Inc
-Beta-quality: DB2, Informix, Sybase, Interbase, Firebird, SQLite.
-Alpha-quality: MS Access (does not support DEFAULT values) and
-generic ODBC.
-Example Usage
- include_once('adodb.inc.php');
-
# First create a normal connection
$db = NewADOConnection('mysql');
$db->Connect(...);
# Then create a data dictionary object, using this connection
$dict = NewDataDictionary($db);
# We have a portable declarative data dictionary format in ADOdb, similar to SQL.
# Field types use 1 character codes, and fields are separated by commas.
# The following example creates three fields: "col1", "col2" and "col3":
$flds = "
col1 C(32) NOTNULL DEFAULT 'abc',
col2 I DEFAULT 0,
col3 N(12.2)
";
# We demonstrate creating tables and indexes
$sqlarray = $dict->CreateTableSQL($tabname, $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
$idxflds = 'co11, col2';
$sqlarray = $dict->CreateIndexSQL($idxname, $tabname, $idxflds);
$dict->ExecuteSQLArray($sqlarray);More Complex Table Sample
-
-$flds = "
- event_id I(11) NOTNULL AUTOINCREMENT PRIMARY,
- event_type I(4) NOTNULL INDEX idx_evt,
- event_start_date T DEFAULT NULL INDEX id_esd,
- event_end_date T DEFAULT '0000-00-00 00:00:00' INDEX id_eted,
- event_parent I(11) UNSIGNED NOTNULL DEFAULT 0 INDEX id_evp,
- event_owner I(11) DEFAULT 0 INDEX idx_ev1,
- event_project I(11) DEFAULT 0 INDEX idx_ev1,
- event_times_recuring I(11) UNSIGNED NOTNULL DEFAULT 0,
- event_icon C(20) DEFAULT 'obj/event',
- event_description X
-";
-$sqlarray = $db->CreateTableSQL($tablename, $flds);
-$dict->ExecuteSQLArray($sqlarray);
-
-Class Factory
-NewDataDictionary($connection, $drivername=false)
-
-$db = NewADOConnection('odbtp');
-$datadict = NewDataDictionary($db, 'mssql'); # force mssql
-
-Class Functions
-function CreateDatabase($dbname, $optionsarray=false)
-function CreateTableSQL($tabname, $fldarray, $taboptarray=false)
- RETURNS: an array of strings, the sql to be executed, or false
-
$tabname: name of table
$fldarray: string (or array) containing field info
$taboptarray: array containing table options "$fieldname $type $colsize $otheroptions"
- array($fieldname, $type, [,$colsize] [,$otheroptions]*)
- C: Varchar, capped to 255 characters.
-
X: Larger varchar, capped to 4000 characters (to be compatible with Oracle).
XL: For Oracle, returns CLOB, otherwise the largest varchar size.
C2: Multibyte varchar
X2: Multibyte varchar (largest size)
B: BLOB (binary large object)
D: Date (some databases do not support this, and we return a datetime type)
T: Datetime or Timestamp accurate to the second.
TS: Datetime or Timestamp supporting Sub-second accuracy.
Supported by Oracle, PostgreSQL and SQL Server currently.
Otherwise equivalent to T.
- L: Integer field suitable for storing booleans (0 or 1)
I: Integer (mapped to I4)
I1: 1-byte integer
I2: 2-byte integer
I4: 4-byte integer
I8: 8-byte integer
F: Floating point number
N: Numeric or decimal number AUTO For autoincrement number. Emulated with triggers if not available.
-
Sets NOTNULL also.
AUTOINCREMENT Same as auto.
KEY Primary key field. Sets NOTNULL also. Compound keys are supported.
PRIMARY Same as KEY.
DEF Synonym for DEFAULT for lazy typists.
DEFAULT The default value. Character strings are auto-quoted unless
the string begins and ends with spaces, eg ' SYSDATE '.
NOTNULL If field is not null.
DEFDATE Set default value to call function to get today's date.
DEFTIMESTAMP Set default to call function to get today's datetime.
NOQUOTE Prevents autoquoting of default string values.
CONSTRAINTS Additional constraints defined at the end of the field
definition. $flds = array(
-
array('COLNAME', 'DECIMAL', '8.4', 'DEFAULT' =gt; 0, 'NOTNULL'),
array('id', 'I' , 'AUTO'),
array('`MY DATE`', 'D' , 'DEFDATE'),
array('NAME', 'C' , '32', 'CONSTRAINTS' =gt; 'FOREIGN KEY REFERENCES reftable')
); $flds = "
-
COLNAME DECIMAL(8.4) DEFAULT 0 NOTNULL,
id I AUTO,
`MY DATE` D DEFDATE,
NAME C(32) CONSTRAINTS 'FOREIGN KEY REFERENCES reftable'
";
-
-
-Indicates that the previous table definition should be removed
-(dropped)together with ALL data. See first example below.
-Drop table. Useful for removing unused tables.
-Define this as the key, with the constraint as the value. See the
-postgresql example below. Additional constraints defined for the whole
-table. You will probably need to prefix this with a comma. $taboptarray = array('mysql' =gt; 'TYPE=ISAM', 'oci8' =gt; 'tablespace users', 'REPLACE');
- $taboptarray = array('constraints' =gt; ', FOREIGN KEY (col1) REFERENCES reftable (refcol)');
-function DropTableSQL($tabname)
-function ChangeTableSQL($tabname, $flds, $tableOptions=false, $dropOldFlds=false)
-function RenameTableSQL($tabname,$newname)
- function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='')
-function CreateIndexSQL($idxname, $tabname, $flds,
-$idxoptarray=false)
- RETURNS: an array of strings, the sql to be executed, or false
-
$idxname: name of index
$tabname: name of table
$flds: list of fields as a comma delimited string or an array of strings
$idxoptarray: array of index creation options CLUSTERED Create clustered index (only mssql)
-
BITMAP Create bitmap index (only oci8)
UNIQUE Make unique index
FULLTEXT Make fulltext index (only mysql)
HASH Create hash index (only postgres)
DROP Drop legacy indexfunction DropIndexSQL ($idxname, $tabname = NULL)
-function AddColumnSQL($tabname, $flds)
-function AlterColumnSQL($tabname, $flds)
-function DropColumnSQL($tabname, $flds)
-function SetSchema($schema)
-function MetaTables()
-function MetaColumns($tab, $upper=true, $schema=false)
-function MetaPrimaryKeys($tab,$owner=false,$intkey=false)
-function MetaIndexes($table, $primary = false, $owner = false)
-function NameQuote($name = NULL)
-function TableName($name)
-function MetaType($t,$len=-1,$fieldobj=false)
-function ActualType($meta)
-function ExecuteSQLArray($sqlarray, $contOnError = true)
- RETURNS: 0 if failed, 1 if executed all but with errors, 2 if executed successfully
-
$sqlarray: an array of strings with sql code (no semicolon at the end of string)
$contOnError: if true, then continue executing even if error occurs
-
-ADOdb XML Schema (AXMLS)
-Quick Start
-
-<?xml version="1.0"?>
<schema version="0.2">
<table name="users">
<desc>A typical users table for our application.</desc>
<field name="userId" type="I">
<descr>A unique ID assigned to each user.</descr>
<KEY/>
<AUTOINCREMENT/>
</field>
<field name="userName" type="C" size="16"><NOTNULL/></field>
<index name="userName">
<descr>Put a unique index on the user name</descr>
<col>userName</col>
<UNIQUE/>
</index>
</table>
<sql>
<descr>Insert some data into the users table.</descr>
<query>insert into users (userName) values ( 'admin' )</query>
<query>insert into users (userName) values ( 'Joe' )</query>
</sql>
</schema>
-<?xml version="1.0"?>
<schema version="0.2">
...
</schema>
-<table name="users">
<desc>A typical users table for our application.</desc>
<field name="userId" type="I">
<descr>A unique ID assigned to each user.</descr>
<KEY/>
<AUTOINCREMENT/>
</field>
<field name="userName" type="C" size="16"><NOTNULL/></field>
</table>
-<table name="users">
...
<index name="userName">
<descr>Put a unique index on the user name</descr>
<col>userName</col>
<UNIQUE/>
</index>
</table>
-<sql>
<descr>Insert some data into the users table.</descr>
<query>insert into users (userName) values ( 'admin' )</query>
<query>insert into users (userName) values ( 'Joe' )</query>
</sql>
-<?PHP
/* You must tell the script where to find the ADOdb and
* the AXMLS libraries.
*/
-require( "path_to_adodb/adodb.inc.php");
-require( "path_to_adodb/adodb-xmlschema.inc.php" ); # or adodb-xmlschema03.inc.php
-
-/* Configuration information. Define the schema filename,
* RDBMS platform (see the ADODB documentation for valid
* platform names), and database connection information here.
*/
$schemaFile = 'example.xml';
$platform = 'mysql';
$dbHost = 'localhost';
$dbName = 'database';
$dbUser = 'username';
$dbPassword = 'password';
/* Start by creating a normal ADODB connection.
*/
$db = ADONewConnection( $platform );
$db->Connect( $dbHost, $dbUser, $dbPassword, $dbName );
/* Use the database connection to create a new adoSchema object.
*/
$schema = new adoSchema( $db );
/* Call ParseSchema() to build SQL from the XML schema file.
* Then call ExecuteSchema() to apply the resulting SQL to
* the database.
*/
$sql = $schema->ParseSchema( $schemaFile );
$result = $schema->ExecuteSchema();
?>
-$db = ADONewConnection( 'mysql' );
$db->Connect( 'host', 'user', 'password', 'database' );$schema = new adoSchema( $db );
-$schema->ParseSchema( $schemaFile );
-
$schema->ExecuteSchema();XML Schema Version 3
-
-
-
-<?xml version="1.0"?>
-<schema version="0.3">
- <table name="ats_kb">
- <descr>ATS KnowledgeBase</descr>
- <opt platform="mysql">TYPE=INNODB</opt>
- <field name="recid" type="I"/>
- <field name="organization_code" type="I4"/>
- <field name="sub_code" type="C" size="20"/>
- etc...
-
-Upgrading
-
-If you have any questions or comments, please email them to
-Richard at richtl#arscognita.com.
-
-
-
diff --git a/src/adodb512/docs/docs-oracle.htm b/src/adodb512/docs/docs-oracle.htm
deleted file mode 100644
index c91a8db3..00000000
--- a/src/adodb512/docs/docs-oracle.htm
+++ /dev/null
@@ -1,542 +0,0 @@
-
-
-
-
-
-
- Using ADOdb with PHP and Oracle: an advanced tutorial
-![]()
1. Introduction
-
-
-
-
-
-
- Oracle extension
- Designed for Oracle 7 or earlier. This is obsolete.
-
-
-Oci8 extension
- Despite it's name, which implies it is only for Oracle 8i, this is the standard method for accessing databases running Oracle 8i, 9i or 10g (and later).
-
-$conn = OCILogon("scott","tiger", $tnsName);
-
-$stmt = OCIParse($conn,"select * from emp where empno > :emp order by empno");
-$emp = 7900;
-OCIBindByName($stmt, ':emp', $emp);
-$ok = OCIExecute($stmt);
-while (OCIFetchInto($stmt,$arr)) {
- print_r($arr);
- echo "<hr>";
-}
-
-
- Array ( [0] => 7934 [1] => MILLER [2] => CLERK [3] => 7782 [4] => 23/JAN/82 [5] => 1300 [7] => 10 )
-
-
-
-
- Feature
- PEAR DB 1.6
- ADOdb 4.52
-
-
- General Style
- Simple, easy to use. Lacks Oracle specific functionality.
- Has multi-tier design. Simple high-level design for beginners, and also lower-level advanced Oracle functionality.
-
-
- Support for Prepare
- Yes, but only on one statement, as the last prepare overwrites previous prepares.
- Yes (multiple simultaneous prepare's allowed)
-
-
- Support for LOBs
- No
- Yes, using update semantics
-
-
- Support for REF Cursors
- No
- Yes
-
-
- Support for IN Parameters
- Yes
- Yes
-
-
- Support for OUT Parameters
- No
- Yes
-
-
- Schema creation using XML
- No
- Yes, including ability to define tablespaces and constraints
-
-
- Provides database portability features
- No
- Yes, has some ability to abstract features that differ between databases such as dates, bind parameters, and data types.
-
-
- Performance monitoring and tracing
- No
- Yes. SQL can be traced and linked to web page it was executed on. Explain plan support included.
-
-
- Recordset caching for frequently used queries
- No
- Yes. Provides great speedups for SQL involving complex where, group-by and order-by clauses.
-
-
- Popularity
- Yes, part of PEAR release
- Yes, many open source projects are using this software, including PostNuke, Xaraya, Mambo, Tiki Wiki.
-
-
- Speed
- Medium speed.
- Very high speed. Fastest database abstraction library available for PHP. Benchmarks are available.
-
-
-High Speed Extension available
- No
- Yes. You can install the optional ADOdb extension, which reimplements the most frequently used parts of ADOdb as fast C code. Note that the source code version of ADOdb runs just fine without this extension, and only makes use of the extension if detected.
- ADOdb Example
-
-include "/path/to/adodb.inc.php";
-$db = NewADOConnection("oci8");
-$db->Connect($tnsName, "scott", "tiger");
-
-$rs = $db->Execute("select * from emp where empno>:emp order by empno",
- array('emp' => 7900));
-while ($arr = $rs->FetchRow()) {
- print_r($arr);
- echo "<hr>";
-}
-
-
-
-
-
- Oci8
- ADOdb
-
-
-
- $stmt = OCIParse($conn,
- "select * from emp where empno > :emp");
-$emp = 7900;
-OCIBindByName($stmt, ':emp', $emp);
-$ok = OCIExecute($stmt);
-
-while (OCIFetchInto($stmt,$arr)) {
- print_r($arr);
- echo "<hr>";
-}
- $recordset = $db->Execute("select * from emp where empno>:emp",
- array('emp' => 7900));
-
-while ($arr = $recordset->FetchRow()) {
- print_r($arr);
- echo "<hr>";
-}2. ADOdb Query Semantics
-
-$rs = $db->Execute("select * from emp where empno>:emp", array('emp' => 7900));
-while (!$rs->EOF) {
- print_r($rs->fields);
- $rs->MoveNext();
-}
-
-
-$arr = $db->GetArray("select * from emp where empno>:emp", array('emp' => 7900));
-
-
-$arr = $db->GetRow("select * from emp where empno=:emp", array('emp' => 7900));
-
-
-$arr = $db->GetOne("select ename from emp where empno=:emp", array('emp' => 7900));
-
-
-$offset = 200; $limitrows = 100;
-$rs = $db->SelectLimit('select * from table', $limitrows, $offset);
-
-Array Fetch Mode
-
-
-Caching
-
-$ADODB_CACHE_DIR = '/var/adodb/tmp';
-$rs = $db->CacheExecute(3600, "select names from allcountries order by 1");
-
-There are analogous CacheGetArray(
-), CacheGetRow( ), CacheGetOne( ) and CacheSelectLimit( ) functions. The first parameter is the number of seconds to cache. You can also pass a bind array as a 3rd parameter (not shown above).
-
-$ADODB_CACHE_DIR = '/var/adodb/tmp';
-$connection->cacheSecs = 3600;
-$rs = $connection->CacheExecute($sql, array('id' => 1));
-
-
-3. Using Prepare( ) For Frequently Used Statements
-
-$stmt = $db->Prepare('insert into table (field1, field2) values (:f1, :f2)');
-foreach ($arrayToInsert as $key => $value) {
- $db->Execute($stmt, array('f1' => $key, 'f2' => $val);
-}
-
-4. Working With LOBs
-
-$ok = $db->Execute("insert into aTable (id, name, ablob)
- values (aSequence.nextVal, 'Name', null)");
-if (!$ok) return LogError($db->ErrorMsg());
-# params: $tableName, $blobFieldName, $blobValue, $whereClause
-$db->UpdateBlob('aTable', 'ablob', $blobValue, 'id=aSequence.currVal');
-
-
-$ok = $db->Execute("insert into aTable (id, name, aclob)
- values (aSequence.nextVal, 'Name', null)");
-if (!$ok) return LogError($db->ErrorMsg());
-$db->UpdateClob('aTable', 'aclob', $clobValue, 'id=aSequence.currVal');
-
-
- $sql = "INSERT INTO photos ( ID, photo) ".
- "VALUES ( :id, empty_blob() )".
- " RETURNING photo INTO :xx";
-
- $stmt = $db->PrepareSP($sql);
- $db->InParameter($stmt, $id, 'id');
- $blob = $db->InParameter($stmt, $blob_data, 'xx',-1, OCI_B_BLOB);
- $db->StartTrans();
- $ok = $db->Execute($stmt);
- $db->CompleteTrans();
-
-5. REF CURSORs
-
-TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;
-
-PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames IN VARCHAR) IS
- BEGIN
- OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
- END open_tab;
-
-
-$rs = $db->ExecuteCursor("BEGIN open_tab(:refc,'A%'); END;",'refc');
-while ($arr = $rs->FetchRow()) print_r($arr);
-
-6. In and Out Parameters
-
-PROCEDURE data_out(input IN VARCHAR, output OUT VARCHAR) IS
- BEGIN
- output := 'I love '||input;
- END;
-
-
-$stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;");
-$input = 'Sophia Loren';
-$db->InParameter($stmt,$input,'a1');
-$db->OutParameter($stmt,$output,'a2');
-$ok = $db->Execute($stmt);
-if ($ok) echo ($output == 'I love Sophia Loren') ? 'OK' : 'Failed';
-
-Bind Parameters and REF CURSORs
-
-$stmt = $db->PrepareSP("BEGIN adodb.open_tab(:refc,:tabname); END;");
-$input = 'A%';
-$db->InParameter($stmt,$input,'tabname');
-$rs = $db->ExecuteCursor($stmt,'refc');
-while ($arr = $rs->FetchRow()) print_r($arr);
-
-Bind Parameters and LOBs
-
- $text = 'test test test';
- $sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";
- $stmt = $conn -> PrepareSP($sql);
- $conn -> InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB); # -1 means variable length
- $rs = '';
- $conn -> OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);
- $conn -> Execute($stmt);
- echo "return = ".$rs."<br>";
-
-Reusing Bind Parameters with CURSOR_SHARING=FORCE
-
-$arr = $db->GetArray("select * from emp where empno>:emp", array('emp' => 7900));
-
-
-$arr = $db->GetArray("select * from emp where empno>7900");
-
-
-ALTER SESSION SET CURSOR_SHARING=FORCE
-
-7. Dates and Datetime in ADOdb
-
-$db = NewADOConnection('oci8');
-$db->NLS_DATE_FORMAT = 'RRRR-MM-DD HH24:MI:SS';
-$db->Connect($tns, $user, $pwd);
-
-$sql = quot;ALTER SESSION SET NLS_DATE_FORMAT = 'RRRR-MM-DD HH24:MI:SS'";
-$db->Execute($sql);
-
-8. Database Portability Layer
-
-
-
-
- Function
- Description
-
-
- DBDate($date)
- Pass in a UNIX timestamp or ISO date and it will convert it to a date
- string formatted for INSERT/UPDATE
-
-
- DBTimeStamp($date)
- Pass in a UNIX timestamp or ISO date and it will convert it to a timestamp
- string formatted for INSERT/UPDATE
-
-
- SQLDate($date, $fmt)
- Portably generate a date formatted using $fmt mask, for use in SELECT
- statements.
-
-
- OffsetDate($date, $ndays)
- Portably generate a $date offset by $ndays.
-
-
- Concat($s1, $s2, ...)
- Portably concatenate strings. Alternatively, for mssql use mssqlpo driver,
- which allows || operator.
-
-
- IfNull($fld, $replaceNull)
- Returns a string that is the equivalent of MySQL IFNULL or Oracle NVL.
-
-
- Param($name)
- Generates bind placeholders, using ? or named conventions as appropriate.
-
-$db->sysDate Property that holds the SQL function that returns today's date
-
-$db->sysTimeStamp Property that holds the SQL function that returns the current
-timestamp (date+time).
-
-
-
-$db->concat_operator Property that holds the concatenation operator
-
-
-
-$db->length Property that holds the name of the SQL strlen function.
-
-$db->upperCase Property that holds the name of the SQL strtoupper function.
-
-$db->random Property that holds the SQL to generate a random number between 0.00 and 1.00.
-
-
-$db->substr Property that holds the name of the SQL substring function.
-
-
-
-
- Driver Name
- Description
-
-
- oci805
- Specifically for Oracle 8.0.5. This driver has a slower SelectLimit( ).
-
-
- oci8
- The default high performance driver. The keys of associative arrays returned in a recordset are upper-case.
-
-
-oci8po
- The portable Oracle driver. Slightly slower than oci8. This driver uses ? instead of :bindvar for binding variables, which is the standard for other databases. Also the keys of associative arrays are in lower-case like other databases.
- $db = NewADOConnection('oci8po');
-$db->Connect($tns, $user, $pwd);
-$db->Execute("insert into atable (f1, f2) values (?,?)", array(12, 'abc'));
-9. Connecting to Oracle
-Should You Use Persistent Connections
-Connection Examples
- $conn = NewADOConnection('oci8');
- $conn->Connect(false, 'scott', 'tiger');
- $conn = NewADOConnection('oci8');
- $conn->PConnect(false, 'scott', 'tiger', 'myTNS');
- $conn->PConnect('myTNS', 'scott', 'tiger');
-
- $conn->connectSID = true;
- $conn->Connect('192.168.0.1', 'scott', 'tiger', 'SID');
- $conn->Connect('192.168.0.1', 'scott', 'tiger', 'servicename');
- $cstr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$host)(PORT=$port))
- (CONNECT_DATA=(SID=$sid)))";
- $conn->Connect($cstr, 'scott', 'tiger');
-
-
- $dsn = 'oci8://user:pwd@tnsname/?persist'; # persist is optional
- $conn = ADONewConnection($dsn); # no need for Connect/PConnect
-
- $dsn = 'oci8://user:pwd@host/sid';
- $conn = ADONewConnection($dsn);
-
- $dsn = 'oci8://user:pwd@/'; # oracle on local machine
- $conn = ADONewConnection($dsn);
-10. Error Checking
-function InvokeErrorHandler()
-{
-
global $db; ## assume global
- MyLogFunction($db->ErrorNo(), $db->ErrorMsg());
-}
-if (!$db->Connect($tns, $usr, $pwd)) InvokeErrorHandler();
-
-$rs = $db->Execute("select * from emp where empno>:emp order by empno",
- array('emp' => 7900));
-if (!$rs) return InvokeErrorHandler();
-while ($arr = $rs->FetchRow()) {
- print_r($arr);
- echo "<hr>";
-}
-Handling Large Recordsets (added 27 May 2005)
-The oci8 driver does not support counting the number of records returned in a SELECT statement, so the function RecordCount()
-is emulated when the global variable $ADODB_COUNTRECS is set to true, which is the default.
-We emulate this by buffering all the records. This can take up large amounts of memory for big recordsets.
- Set $ADODB_COUNTRECS to false for the best performance.
- 11. Other ADOdb Features
-12. Download
-13. Resources
-
-
-
-
diff --git a/src/adodb512/docs/docs-perf.htm b/src/adodb512/docs/docs-perf.htm
deleted file mode 100644
index 924fe162..00000000
--- a/src/adodb512/docs/docs-perf.htm
+++ /dev/null
@@ -1,965 +0,0 @@
-
-
-
- The ADOdb Performance Monitoring Library
-Introduction
-
-
-$perf->HealthCheck()
-or $perf->HealthCheckCLI(). $perf->UI().
-This UI displays:
-
-
- $perf->DBParameter('data cache hit
-ratio') returns this very important statistic in a database
-independant manner.
-
-
-
-Usage
-<?php
-
include_once('adodb.inc.php');
session_start(); # session variables required for monitoring
$conn = ADONewConnection($driver);
$conn->Connect($server,$user,$pwd,$db);
$perf =& NewPerfMonitor($conn);
$perf->UI($pollsecs=5);
?>$size = $perf->DBParameter('data cache size');
-Methods
-
-define('ADODB_PERF_NO_RUN_SQL',1);
-
-
-
-
-
- ADOdb
-Performance Monitor for localhost, db=test
-
- PostgreSQL 7.3.2 on i686-pc-cygwin, compiled by
-GCC gcc (GCC) 3.2 20020927 (prerelease)
-
-
- Performance Stats View
-SQL View Tables Poll
-Stats
-
-
-
-
-
-
-
- postgres7
-
-
- Parameter
- Value
- Description
-
-
- Ratios
-
-
- statistics collector
- TRUE
- Value must be TRUE to enable hit ratio statistics (stats_start_collector,stats_row_level
-and stats_block_level must be set to true in postgresql.conf)
-
-
- data cache hit ratio
- 99.7967555299239
-
-
-
- IO
-
-
- data reads
- 125
-
-
-
- data writes
- 21.78125000000000000
- Count of inserts/updates/deletes * coef
-
-
- Data Cache
-
-
- data cache buffers
- 640
- Number of cache buffers. Tuning
-
-
- cache blocksize
- 8192
- (estimate)
-
-
- data cache size
- 5M
-
-
-
- operating system cache size
- 80M
- (effective cache size)
-
-
- Memory Usage
-
-
- sort buffer size
- 1M
- Size of sort buffer (per query)
-
-
- Connections
-
-
- current connections
- 0
-
-
-
- max connections
- 32
-
-
-
- Parameters
-
-
- rollback buffers
- 8
- WAL buffers
-
-
-
-random page cost
- 4
- Cost of doing a seek (default=4). See random_page_cost
- -- Ratios --
-
MyISAM cache hit ratio =gt; 56.5635738832
InnoDB cache hit ratio =gt; 0
sql cache hit ratio =gt; 0
-- IO --
data reads =gt; 2622
data writes =gt; 2415.5
-- Data Cache --
MyISAM data cache size =gt; 512K
BDB data cache size =gt; 8388600
InnoDB data cache size =gt; 8M
-- Memory Pools --
read buffer size =gt; 131072
sort buffer size =gt; 65528
table cache =gt; 4
-- Connections --
current connections =gt; 3
max connections =gt; 100Accumulating statistics...
-
Time WS-CPU% Hit% Sess Reads/s Writes/s
11:08:30 0.7 56.56 1 0.0000 0.0000
11:08:33 1.8 56.56 2 0.0000 0.0000
11:08:36 11.1 56.55 3 2.5000 0.0000
11:08:39 9.8 56.55 2 3.1121 0.0000
11:08:42 2.8 56.55 1 0.0000 0.0000
11:08:45 7.4 56.55 2 0.0000 1.5000Raw Functions
-$ADODB_PERF_MIN
-Format of $settings Property
-
-
-
-
-
-
- 'table cache' =gt; array('CACHE', # category code
-
array("show variables", 'table_cache'), # array (type 1b)
'Number of tables to keep open'), # descriptionExample Health Check Output
-
-
-
-
-
-
-
- db2
-
-
- Parameter
- Value
- Description
-
-
- Ratios
-
-
- data cache hit ratio
- 0
-
-
-
- Data Cache
-
-
- data cache buffers
- 250
- See tuning
-reference.
-
-
- cache blocksize
- 4096
-
-
-
- data cache size
- 1000K
-
-
-
- Connections
-
-
-
-current connections
- 2
-
-
-
-
-
-
-
-
- informix
-
-
- Parameter
- Val
-ue
- Description
-
-
- Ratios
-
-
- data cache hit
-ratio
- 95.89
-
-
-
- IO
-
-
- data
-reads
- 1883884
- Page reads
-
-
- data writes
- 1716724
- Page writes
-
-
- Connections
-
-
-
-
-current connections
- 263.0
- Number of
-sessions
-
- -
- mysql- |
- ||
| Parameter | -Value | -Description | -
| Ratios | -||
| MyISAM cache hit ratio | -56.5658301822 | -Cache ratio should be at least 90% | -
| InnoDB cache hit ratio | -0 | -Cache ratio should be at least 90% | -
| sql cache hit ratio | -0 | -- |
| IO | -||
| data reads | -2622 | -Number of selects (Key_reads is not accurate) | -
| data writes | -2415.5 | -Number of inserts/updates/deletes * coef (Key_writes is not -accurate) | -
| Data Cache | -||
| MyISAM data cache size | -512K | -- |
| BDB data cache size | -8388600 | -- |
| InnoDB data cache size | -8M | -- |
| Memory Pools | -||
| read buffer size | -131072 | -(per session) | -
| sort buffer size | -65528 | -Size of sort buffer (per session) | -
| table cache | -4 | -Number of tables to keep open | -
| Connections | -||
| current connections | -3 | -- |
| max connections | -100 | -- |
- -
- mssql- |
- ||
| Parameter | -Value | -Description | -
| Ratios | -||
| data cache hit ratio | -99.9999694824 | -- |
| prepared sql hit ratio | -99.7738579828 | -- |
| adhoc sql hit ratio | -98.4540169133 | -- |
| IO | -||
| data reads | -2858 | -- |
| data writes | -1438 | -- |
| Data Cache | -||
| data cache size | -4362 | -in K | -
| Connections | -||
| current connections | -14 | -- |
| max connections | -32767 | -- |
- -
- oci8- |
- ||
| Parameter | -Value | -Description | -
| Ratios | -||
| data cache hit ratio | -96.98 | -- |
| sql cache hit ratio | -99.96 | -- |
| IO | -||
| data reads | -842938 | -- |
| data writes | -16852 | -- |
| Data Cache | -||
| data cache buffers | -3072 | -Number of cache buffers | -
| data cache blocksize | -8192 | -- |
| data cache size | -48M | -shared_pool_size | -
| Memory Pools | -||
| java pool size | -0 | -java_pool_size | -
| sort buffer size | -512K | -sort_area_size (per query) | -
| user session buffer size | -8M | -large_pool_size | -
| Connections | -||
| current connections | -1 | -- |
| max connections | -170 | -- |
| data cache utilization ratio | -88.46 | -Percentage of data cache actually in use | -
| user cache utilization ratio | -91.76 | -Percentage of user cache (large_pool) actually in use | -
| rollback segments | -11 | -- |
| Transactions | -||
| peak transactions | -24 | -Taken from high-water-mark | -
| max transactions | -187 | -max transactions / rollback segments < 3.5 (or -transactions_per_rollback_segment) | -
| Parameters | -||
| cursor sharing | -EXACT | -Cursor reuse strategy. Recommended is FORCE (8i+) or SIMILAR -(9i+). See cursor_sharing. | -
| index cache cost | -0 | -% of indexed data blocks expected in the cache. Recommended -is 20-80. Default is 0. See optimizer_index_caching. | -
| random page cost | -100 | -Recommended is 10-50 for TP, and 50 for data warehouses. -Default is 100. See optimizer_index_cost_adj. - | -
| LOAD | -EXECUTES | -SQL_TEXT | -
| .73% | -89 | -select u.name, o.name, t.spare1, t.pctfree$ from sys.obj$ o, -sys.user$ u, sys.tab$ t where (bitand(t.trigflag, 1048576) = 1048576) -and o.obj#=t.obj# and o.owner# = u.user# select i.obj#, i.flags, -u.name, o.name from sys.obj$ o, sys.user$ u, sys.ind$ i where -(bitand(i.flags, 256) = 256 or bitand(i.flags, 512) = 512) and -(not((i.type# = 9) and bitand(i.flags,8) = 8)) and o.obj#=i.obj# and -o.owner# = u.user# | -
| .84% | -3 | -select /*+ RULE */ distinct tabs.table_name, tabs.owner , -partitioned, iot_type , TEMPORARY, table_type, table_type_owner from -DBA_ALL_TABLES tabs where tabs.owner = :own | -
| 3.95% | -6 | -SELECT round(count(1)*avg(buf.block_size)/1048576) FROM -DBA_OBJECTS obj, V$BH bh, dba_segments seg, v$buffer_pool buf WHERE -obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = -seg.owner and obj.object_name = seg.segment_name and obj.object_type = -seg.segment_type and seg.buffer_pool = buf.name and buf.name = -'DEFAULT' | -
| 4.50% | -6 | -SELECT round(count(1)*avg(tsp.block_size)/1048576) FROM -DBA_OBJECTS obj, V$BH bh, dba_segments seg, dba_tablespaces tsp WHERE -obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = -seg.owner and obj.object_name = seg.segment_name and obj.object_type = -seg.segment_type and seg.tablespace_name = tsp.tablespace_name | -
| 57.34% | -9267 | -select t.schema, t.name, t.flags, q.name from -system.aq$_queue_tables t, sys.aq$_queue_table_affinities aft, -system.aq$_queues q where aft.table_objno = t.objno and -aft.owner_instance = :1 and q.table_objno = t.objno and q.usage = 0 and -bitand(t.flags, 4+16+32+64+128+256) = 0 for update of t.name, -aft.table_objno skip locked | -
| LOAD | -EXECUTES | -SQL_TEXT | -
| 5.24% | -1 | -select round(sum(bytes)/1048576) from dba_segments | -
| 6.89% | -6 | -SELECT round(count(1)*avg(buf.block_size)/1048576) FROM -DBA_OBJECTS obj, V$BH bh, dba_segments seg, v$buffer_pool buf WHERE -obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = -seg.owner and obj.object_name = seg.segment_name and obj.object_type = -seg.segment_type and seg.buffer_pool = buf.name and buf.name = -'DEFAULT' | -
| 7.85% | -6 | -SELECT round(count(1)*avg(tsp.block_size)/1048576) FROM -DBA_OBJECTS obj, V$BH bh, dba_segments seg, dba_tablespaces tsp WHERE -obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = -seg.owner and obj.object_name = seg.segment_name and obj.object_type = -seg.segment_type and seg.tablespace_name = tsp.tablespace_name | -
| 33.69% | -89 | -select u.name, o.name, t.spare1, t.pctfree$ from sys.obj$ o, -sys.user$ u, sys.tab$ t where (bitand(t.trigflag, 1048576) = 1048576) -and o.obj#=t.obj# and o.owner# = u.user# | -
| 36.44% | -89 | -select i.obj#, i.flags, u.name, o.name from sys.obj$ o, -sys.user$ u, sys.ind$ i where (bitand(i.flags, 256) = 256 or -bitand(i.flags, 512) = 512) and (not((i.type# = 9) and -bitand(i.flags,8) = 8)) and o.obj#=i.obj# and o.owner# = u.user# | -
- postgres7- |
- ||
| Parameter | -Value | -Description | -
| Ratios | -||
| statistics collector | -FALSE | -Must be set to TRUE to enable hit ratio statistics (stats_start_collector,stats_row_level -and stats_block_level must be set to true in postgresql.conf) | -
| data cache hit ratio | -99.9666031916603 | -- |
| IO | -||
| data reads | -15 | -- |
| data writes | -0.000000000000000000 | -Count of inserts/updates/deletes * coef | -
| Data Cache | -||
| data cache buffers | -1280 | -Number of cache buffers. Tuning | -
| cache blocksize | -8192 | -(estimate) | -
| data cache size | -10M | -- |
| operating system cache size | -80000K | -(effective cache size) | -
| Memory Pools | -||
| sort buffer size | -1M | -Size of sort buffer (per query) | -
| Connections | -||
| current connections | -13 | -- |
| max connections | -32 | -- |
| Parameters | -||
| rollback buffers | -8 | -WAL buffers | -
| random page cost | -4 | -Cost of doing a seek (default=4). See random_page_cost | -
-V5.11 5 May 2010 (c) 2000-2010 John Lim (jlim#natsoft.com) -
-This software is dual licensed using BSD-Style and -LGPL. This means you can use it in compiled proprietary and commercial -products. -
Useful ADOdb links: Download - Other Docs -
-This document discusses the newer session handler adodb-session2.php. If - you have used the older adodb-session.php, then be forewarned that you will - need to alter your session table format. Otherwise everything is backward - compatible. - Here are the older - docs for - adodb-session.php.
-We store state information specific to a user or web - client in session variables. These session variables persist throughout a -session, as the user moves from page to page.
-To use session variables, call session_start() at the beginning of -your web page, before your HTTP headers are sent. Then for every -variable you want to keep alive for the duration of the session, call -session_register($variable_name). By default, the session handler will -keep track of the session by using a cookie. You can save objects or -arrays in session variables also. -
-The default method of storing sessions is to store it in a file. -However if you have special needs such as you: -
-The ADOdb session handler provides you with the above -additional capabilities by storing the session information as records -in a database table that can be shared across multiple servers.
-These records will be garbage collected based on the php.ini [session] timeout settings. -You can register a notification function to notify you when the record has expired and -is about to be freed by the garbage collector.
-An alternative to using a database backed session handler is to use memcached. - This is a distributed memory based caching system suitable for storing session - information. -
-In ADOdb 4.91, we added a new session handler, in adodb-session2.php. -It features the following improvements: -
Usage is - -
-include_once("adodb/session/adodb-session2.php");
-ADOdb_Session::config($driver, $host, $user, $password, $database,$options=false);
-session_start();
-
-#
# Test session vars, the following should increment on refresh
#
$_SESSION['AVAR'] += 1;
print "<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-
-
-When the session is created in session_start( ), the global variable $ADODB_SESS_CONN holds -the connection object. -
The default name of the table is sessions2. If you want to override it: - -
-include_once("adodb/session/adodb-session2.php");
-$options['table'] = 'mytablename';
-ADOdb_Session::config($driver, $host, $user, $password, $database,$options);
-session_start();
-
-
-
-There are 3 session management files that you can use: -
-adodb-session2.php : The default-
adodb-cryptsession2.php : Use this if you want to store encrypted session data in the database
adodb-session-clob2.php : Use this if you are storing DATA in clobs and you are NOT using oci8 driver
To force non-persistent connections, call Persist() first before session_start(): - - -
-
-include_once("adodb/session/adodb-session2.php");
-$driver = 'mysql'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret'; $database = 'sessiondb';
-ADOdb_Session::config($driver, $host, $user, $password, $database, $options=false);
ADOdb_session::Persist($connectMode=false);
-session_start();
-
-# or, using DSN support so you can set other options such as port (since 5.11)
-include_once("adodb/session/adodb-session2.php");
-$dsn = 'mysql://root:pwd@localhost/mydb?persist=1&port=5654';
-ADOdb_Session::config($dsn, '', '', '');
-session_start();
-
-The parameter to the Persist( ) method sets the connection mode. You can - pass the following:
-| $connectMode | -Connection Method | -
| true | -PConnect( ) |
-
| false | -Connect( ) | -
| 'N' | -NConnect( ) | -
| 'P' | -PConnect( ) | -
| 'C' | -Connect( ) | -
To use a encrypted sessions, simply replace the file adodb-session2.php:
--
include('adodb/session/adodb-cryptsession2.php');
$driver = 'mysql'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret'; $database = 'sessiondb'; -ADOdb_Session::config($driver, $host, $user, $password, $database,$options=false);
adodb_sess_open(false,false,$connectMode=false); -session_start();
And the same technique for adodb-session-clob2.php:
--
include('adodb/session/adodb-session2-clob2.php');
$driver = 'oci8'; $host = 'localhost'; $user = 'auser'; $pwd = 'secret'; $database = 'sessiondb'; -ADOdb_Session::config($driver, $host, $user, $password, $database,$options=false);
adodb_sess_open(false,false,$connectMode=false); -session_start();
1. Create this table in your database. Here is the MySQL version: -
-CREATE TABLE sessions2( - sesskey VARCHAR( 64 ) NOT NULL DEFAULT '', - expiry DATETIME NOT NULL , - expireref VARCHAR( 250 ) DEFAULT '', - created DATETIME NOT NULL , - modified DATETIME NOT NULL , - sessdata LONGTEXT, - PRIMARY KEY ( sesskey ) , - INDEX sess2_expiry( expiry ), - INDEX sess2_expireref( expireref ) -)- -
For PostgreSQL, use: -
CREATE TABLE sessions2( - sesskey VARCHAR( 64 ) NOT NULL DEFAULT '', - expiry TIMESTAMP NOT NULL , - expireref VARCHAR( 250 ) DEFAULT '', - created TIMESTAMP NOT NULL , - modified TIMESTAMP NOT NULL , - sessdata TEXT DEFAULT '', - PRIMARY KEY ( sesskey ) - ); --
create INDEX sess2_expiry on sessions2( expiry ); -create INDEX sess2_expireref on sessions2 ( expireref );-
Here is the Oracle definition, which uses a CLOB for the SESSDATA field: -
- CREATE TABLE SESSIONS2-
(
SESSKEY VARCHAR2(48 BYTE) NOT NULL,
EXPIRY DATE NOT NULL,
EXPIREREF VARCHAR2(200 BYTE),
CREATED DATE NOT NULL,
MODIFIED DATE NOT NULL,
SESSDATA CLOB,
PRIMARY KEY(SESSKEY)
); -
CREATE INDEX SESS2_EXPIRY ON SESSIONS2(EXPIRY); -CREATE INDEX SESS2_EXPIREREF ON SESSIONS2(EXPIREREF);
We need to use a CLOB here because for text greater than 4000 bytes long,
- Oracle requires you to use the CLOB data type. If you are using the oci8 driver,
- ADOdb will automatically enable CLOB handling. So you can use either adodb-session2.php
- or adodb-session-clob2.php - in this case it doesn't matter.
-
You can receive notification when your session is cleaned up by the session garbage collector or -when you call session_destroy(). -
PHP's session extension will automatically run a special garbage collection function based on -your php.ini session.cookie_lifetime and session.gc_probability settings. This will in turn call -adodb's garbage collection function, which can be setup to do notification. -
-
- PHP Session --> ADOdb Session --> Find all recs --> Send --> Delete queued - GC Function GC Function to be deleted notification records - executed at called by for all recs - random time Session Extension queued for deletion --
When a session is created, we need to store a value in the session record (in the EXPIREREF field), typically -the userid of the session. Later when the session has expired, just before the record is deleted, -we reload the EXPIREREF field and call the notification function with the value of EXPIREREF, which -is the userid of the person being logged off. -
ADOdb uses a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session -start to store the notification configuration. -$ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the -first being the name of the session variable you would like to store in -the EXPIREREF field, and the 2nd is the notification function's name.
-For example, suppose we want to be notified when a user's session has expired, -based on the userid. When the user logs in, we store the id in the global session variable -$USERID. The function name is 'NotifyFn'. -
-So we define (before session_start() is called):
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
-And when the NotifyFn is called (when the session expires), the
-$EXPIREREF holding the user id is passed in as the first parameter, eg. NotifyFn($userid, $sesskey). The
-session key (which is the primary key of the record in the sessions
-table) is the 2nd parameter.
-Here is an example of a Notification function that deletes some -records in the database and temporary files:
-
- function NotifyFn($expireref, $sesskey)
- {
- global $ADODB_SESS_CONN; # the session connection object
- $user = $ADODB_SESS_CONN->qstr($expireref);
-
- $ADODB_SESS_CONN->Execute("delete from shopping_cart where user=$user");
- system("rm /work/tmpfiles/$expireref/*");
- }
-
-NOTE 1: If you have register_globals disabled in php.ini, then you -will have to manually set the EXPIREREF. E.g.
-
-$GLOBALS['USERID'] = GetUserID();
-$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
-NOTE 2: If you want to change the EXPIREREF after the session -record has been created, you will need to modify any session variable -to force a database record update. -
-ExpireRef normally holds the user id of the current session. -
-1. You can then write a session monitor, scanning expireref to see -who is currently logged on. -
-2. If you delete the sessions record for a specific user, eg. -
-delete from sessions where expireref = '$USER'-then the user is logged out. Useful for ejecting someone from a -site. -
3. You can scan the sessions table to ensure no user -can be logged in twice. Useful for security reasons. -
--
MD5Crypt (crypt.inc.php)-
MCrypt
Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
GZip
BZip2
These are stackable. E.g. -
ADODB_Session::filter(new ADODB_Compress_Bzip2());-will compress and then encrypt the record in the database. -
ADODB_Session::filter(new ADODB_Encrypt_MD5());
Dynamically change the current session id with a newly generated one and update - database. Currently only works with cookies. Useful to improve security by - reducing the risk of session-hijacking. See this article on Session - Fixation for more info -on the theory behind this feature. Usage:
- include('path/to/adodb/session/adodb-session2.php');
-
- session_start();
- # Approximately every 10 page loads, reset cookie for safety.
- # This is extremely simplistic example, better
- # to regenerate only when the user logs in or changes
- # user privilege levels.
- if ((rand()%10) == 0) adodb_session_regenerate_id();
-
-This function calls session_regenerate_id() internally or simulates it if the function does not exist. -
During session garbage collection, if postgresql is detected, - ADOdb can be set to run VACUUM. If mysql is detected, then optimize database - could be called.You can turn this on or off using:
-$turnOn = true; # or false -ADODB_Session::optimize($turnOn); --
The default is optimization is disabled.
-The older method of connecting to ADOdb using global variables is still supported:
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='abc';
- $ADODB_SESSION_DB ='phplens';
-
- include('path/to/adodb/session/adodb-session2.php');
-In the above example, the only things you need to change in your code to upgrade - is
-Also see the core ADOdb documentation. And if - you are interested in the obsolete adodb-session.php, see old - session documentation.
- - diff --git a/src/adodb512/docs/docs-session.old.htm b/src/adodb512/docs/docs-session.old.htm deleted file mode 100644 index 3c772d67..00000000 --- a/src/adodb512/docs/docs-session.old.htm +++ /dev/null @@ -1,313 +0,0 @@ - - - --V5.06 16 Oct 2008 (c) 2000-2010 John Lim (jlim#natsoft.com) -
-This software is dual licensed using BSD-Style and -LGPL. This means you can use it in compiled proprietary and commercial -products. -
Useful ADOdb links: Download - Other Docs -
-This documentation discusses the old adodb-session.php. -Here is the new documentation on the newer adodb-session2.php. -
We store state information specific to a user or web client in -session variables. These session variables persist throughout a -session, as the user moves from page to page.
-To use session variables, call session_start() at the beginning of -your web page, before your HTTP headers are sent. Then for every -variable you want to keep alive for the duration of the session, call -session_register($variable_name). By default, the session handler will -keep track of the session by using a cookie. You can save objects or -arrays in session variables also. -
-The default method of storing sessions is to store it in a file. -However if you have special needs such as you: -
-The ADOdb session handler provides you with the above -additional capabilities by storing the session information as records -in a database table that can be shared across multiple servers.
-These records will be garbage collected based on the php.ini [session] timeout settings. -You can register a notification function to notify you when the record has expired and -is about to be freed by the garbage collector.
-Important Upgrade Notice: Since ADOdb 4.05, the session files -have been moved to its own folder, adodb/session. This is a rewrite -of the session code by Ross Smith. The old session code is in -adodb/session/old.
-There are 3 session management files that you can use: -
-adodb-session.php : The default-
adodb-session-clob.php : Use this if you are storing DATA in clobs
adodb-cryptsession.php : Use this if you want to store encrypted session data in the database
-
Examples -
- include('adodb/adodb.inc.php');
$ADODB_SESSION_DRIVER='mysql';
$ADODB_SESSION_CONNECT='localhost';
$ADODB_SESSION_USER ='scott';
$ADODB_SESSION_PWD ='tiger';
$ADODB_SESSION_DB ='sessiondb';
include('adodb/session/adodb-session.php');
session_start();
#
# Test session vars, the following should increment on refresh
#
$_SESSION['AVAR'] += 1;
print "<p>\$_SESSION['AVAR']={$_SESSION['AVAR']}</p>";
-
-To force non-persistent connections, call adodb_session_open() first before session_start(): -
-
--
include('adodb/adodb.inc.php');
$ADODB_SESSION_DRIVER='mysql';
$ADODB_SESSION_CONNECT='localhost';
$ADODB_SESSION_USER ='scott';
$ADODB_SESSION_PWD ='tiger';
$ADODB_SESSION_DB ='sessiondb';
include('adodb/session/adodb-session.php');
adodb_sess_open(false,false,false);
session_start();
-
The 3rd parameter to adodb_sess_open($path, $sessname, $connectMode) sets the connection method. You can pass in the following:
-| $connectMode | -Connection Method | -
| true | -PConnect( ) |
-
| false | -Connect( ) | -
| 'N' | -NConnect( ) | -
| 'P' | -PConnect( ) | -
| 'C' | -Connect( ) | -
To use a encrypted sessions, simply replace the file adodb-session.php:
--
include('adodb/adodb.inc.php');
$ADODB_SESSION_DRIVER='mysql';
$ADODB_SESSION_CONNECT='localhost';
$ADODB_SESSION_USER ='scott';
$ADODB_SESSION_PWD ='tiger';
$ADODB_SESSION_DB ='sessiondb';
include('adodb/session/adodb-cryptsession.php');
session_start();
-
And the same technique for adodb-session-clob.php:
--
include('adodb/adodb.inc.php');
$ADODB_SESSION_DRIVER='mysql';
$ADODB_SESSION_CONNECT='localhost';
$ADODB_SESSION_USER ='scott';
$ADODB_SESSION_PWD ='tiger';
$ADODB_SESSION_DB ='sessiondb';
include('adodb/session/adodb-session-clob.php');
session_start(); -
An alternative way to set persistant or non-persistent connections is to call the following function before session_start() is called. -
- ADODB_Session::persist('P'); # 'C' for non-persistent connections
-
- 1. Create this table in your database (MySQL syntax): -
- create table sessions ( - SESSKEY char(32) not null, - EXPIRY int(11) unsigned not null, - EXPIREREF varchar(64), - DATA text not null, - primary key (sesskey) - ); -- -
You may want to rename the 'data' field to 'session_data' as - 'data' appears to be a reserved word for one or more of the following: -
- If you do, then execute: -
- ADODB_Session::dataFieldName('session_data');
-
- For the adodb-session-clob.php version, create this: -
--
create table sessions (
SESSKEY char(32) not null,
EXPIRY int(11) unsigned not null,
EXPIREREF varchar(64),
DATA CLOB,
primary key (sesskey)
); -
2. Then define the following parameters. You can either modify this file, or define them before this file is included: -
$ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
$ADODB_SESSION_CONNECT='server to connect to';
$ADODB_SESSION_USER ='user';
$ADODB_SESSION_PWD ='password';
$ADODB_SESSION_DB ='database';
$ADODB_SESSION_TBL = 'sessions'; # setting this is optional
-
- When the session is created, $ADODB_SESS_CONN holds the connection object.
3. Recommended is PHP 4.0.6 or later. There are documented session bugs in earlier versions of PHP.
-
You can receive notification when your session is cleaned up by the session garbage collector or -when you call session_destroy(). -
PHP's session extension will automatically run a special garbage collection function based on -your php.ini session.cookie_lifetime and session.gc_probability settings. This will in turn call -adodb's garbage collection function, which can be setup to do notification. -
-
- PHP Session --> ADOdb Session --> Find all recs --> Send --> Delete queued - GC Function GC Function to be deleted notification records - executed at called by for all recs - random time Session Extension queued for deletion --
When a session is created, we need to store a value in the session record (in the EXPIREREF field), typically -the userid of the session. Later when the session has expired, just before the record is deleted, -we reload the EXPIREREF field and call the notification function with the value of EXPIREREF, which -is the userid of the person being logged off. -
ADOdb uses a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session -start to store the notification configuration. -$ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the -first being the name of the session variable you would like to store in -the EXPIREREF field, and the 2nd is the notification function's name.
-For example, suppose we want to be notified when a user's session has expired, -based on the userid. When the user logs in, we store the id in the global session variable -$USERID. The function name is 'NotifyFn'. -
-So we define (before session_start() is called):
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
-And when the NotifyFn is called (when the session expires), the
-$USERID is passed in as the first parameter, eg. NotifyFn($userid, $sesskey). The
-session key (which is the primary key of the record in the sessions
-table) is the 2nd parameter.
-Here is an example of a Notification function that deletes some -records in the database and temporary files:
-
- function NotifyFn($expireref, $sesskey)
- {
- global $ADODB_SESS_CONN; # the session connection object
- $user = $ADODB_SESS_CONN->qstr($expireref);
-
- $ADODB_SESS_CONN->Execute("delete from shopping_cart where user=$user");
- system("rm /work/tmpfiles/$expireref/*");
- }
-
-NOTE 1: If you have register_globals disabled in php.ini, then you -will have to manually set the EXPIREREF. E.g.
-
-$GLOBALS['USERID'] = GetUserID();
-$ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
-NOTE 2: If you want to change the EXPIREREF after the session -record has been created, you will need to modify any session variable -to force a database record update. -
-ExpireRef normally holds the user id of the current session. -
-1. You can then write a session monitor, scanning expireref to see -who is currently logged on. -
-2. If you delete the sessions record for a specific user, eg. -
-delete from sessions where expireref = '$USER'-then the user is logged out. Useful for ejecting someone from a -site. -
3. You can scan the sessions table to ensure no user -can be logged in twice. Useful for security reasons. -
-Suppose you are storing the DATA field in a CLOB: -
- CREATE TABLE sessions ( - SESSKEY VARCHAR(32) NOT NULL, - EXPIRY NUMBER(16) NOT NULL, - EXPIREREF VARCHAR(64), - DATA CLOB, - PRIMARY KEY (sesskey) - ); --
Then your PHP code could look like this: -
- ADODB_SESSION_DRIVER='oci8';
- $ADODB_SESSION_CONNECT=$tnsname;
- $ADODB_SESSION_USER ='scott';
- $ADODB_SESSION_PWD = 'tiger';
- $ADODB_SESSION_DB ='';
-
- $ADODB_SESSION_USE_LOBS = 'clob';
- $ADODB_SESSION_TBL = 'sessions';
-
- $ADODB_SESS_DEBUG=0;
-
- include(ADODB_DIR.'/session/adodb-session.php');
-
- ADODB_Session::persist('P'); # use 'C' for non-persistent connects
-
- session_start();
-
- Note that you can set persistance using ADODB_Session::persist('P'). - -
-
MD5Crypt (crypt.inc.php)-
MCrypt
Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
GZip
BZip2
These are stackable. E.g. -
ADODB_Session::filter(new ADODB_Compress_Bzip2());-will compress and then encrypt the record in the database. -
ADODB_Session::filter(new ADODB_Encrypt_MD5());
Dynamically change the current session id with a newly generated one and update database. Currently only -works with cookies. Useful to improve security by reducing the risk of session-hijacking. -See this article on Session Fixation for more info -on the theory behind this feature. Usage: -
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='abc';
- $ADODB_SESSION_DB ='phplens';
-
- include('path/to/adodb/session/adodb-session.php');
-
- session_start();
- # Every 10 page loads, reset cookie for safety.
- # This is extremely simplistic example, better
- # to regenerate only when the user logs in or changes
- # user privilege levels.
- if ((rand()%10) == 0) adodb_session_regenerate_id();
-
-This function calls session_regenerate_id() internally or simulates it if the function does not exist. -
During session garbage collection, if postgresql is detected, - ADOdb can be set to run VACUUM. If mysql is detected, then optimize database - could be called.You can turn this on or off using:
-$turnOn = true; # or false -ADODB_Session::optimize($turnOn); --
The default for optimization is it is disabled.
-Also see the core ADOdb documentation. -
- - diff --git a/src/adodb512/docs/old-changelog.htm b/src/adodb512/docs/old-changelog.htm deleted file mode 100644 index 284f3ad1..00000000 --- a/src/adodb512/docs/old-changelog.htm +++ /dev/null @@ -1,822 +0,0 @@ -3.92 22 Sept 2003 -
Added GetAssoc and CacheGetAssoc to connection object. -
Removed TextMax and CharMax functions from adodb.inc.php. -
HasFailedTrans() returned false when trans failed. Fixed. -
Moved perf driver classes into adodb/perf/*.php. -
Misc improvements to performance monitoring, including UI(). -
RETVAL in mssql Parameter(), we do not append @ now. -
Added Param($name) to connection class, returns '?' or ":$name", for defining - bind parameters portably. -
LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 - _stmt and _affectedrows() bugs. -
Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT - stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also - added new $conn->datetime field to oci8, controls whether MetaType() returns - 'D' ($this->datetime==false) or 'T' ($this->datetime == true) for DATE type. -
Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php. -
Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL(). -
Tuned include_once handling to reduce file-system checking overhead. -
3.91 9 Sept 2003 -
Only released to InterAkt -
Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory - for driver instantiation. -
Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com -
Added portable substr support. -
Now rs2html() has new parameter, $echo. Set to false to return $html instead - of echoing it. -
3.90 5 Sept 2003 -
First beta of performance monitoring released. -
MySQL supports MetaTable() masking. -
Fixed key_exists() bug in adodb-lib.inc.php -
Added sp_executesql Prepare() support to mssql. -
Added bind support to db2. -
Added swedish language file - Christian Tiberg" christian#commsoft.nu -
Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich. -
Left join setting for oci8 was wrong. Thx to johnwilk#juno.com -
3.80 27 Aug 2003 -
Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility. -
Added matching mask for MetaTables. Only for oci8, mssql and postgres currently. -
Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano. -
Added better debugging for Smart Transactions. -
Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP. -
ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define - it after including adodb.inc.php. -
Added portugese (brazilian) to languages. Thx to "Levi Fukumori". -
Removed arg3 parameter from Execute/SelectLimit/Cache* functions. -
Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() - to note change in sql query counting with 2-d arrays. -
Added MONEY to MetaType in PostgreSQL. -
Added more debugging output to CacheFlush(). -
3.72 9 Aug 2003 -
Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes - and does the right thing... -
Fixed CacheFlush() bug - Thx to martin#gmx.de -
Walt Boring contributed MetaForeignKeys for postgres7. -
_fetch() called _BlobDecode() wrongly in interbase. Fixed. -
adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980 -
3.71 4 Aug 2003 -
The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner - == false. -
Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. -
Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com. -
Error handling in oci8 bugfix - if there was an error in Execute(), then when - calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but - the 2nd call would return no error. -
Error handling in odbc bugfix. ODBC would always return the last error, even - if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to - 0 everytime before CacheExecute() and Execute(). -
3.70 29 July 2003 -
Added new SQLite driver. Tested on PHP 4.3 and PHP 5. -
Added limited "sapdb" driver support - mainly date support. -
The oci8 driver did not identify NUMBER with no defined precision correctly. -
Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls - in GetInsertSQL/GetUpdateSQL. -
DBDate() and DBTimeStamp() format for postgresql had problems. Fixed. -
Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit. -
Added charset support to postgresql. Thx to Julian Tarkhanov. -
Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS) -
Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn. -
adodb-cryptsession.php includes wrong. Fixed. -
Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8. -
Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring. -
adodb_getcount() did not init qryRecs to 0. Missing "WHERE" clause checking - in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn. -
Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring. -
Upgraded to adodb-xmlschema.inc.php 0.0.2. -
NConnect for mysql now returns value. Thx to Dennis Verspuij. -
ADODB_FETCH_BOTH support added to interbase/firebird. -
Czech language file contributed by Kamil Jakubovic jake#host.sk. -
PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec. -
Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it -
ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed. -
3.60 16 June 2003 -
We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with - mssql driver. -
The property $emptyDate missing from connection class. Also changed 1903 to - constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn. -
ADOdb speedup optimization - we now return all arrays by reference. -
Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. - Suggested by vincent. -
Added GetArray() to connection class. -
Added not_null check in informix metacolumns(). -
Connection parameters for postgresql did not work correctly when port was defined. -
DB2 is now a tested driver, making adodb 100% compatible. Extensive changes - to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching - to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() - fixes. -
The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed. -
Some bugs in adodb_backtrace() fixed. -
Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql - properly. -
MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions - to odbc MetaColumns() for vfp and db2 compat. -
Added unsigned support to mysql datadict class. Thx to iamsure. -
Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to - Josh R, Night_Wulfe#hotmail.com. -
ChangeTableSQL contributed by Florian Buzin. -
The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with - mssql driver. -
- -3.50 19 May 2003
-Fixed mssql compat with FreeTDS. FreeTDS does not implement mssql_fetch_assoc(). -
Merged back connection and recordset code into adodb.inc.php. -
ADOdb sessions using oracle clobs contributed by achim.gosse#ddd.de. See adodb-session-clob.php. -
Added /s modifier to preg_match everywhere, which ensures that regex does not - stop at /n. Thx Pao-Hsi Huang. -
Fixed error in metacolumns() for mssql. -
Added time format support for SQLDate. -
Image => B added to metatype. -
MetaType now checks empty($this->blobSize) instead of empty($this). -
Datadict has beta support for informix, sybase (mapped to mssql), db2 and generic - (which is a fudge). -
BlobEncode for postgresql uses pg_escape_bytea, if available. Needed for compat - with 7.3. -
Added $ADODB_LANG, to support multiple languages in MetaErrorMsg(). -
Datadict can now parse table definition as declarative text. -
For DataDict, oci8 autoincrement trigger missing semi-colon. Fixed. -
For DataDict, when REPLACE flag enabled, drop sequence in datadict for autoincrement - field in postgres and oci8.s -
Postgresql defaults to template1 database if no database defined in connect/pconnect. -
We now clear _resultid in postgresql if query fails. -
3.40 19 May 2003
-Added insert_id for odbc_mssql. -
Modified postgresql UpdateBlobFile() because it did not work in safe mode. -
Now connection object is passed to raiseErrorFn as last parameter. Needed by - StartTrans(). -
Added StartTrans() and CompleteTrans(). It is recommended that you do not modify - transOff, but use the above functions. -
oci8po now obeys ADODB_ASSOC_CASE settings. -
Added virtualized error codes, using PEAR DB equivalents. Requires you to manually - include adodb-error.inc.php yourself, with MetaError() and MetaErrorMsg($errno). -
GetRowAssoc for mysql and pgsql were flawed. Fix by Ross Smith. -
Added to datadict types I1, I2, I4 and I8. Changed datadict type 'T' to map - to timestamp instead of datetime for postgresql. -
Error handling in ExecuteSQLArray(), adodb-datadict.inc.php did not work. -
We now auto-quote postgresql connection parameters when building connection - string. -
Added session expiry notification. -
We now test with odbc mysql - made some changes to odbc recordset constructor. -
MetaColumns now special cases access and other databases for odbc. -
3.31 17 March 2003
-Added row checking for _fetch in postgres. -
Added Interval type to MetaType for postgres. -
Remapped postgres driver to call postgres7 driver internally. -
Adorecordset_array::getarray() did not return array when nRows >= 0. -
Postgresql: at times, no error message returned by pg_result_error() but error - message returned in pg_last_error(). Recoded again. -
Interbase blob's now use chunking for updateblob. -
Move() did not set EOF correctly. Reported by Jorma T. -
We properly support mysql timestamp fields when we are creating mysql tables - using the data-dict interface. -
Table regex includes backticks character now. -
3.30 3 March 2003
-Added $ADODB_EXTENSION and $ADODB_COMPAT_FETCH constant. -
Made blank1stItem configurable using syntax "value:text" in GetMenu/GetMenu2. - Thx to Gabriel Birke. -
Previously ADOdb differed from the Microsoft standard because it did not define - what to set $this->fields when EOF was reached. Now at EOF, ADOdb sets $this->fields - to false for all databases, which is consist with Microsoft's implementation. - Postgresql and mysql have always worked this way (in 3.11 and earlier). If you - are experiencing compatibility problems (and you are not using postgresql nor - mysql) on upgrading to 3.30, try setting the global variables $ADODB_COUNTRECS - = true (which is the default) and $ADODB_FETCH_COMPAT = true (this is a new - global variable). -
We now check both pg_result_error and pg_last_error as sometimes pg_result_error - does not display anything. Iman Mayes -
We no longer check for magic quotes gpc in Quote(). -
Misc fixes for table creation in adodb-datadict.inc.php. Thx to iamsure. -
Time calculations use adodb_time library for all negative timestamps due to - problems in Red Hat 7.3 or later. Formerly, only did this for Windows. -
In mssqlpo, we now check if $sql in _query is a string before we change || - to +. This is to support prepared stmts. -
Move() and MoveLast() internals changed to support to support EOF and $this->fields - change. -
Added ADODB_FETCH_BOTH support to mssql. Thx to Angel Fradejas afradejas#mediafusion.es -
We now check if link resource exists before we run mysql_escape_string in - qstr(). -
Before we flock in csv code, we check that it is not a http url. -
3.20 17 Feb 2003
-Added new Data Dictionary classes for creating tables and indexes. Warning - - this is very much alpha quality code. The API can still change. See adodb/tests/test-datadict.php - for more info. -
We now ignore $ADODB_COUNTRECS for mysql, because PHP truncates incomplete - recordsets when mysql_unbuffered_query() is called a second time. -
Now postgresql works correctly when $ADODB_COUNTRECS = false. -
Changed _adodb_getcount to properly support SELECT DISTINCT. -
Discovered that $ADODB_COUNTRECS=true has some problems with prepared queries - - suspect PHP bug. -
Now GetOne and GetRow run in $ADODB_COUNTRECS=false mode for better performance. -
Added support for mysql_real_escape_string() and pg_escape_string() in qstr(). -
Added an intermediate variable for mysql _fetch() and MoveNext() to store fields, - to prevent overwriting field array with boolean when mysql_fetch_array() returns - false. -
Made arrays for getinsertsql and getupdatesql case-insensitive. Suggested by - Tim Uckun" tim#diligence.com -
3.11 11 Feb 2003
-Added check for ADODB_NEVER_PERSIST constant in PConnect(). If defined, then - PConnect() will actually call non-persistent Connect(). -
Modified interbase to properly work with Prepare(). -
Added $this->ibase_timefmt to allow you to change the date and time format. -
Added support for $input_array parameter in CacheFlush(). -
Added experimental support for dbx, which was then removed when i found that - it was slower than using native calls. -
Added MetaPrimaryKeys for mssql and ibase/firebird. -
Added new $trim parameter to GetCol and CacheGetCol -
Uses updated adodb-time.inc.php 0.06. -
3.10 27 Jan 2003 -
Added adodb_date(), adodb_getdate(), adodb_mktime() and adodb-time.inc.php. -
For interbase, added code to handle unlimited number of bind parameters. From - Daniel Hasan daniel#hasan.cl. -
Added BlobDecode and UpdateBlob for informix. Thx to Fernando Ortiz. -
Added constant ADODB_WINDOWS. If defined, means that running on Windows. -
Added constant ADODB_PHPVER which stores php version as a hex num. Removed - $ADODB_PHPVER variable. -
Felho Bacsi reported a minor white-space regular expression problem in GetInsertSQL. -
Modified ADO to use variant to store _affectedRows -
Changed ibase to use base class Replace(). Modified base class Replace() to - support ibase. -
Changed odbc to auto-detect when 0 records returned is wrong due to bad odbc - drivers. -
Changed mssql to use datetimeconvert ini setting only when 4.30 or later (does - not work in 4.23). -
ExecuteCursor($stmt, $cursorname, $params) now accepts a new $params array - of additional bind parameters -- William Lovaton walovaton#yahoo.com.mx. -
Added support for sybase_unbuffered_query if ADODB_COUNTRECS == false. Thx - to chuck may. -
Fixed FetchNextObj() bug. Thx to Jorma Tuomainen. -
We now use SCOPE_IDENTITY() instead of @@IDENTITY for mssql - thx to marchesini#eside.it -
Changed postgresql movenext logic to prevent illegal row number from being - passed to pg_fetch_array(). -
Postgresql initrs bug found by "Bogdan RIPA" bripa#interakt.ro $f1 accidentally - named $f -
3.00 6 Jan 2003 -
Fixed adodb-pear.inc.php syntax error. -
Improved _adodb_getcount() to use SELECT COUNT(*) FROM ($sql) for languages - that accept it. -
Fixed _adodb_getcount() caching error. -
Added sql to retrive table and column info for odbc_mssql. -
2.91 3 Jan 2003 -
Revised PHP version checking to use $ADODB_PHPVER with legal values 0x4000, - 0x4050, 0x4200, 0x4300. -
Added support for bytea fields and oid blobs in postgres by allowing BlobDecode() - to detect and convert non-oid fields. Also added BlobEncode to postgres when - you want to encode oid blobs. -
Added blobEncodeType property for connections to inform phpLens what encoding - method to use for blobs. -
Added BlobDecode() and BlobEncode() to base ADOConnection class. -
Added umask() to _gencachename() when creating directories. -
Added charPage for ado drivers, so you can set the code page. -
-$conn->charPage = CP_UTF8; -$conn->Connect($dsn); --
Modified _seek in mysql to check for num rows=0. -
Added to metatypes new informix types for IDS 9.30. Thx Fernando Ortiz. -
_maxrecordcount returned in CachePageExecute $rsreturn -
Fixed sybase cacheselectlimit( ) problems -
MetaColumns() max_length should use precision for types X and C for ms access. - Fixed. -
Speedup of odbc non-SELECT sql statements. -
Added support in MetaColumns for Wide Char types for ODBC. We halve max_length - if unicode/wide char. -
Added 'B' to types handled by GetUpdateSQL/GetInsertSQL. -
Fixed warning message in oci8 driver with $persist variable when using PConnect. -
2.90 11 Dec 2002 -
Mssql and mssqlpo and oci8po now support ADODB_ASSOC_CASE. -
Now MetaType() can accept a field object as the first parameter. -
New $arr = $db->ServerInfo( ) function. Returns $arr['description'] which - is the string description, and $arr['version']. -
PostgreSQL and MSSQL speedups for insert/updates. -
Implemented new SetFetchMode() that removes the need to use $ADODB_FETCH_MODE. - Each connection has independant fetchMode. -
ADODB_ASSOC_CASE now defaults to 2, use native defaults. This is because we - would break backward compat for too many applications otherwise. -
Patched encrypted sessions to use replace() -
The qstr function supports quoting of nulls when escape character is \ -
Rewrote bits and pieces of session code to check for time synch and improve - reliability. -
Added property ADOConnection::hasTransactions = true/false; -
Added CreateSequence and DropSequence functions -
Found misplaced MoveNext() in adodb-postgres.inc.php. Fixed. -
Sybase SelectLimit not reliable because 'set rowcount' not cached - fixed. -
Moved ADOConnection to adodb-connection.inc.php and ADORecordSet to adodb-recordset.inc.php. - This allows us to use doxygen to generate documentation. Doxygen doesn't like - the classes in the main adodb.inc.php file for some mysterious reason. -
2.50, 14 Nov 2002 -
Added transOff and transCnt properties for disabling (transOff = true) and - tracking transaction status (transCnt>0). -
Added inputarray handling into _adodb_pageexecute_all_rows - "Ross Smith" RossSmith#bnw.com. -
Fixed postgresql inconsistencies in date handling. -
Added support for mssql_fetch_assoc. -
Fixed $ADODB_FETCH_MODE bug in odbc MetaTables() and MetaPrimaryKeys(). -
Accidentally declared UnixDate() twice, making adodb incompatible with php - 4.3.0. Fixed. -
Fixed pager problems with some databases that returned -1 for _currentRow on - MoveLast() by switching to MoveNext() in adodb-lib.inc.php. -
Also fixed uninited $discard in adodb-lib.inc.php. -
2.43, 25 Oct 2002
-Added ADODB_ASSOC_CASE constant to better support ibase and odbc field names. -Added support for NConnect() for oracle OCINLogin. -
Fixed NumCols() bug. -
Changed session handler to use Replace() on write. -
Fixed oci8 SelectLimit aggregate function bug again. -
Rewrote pivoting code. -
2.42, 4 Oct 2002
-Fixed ibase_fetch() problem with nulls. Also interbase now does automatic blob - decoding, and is backward compatible. Suggested by Heinz Hombergs heinz#hhombergs.de. -
Fixed postgresql MoveNext() problems when called repeatedly after EOF. Also - suggested by Heinz Hombergs. -
PageExecute() does not rewrite queries if SELECT DISTINCT is used. Requested - by hans#velum.net -
Added additional fixes to oci8 SelectLimit handling with aggregate functions - - thx to Christian Bugge for reporting the problem. -
2.41, 2 Oct 2002
-Fixed ADODB_COUNTRECS bug in odbc. Thx to Joshua Zoshi jzoshi#hotmail.com. -
Increased buffers for adodb-csvlib.inc.php for extremely long sql from 8192 - to 32000. -
Revised pivottable.inc.php code. Added better support for aggregate fields. -
Fixed mysql text/blob types problem in MetaTypes base class - thx to horacio - degiorgi. -
Added SQLDate($fmt,$date) function, which allows an sql date format string - to be generated - useful for group by's. -
Fixed bug in oci8 SelectLimit when offset>100. -
2.40 4 Sept 2002
-Added new NLS_DATE_FORMAT property to oci8. Suggested by Laurent NAVARRO ln#altidev.com -
Now use bind parameters in oci8 selectlimit for better performance. -
Fixed interbase replaceQuote for dialect != 1. Thx to "BEGUIN Pierre-Henri - - INFOCOB" phb#infocob.com. -
Added white-space check to QA. -
Changed unixtimestamp to support fractional seconds (we always round down/floor - the seconds). Thanks to beezly#beezly.org.uk. -
Now you can set the trigger_error type your own user-defined type in adodb-errorhandler.inc.php. - Suggested by Claudio Bustos clbustos#entelchile.net. -
Added recordset filters with rsfilter.inc.php. -
$conn->_rs2rs does not create a new recordset when it detects it is of type - array. Some trickery there as there seems to be a bug in Zend Engine -
Added render_pagelinks to adodb-pager.inc.php. Code by "Pablo Costa" pablo#cbsp.com.br. -
MetaType() speedup in adodb.inc.php by using hashing instead of switch. Best - performance if constant arrays are supported, as they are in PHP5. -
adodb-session.php now updates only the expiry date if the crc32 check indicates - that the data has not been modified. -
2.31 20 Aug 2002
-Made changes to pivottable.inc.php due to daniel lucuzaeu's suggestions (we sum the pivottable column if desired). -
Fixed ErrorNo() in postgres so it does not depend on _errorMsg property. -
Robert Tuttle added support for oracle cursors. See ExecuteCursor(). -
Fixed Replace() so it works with mysql when updating record where data has not changed. Reported by -Cal Evans (cal#calevans.com). -
2.30 1 Aug 2002
-Added pivottable.inc.php. Thanks to daniel.lucazeau#ajornet.com for the original - concept. -
Added ADOConnection::outp($msg,$newline) to output error and debugging messages. Now -you can override this using the ADODB_OUTP constant and use your own output handler. -
Changed == to === for 'null' comparison. Reported by ericquil#yahoo.com -
Fixed mssql SelectLimit( ) bug when distinct used. -
2.30 1 Aug 2002
-New GetCol() and CacheGetCol() from ross#bnw.com that returns the first field as a 1 dim array. -
We have an empty recordset, but RecordCount() could return -1. Fixed. Reported by "Jonathan Polansky" jonathan#polansky.com. -
We now check for session variable changes using strlen($sessval).crc32($sessval). -Formerly we only used crc32(). -
Informix SelectLimit() problem with $ADODB_COUNTRECS fixed. -
Fixed informix SELECT FIRST x DISTINCT, and not SELECT DISTINCT FIRST x - reported by F Riosa -
Now default adodb error handlers ignores error if @ used. -
If you set $conn->autoRollback=true, we auto-rollback persistent connections for odbc, mysql, oci8, mssql. -Default for autoRollback is false. No need to do so for postgres. -As interbase requires a transaction id (what a flawed api), we don't do it for interbase. -
Changed PageExecute() to use non-greedy preg_match when searching for "FROM" keyword. -
2.20 9 July 2002
-Added CacheGetOne($secs2cache,$sql), CacheGetRow($secs2cache,$sql), CacheGetAll($secs2cache,$sql). -
Added $conn->OffsetDate($dayFraction,$date=false) to generate sql that calcs - date offsets. Useful for scheduling appointments. -
Added connection properties: leftOuter, rightOuter that hold left and right - outer join operators. -
Added connection property: ansiOuter to indicate whether ansi outer joins supported. -
New driver mssqlpo, the portable mssql driver, which converts string - concat operator from || to +. -
Fixed ms access bug - SelectLimit() did not support ties - fixed. -
Karsten Kraus (Karsten.Kraus#web.de), contributed error-handling code to ADONewConnection. - Unfortunately due to backward compat problems, had to rollback most of the changes. -
Added new parameter to GetAssoc() to allow returning an array of key-value pairs, -ignoring any additional columns in the recordset. Off by default. -
Corrected mssql $conn->sysDate to return only date using convert(). -
CacheExecute() improved debugging output. -
Changed rs2html() so newlines are converted to BR tags. Also optimized rs2html() based -on feedback by "Jerry Workman" jerry#mtncad.com. -
Added support for Replace() with Interbase, using DELETE and INSERT. -
Some minor optimizations (mostly removing & references when passing arrays). -
Changed GenID() to allows id's larger than the size of an integer. -
Added force_session property to oci8 for better updateblob() support. -
Fixed PageExecute() which did not work properly with sql containing GROUP BY. -
2.12 12 June 2002
-Added toexport.inc.php to export recordsets in CSV and tab-delimited format. -
CachePageExecute() does not work - fixed - thx John Huong. -
Interbase aliases not set properly in FetchField() - fixed. Thx Stefan Goethals. -
Added cache property to adodb pager class. The number of secs to cache recordsets. -
SQL rewriting bug in pageexecute() due to skipping of newlines due to missing /s modifier. Fixed. -
Max size of cached recordset due to a bug was 256000 bytes. Fixed. -
Speedup of 1st invocation of CacheExecute() by tuning code. -
We compare $rewritesql with $sql in pageexecute code in case of rewrite failure. -
2.11 7 June 2002
-Fixed PageExecute() rewrite sql problem - COUNT(*) and ORDER BY don't go together with - mssql, access and postgres. Thx to Alexander Zhukov alex#unipack.ru -
DB2 support for CHARACTER type added - thx John Huong huongch#bigfoot.com -
For ado, $argProvider not properly checked. Fixed - kalimero#ngi.it -
Added $conn->Replace() function for update with automatic insert if the record does not exist. - Supported by all databases except interbase. -
2.10 4 June 2002
-Added uniqueSort property to indicate mssql ORDER BY cols must be unique. -
Optimized session handler by crc32 the data. We only write if session data has changed. -
adodb_sess_read in adodb-session.php now returns ''correctly - thanks to Jorma Tuomainen, webmaster#wizactive.com -
Mssql driver did not throw EXECUTE errors correctly because ErrorMsg() and ErrorNo() called in wrong order. -Pointed out by Alexios Fakos. Fixed. -
Changed ado to use client cursors. This fixes BeginTran() problems with ado. -
Added handling of timestamp type in ado. -
Added to ado_mssql support for insert_id() and affected_rows(). -
Added support for mssql.datetimeconvert=0, available since php 4.2.0. -
Made UnixDate() less strict, so that the time is ignored if present. -
Changed quote() so that it checks for magic_quotes_gpc. -
Changed maxblobsize for odbc to default to 64000. -
2.00 13 May 2002
-Added drivers informix72 for pre-7.3 versions, and oci805 for - oracle 8.0.5, and postgres64 for postgresql 6.4 and earlier. The postgres and postgres7 drivers - are now identical. -
Interbase now partially supports ADODB_FETCH_BOTH, by defaulting to ASSOC mode. -
Proper support for blobs in mssql. Also revised blob support code -is base class. Now UpdateBlobFile() calls UpdateBlob() for consistency. -
Added support for changed odbc_fetch_into api in php 4.2.0 -with $conn->_has_stupid_odbc_fetch_api_change. -
Fixed spelling of tablock locking hint in GenID( ) for mssql. -
Added RowLock( ) to several databases, including oci8, informix, sybase, etc. - Fixed where error in mssql RowLock(). -
Added sysDate and sysTimeStamp properties to most database drivers. These are the sql -functions/constants for that database that return the current date and current timestamp, and -are useful for portable inserts and updates. -
Support for RecordCount() caused date handling in sybase and mssql to break. -Fixed, thanks to Toni Tunkkari, by creating derived classes for ADORecordSet_array for -both databases. Generalized using arrayClass property. Also to support RecordCount(), -changed metatype handling for ado drivers. Now the type returned in FetchField - is no longer a number, but the 1-char data type returned by MetaType. - At the same time, fixed a lot of date handling. Now mssql support dmy and mdy date formats. -Also speedups in sybase and mssql with preg_match and ^ in date/timestamp handling. -Added support in sybase and mssql for 24 hour clock in timestamps (no AM/PM). -
Extensive revisions to informix driver - thanks to Samuel CARRIERE samuel_carriere#hotmail.com -
Added $ok parameter to CommitTrans($ok) for easy rollbacks. -
Fixed odbc MetaColumns and MetaTables to save and restore $ADODB_FETCH_MODE. -
Some odbc drivers did not call the base connection class constructor. Fixed. -
Fixed regex for GetUpdateSQL() and GetInsertSQL() to support more legal character combinations. - -
1.99 21 April 2002
-Added emulated RecordCount() to all database drivers if $ADODB_COUNTRECS = true - (which it is by default). Inspired by Cristiano Duarte (cunha17#uol.com.br). -
Unified stored procedure support for mssql and oci8. Parameter() and PrepareSP() - functions implemented. -
Added support for SELECT FIRST in informix, modified hasTop property to support - this. -
Changed csv driver to handle updates/deletes/inserts properly (when Execute() returns true). -Bind params also work now, and raiseErrorFn with csv driver. Added csv driver to QA process. -
Better error checking in oci8 UpdateBlob() and UpdateBlobFile(). -
Added TIME type to MySQL - patch by Manfred h9125297#zechine.wu-wien.ac.at -
Prepare/Execute implemented for Interbase/Firebird -
Changed some regular expressions to be anchored by /^ $/ for speed. -
Added UnixTimeStamp() and UnixDate() to ADOConnection(). Now these functions - are in both ADOConnection and ADORecordSet classes. -
Empty recordsets were not cached - fixed. -
Thanks to Gaetano Giunta (g.giunta#libero.it) for the oci8 code review. We - didn't agree on everything, but i hoped we agreed to disagree! -
1.90 6 April 2002
-Now all database drivers support fetch modes ADODB_FETCH_NUM and ADODB_FETCH_ASSOC, though - still not fully tested. Eg. Frontbase, Sybase, Informix. -
NextRecordSet() support for mssql. Contributed by "Sven Axelsson" sven.axelsson#bokochwebb.se -
Added blob support for SQL Anywhere. Contributed by Wade Johnson wade#wadejohnson.de -
Fixed some security loopholes in server.php. Server.php also supports fetch mode. -
Generalized GenID() to support odbc and mssql drivers. Mssql no longer generates GUID's. -
Experimental RowLock($table,$where) for mssql. -
Properly implemented Prepare() in oci8 and ODBC. -
Added Bind() support to oci8 to support Prepare(). -
Improved error handler. Catches CacheExecute() and GenID() errors now. -
Now if you are running php from the command line, debugging messages do not output html formating. -Not 100% complete, but getting there. -
1.81 22 March 2002
-Restored default $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT for backward compatibility. -
SelectLimit for oci8 improved - Our FIRST_ROWS optimization now does not overwrite existing hint. -
New Sybase SQL Anywhere driver. Contributed by Wade Johnson wade#wadejohnson.de -
1.80 15 March 2002
-Redesigned directory structure of ADOdb files. Added new driver directory where -all database drivers reside. -
Changed caching algorithm to create subdirectories. Now we scale better. -
Informix driver now supports insert_id(). Contribution by "Andrea Pinnisi" pinnisi#sysnet.it -
Added experimental ISO date and FetchField support for informix. -
Fixed a quoting bug in Execute() with bind parameters, causing problems with blobs. -
Mssql driver speedup by 10-15%. -
Now in CacheExecute($secs2cache,$sql,...), $secs2cache is optional. If missing, it will -take the value defined in $connection->cacheSecs (default is 3600 seconds). Note that -CacheSelectLimit(), the secs2cache is still compulsory - sigh. -
Sybase SQL Anywhere driver (using ODBC) contributed by Wade Johnson wade#wadejohnson.de -
1.72 8 March 2002
-Added @ when returning Fields() to prevent spurious error - "Michael William Miller" mille562#pilot.msu.edu -
MetaDatabases() for postgres contributed by Phil pamelant#nerim.net -
Mitchell T. Young (mitch#youngfamily.org) contributed informix driver. -
Fixed rs2html() problem. I cannot reproduce, so probably a problem with pre PHP 4.1.0 versions, - when supporting new ADODB_FETCH_MODEs. -
Mattia Rossi (mattia#technologist.com) contributed BlobDecode() and UpdateBlobFile() for postgresql - using the postgres specific pg_lo_import()/pg_lo_open() - i don't use them but hopefully others will - find this useful. See this posting - for an example of usage. -
Added UpdateBlobFile() for uploading files to a database. -
Made UpdateBlob() compatible with oci8po driver. -
Added noNullStrings support to oci8 driver. Oracle changes all ' ' strings to nulls, - so you need to set strings to ' ' to prevent the nullifying of strings. $conn->noNullStrings = true; - will do this for you automatically. This is useful when you define a char column as NOT NULL. -
Fixed UnixTimeStamp() bug - wasn't setting minutes and seconds properly. Patch from Agusti Fita i Borrell agusti#anglatecnic.com. -
Toni Tunkkari added patch for sybase dates. Problem with spaces in day part of date fixed. -
1.71 18 Jan 2002
-Sequence start id support. Now $conn->Gen_ID('seqname', 50) to start sequence from 50. -
CSV driver fix for selectlimit, from Andreas - akaiser#vocote.de. -
Gam3r spotted that a global variable was undefined in the session handler. -
Mssql date regex had error. Fixed - reported by Minh Hoang vb_user#yahoo.com. -
DBTimeStamp() and DBDate() now accept iso dates and unix timestamps. This means -that the PostgreSQL handling of dates in GetInsertSQL() and GetUpdateSQL() can -be removed. Also if these functions are passed '' or null or false, we return a SQL null. -
GetInsertSQL() and GetUpdateSQL() now accept a new parameter, $magicq to -indicate whether quotes should be inserted based on magic quote settings - suggested by -dj#4ict.com. -
Reformated docs slightly based on suggestions by Chris Small. -
1.65 28 Dec 2001
-Fixed borland_ibase class naming bug. -
Now instead of using $rs->fields[0] internally, we use reset($rs->fields) so - that we are compatible with ADODB_FETCH_ASSOC mode. Reported by Nico S. -
Changed recordset constructor and _initrs() for oci8 so that it returns the field definitions even - if no rows in the recordset. Reported by Rick Hickerson (rhickers#mv.mv.com). -
Improved support for postgresql in GetInsertSQL and GetUpdateSQL by - "mike" mike#partner2partner.com and "Ryan Bailey" rebel#windriders.com -
1.64 20 Dec 2001
-Danny Milosavljevic <danny.milo#gmx.net> added some patches for MySQL error handling -and displaying default values. -
Fixed some ADODB_FETCH_BOTH inconsistencies in odbc and interbase. -
Added more tests to test suite to cover ADODB_FETCH_* and ADODB_ERROR_HANDLER. -
Added firebird (ibase) driver -
Added borland_ibase driver for interbase 6.5 -
1.63 13 Dec 2001
-Absolute to the adodb-lib.inc.php file not set properly. Fixed.- -
1.62 11 Dec 2001
-Major speedup of ADOdb for low-end web sites by reducing the php code loading and compiling -cycle. We conditionally compile not so common functions. -Moved csv code to adodb-csvlib.inc.php to reduce adodb.inc.php parsing. This file -is loaded only when the csv/proxy driver is used, or CacheExecute() is run. -Also moved PageExecute(), GetSelectSQL() and GetUpdateSQL() core code to adodb-lib.inc.php. -This reduced the 70K main adodb.inc.php file to 55K, and since at least 20K of the file -is comments, we have reduced 50K of code in adodb.inc.php to 35K. There - should be 35% reduction in memory and thus 35% speedup in compiling the php code for the -main adodb.inc.php file. -
Highly tuned SelectLimit() for oci8 for massive speed improvements on large files. -Selecting 20 rows starting from the 20,000th row of a table is now 7 times faster. -Thx to Tomas V V Cox. -
Allow . and # in table definitions in GetInsertSQL and GetUpdateSQL. - See ADODB_TABLE_REGEX constant. Thx to Ari Kuorikoski. -
Added ADODB_PREFETCH_ROWS constant, defaulting to 10. This determines the number -of records to prefetch in a SELECT statement. Only used by oci8.
-Added high portability Oracle class called oci8po. This uses ? for bind variables, and -lower cases column names.
-Now all database drivers support $ADODB_FETCH_MODE, including interbase, ado, and odbc: -ADODB_FETCH_NUM and ADODB_FETCH_ASSOC. ADODB_FETCH_BOTH is not fully implemented for all -database drivers. -
1.61 Nov 2001
-Added PO_RecordCount() and PO_Insert_ID(). PO stands for portable. Pablo Roca - [pabloroca#mvps.org]
-GenID now returns 0 if not available. Safer is that you should check $conn->hasGenID - for availability.
-M'soft ADO we now correctly close recordset in _close() peterd#telephonetics.co.uk
-MSSQL now supports GenID(). It generates a 16-byte GUID from mssql newid() - function.
-Changed ereg_replace to preg_replace in SelectLimit. This is a fix for mssql. - Ereg doesn't support t or n! Reported by marino Carlos xaplo#postnuke-espanol.org
-Added $recordset->connection. This is the ADOConnection object for the recordset. -Works with cached and normal recordsets. Surprisingly, this had no affect on performance!
-1.54 15 Nov 2001
-Fixed some more bugs in PageExecute(). I am getting sick of bug in this and will have to -reconsider my QA here. The main issue is that I don't use PageExecute() and -to check whether it is working requires a visual inspection of the html generated currently. -It is possible to write a test script but it would be quite complicated :( -More speedups of SelectLimit() for DB2, Oci8, access, vfp, mssql. -
- -
1.53 7 Nov 2001
-Added support for ADODB_FETCH_ASSOC for ado and odbc drivers.-Tuned GetRowAssoc(false) in postgresql and mysql.
-Stephen Van Dyke contributed ADOdb icon, accepted with some minor mods.
-Enabled Affected_Rows() for postgresql
-Speedup for Concat() using implode() - Benjamin Curtis ben_curtis#yahoo.com
-Fixed some more bugs in PageExecute() to prevent infinite loops
-
1.52 5 Nov 2001
-Spelling error in CacheExecute() caused it to fail. $ql should be $sql in line 625!-Added fixes for parsing [ and ] in GetUpdateSQL(). -
1.51 5 Nov 2001
-Oci8 SelectLimit() speedup by using OCIFetch(). -
Oci8 was mistakenly reporting errors when $db->debug = true. -
If a connection failed with ODBC, it was not correctly reported - fixed. -
_connectionID was inited to -1, changed to false. -
Added $rs->FetchRow(), to simplify API, ala PEAR DB -
Added PEAR DB compat mode, which is still faster than PEAR! See adodb-pear.inc.php. -
Removed postgres pconnect debugging statement. -
1.50 31 Oct 2001
-ADOdbConnection renamed to ADOConnection, and ADOdbFieldObject to ADOFieldObject. -
PageExecute() now checks for empty $rs correctly, and the errors in the docs on this subject have been fixed. -
odbc_error() does not return 6 digit error correctly at times. Implemented workaround. -
Added ADORecordSet_empty class. This will speedup INSERTS/DELETES/UPDATES because the return -object created is much smaller. -
Added Prepare() to odbc, and oci8 (but doesn't work properly for oci8 still). -
Made pgsql a synonym for postgre7, and changed SELECT LIMIT to use OFFSET for compat with -postgres 7.2. -
Revised adodb-cryptsession.php thanks to Ari. -
Set resources to false on _close, to force freeing of resources. -
Added adodb-errorhandler.inc.php, adodb-errorpear.inc.php and raiseErrorFn on Freek's urging. -
GetRowAssoc($toUpper=true): $toUpper added as default. -
Errors when connecting to a database were not captured formerly. Now we do it correctly. -
1.40 19 September 2001
-PageExecute() to implement page scrolling added. Code and idea by Iván Oliva.
-Some minor postgresql fixes.
-Added sequence support using GenID() for postgresql, oci8, mysql, interbase.
-Added UpdateBlob support for interbase (untested).
-Added encrypted sessions (see adodb-cryptsession.php). By Ari Kuorikoski <kuoriari#finebyte.com>
-1.31 21 August 2001
-Many bug fixes thanks to "GaM3R (Cameron)" <gamr#outworld.cx>. Some session changes due to Gam3r. -
Fixed qstr() to quote also. -
rs2html() now pretty printed. -
Jonathan Younger jyounger#unilab.com contributed the great idea GetUpdateSQL() and GetInsertSQL() which -generates SQL to update and insert into a table from a recordset. Modify the recordset fields -array, then can this function to generate the SQL (the SQL is not executed). -
"Nicola Fankhauser" <nicola.fankhauser#couniq.com> found some bugs in date handling for mssql.
-Added minimal Oracle support for LOBs. Still under development.
-Added $ADODB_FETCH_MODE so you can control whether recordsets return arrays which are -numeric, associative or both. This is a global variable you set. Currently only MySQL, Oci8, Postgres -drivers support this. -PostgreSQL properly closes recordsets now. Reported by several people. -
-Added UpdateBlob() for Oracle. A hack to make it easier to save blobs. -
-Oracle timestamps did not display properly. Fixed. -
1.20 6 June 2001
-Now Oracle can connect using tnsnames.ora or server and service name
-Extensive Oci8 speed optimizations. -Oci8 code revised to support variable binding, and /*+ FIRST_ROWS */ hint.
-Worked around some 4.0.6 bugs in odbc_fetch_into().
-Paolo S. Asioli paolo.asioli#libero.it suggested GetRowAssoc().
-Escape quotes for oracle wrongly set to '. Now '' is used.
-Variable binding now works in ODBC also.
-Jumped to version 1.20 because I don't like 13 :-)
-1.12 6 June 2001
-Changed $ADODB_DIR to ADODB_DIR constant to plug a security loophole.
-Changed _close() to close persistent connections also. Prevents connection leaks.
-Major revision of oracle and oci8 drivers. -Added OCI_RETURN_NULLS and OCI_RETURN_LOBS to OCIFetchInto(). BLOB, CLOB and VARCHAR2 recognition -in MetaType() improved. MetaColumns() returns columns in correct sort order.
-Interbase timestamp input format was wrong. Fixed.
-1.11 20 May 2001
-Improved file locking for Windows.
-Probabilistic flushing of cache to avoid avalanche updates when cache timeouts.
-Cached recordset timestamp not saved in some scenarios. Fixed.
-1.10 19 May 2001
-Added caching. CacheExecute() and CacheSelectLimit(). -
Added csv driver. See http://php.weblogs.com/ADODB_csv. -
Fixed SelectLimit(), SELECT TOP not working under certain circumstances. -
Added better Frontbase support of MetaTypes() by Frank M. Kromann. -
1.01 24 April 2001
-Fixed SelectLimit bug. not quoted properly. -
SelectLimit: SELECT TOP -1 * FROM TABLE not support by Microsoft. Fixed.
-GetMenu improved by glen.davies#cce.ac.nz to support multiple hilited items
-
FetchNextObject() did not work with only 1 record returned. Fixed bug reported by $tim#orotech.net
-Fixed mysql field max_length problem. Fix suggested by Jim Nicholson (jnich#att.com)
-1.00 16 April 2001
-Given some brilliant suggestions on how to simplify ADOdb by akul. You no longer need to -setup $ADODB_DIR yourself, and ADOLoadCode() is automatically called by ADONewConnection(), -simplifying the startup code.
-FetchNextObject() added. Suggested by Jakub Marecek. This makes FetchObject() obsolete, as -this is more flexible and powerful.
-Misc fixes to SelectLimit() to support Access (top must follow distinct) and Fields() -in the array recordset. From Reinhard Balling.
-0.96 27 Mar 2001
-ADOConnection Close() did not return a value correctly. Thanks to akul#otamedia.com.
-When the horrible magic_quotes is enabled, back-slash () is changed to double-backslash (\). -This doesn't make sense for Microsoft/Sybase databases. We fix this in qstr().
-Fixed Sybase date problem in UnixDate() thanks to Toni Tunkkari. Also fixed MSSQL problem -in UnixDate() - thanks to milhouse31#hotmail.com.
-MoveNext() moved to leaf classes for speed in MySQL/PostgreSQL. 10-15% speedup.
-Added null handling in bindInputArray in Execute() -- Ron Baldwin suggestion.
-Fixed some option tags. Thanks to john#jrmstudios.com.
-0.95 13 Mar 2001
-Added postgres7 database driver which supports LIMIT and other version 7 stuff in the future.
-Added SelectLimit to ADOConnection to simulate PostgreSQL's "select * from table limit 10 offset 3". -Added helper function GetArrayLimit() to ADORecordSet.
-Fixed mysql metacolumns bug. Thanks to Freek Dijkstra (phpeverywhere#macfreek.com).
-Also many PostgreSQL changes by Freek. He almost rewrote the whole PostgreSQL driver!
-Added fix to input parameters in Execute for non-strings by Ron Baldwin.
-Added new metatype, X for TeXt. Formerly, metatype B for Blob also included -text fields. Now 'B' is for binary/image data. 'X' for textual data.
-Fixed $this->GetArray() in GetRows().
-Oracle and OCI8: 1st parameter is always blank -- now warns if it is filled.
-Now hasLimit and hasTop added to indicate whether -SELECT * FROM TABLE LIMIT 10 or SELECT TOP 10 * FROM TABLE are supported.
-0.94 04 Feb 2001
-Added ADORecordSet::GetRows() for compatibility with Microsoft ADO. Synonym for GetArray().
-Added new metatype 'R' to represent autoincrement numbers.
-Added ADORecordSet.FetchObject() to return a row as an object.
-Finally got a Linux box to test PostgreSql. Many fixes.
-Fixed copyright misspellings in 0.93.
-Fixed mssql MetaColumns type bug.
-Worked around odbc bug in PHP4 for sessions.
-Fixed many documentation bugs (affected_rows, metadatabases, qstr).
-Fixed MySQL timestamp format (removed comma).
-Interbase driver did not call ibase_pconnect(). Fixed.
-0.93 18 Jan 2002
-Fixed GetMenu bug.
-Simplified Interbase commit and rollback.
-Default behaviour on closing a connection is now to rollback all active transactions.
-Added field object handling for array recordset for future XML compatibility.
-Added arr2html() to convert array to html table.
-0.92 2 Jan 2002
-Interbase Commit and Rollback should be working again.
-Changed initialisation of ADORecordSet. This is internal and should not affect users. We -are doing this to support cached recordsets in the future.
- -Implemented ADORecordSet_array class. This allows you to simulate a database recordset -with an array.
-Added UnixDate() and UnixTimeStamp() to ADORecordSet.
-0.91 21 Dec 2000
-Fixed ODBC so ErrorMsg() is working.
-Worked around ADO unrecognised null (0x1) value problem in COM.
-Added Sybase support for FetchField() type
-Removed debugging code and unneeded html from various files
-Changed to javadoc style comments to adodb.inc.php.
-Added maxsql as synonym for mysqlt
-Now ODBC downloads first 8K of blob by default -
0.90 15 Nov 2000
-Lots of testing of Microsoft ADO. Should be more stable now.
-Added $ADODB_COUNTREC. Set to false for high speed selects.
-Added Sybase support. Contributed by Toni Tunkkari (toni.tunkkari#finebyte.com). Bug in Sybase - API: GetFields is unable to determine date types.
-Changed behaviour of RecordSet.GetMenu() to support size parameter (listbox) properly.
-Added emptyDate and emptyTimeStamp to RecordSet class that defines how to represent - empty dates.
-Added MetaColumns($table) that returns an array of ADOFieldObject's listing - the columns of a table.
-Added transaction support for PostgresSQL -- thanks to "Eric G. Werk" egw#netguide.dk.
-Added adodb-session.php for session support.
-0.80 30 Nov 2000
-Added support for charSet for interbase. Implemented MetaTables for most databases. - PostgreSQL more extensively tested.
-0.71 22 Nov 2000
-Switched from using require_once to include/include_once for backward compatability with PHP 4.02 and earlier.
-0.70 15 Nov 2000
-Calls by reference have been removed (call_time_pass_reference=Off) to ensure compatibility with future versions of PHP, -except in Oracle 7 driver due to a bug in php_oracle.dll.
-PostgreSQL database driver contributed by Alberto Cerezal (acerezalp#dbnet.es). -
-Oci8 driver for Oracle 8 contributed by George Fourlanos (fou#infomap.gr).
-Added mysqlt database driver to support MySQL 3.23 which has transaction - support.
-Oracle default date format (DD-MON-YY) did not match ADOdb default date format (which is YYYY-MM-DD). Use ALTER SESSION to force the default date.
-Error message checking is now included in test suite.
-MoveNext() did not check EOF properly -- fixed.
-0.60 Nov 8 2000
-Fixed some constructor bugs in ODBC and ADO. Added ErrorNo function to ADOConnection - class.
-0.51 Oct 18 2000
-Fixed some interbase bugs.
-0.50 Oct 16 2000
-Interbase commit/rollback changed to be compatible with PHP 4.03.
-CommitTrans( ) will now return true if transactions not supported.
-Conversely RollbackTrans( ) will return false if transactions not supported. -
-0.46 Oct 12
-Many Oracle compatibility issues fixed. -0.40 Sept 26
-Many bug fixes
-Now Code for BeginTrans, CommitTrans and RollbackTrans is working. So is the Affected_Rows -and Insert_ID. Added above functions to test.php.
-ADO type handling was busted in 0.30. Fixed.
-Generalised Move( ) so it works will all databases, including ODBC.
-0.30 Sept 18
-Renamed ADOLoadDB to ADOLoadCode. This is clearer.
-Added BeginTrans, CommitTrans and RollbackTrans functions.
-Added Affected_Rows() and Insert_ID(), _affectedrows() and _insertID(), ListTables(), - ListDatabases(), ListColumns().
-Need to add New_ID() and hasInsertID and hasAffectedRows, autoCommit
-0.20 Sept 12
-Added support for Microsoft's ADO.
-Added new field to ADORecordSet -- canSeek
-Added new parameter to _fetch($ignore_fields = false). Setting to true will - not update fields array for faster performance.
-Added new field to ADORecordSet/ADOConnection -- dataProvider to indicate whether - a class is derived from odbc or ado.
-Changed class ODBCFieldObject to ADOFieldObject -- not documented currently.
-Added benchmark.php and testdatabases.inc.php to the test suite.
-Added to ADORecordSet FastForward( ) for future high speed scrolling. Not documented.
-Realised that ADO's Move( ) uses relative positioning. ADOdb uses absolute. -
-0.10 Sept 9 2000
-First release
- \ No newline at end of file diff --git a/src/adodb512/docs/readme.htm b/src/adodb512/docs/readme.htm deleted file mode 100644 index e2c0bb54..00000000 --- a/src/adodb512/docs/readme.htm +++ /dev/null @@ -1,68 +0,0 @@ - - -ADOdb is a suite of database libraries that allow you to connect to multiple - databases in a portable manner. Download from http://adodb.sourceforge.net/. -
-
-To test, try modifying some of the tutorial examples. Make sure you customize the connection settings correctly. You can debug using: -
-<?php
-include('adodb/adodb.inc.php');
-
-$db = ADONewConnection($driver); # eg. 'mysql' or 'oci8'
-$db->debug = true;
-$db->Connect($server, $user, $password, $database);
-$rs = $db->Execute('select * from some_small_table');
-print "<pre>";
-print_r($rs->GetRows());
-print "</pre>";
-?>
-
-Tips on Writing Portable SQL |
- |
Updated 6 Oct 2006. Added OffsetDate example. -
Updated 18 Sep 2003. Added Portable Native SQL section. -
- - If you are writing an application that is used in multiple environments and - operating systems, you need to plan to support multiple databases. This article - is based on my experiences with multiple database systems, stretching from 4th - Dimension in my Mac days, to the databases I currently use, which are: Oracle, - FoxPro, Access, MS SQL Server and MySQL. Although most of the advice here applies - to using SQL with Perl, Python and other programming languages, I will focus on PHP and how - the ADOdb database abstraction library - offers some solutions.
-Most database vendors practice product lock-in. The best or fastest way to - do things is often implemented using proprietary extensions to SQL. This makes - it extremely hard to write portable SQL code that performs well under all conditions. - When the first ANSI committee got together in 1984 to standardize SQL, the database - vendors had such different implementations that they could only agree on the - core functionality of SQL. Many important application specific requirements - were not standardized, and after so many years since the ANSI effort began, - it looks as if much useful database functionality will never be standardized. - Even though ANSI-92 SQL has codified much more, we still have to implement portability - at the application level.
-The SELECT statement has been standardized to a great degree. Nearly every - database supports the following:
-SELECT [cols] FROM [tables]
- [WHERE conditions]
- [GROUP BY cols]
- [HAVING conditions]
- [ORDER BY cols]
But so many useful techniques can only be implemented by using proprietary - extensions. For example, when writing SQL to retrieve the first 10 rows for - paging, you could write...
-| Database | -SQL Syntax | -
| DB2 | -select * from table fetch first 10 rows only | -
| Informix | -select first 10 * from table | -
| Microsoft SQL Server and Access | -select top 10 * from table | -
| MySQL and PostgreSQL | -select * from table limit 10 | -
| Oracle 8i | -select * from (select * from table) where rownum <= 10 | -
This feature of getting a subset of data is so useful that in the PHP class - library ADOdb, we have a SelectLimit( ) function that allows you to hide the - implementation details within a function that will rewrite your SQL for you:
-$connection->SelectLimit('select * from table', 10);
-
-Selects: Fetch Modes
-PHP allows you to retrieve database records as arrays. You can choose to have - the arrays indexed by field name or number. However different low-level PHP - database drivers are inconsistent in their indexing efforts. ADOdb allows you - to determine your prefered mode. You set this by setting the variable $ADODB_FETCH_MODE - to either of the constants ADODB_FETCH_NUM (for numeric indexes) or ADODB_FETCH_ASSOC - (using field names as an associative index).
-The default behaviour of ADOdb varies depending on the database you are using. - For consistency, set the fetch mode to either ADODB_FETCH_NUM (for speed) or - ADODB_FETCH_ASSOC (for convenience) at the beginning of your code.
-Selects: Counting Records
-Another problem with SELECTs is that some databases do not return the number - of rows retrieved from a select statement. This is because the highest performance - databases will return records to you even before the last record has been found. -
-In ADOdb, RecordCount( ) returns the number of rows returned, or will emulate - it by buffering the rows and returning the count after all rows have been returned. - This can be disabled for performance reasons when retrieving large recordsets - by setting the global variable $ADODB_COUNTRECS = false. This variable is checked - every time a query is executed, so you can selectively choose which recordsets - to count.
-If you prefer to set $ADODB_COUNTRECS = false, ADOdb still has the PO_RecordCount( - ) function. This will return the number of rows, or if it is not found, it will - return an estimate using SELECT COUNT(*):
-$rs = $db->Execute("select * from table where state=$state");
-$numrows = $rs->PO_RecordCount('table', "state=$state");
-Selects: Locking
-SELECT statements are commonly used to implement row-level locking of tables. - Other databases such as Oracle, Interbase, PostgreSQL and MySQL with InnoDB - do not require row-level locking because they use versioning to display data - consistent with a specific point in time.
-Currently, I recommend encapsulating the row-level locking in a separate function, - such as RowLock($table, $where):
-$connection->BeginTrans( ); -$connection->RowLock($table, $where);-
# some operation-
if ($ok) $connection->CommitTrans( ); -else $connection->RollbackTrans( ); --
Selects: Outer Joins
-Not all databases support outer joins. Furthermore the syntax for outer joins - differs dramatically between database vendors. One portable (and possibly slower) - method of implementing outer joins is using UNION.
-For example, an ANSI-92 left outer join between two tables t1 and t2 could - look like:
-SELECT t1.col1, t1.col2, t2.cola-
FROM t1 LEFT JOIN t2 ON t1.col = t2.col
This can be emulated using:
-SELECT t1.col1, t1.col2, t2.cola FROM t1, t2-
WHERE t1.col = t2.col - UNION ALL -SELECT col1, col2, null FROM t1
WHERE t1.col not in (select distinct col from t2) -
Since ADOdb 2.13, we provide some hints in the connection object as to legal - join variations. This is still incomplete and sometimes depends on the database - version you are using, but is useful as a general guideline:
-$conn->leftOuter: holds the
- operator used for left outer joins (eg. '*='), or false if not known or not
- available.
- $conn->rightOuter: holds the
- operator used for right outer joins (eg '=*'), or false if not known or not
- available.
- $conn->ansiOuter: boolean
- that if true means that ANSI-92 style outer joins are supported, or false if
- not known.
When you create records, you need to generate unique id's for each record. - There are two common techniques: (1) auto-incrementing columns and (2) sequences. -
-Auto-incrementing columns are supported by MySQL, Sybase and Microsoft Access - and SQL Server. However most other databases do not support this feature. So - for portability, you have little choice but to use sequences. Sequences are - special functions that return a unique incrementing number every time you call - it, suitable to be used as database keys. In ADOdb, we use the GenID( ) function. - It has takes a parameter, the sequence name. Different tables can have different - sequences.
-$id = $connection->GenID('sequence_name');
$connection->Execute("insert into table (id, firstname, lastname)
values ($id, $firstname, $lastname)");
-For databases that do not support sequences natively, ADOdb emulates sequences - by creating a table for every sequence.
-Binding variables in an SQL statement is another tricky feature. Binding is - useful because it allows pre-compilation of SQL. When inserting multiple records - into a database in a loop, binding can offer a 50% (or greater) speedup. However - many databases such as Access and MySQL do not support binding natively and - there is some overhead in emulating binding. Furthermore, different databases - (specificly Oracle!) implement binding differently. My recommendation is to - use binding if your database queries are too slow, but make sure you are using - a database that supports it like Oracle.
-ADOdb supports portable Prepare/Execute with:
-$stmt = $db->Prepare('select * from customers where custid=? and state=?');
-$rs = $db->Execute($stmt, array($id,'New York'));
-Oracle uses named bind placeholders, not "?", so to support portable binding, we have Param() that generates -the correct placeholder (available since ADOdb 3.92): -
$sql = 'insert into table (col1,col2) values ('.$DB->Param('a').','.$DB->Param('b').')';
-# generates 'insert into table (col1,col2) values (?,?)'
-# or 'insert into table (col1,col2) values (:a,:b)'
-$stmt = $DB->Prepare($sql);
-$stmt = $DB->Execute($stmt,array('one','two'));
-
-
-ADOdb provides the following functions for portably generating SQL functions - as strings to be merged into your SQL statements (some are only available since - ADOdb 3.92):
-| Function | -Description | -
| DBDate($date) | -Pass in a UNIX timestamp or ISO date and it will convert it to a date - string formatted for INSERT/UPDATE | -
| DBTimeStamp($date) | -Pass in a UNIX timestamp or ISO date and it will convert it to a timestamp - string formatted for INSERT/UPDATE | -
| SQLDate($date, $fmt) | -Portably generate a date formatted using $fmt mask, for use in SELECT - statements. | -
| OffsetDate($date, $ndays) | -Portably generate a $date offset by $ndays. | -
| Concat($s1, $s2, ...) | -Portably concatenate strings. Alternatively, for mssql use mssqlpo driver, - which allows || operator. | -
| IfNull($fld, $replaceNull) | -Returns a string that is the equivalent of MySQL IFNULL or Oracle NVL. | -
| Param($name) | -Generates bind placeholders, using ? or named conventions as appropriate. | -
| $db->sysDate | Property that holds the SQL function that returns today's date | -
| $db->sysTimeStamp | Property that holds the SQL function that returns the current -timestamp (date+time). - | -
| $db->concat_operator | Property that holds the concatenation operator - | -
| $db->length | Property that holds the name of the SQL strlen function. - |
| $db->upperCase | Property that holds the name of the SQL strtoupper function. - |
| $db->random | Property that holds the SQL to generate a random number between 0.00 and 1.00. - | -
| $db->substr | Property that holds the name of the SQL substring function. - |
-
-However if you prefer to use a PHP-based table creation scheme, adodb provides you with this feature. Here is the code to generate the SQL to create a table with: -
-Also create a compound index consisting of 'NAME' and 'AGE': -
-$datadict = NewDataDictionary($connection);
-$flds = "
- ID I AUTOINCREMENT PRIMARY,
- NAME C(32) DEFAULT '' NOTNULL,
- CREATED T DEFTIMESTAMP,
- AGE N(16) DEFAULT 0
-";
-$sql1 = $datadict->CreateTableSQL('tabname', $flds);
-$sql2 = $datadict->CreateIndexSQL('idx_name_age', 'tabname', 'NAME,AGE');
-
-
-Stick to a few data types that are available in most databases. Char, varchar - and numeric/number are supported by most databases. Most other data types (including - integer, boolean and float) cannot be relied on being available. I recommend - using char(1) or number(1) to hold booleans.
-Different databases have different ways of representing dates and timestamps/datetime. - ADOdb attempts to display all dates in ISO (YYYY-MM-DD) format. ADOdb also provides - DBDate( ) and DBTimeStamp( ) to convert dates to formats that are acceptable - to that database. Both functions accept Unix integer timestamps and date strings - in ISO format.
-$date1 = $connection->DBDate(time( ));-
$date2 = $connection->DBTimeStamp('2002-02-23 13:03:33');
We also provide functions to convert database dates to Unix timestamps:
-$unixts = $recordset->UnixDate('#2002-02-30#'); # MS Access date =gt; unix timestamp
-For date calculations, we have OffsetDate which allows you to calculate dates such as yesterday and next week in a RDBMS independant fashion. For example, if we want to set a field to 6 hour from now, use: -
-$sql = 'update table set dtimefld='.$db->OffsetDate($db->sysTimeStamp, 6/24).' where ...'; --
The maximum length of a char/varchar field is also database specific. You can - only assume that field lengths of up to 250 characters are supported. This is - normally impractical for web based forum or content management systems. You - will need to be familiar with how databases handle large objects (LOBs). ADOdb - implements two functions, UpdateBlob( ) and UpdateClob( ) that allow you to - update fields holding Binary Large Objects (eg. pictures) and Character Large - Objects (eg. HTML articles):
-# for oracle
-$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1,empty_blob())');
-$conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');
-
-# non-oracle databases
-$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
-$conn->UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');
-
-Null handling is another area where differences can occur. This is a mine-field, - because 3-value logic is tricky. -
In general, I avoid using nulls except for dates and default all my numeric - and character fields to 0 or the empty string. This maintains consistency with - PHP, where empty strings and zero are treated as equivalent, and avoids SQL - ambiguities when you use the ANY and EXISTS operators. However if your database - has significant amounts of missing or unknown data, using nulls might be a good - idea. -
- ADOdb also supports a portable IfNull function, so you can define what to display - if the field contains a null. -
Stored procedures are another problem area. Some databases allow recordsets - to be returned in a stored procedure (Microsoft SQL Server and Sybase), and - others only allow output parameters to be returned. Stored procedures sometimes - need to be wrapped in special syntax. For example, Oracle requires such code - to be wrapped in an anonymous block with BEGIN and END. Also internal sql operators - and functions such as +, ||, TRIM( ), SUBSTR( ) or INSTR( ) vary between vendors. -
-An example of how to call a stored procedure with 2 parameters and 1 return - value follows:
- switch ($db->databaseType) {
- case 'mssql':
- $sql = 'SP_RUNSOMETHING'; break;
- case 'oci8':
- $sql =
- "declare RETVAL integer;begin :RETVAL := SP_RUNSOMETHING(:myid,:group);end;";
- break;
- default:
- die('Unsupported feature');
- }
- # @RETVAL = SP_RUNSOMETHING @myid,@group
- $stmt = $db->PrepareSP($sql);
$db->Parameter($stmt,$id,'myid');
- $db->Parameter($stmt,$group,'group');
- # true indicates output parameter
$db->Parameter($stmt,$ret,'RETVAL',true);
- $db->Execute($stmt);
-As you can see, the ADOdb API is the same for both databases. But the stored - procedure SQL syntax is quite different between databases and is not portable, - so be forewarned! However sometimes you have little choice as some systems only - allow data to be accessed via stored procedures. This is when the ultimate portability - solution might be the only solution: treating portable SQL as a localization - exercise...
-In general to provide real portability, you will have to treat SQL coding - as a localization exercise. In PHP, it has become common to define separate - language files for English, Russian, Korean, etc. Similarly, I would suggest - you have separate Sybase, Intebase, MySQL, etc files, and conditionally include - the SQL based on the database. For example, each MySQL SQL statement would be - stored in a separate variable, in a file called 'mysql-lang.inc.php'.
-$sqlGetPassword = 'select password from users where userid=%s'; -$sqlSearchKeyword = quot;SELECT * FROM articles WHERE match (title,body) against (%s)";-
In our main PHP file:
-# define which database to load...
-$database = 'mysql';
-include_once("$database-lang.inc.php");
-
-$db = NewADOConnection($database);
-$db->PConnect(...) or die('Failed to connect to database');
-
-# search for a keyword $word
-$rs = $db->Execute(sprintf($sqlSearchKeyWord,$db->qstr($word)));
-Note that we quote the $word variable using the qstr( ) function. This is because - each database quotes strings using different conventions.
--
The best way to ensure that you have portable SQL is to have your data tables designed using -sound principles. Learn the theory of normalization and entity-relationship diagrams and model -your data carefully. Understand how joins and indexes work and how they are used to tune performance. -
Visit the following page for more references on database theory and vendors: - http://php.weblogs.com/sql_tutorial. - Also read this article on Optimizing PHP. -
-(c) 2002-2003 John Lim. - - - diff --git a/src/adodb512/docs/tute.htm b/src/adodb512/docs/tute.htm deleted file mode 100644 index a7c85003..00000000 --- a/src/adodb512/docs/tute.htm +++ /dev/null @@ -1,290 +0,0 @@ - - - -
-You say eether and I say eyether, - You say neether and I say nyther; - Eether, eyether, neether, nyther - - Let's call the whole thing off ! --
- You like potato and I like po-tah-to, - You like tomato and I like to-mah-to; - Potato, po-tah-to, tomato, to-mah-to - - Let's call the whole thing off ! -
I love this song, especially the version with Louis Armstrong and Ella singing - duet. It is all about how hard it is for two people in love to be compatible - with each other. It's about compromise and finding a common ground, and that's - what this article is all about. -
PHP is all about creating dynamic web-sites with the least fuss and the most - fun. To create these websites we need to use databases to retrieve login information, - to splash dynamic news onto the web page and store forum postings. So let's - say we were using the popular MySQL database for this. Your company has done - such a fantastic job that the Web site is more popular than your wildest dreams. - You find that MySQL cannot scale to handle the workload; time to switch databases. -
Unfortunately in PHP every database is accessed slightly differently. To connect - to MySQL, you would use mysql_connect(); when you decide to upgrade to - Oracle or Microsoft SQL Server, you would use ocilogon() or mssql_connect() - respectively. What is worse is that the parameters you use for the different - connect functions are different also.. One database says po-tato, the other - database says pota-to. Oh-oh. -
A database wrapper library such as ADODB comes in handy when you need to ensure portability. It provides - you with a common API to communicate with any supported database so you don't have to call things off.
- -
ADODB stands for Active Data Objects DataBase (sorry computer guys are sometimes - not very original). ADODB currently supports MySQL, PostgreSQL, Oracle, Interbase, - Microsoft SQL Server, Access, FoxPro, Sybase, ODBC and ADO. You can download - ADODB from http://php.weblogs.com/adodb. -
The most common database used with PHP is MySQL, so I guess you should be familiar - with the following code. It connects to a MySQL server at localhost, - database mydb, and executes an SQL select statement. The results are - printed, one line per row. -
$db = mysql_connect("localhost", "root", "password");
-mysql_select_db("mydb",$db);
-$result = mysql_query("SELECT * FROM profiles",$db);
-if ($result === false) die("failed");
-while ($fields = mysql_fetch_row($result)) {
- for ($i=0, $max=sizeof($fields); $i < $max; $i++) {
- print $fields[$i].' ';
- }
- print "<br>\n";
-}
-
-The above code has been color-coded by section. The first section is the connection - phase. The second is the execution of the SQL, and the last section is displaying - the fields. The while loop scans the rows of the result, while the for - loop scans the fields in one row.
-Here is the equivalent code in ADODB
- include("adodb.inc.php");
- $db = NewADOConnection('mysql');
- $db->Connect("localhost", "root", "password", "mydb");
- $result = $db->Execute("SELECT * FROM profiles");
- if ($result === false) die("failed");
- while (!$result->EOF) {
- for ($i=0, $max=$result->FieldCount(); $i < $max; $i++)
- print $result->fields[$i].' ';
- $result->MoveNext();
- print "<br>\n";
- }
-
-Now porting to Oracle is as simple as changing the second line to NewADOConnection('oracle').
- Let's walk through the code...
include("adodb.inc.php");
-$db = NewADOConnection('mysql');
-$db->Connect("localhost", "root", "password", "mydb");
-The connection code is a bit more sophisticated than MySQL's because our needs
- are more sophisticated. In ADODB, we use an object-oriented approach to managing
- the complexity of handling multiple databases. We have different classes to
- handle different databases. If you aren't familiar with object-oriented programing,
- don't worry -- the complexity is all hidden away in the NewADOConnection()
- function.
To conserve memory, we only load the PHP code specific to the database you
- are connecting to. We do this by calling NewADOConnection(databasedriver).
- Legal database drivers include mysql, mssql, oracle, oci8, postgres, sybase,
- vfp, access, ibase and many others.
Then we create a new instance of the connection class by calling NewADOConnection().
- Finally we connect to the database using $db->Connect().
$result = $db->Execute("SELECT *
- FROM profiles");
- if ($result === false) die("failed");
-
-
Sending the SQL statement to the server is straight forward. Execute() will - return a recordset object on successful execution. You should check $result - as we do above. -
An issue that confuses beginners is the fact that we have two types of objects - in ADODB, the connection object and the recordset object. When do we use each? -
The connection object ($db) is responsible for connecting to the database, - formatting your SQL and querying the database server. The recordset object ($result) - is responsible for retrieving the results and formatting the reply as text or - as an array. -
The only thing I need to add is that ADODB provides several helper functions - for making INSERT and UPDATE statements easier, which we will cover in the Advanced - section. -
while (!$result->EOF) {
- for ($i=0, $max=$result->FieldCount(); $i < $max; $i++)
- print $result->fields[$i].' ';
- $result->MoveNext();
- print "<br>\n";
-}
-The paradigm for getting the data is that it's like reading a file. For every - line, we check first whether we have reached the end-of-file (EOF). While not - end-of-file, loop through each field in the row. Then move to the next line - (MoveNext) and repeat. -
The $result->fields[] array is generated by the PHP database
- extension. Some database extensions do not index the array by field name.
- To force indexing by name - that is associative arrays -
- use the $ADODB_FETCH_MODE global variable.
-
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs1 = $db->Execute('select * from table');
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rs2 = $db->Execute('select * from table');
- print_r($rs1->fields); // shows array([0]=>'v0',[1] =>'v1')
- print_r($rs2->fields); // shows array(['col1']=>'v0',['col2'] =>'v1')
-
--As you can see in the above example, both recordsets store and use different fetch modes -based on the $ADODB_FETCH_MODE setting when the recordset was created by Execute().
-Object that performs the connection to the database, executes SQL statements - and has a set of utility functions for standardising the format of SQL statements - for issues such as concatenation and date formats.
- -$recordset->Move($pos) scrolls to that particular row. ADODB supports forward
- scrolling for all databases. Some databases will not support backwards scrolling.
- This is normally not a problem as you can always cache records to simulate backwards
- scrolling.
-
$recordset->RecordCount() returns the number of records accessed by the
- SQL statement. Some databases will return -1 because it is not supported.
-
$recordset->GetArray() returns the result as an array.
-
rs2html($recordset) is a function that is generates a HTML table based on the
- $recordset passed to it. An example with the relevant lines in bold:
-
include('adodb.inc.php');
- include('tohtml.inc.php'); /* includes the rs2html function */
- $conn = ADONewConnection('mysql');
- $conn->PConnect('localhost','userid','password','database');
- $rs = $conn->Execute('select * from table');
- rs2html($rs); /* recordset to html table */
-There are many other helper functions that are listed in the documentation available at http://php.weblogs.com/adodb_manual. -
Let's say you want to insert the following data into a database. -
ID = 3
- TheDate=mktime(0,0,0,8,31,2001) /* 31st August 2001 */
- Note= sugar why don't we call it off
-
When you move to another database, your insert might no longer work.
-The first problem is that each database has a different default date format. - MySQL expects YYYY-MM-DD format, while other databases have different defaults. - ADODB has a function called DBDate() that addresses this issue by converting - converting the date to the correct format.
-The next problem is that the don't in the Note needs to be quoted. In - MySQL, we use don\'t but in some other databases (Sybase, Access, Microsoft - SQL Server) we use don''t. The qstr() function addresses this issue.
-So how do we use the functions? Like this:
-$sql = "INSERT INTO table (id, thedate,note) values ("
- . $ID . ','
- . $db->DBDate($TheDate) .','
- . $db->qstr($Note).")";
-$db->Execute($sql);
-ADODB also supports $connection->Affected_Rows() (returns the
- number of rows affected by last update or delete) and $recordset->Insert_ID()
- (returns last autoincrement number generated by an insert statement). Be forewarned
- that not all databases support the two functions.
-
You can find out more information about each of the fields (I use the words
- fields and columns interchangebly) you are selecting by calling the recordset
- method FetchField($fieldoffset). This will return an object with
- 3 properties: name, type and max_length.
-
For example:-
$recordset = $conn->Execute("select adate from table");
$f0 = $recordset->FetchField(0);
-
-Then $f0->name will hold 'adata', $f0->type
- will be set to 'date'. If the max_length is unknown, it will be set to
- -1.
-
One problem with handling different databases is that each database often calls
- the same type by a different name. For example a timestamp type is called
- datetime in one database and time in another. So ADODB has a special
- MetaType($type, $max_length) function that standardises the types
- to the following:
-
C: character and varchar types
- X: text or long character (eg. more than 255 bytes wide).
- B: blob or binary image
- D: date
- T: timestamp
- L: logical (boolean)
- I: integer
- N: numeric (float, double, money)
-
In the above date example, -
$recordset = $conn->Execute("select adate from table"); */
-
- $f0 = $recordset->FetchField(0);
- $type = $recordset->MetaType($f0->type, $f0->max_length);
- print $type; /* should print 'D'
-
Select Limit and Top Support -
ADODB has a function called $connection->SelectLimit($sql,$nrows,$offset) that allows -you to retrieve a subset of the recordset. This will take advantage of native -SELECT TOP on Microsoft products and SELECT ... LIMIT with PostgreSQL and MySQL, and -emulated if the database does not support it. -
Caching Support -
ADODB allows you to cache recordsets in your file system, and only requery the database -server after a certain timeout period with $connection->CacheExecute($secs2cache,$sql) and -$connection->CacheSelectLimit($secs2cache,$sql,$nrows,$offset). -
PHP4 Session Handler Support -
ADODB also supports PHP4 session handlers. You can store your session variables - in a database for true scalability using ADODB. For further information, visit - http://php.weblogs.com/adodb-sessions -
If you plan to write commercial PHP applications that you want to resell, you should consider ADODB. It has been released using the lesser GPL, which means you can legally include it in commercial applications, while keeping your code proprietary. Commercial use of ADODB is strongly encouraged! We are using it internally for this reason.
- -
As a thank you for finishing this article, here are the complete lyrics for
- let's call the whole thing off.
-
-
- Refrain --
- You say eether and I say eyether, - You say neether and I say nyther; - Eether, eyether, neether, nyther - - Let's call the whole thing off ! -
- You like potato and I like po-tah-to, - You like tomato and I like to-mah-to; - Potato, po-tah-to, tomato, to-mah-to - - Let's call the whole thing off ! -
-But oh, if we call the whole thing off, then we must part. -And oh, if we ever part, then that might break my heart. -
- So, if you like pajamas and I like pa-jah-mas, - I'll wear pajamas and give up pa-jah-mas. - For we know we - Need each other, so we - Better call the calling off off. - Let's call the whole thing off ! -
- Second Refrain -
- You say laughter and I say lawfter, - You say after and I say awfter; - Laughter, lawfter, after, awfter - - Let's call the whole thing off ! -
- You like vanilla and I like vanella, - You, sa's'parilla and I sa's'parella; - Vanilla, vanella, choc'late, strawb'ry - - Let's call the whole thing off ! -
-But oh, if we call the whole thing off, then we must part. -And oh, if we ever part, then that might break my heart. -
- So, if you go for oysters and I go for ersters, - I'll order oysters and cancel the ersters. - For we know we - Need each other, so we - Better call the calling off off. - Let's call the whole thing off ! -
Song and lyrics by George and Ira Gershwin, introduced by Fred Astaire and Ginger Rogers -in the film "Shall We Dance?"
-
-(c)2001-2002 John Lim.
-
-
-
diff --git a/src/adodb512/drivers/adodb-access.inc.php b/src/adodb512/drivers/adodb-access.inc.php
deleted file mode 100644
index ef94e9b1..00000000
--- a/src/adodb512/drivers/adodb-access.inc.php
+++ /dev/null
@@ -1,87 +0,0 @@
-ADODB_odbc();
- }
-
- function Time()
- {
- return time();
- }
-
- function BeginTrans() { return false;}
-
- function IfNull( $field, $ifNull )
- {
- return " IIF(IsNull($field), $ifNull, $field) "; // if Access
- }
-/*
- function MetaTables()
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID);
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) return false;
-
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_pre($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE')
- $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }*/
-}
-
-
-class ADORecordSet_access extends ADORecordSet_odbc {
-
- var $databaseType = "access";
-
- function ADORecordSet_access($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-}// class
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-ado.inc.php b/src/adodb512/drivers/adodb-ado.inc.php
deleted file mode 100644
index 671e8588..00000000
--- a/src/adodb512/drivers/adodb-ado.inc.php
+++ /dev/null
@@ -1,660 +0,0 @@
-_affectedRows = new VARIANT;
- }
-
- function ServerInfo()
- {
- if (!empty($this->_connectionID)) $desc = $this->_connectionID->provider;
- return array('description' => $desc, 'version' => '');
- }
-
- function _affectedrows()
- {
- if (PHP_VERSION >= 5) return $this->_affectedRows;
-
- return $this->_affectedRows->value;
- }
-
- // you can also pass a connection string like this:
- //
- // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB');
- function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL')
- {
- $u = 'UID';
- $p = 'PWD';
-
- if (!empty($this->charPage))
- $dbc = new COM('ADODB.Connection',null,$this->charPage);
- else
- $dbc = new COM('ADODB.Connection');
-
- if (! $dbc) return false;
-
- /* special support if provider is mssql or access */
- if ($argProvider=='mssql') {
- $u = 'User Id'; //User parameter name for OLEDB
- $p = 'Password';
- $argProvider = "SQLOLEDB"; // SQL Server Provider
-
- // not yet
- //if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename";
-
- //use trusted conection for SQL if username not specified
- if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes";
- } else if ($argProvider=='access')
- $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider
-
- if ($argProvider) $dbc->Provider = $argProvider;
-
- if ($argUsername) $argHostname .= ";$u=$argUsername";
- if ($argPassword)$argHostname .= ";$p=$argPassword";
-
- if ($this->debug) ADOConnection::outp( "Host=".$argHostname."
\n version=$dbc->version");
- // @ added below for php 4.0.1 and earlier
- @$dbc->Open((string) $argHostname);
-
- $this->_connectionID = $dbc;
-
- $dbc->CursorLocation = $this->_cursor_location;
- return $dbc->State > 0;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
- {
- return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
- }
-
-/*
- adSchemaCatalogs = 1,
- adSchemaCharacterSets = 2,
- adSchemaCollations = 3,
- adSchemaColumns = 4,
- adSchemaCheckConstraints = 5,
- adSchemaConstraintColumnUsage = 6,
- adSchemaConstraintTableUsage = 7,
- adSchemaKeyColumnUsage = 8,
- adSchemaReferentialContraints = 9,
- adSchemaTableConstraints = 10,
- adSchemaColumnsDomainUsage = 11,
- adSchemaIndexes = 12,
- adSchemaColumnPrivileges = 13,
- adSchemaTablePrivileges = 14,
- adSchemaUsagePrivileges = 15,
- adSchemaProcedures = 16,
- adSchemaSchemata = 17,
- adSchemaSQLLanguages = 18,
- adSchemaStatistics = 19,
- adSchemaTables = 20,
- adSchemaTranslations = 21,
- adSchemaProviderTypes = 22,
- adSchemaViews = 23,
- adSchemaViewColumnUsage = 24,
- adSchemaViewTableUsage = 25,
- adSchemaProcedureParameters = 26,
- adSchemaForeignKeys = 27,
- adSchemaPrimaryKeys = 28,
- adSchemaProcedureColumns = 29,
- adSchemaDBInfoKeywords = 30,
- adSchemaDBInfoLiterals = 31,
- adSchemaCubes = 32,
- adSchemaDimensions = 33,
- adSchemaHierarchies = 34,
- adSchemaLevels = 35,
- adSchemaMeasures = 36,
- adSchemaProperties = 37,
- adSchemaMembers = 38
-
-*/
-
- function MetaTables()
- {
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(20);//tables
- if ($adors){
- $f = $adors->Fields(2);//table/view name
- $t = $adors->Fields(3);//table type
- while (!$adors->EOF){
- $tt=substr($t->value,0,6);
- if ($tt!='SYSTEM' && $tt !='ACCESS')
- $arr[]=$f->value;
- //print $f->value . ' ' . $t->value.'
';
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $table = strtoupper($table);
- $arr = array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(4);//tables
-
- if ($adors){
- $t = $adors->Fields(2);//table/view name
- while (!$adors->EOF){
-
-
- if (strtoupper($t->Value) == $table) {
-
- $fld = new ADOFieldObject();
- $c = $adors->Fields(3);
- $fld->name = $c->Value;
- $fld->type = 'CHAR'; // cannot discover type in ADO!
- $fld->max_length = -1;
- $arr[strtoupper($fld->name)]=$fld;
- }
-
- $adors->MoveNext();
- }
- $adors->Close();
- }
- $false = false;
- return empty($arr) ? $false : $arr;
- }
-
-
-
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
-
- $dbc = $this->_connectionID;
- $false = false;
-
- // return rs
- if ($inputarr) {
-
- if (!empty($this->charPage))
- $oCmd = new COM('ADODB.Command',null,$this->charPage);
- else
- $oCmd = new COM('ADODB.Command');
- $oCmd->ActiveConnection = $dbc;
- $oCmd->CommandText = $sql;
- $oCmd->CommandType = 1;
-
- // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
- // Check issue http://bugs.php.net/bug.php?id=40664 !!!
- while(list(, $val) = each($inputarr)) {
- $type = gettype($val);
- $len=strlen($val);
- if ($type == 'boolean')
- $this->adoParameterType = 11;
- else if ($type == 'integer')
- $this->adoParameterType = 3;
- else if ($type == 'double')
- $this->adoParameterType = 5;
- elseif ($type == 'string')
- $this->adoParameterType = 202;
- else if (($val === null) || (!defined($val)))
- $len=1;
- else
- $this->adoParameterType = 130;
-
- // name, type, direction 1 = input, len,
- $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
-
- $oCmd->Parameters->Append($p);
- }
- $p = false;
- $rs = $oCmd->Execute();
- $e = $dbc->Errors;
- if ($dbc->Errors->Count > 0) return $false;
- return $rs;
- }
-
- $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);
-
- if ($dbc->Errors->Count > 0) return $false;
- if (! $rs) return $false;
-
- if ($rs->State == 0) {
- $true = true;
- return $true; // 0 = adStateClosed means no records returned
- }
- return $rs;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
-
- if (isset($this->_thisTransactions))
- if (!$this->_thisTransactions) return false;
- else {
- $o = $this->_connectionID->Properties("Transaction DDL");
- $this->_thisTransactions = $o ? true : false;
- if (!$o) return false;
- }
- @$this->_connectionID->BeginTrans();
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- if ($this->transOff) return true;
-
- @$this->_connectionID->CommitTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
- function RollbackTrans() {
- if ($this->transOff) return true;
- @$this->_connectionID->RollbackTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
-
- /* Returns: the last error message from previous database operation */
-
- function ErrorMsg()
- {
- if (!$this->_connectionID) return "No connection established";
- $errc = $this->_connectionID->Errors;
- if (!$errc) return "No Errors object found";
- if ($errc->Count == 0) return '';
- $err = $errc->Item($errc->Count-1);
- return $err->Description;
- }
-
- function ErrorNo()
- {
- $errc = $this->_connectionID->Errors;
- if ($errc->Count == 0) return 0;
- $err = $errc->Item($errc->Count-1);
- return $err->NativeError;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->_connectionID) $this->_connectionID->Close();
- $this->_connectionID = false;
- return true;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ado extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ado";
- var $dataProvider = "ado";
- var $_tarr = false; // caches the types
- var $_flds; // and field objects
- var $canSeek = true;
- var $hideErrors = true;
-
- function ADORecordSet_ado($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- return $this->ADORecordSet($id,$mode);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1) {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $rs = $this->_queryID;
- $f = $rs->Fields($fieldOffset);
- $o->name = $f->Name;
- $t = $f->Type;
- $o->type = $this->MetaType($t);
- $o->max_length = $f->DefinedSize;
- $o->ado_type = $t;
-
- //print "off=$off name=$o->name type=$o->type len=$o->max_length
";
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- $rs = $this->_queryID;
- $this->_numOfRows = $rs->RecordCount;
-
- $f = $rs->Fields;
- $this->_numOfFields = $f->Count;
- }
-
-
- // should only be used to move forward as we normally use forward-only cursors
- function _seek($row)
- {
- $rs = $this->_queryID;
- // absoluteposition doesn't work -- my maths is wrong ?
- // $rs->AbsolutePosition->$row-2;
- // return true;
- if ($this->_currentRow > $row) return false;
- @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
- return true;
- }
-
-/*
- OLEDB types
-
- enum DBTYPEENUM
- { DBTYPE_EMPTY = 0,
- DBTYPE_NULL = 1,
- DBTYPE_I2 = 2,
- DBTYPE_I4 = 3,
- DBTYPE_R4 = 4,
- DBTYPE_R8 = 5,
- DBTYPE_CY = 6,
- DBTYPE_DATE = 7,
- DBTYPE_BSTR = 8,
- DBTYPE_IDISPATCH = 9,
- DBTYPE_ERROR = 10,
- DBTYPE_BOOL = 11,
- DBTYPE_VARIANT = 12,
- DBTYPE_IUNKNOWN = 13,
- DBTYPE_DECIMAL = 14,
- DBTYPE_UI1 = 17,
- DBTYPE_ARRAY = 0x2000,
- DBTYPE_BYREF = 0x4000,
- DBTYPE_I1 = 16,
- DBTYPE_UI2 = 18,
- DBTYPE_UI4 = 19,
- DBTYPE_I8 = 20,
- DBTYPE_UI8 = 21,
- DBTYPE_GUID = 72,
- DBTYPE_VECTOR = 0x1000,
- DBTYPE_RESERVED = 0x8000,
- DBTYPE_BYTES = 128,
- DBTYPE_STR = 129,
- DBTYPE_WSTR = 130,
- DBTYPE_NUMERIC = 131,
- DBTYPE_UDT = 132,
- DBTYPE_DBDATE = 133,
- DBTYPE_DBTIME = 134,
- DBTYPE_DBTIMESTAMP = 135
-
- ADO Types
-
- adEmpty = 0,
- adTinyInt = 16,
- adSmallInt = 2,
- adInteger = 3,
- adBigInt = 20,
- adUnsignedTinyInt = 17,
- adUnsignedSmallInt = 18,
- adUnsignedInt = 19,
- adUnsignedBigInt = 21,
- adSingle = 4,
- adDouble = 5,
- adCurrency = 6,
- adDecimal = 14,
- adNumeric = 131,
- adBoolean = 11,
- adError = 10,
- adUserDefined = 132,
- adVariant = 12,
- adIDispatch = 9,
- adIUnknown = 13,
- adGUID = 72,
- adDate = 7,
- adDBDate = 133,
- adDBTime = 134,
- adDBTimeStamp = 135,
- adBSTR = 8,
- adChar = 129,
- adVarChar = 200,
- adLongVarChar = 201,
- adWChar = 130,
- adVarWChar = 202,
- adLongVarWChar = 203,
- adBinary = 128,
- adVarBinary = 204,
- adLongVarBinary = 205,
- adChapter = 136,
- adFileTime = 64,
- adDBFileTime = 137,
- adPropVariant = 138,
- adVarNumeric = 139
-*/
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- if (!is_numeric($t)) return $t;
-
- switch ($t) {
- case 0:
- case 12: // variant
- case 8: // bstr
- case 129: //char
- case 130: //wc
- case 200: // varc
- case 202:// varWC
- case 128: // bin
- case 204: // varBin
- case 72: // guid
- if ($len <= $this->blobSize) return 'C';
-
- case 201:
- case 203:
- return 'X';
- case 128:
- case 204:
- case 205:
- return 'B';
- case 7:
- case 133: return 'D';
-
- case 134:
- case 135: return 'T';
-
- case 11: return 'L';
-
- case 16:// adTinyInt = 16,
- case 2://adSmallInt = 2,
- case 3://adInteger = 3,
- case 4://adBigInt = 20,
- case 17://adUnsignedTinyInt = 17,
- case 18://adUnsignedSmallInt = 18,
- case 19://adUnsignedInt = 19,
- case 20://adUnsignedBigInt = 21,
- return 'I';
- default: return 'N';
- }
- }
-
- // time stamp not supported yet
- function _fetch()
- {
- $rs = $this->_queryID;
- if (!$rs or $rs->EOF) {
- $this->fields = false;
- return false;
- }
- $this->fields = array();
-
- if (!$this->_tarr) {
- $tarr = array();
- $flds = array();
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- $f = $rs->Fields($i);
- $flds[] = $f;
- $tarr[] = $f->Type;
- }
- // bind types and flds only once
- $this->_tarr = $tarr;
- $this->_flds = $flds;
- }
- $t = reset($this->_tarr);
- $f = reset($this->_flds);
-
- if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- //echo "
",$t,' ';var_dump($f->value); echo '
'; - switch($t) { - case 135: // timestamp - if (!strlen((string)$f->value)) $this->fields[] = false; - else { - if (!is_numeric($f->value)) # $val = variant_date_to_timestamp($f->value); - // VT_DATE stores dates as (float) fractional days since 1899/12/30 00:00:00 - $val=(float) variant_cast($f->value,VT_R8)*3600*24-2209161600; - else - $val = $f->value; - $this->fields[] = adodb_date('Y-m-d H:i:s',$val); - } - break; - case 133:// A date value (yyyymmdd) - if ($val = $f->value) { - $this->fields[] = substr($val,0,4).'-'.substr($val,4,2).'-'.substr($val,6,2); - } else - $this->fields[] = false; - break; - case 7: // adDate - if (!strlen((string)$f->value)) $this->fields[] = false; - else { - if (!is_numeric($f->value)) $val = variant_date_to_timestamp($f->value); - else $val = $f->value; - - if (($val % 86400) == 0) $this->fields[] = adodb_date('Y-m-d',$val); - else $this->fields[] = adodb_date('Y-m-d H:i:s',$val); - } - break; - case 1: // null - $this->fields[] = false; - break; - case 6: // currency is not supported properly; - ADOConnection::outp( ''.$f->Name.': currency type not supported by PHP'); - $this->fields[] = (float) $f->value; - break; - case 11: //BIT; - $val = ""; - if(is_bool($f->value)) { - if($f->value==true) $val = 1; - else $val = 0; - } - if(is_null($f->value)) $val = null; - - $this->fields[] = $val; - break; - default: - $this->fields[] = $f->value; - break; - } - //print " $f->value $t, "; - $f = next($this->_flds); - $t = next($this->_tarr); - } // for - if ($this->hideErrors) error_reporting($olde); - @$rs->MoveNext(); // @ needed for some versions of PHP! - - if ($this->fetchMode & ADODB_FETCH_ASSOC) { - $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); - } - return true; - } - - function NextRecordSet() - { - $rs = $this->_queryID; - $this->_queryID = $rs->NextRecordSet(); - //$this->_queryID = $this->_QueryId->NextRecordSet(); - if ($this->_queryID == null) return false; - - $this->_currentRow = -1; - $this->_currentPage = -1; - $this->bind = false; - $this->fields = false; - $this->_flds = false; - $this->_tarr = false; - - $this->_inited = false; - $this->Init(); - return true; - } - - function _close() { - $this->_flds = false; - @$this->_queryID->Close();// by Pete Dishman (peterd@telephonetics.co.uk) - $this->_queryID = false; - } - -} - -?> \ No newline at end of file diff --git a/src/adodb512/drivers/adodb-ado5.inc.php b/src/adodb512/drivers/adodb-ado5.inc.php deleted file mode 100644 index 30d192d8..00000000 --- a/src/adodb512/drivers/adodb-ado5.inc.php +++ /dev/null @@ -1,708 +0,0 @@ -_affectedRows = new VARIANT; - } - - function ServerInfo() - { - if (!empty($this->_connectionID)) $desc = $this->_connectionID->provider; - return array('description' => $desc, 'version' => ''); - } - - function _affectedrows() - { - if (PHP_VERSION >= 5) return $this->_affectedRows; - - return $this->_affectedRows->value; - } - - // you can also pass a connection string like this: - // - // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB'); - function _connect($argHostname, $argUsername, $argPassword,$argDBorProvider, $argProvider= '') - { - // two modes - // - if $argProvider is empty, we assume that $argDBorProvider holds provider -- this is for backward compat - // - if $argProvider is not empty, then $argDBorProvider holds db - - - if ($argProvider) { - $argDatabasename = $argDBorProvider; - } else { - $argDatabasename = ''; - if ($argDBorProvider) $argProvider = $argDBorProvider; - else if (stripos($argHostname,'PROVIDER') === false) /* full conn string is not in $argHostname */ - $argProvider = 'MSDASQL'; - } - - - try { - $u = 'UID'; - $p = 'PWD'; - - if (!empty($this->charPage)) - $dbc = new COM('ADODB.Connection',null,$this->charPage); - else - $dbc = new COM('ADODB.Connection'); - - if (! $dbc) return false; - - /* special support if provider is mssql or access */ - if ($argProvider=='mssql') { - $u = 'User Id'; //User parameter name for OLEDB - $p = 'Password'; - $argProvider = "SQLOLEDB"; // SQL Server Provider - - // not yet - //if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename"; - - //use trusted conection for SQL if username not specified - if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes"; - } else if ($argProvider=='access') - $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider - - if ($argProvider) $dbc->Provider = $argProvider; - - if ($argProvider) $argHostname = "PROVIDER=$argProvider;DRIVER={SQL Server};SERVER=$argHostname"; - - - if ($argDatabasename) $argHostname .= ";DATABASE=$argDatabasename"; - if ($argUsername) $argHostname .= ";$u=$argUsername"; - if ($argPassword)$argHostname .= ";$p=$argPassword"; - - if ($this->debug) ADOConnection::outp( "Host=".$argHostname."",$argHostname,"\n",$e,"\n"; - } - - return false; - } - - // returns true or false - function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL') - { - return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider); - } - -/* - adSchemaCatalogs = 1, - adSchemaCharacterSets = 2, - adSchemaCollations = 3, - adSchemaColumns = 4, - adSchemaCheckConstraints = 5, - adSchemaConstraintColumnUsage = 6, - adSchemaConstraintTableUsage = 7, - adSchemaKeyColumnUsage = 8, - adSchemaReferentialContraints = 9, - adSchemaTableConstraints = 10, - adSchemaColumnsDomainUsage = 11, - adSchemaIndexes = 12, - adSchemaColumnPrivileges = 13, - adSchemaTablePrivileges = 14, - adSchemaUsagePrivileges = 15, - adSchemaProcedures = 16, - adSchemaSchemata = 17, - adSchemaSQLLanguages = 18, - adSchemaStatistics = 19, - adSchemaTables = 20, - adSchemaTranslations = 21, - adSchemaProviderTypes = 22, - adSchemaViews = 23, - adSchemaViewColumnUsage = 24, - adSchemaViewTableUsage = 25, - adSchemaProcedureParameters = 26, - adSchemaForeignKeys = 27, - adSchemaPrimaryKeys = 28, - adSchemaProcedureColumns = 29, - adSchemaDBInfoKeywords = 30, - adSchemaDBInfoLiterals = 31, - adSchemaCubes = 32, - adSchemaDimensions = 33, - adSchemaHierarchies = 34, - adSchemaLevels = 35, - adSchemaMeasures = 36, - adSchemaProperties = 37, - adSchemaMembers = 38 - -*/ - - function MetaTables() - { - $arr= array(); - $dbc = $this->_connectionID; - - $adors=@$dbc->OpenSchema(20);//tables - if ($adors){ - $f = $adors->Fields(2);//table/view name - $t = $adors->Fields(3);//table type - while (!$adors->EOF){ - $tt=substr($t->value,0,6); - if ($tt!='SYSTEM' && $tt !='ACCESS') - $arr[]=$f->value; - //print $f->value . ' ' . $t->value.'
",$t,' ';var_dump($f->value); echo '
'; - switch($t) { - case 135: // timestamp - if (!strlen((string)$f->value)) $this->fields[] = false; - else { - if (!is_numeric($f->value)) # $val = variant_date_to_timestamp($f->value); - // VT_DATE stores dates as (float) fractional days since 1899/12/30 00:00:00 - $val= (float) variant_cast($f->value,VT_R8)*3600*24-2209161600; - else - $val = $f->value; - $this->fields[] = adodb_date('Y-m-d H:i:s',$val); - } - break; - case 133:// A date value (yyyymmdd) - if ($val = $f->value) { - $this->fields[] = substr($val,0,4).'-'.substr($val,4,2).'-'.substr($val,6,2); - } else - $this->fields[] = false; - break; - case 7: // adDate - if (!strlen((string)$f->value)) $this->fields[] = false; - else { - if (!is_numeric($f->value)) $val = variant_date_to_timestamp($f->value); - else $val = $f->value; - - if (($val % 86400) == 0) $this->fields[] = adodb_date('Y-m-d',$val); - else $this->fields[] = adodb_date('Y-m-d H:i:s',$val); - } - break; - case 1: // null - $this->fields[] = false; - break; - case 20: - case 21: // bigint (64 bit) - $this->fields[] = (float) $f->value; // if 64 bit PHP, could use (int) - break; - case 6: // currency is not supported properly; - ADOConnection::outp( ''.$f->Name.': currency type not supported by PHP'); - $this->fields[] = (float) $f->value; - break; - case 11: //BIT; - $val = ""; - if(is_bool($f->value)) { - if($f->value==true) $val = 1; - else $val = 0; - } - if(is_null($f->value)) $val = null; - - $this->fields[] = $val; - break; - default: - $this->fields[] = $f->value; - break; - } - //print " $f->value $t, "; - $f = next($this->_flds); - $t = next($this->_tarr); - } // for - if ($this->hideErrors) error_reporting($olde); - @$rs->MoveNext(); // @ needed for some versions of PHP! - - if ($this->fetchMode & ADODB_FETCH_ASSOC) { - $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); - } - return true; - } - - function NextRecordSet() - { - $rs = $this->_queryID; - $this->_queryID = $rs->NextRecordSet(); - //$this->_queryID = $this->_QueryId->NextRecordSet(); - if ($this->_queryID == null) return false; - - $this->_currentRow = -1; - $this->_currentPage = -1; - $this->bind = false; - $this->fields = false; - $this->_flds = false; - $this->_tarr = false; - - $this->_inited = false; - $this->Init(); - return true; - } - - function _close() { - $this->_flds = false; - try { - @$this->_queryID->Close();// by Pete Dishman (peterd@telephonetics.co.uk) - } catch (Exception $e) { - } - $this->_queryID = false; - } - -} - -?> \ No newline at end of file diff --git a/src/adodb512/drivers/adodb-ado_access.inc.php b/src/adodb512/drivers/adodb-ado_access.inc.php deleted file mode 100644 index 5b30f440..00000000 --- a/src/adodb512/drivers/adodb-ado_access.inc.php +++ /dev/null @@ -1,54 +0,0 @@ -= 5) include(ADODB_DIR."/drivers/adodb-ado5.inc.php"); - else include(ADODB_DIR."/drivers/adodb-ado.inc.php"); -} - -class ADODB_ado_access extends ADODB_ado { - var $databaseType = 'ado_access'; - var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE - var $fmtDate = "#Y-m-d#"; - var $fmtTimeStamp = "#Y-m-d h:i:sA#";// note no comma - var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')"; - var $sysTimeStamp = 'NOW'; - var $upperCase = 'ucase'; - - function ADODB_ado_access() - { - $this->ADODB_ado(); - } - - /*function BeginTrans() { return false;} - - function CommitTrans() { return false;} - - function RollbackTrans() { return false;}*/ - -} - - -class ADORecordSet_ado_access extends ADORecordSet_ado { - - var $databaseType = "ado_access"; - - function ADORecordSet_ado_access($id,$mode=false) - { - return $this->ADORecordSet_ado($id,$mode); - } -} -?> \ No newline at end of file diff --git a/src/adodb512/drivers/adodb-ado_mssql.inc.php b/src/adodb512/drivers/adodb-ado_mssql.inc.php deleted file mode 100644 index dd2f58a4..00000000 --- a/src/adodb512/drivers/adodb-ado_mssql.inc.php +++ /dev/null @@ -1,154 +0,0 @@ -= 5) include(ADODB_DIR."/drivers/adodb-ado5.inc.php"); - else include(ADODB_DIR."/drivers/adodb-ado.inc.php"); -} - - -class ADODB_ado_mssql extends ADODB_ado { - var $databaseType = 'ado_mssql'; - var $hasTop = 'top'; - var $hasInsertID = true; - var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)'; - var $sysTimeStamp = 'GetDate()'; - var $leftOuter = '*='; - var $rightOuter = '=*'; - var $ansiOuter = true; // for mssql7 or later - var $substr = "substring"; - var $length = 'len'; - var $_dropSeqSQL = "drop table %s"; - - //var $_inTransaction = 1; // always open recordsets, so no transaction problems. - - function ADODB_ado_mssql() - { - $this->ADODB_ado(); - } - - function _insertid() - { - return $this->GetOne('select SCOPE_IDENTITY()'); - } - - function _affectedrows() - { - return $this->GetOne('select @@rowcount'); - } - - function SetTransactionMode( $transaction_mode ) - { - $this->_transmode = $transaction_mode; - if (empty($transaction_mode)) { - $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); - return; - } - if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; - $this->Execute("SET TRANSACTION ".$transaction_mode); - } - - function qstr($s,$magic_quotes=false) - { - $s = ADOConnection::qstr($s, $magic_quotes); - return str_replace("\0", "\\\\000", $s); - } - - function MetaColumns($table, $normalize=true) - { - $table = strtoupper($table); - $arr= array(); - $dbc = $this->_connectionID; - - $osoptions = array(); - $osoptions[0] = null; - $osoptions[1] = null; - $osoptions[2] = $table; - $osoptions[3] = null; - - $adors=@$dbc->OpenSchema(4, $osoptions);//tables - - if ($adors){ - while (!$adors->EOF){ - $fld = new ADOFieldObject(); - $c = $adors->Fields(3); - $fld->name = $c->Value; - $fld->type = 'CHAR'; // cannot discover type in ADO! - $fld->max_length = -1; - $arr[strtoupper($fld->name)]=$fld; - - $adors->MoveNext(); - } - $adors->Close(); - } - $false = false; - return empty($arr) ? $false : $arr; - } - - function CreateSequence($seq='adodbseq',$start=1) - { - - $this->Execute('BEGIN TRANSACTION adodbseq'); - $start -= 1; - $this->Execute("create table $seq (id float(53))"); - $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)"); - if (!$ok) { - $this->Execute('ROLLBACK TRANSACTION adodbseq'); - return false; - } - $this->Execute('COMMIT TRANSACTION adodbseq'); - return true; - } - - function GenID($seq='adodbseq',$start=1) - { - //$this->debug=1; - $this->Execute('BEGIN TRANSACTION adodbseq'); - $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1"); - if (!$ok) { - $this->Execute("create table $seq (id float(53))"); - $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)"); - if (!$ok) { - $this->Execute('ROLLBACK TRANSACTION adodbseq'); - return false; - } - $this->Execute('COMMIT TRANSACTION adodbseq'); - return $start; - } - $num = $this->GetOne("select id from $seq"); - $this->Execute('COMMIT TRANSACTION adodbseq'); - return $num; - - // in old implementation, pre 1.90, we returned GUID... - //return $this->GetOne("SELECT CONVERT(varchar(255), NEWID()) AS 'Char'"); - } - - } // end class - - class ADORecordSet_ado_mssql extends ADORecordSet_ado { - - var $databaseType = 'ado_mssql'; - - function ADORecordSet_ado_mssql($id,$mode=false) - { - return $this->ADORecordSet_ado($id,$mode); - } -} -?> \ No newline at end of file diff --git a/src/adodb512/drivers/adodb-ads.inc.php b/src/adodb512/drivers/adodb-ads.inc.php deleted file mode 100644 index 0de57ca7..00000000 --- a/src/adodb512/drivers/adodb-ads.inc.php +++ /dev/null @@ -1,796 +0,0 @@ -_haserrorfunctions = ADODB_PHPVER >= 0x4050; - $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200; - } - - // returns true or false - function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) - { - global $php_errormsg; - - if (!function_exists('ads_connect')) return null; - - if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') { - ADOConnection::outp("For Advantage Connect(), $argDatabasename is not used. Place dsn in 1st parameter."); - } - if (isset($php_errormsg)) $php_errormsg = ''; - if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword); - else $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword,$this->curmode); - $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : ''; - if (isset($this->connectStmt)) $this->Execute($this->connectStmt); - - return $this->_connectionID != false; - } - - // returns true or false - function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) - { - global $php_errormsg; - - if (!function_exists('ads_connect')) return null; - - if (isset($php_errormsg)) $php_errormsg = ''; - $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : ''; - if ($this->debug && $argDatabasename) { - ADOConnection::outp("For PConnect(), $argDatabasename is not used. Place dsn in 1st parameter."); - } - // print "dsn=$argDSN u=$argUsername p=$argPassword");
- sqlsrv_set_error_handling( SQLSRV_ERRORS_LOG_ALL );
- sqlsrv_log_set_severity( SQLSRV_LOG_SEVERITY_ALL );
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('warnings_return_as_errors', 0);
- } else {
- sqlsrv_set_error_handling(0);
- sqlsrv_log_set_severity(0);
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('warnings_return_as_errors', 0);
- }
- }
-
- function ServerInfo()
- {
- global $ADODB_FETCH_MODE;
- if ($this->fetchMode === false) {
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- } else
- $savem = $this->SetFetchMode(ADODB_FETCH_NUM);
- $arrServerInfo = sqlsrv_server_info($this->_connectionID);
- $arr['description'] = $arrServerInfo['SQLServerName'].' connected to '.$arrServerInfo['CurrentDatabase'];
- $arr['version'] = $arrServerInfo['SQLServerVersion'];//ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
- function _affectedrows()
- {
- return sqlsrv_rows_affected($this->_queryID);
- }
-
- function CreateSequence($seq='adodbseq',$start=1)
- {
- if($this->debug) error_log("
CreateSequence($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $start -= 1;
- $this->Execute("create table $seq (id int)");//was float(53)
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) error_log("
Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- sqlsrv_commit($this->_connectionID);
- return true;
- }
-
- function GenID($seq='adodbseq',$start=1)
- {
- if($this->debug) error_log("
GenID($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
- if (!$ok) {
- $this->Execute("create table $seq (id int)");
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) error_log("
Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- sqlsrv_commit($this->_connectionID);
- return $start;
- }
- $num = $this->GetOne("select id from $seq");
- sqlsrv_commit($this->_connectionID);
- if($this->debug) error_log(" Returning: $num");
- return $num;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yyyy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(quarter,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "replace(str(day($col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- if ($this->debug) error_log('
begin transaction');
- sqlsrv_begin_transaction($this->_connectionID);
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if ($this->debug) error_log('
commit transaction');
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_commit($this->_connectionID);
- return true;
- }
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->debug) error_log('
rollback transaction');
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_rollback($this->_connectionID);
- return true;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- /*
- Usage:
-
- $this->BeginTrans();
- $this->RowLock('table1,table2','table1.id=33 and table2.id=table1.id'); # lock row 33 for both tables
-
- # some operation on both tables table1 and table2
-
- $this->CommitTrans();
-
- See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
- */
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($col == '1 as adodbignore') $col = 'top 1 null as ignore';
- if (!$this->transCnt) $this->BeginTrans();
- return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
- }
-
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- $rs = $this->Execute('USE '.$dbName);
- if($rs) {
- return true;
- } else return false;
- }
- else return false;
- }
-
- function ErrorMsg()
- {
- $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($retErrors != null) {
- foreach($retErrors as $arrError) {
- $this->_errorMsg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";
- $this->_errorMsg .= "Error Code: ".$arrError[ 'code']."\n";
- $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
- }
- } else {
- $this->_errorMsg = "No errors found";
- }
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- if ($this->_logsql && $this->_errorCode !== false) return $this->_errorCode;
- $err = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($err[0]) return $err[0]['code'];
- else return -1;
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlsrv_connect')) return null;
- $connectionInfo = array("Database"=>$argDatabasename,'UID'=>$argUsername,'PWD'=>$argPassword);
- if ($this->debug) error_log("
connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
- //if ($this->debug) error_log("
_connectionID before: ".serialize($this->_connectionID));
- if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
- if ($this->debug) error_log( "
errors: ".print_r( sqlsrv_errors(), true));
- return false;
- }
- //if ($this->debug) error_log(" _connectionID after: ".serialize($this->_connectionID));
- //if ($this->debug) error_log("
defined functions: ".var_export(get_defined_functions(),true)."
");
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- //return null;//not implemented. NOTE: Persistent connections have no effect if PHP is used as a CGI program. (FastCGI!)
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function Prepare($sql)
- {
- $stmt = sqlsrv_prepare( $this->_connectionID, $sql);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- // returns concatenated string
- // MSSQL requires integers to be cast as strings
- // automatically cast every datatype to VARCHAR(255)
- // @author David Rogers (introspectshun)
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // Split single record on commas, if possible
- if (sizeof($arr) == 1) {
- foreach ($arr as $arg) {
- $args = explode(',', $arg);
- }
- $arr = $args;
- }
-
- array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
- $s = implode('+',$arr);
- if (sizeof($arr) > 0) return "$s";
-
- return '';
- }
-
- /*
- Unfortunately, it appears that mssql cannot handle varbinary > 255 chars
- So all your blobs must be of type "image".
-
- Remember to set in php.ini the following...
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textlimit = 0 ; zero to pass through
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textsize = 0 ; zero to pass through
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- if (strtoupper($blobtype) == 'CLOB') {
- $sql = "UPDATE $table SET $column='" . $val . "' WHERE $where";
- return $this->Execute($sql) != false;
- }
- $sql = "UPDATE $table SET $column=0x".bin2hex($val)." WHERE $where";
- return $this->Execute($sql) != false;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- $this->_errorMsg = false;
- if (is_array($inputarr)) {
- $rez = sqlsrv_query($this->_connectionID,$sql,$inputarr);
- } else if (is_array($sql)) {
- $rez = sqlsrv_query($this->_connectionID,$sql[1],$inputarr);
- } else {
- $rez = sqlsrv_query($this->_connectionID,$sql);
- }
- if ($this->debug) error_log("
running query: ".var_export($sql,true)."
input array: ".var_export($inputarr,true)."
result: ".var_export($rez,true));//"
connection: ".serialize($this->_connectionID)
- //fix for returning true on anything besides select statements
- if (is_array($sql)) $sql = $sql[1];
- $sql = ltrim($sql);
- if(stripos($sql, 'SELECT') !== 0 && $rez !== false) {
- if ($this->debug) error_log(" isn't a select query, returning boolean true");
- return true;
- }
- //end fix
- if(!$rez) $rez = false;
- return $rez;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->transCnt) $this->RollbackTrans();
- $rez = @sqlsrv_close($this->_connectionID);
- $this->_connectionID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssql::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssql::UnixTimeStamp($v);
- }
-
- function &MetaIndexes($table,$primary=false, $owner = false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
- "select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
- from sysforeignkeys
- where upper(object_name(fkeyid)) = $table
- order by constraint_name, referenced_table_name, keyno";
-
- $constraints =& $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- //From: Fernando Moreira
- function MetaDatabases()
- {
- $this->SelectDB("master");
- $rs =& $this->Execute($this->metaDatabasesSQL);
- $rows = $rs->GetRows();
- $ret = array();
- for($i=0;$iSelectDB($this->database);
- if($ret)
- return $ret;
- else
- return false;
- }
-
- // "Stein-Aksel Basma"
- // tested with MSSQL 2000
- function &MetaPrimaryKeys($table)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table,$schema);
- if (!$schema) $schema = $this->database;
- if ($schema) $schema = "and k.table_catalog like '$schema%'";
-
- $sql = "select distinct k.column_name,ordinal_position from information_schema.key_column_usage k,
- information_schema.table_constraints tc
- where tc.constraint_name = k.constraint_name and tc.constraint_type =
- 'PRIMARY KEY' and k.table_name = '$table' $schema order by ordinal_position ";
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $a = $this->GetCol($sql);
- $ADODB_FETCH_MODE = $savem;
-
- if ($a && sizeof($a)>0) return $a;
- $false = false;
- return $false;
- }
-
-
- function &MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(($mask));
- $this->metaTablesSQL .= " AND name like $mask";
- }
- $ret =& ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_mssqlnative extends ADORecordSet {
-
- var $databaseType = "mssqlnative";
- var $canSeek = false;
- var $fieldOffset = 0;
- // _mths works only in non-localised system
-
- function ADORecordset_mssqlnative($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
-
- }
- $this->fetchMode = $mode;
- return $this->ADORecordSet($id,$mode);
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- if ($this->connection->debug) error_log("(before) ADODB_COUNTRECS: {$ADODB_COUNTRECS} _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
- /*$retRowsAff = sqlsrv_rows_affected($this->_queryID);//"If you need to determine the number of rows a query will return before retrieving the actual results, appending a SELECT COUNT ... query would let you get that information, and then a call to next_result would move you to the "real" results."
- error_log("rowsaff: ".serialize($retRowsAff));
- $this->_numOfRows = ($ADODB_COUNTRECS)? $retRowsAff:-1;*/
- $this->_numOfRows = -1;//not supported
- $fieldmeta = sqlsrv_field_metadata($this->_queryID);
- $this->_numOfFields = ($fieldmeta)? count($fieldmeta):-1;
- if ($this->connection->debug) error_log("(after) _numOfRows: {$this->_numOfRows} _numOfFields: {$this->_numOfFields}");
- }
-
-
- //Contributed by "Sven Axelsson"
- // get next resultset - requires PHP 4.0.5 or later
- function NextRecordSet()
- {
- if (!sqlsrv_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != ADODB_FETCH_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
-
- function &FetchField($fieldOffset = -1)
- {
- if ($this->connection->debug) error_log("
fetchfield: $fieldOffset, fetch array: ".print_r($this->fields,true)."
backtrace: ".adodb_backtrace(false));
- if ($fieldOffset != -1) $this->fieldOffset = $fieldOffset;
- $arrKeys = array_keys($this->fields);
- if(array_key_exists($this->fieldOffset,$arrKeys) && !array_key_exists($arrKeys[$this->fieldOffset],$this->fields)) {
- $f = false;
- } else {
- $f = $this->fields[ $arrKeys[$this->fieldOffset] ];
- if($fieldOffset == -1) $this->fieldOffset++;
- }
-
- if (empty($f)) {
- $f = false;//PHP Notice: Only variable references should be returned by reference
- }
- return $f;
- }
-
- function _seek($row)
- {
- return false;//There is no support for cursors in the driver at this time. All data is returned via forward-only streams.
- }
-
- // speedup
- function MoveNext()
- {
- if ($this->connection->debug) error_log("movenext()");
- //if ($this->connection->debug) error_log("eof (beginning): ".$this->EOF);
- if ($this->EOF) return false;
-
- $this->_currentRow++;
- if ($this->connection->debug) error_log("_currentRow: ".$this->_currentRow);
-
- if ($this->_fetch()) return true;
- $this->EOF = true;
- //if ($this->connection->debug) error_log("eof (end): ".$this->EOF);
-
- return false;
- }
-
-
- // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4
- // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot!
- function _fetch($ignore_fields=false)
- {
- if ($this->connection->debug) error_log("_fetch()");
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- if ($this->fetchMode & ADODB_FETCH_NUM) {
- if ($this->connection->debug) error_log("fetch mode: both");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_BOTH);
- } else {
- if ($this->connection->debug) error_log("fetch mode: assoc");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_ASSOC);
- }
-
- if (ADODB_ASSOC_CASE == 0) {
- foreach($this->fields as $k=>$v) {
- $this->fields[strtolower($k)] = $v;
- }
- } else if (ADODB_ASSOC_CASE == 1) {
- foreach($this->fields as $k=>$v) {
- $this->fields[strtoupper($k)] = $v;
- }
- }
- } else {
- if ($this->connection->debug) error_log("fetch mode: num");
- $this->fields = @sqlsrv_fetch_array($this->_queryID,SQLSRV_FETCH_NUMERIC);
- }
- if(is_array($this->fields) && array_key_exists(1,$this->fields) && !array_key_exists(0,$this->fields)) {//fix fetch numeric keys since they're not 0 based
- $arrFixed = array();
- foreach($this->fields as $key=>$value) {
- if(is_numeric($key)) {
- $arrFixed[$key-1] = $value;
- } else {
- $arrFixed[$key] = $value;
- }
- }
- //if($this->connection->debug) error_log("
fixing non 0 based return array, old: ".print_r($this->fields,true)." new: ".print_r($arrFixed,true));
- $this->fields = $arrFixed;
- }
- if(is_array($this->fields)) {
- foreach($this->fields as $key=>$value) {
- if (is_object($value) && method_exists($value, 'format')) {//is DateTime object
- $this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");
- }
- }
- }
- if($this->fields === null) $this->fields = false;
- if ($this->connection->debug) error_log("
after _fetch, fields: ".print_r($this->fields,true)." backtrace: ".adodb_backtrace(false));
- return $this->fields;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
- function _close()
- {
- $rez = sqlsrv_free_stmt($this->_queryID);
- $this->_queryID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssqlnative::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
- }
-}
-
-
-class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
- function ADORecordSet_array_mssqlnative($id=-1,$mode=false)
- {
- $this->ADORecordSet_array($id,$mode);
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixDate($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return mktime(0,0,0,$themth,$theday,$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixTimeStamp($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
-
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
- }
-}
-
-/*
-Code Example 1:
-
-select object_name(constid) as constraint_name,
- object_name(fkeyid) as table_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where object_name(fkeyid) = x
-order by constraint_name, table_name, referenced_table_name, keyno
-
-Code Example 2:
-select constraint_name,
- column_name,
- ordinal_position
-from information_schema.key_column_usage
-where constraint_catalog = db_name()
-and table_name = x
-order by constraint_name, ordinal_position
-
-http://www.databasejournal.com/scripts/article.php/1440551
-*/
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-mssqlpo.inc.php b/src/adodb512/drivers/adodb-mssqlpo.inc.php
deleted file mode 100644
index dd3b3776..00000000
--- a/src/adodb512/drivers/adodb-mssqlpo.inc.php
+++ /dev/null
@@ -1,62 +0,0 @@
-_has_mssql_init) {
- ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
- return $sql;
- }
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- $stmt = mssql_init($sql,$this->_connectionID);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_mssql::_query($sql,$inputarr);
- }
-}
-
-class ADORecordset_mssqlpo extends ADORecordset_mssql {
- var $databaseType = "mssqlpo";
- function ADORecordset_mssqlpo($id,$mode=false)
- {
- $this->ADORecordset_mssql($id,$mode);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-mysql.inc.php b/src/adodb512/drivers/adodb-mysql.inc.php
deleted file mode 100644
index 4b215e54..00000000
--- a/src/adodb512/drivers/adodb-mysql.inc.php
+++ /dev/null
@@ -1,795 +0,0 @@
-rsPrefix .= 'ext_';
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " IFNULL($field, $ifNull) "; // if MySQL
- }
-
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= " from $showSchema";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $rs = $this->Execute(sprintf('SHOW INDEX FROM %s',$table));
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return $false;
- }
-
- $indexes = array ();
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- if ($primary == FALSE AND $row[2] == 'PRIMARY') {
- continue;
- }
-
- if (!isset($indexes[$row[2]])) {
- $indexes[$row[2]] = array(
- 'unique' => ($row[1] == 0),
- 'columns' => array()
- );
- }
-
- $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index )
- {
- ksort ($indexes[$index]['columns']);
- }
-
- return $indexes;
- }
-
-
- // if magic quotes disabled, use mysql_real_escape_string()
- function qstr($s,$magic_quotes=false)
- {
- if (is_null($s)) return 'NULL';
- if (!$magic_quotes) {
-
- if (ADODB_PHPVER >= 0x4300) {
- if (is_resource($this->_connectionID))
- return "'".mysql_real_escape_string($s,$this->_connectionID)."'";
- }
- if ($this->replaceQuote[0] == '\\'){
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
- function _insertid()
- {
- return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
- //return mysql_insert_id($this->_connectionID);
- }
-
- function GetOne($sql,$inputarr=false)
- {
- global $ADODB_GETONE_EOF;
- if ($this->compat323 == false && strncasecmp($sql,'sele',4) == 0) {
- $rs = $this->SelectLimit($sql,1,-1,$inputarr);
- if ($rs) {
- $rs->Close();
- if ($rs->EOF) return $ADODB_GETONE_EOF;
- return reset($rs->fields);
- }
- } else {
- return ADOConnection::GetOne($sql,$inputarr);
- }
- return false;
- }
-
- function BeginTrans()
- {
- if ($this->debug) ADOConnection::outp("Transactions not supported in 'mysql' driver. Use 'mysqlt' or 'mysqli' driver");
- }
-
- function _affectedrows()
- {
- return mysql_affected_rows($this->_connectionID);
- }
-
- // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
- // Reference on Last_Insert_ID on the recommended way to simulate sequences
- var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
- var $_genSeqSQL = "create table %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table %s";
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $u = strtoupper($seqname);
-
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- }
-
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- // post-nuke sets hasGenID to false
- if (!$this->hasGenID) return false;
-
- $savelog = $this->_logsql;
- $this->_logsql = false;
- $getnext = sprintf($this->_genIDSQL,$seqname);
- $holdtransOK = $this->_transOK; // save the current status
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
- $u = strtoupper($seqname);
- $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
- if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- $rs = $this->Execute($getnext);
- }
-
- if ($rs) {
- $this->genID = mysql_insert_id($this->_connectionID);
- $rs->Close();
- } else
- $this->genID = 0;
-
- $this->_logsql = $savelog;
- return $this->genID;
- }
-
- function MetaDatabases()
- {
- $qid = mysql_list_dbs($this->_connectionID);
- $arr = array();
- $i = 0;
- $max = mysql_num_rows($qid);
- while ($i < $max) {
- $db = mysql_tablename($qid,$i);
- if ($db != 'mysql') $arr[] = $db;
- $i += 1;
- }
- return $arr;
- }
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'DATE_FORMAT('.$col.",'";
- $concat = false;
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- /** FALL THROUGH */
- case '-':
- case '/':
- $s .= $ch;
- break;
-
- case 'Y':
- case 'y':
- $s .= '%Y';
- break;
- case 'M':
- $s .= '%b';
- break;
-
- case 'm':
- $s .= '%m';
- break;
- case 'D':
- case 'd':
- $s .= '%d';
- break;
-
- case 'Q':
- case 'q':
- $s .= "'),Quarter($col)";
-
- if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
- else $s .= ",('";
- $concat = true;
- break;
-
- case 'H':
- $s .= '%H';
- break;
-
- case 'h':
- $s .= '%I';
- break;
-
- case 'i':
- $s .= '%i';
- break;
-
- case 's':
- $s .= '%s';
- break;
-
- case 'a':
- case 'A':
- $s .= '%p';
- break;
-
- case 'w':
- $s .= '%w';
- break;
-
- case 'W':
- $s .= '%U';
- break;
-
- case 'l':
- $s .= '%W';
- break;
- }
- }
- $s.="')";
- if ($concat) $s = "CONCAT($s)";
- return $s;
- }
-
-
- // returns concatenated string
- // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005@mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)";
- else return '';
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
-
- $fraction = $dayFraction * 24 * 3600;
- return '('. $date . ' + INTERVAL ' . $fraction.' SECOND)';
-
-// return "from_unixtime(unix_timestamp($date)+$fraction)";
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect,$this->clientFlags);
- else if (ADODB_PHPVER >= 0x4200)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect);
- else
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
-
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword,$this->clientFlags);
- else
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($this->autoRollback) $this->RollbackTrans();
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->forceNewConnect = true;
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false || strpos($type,'binary') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
- $fld->zerofill = (strpos($type,'zerofill') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- return @mysql_select_db($dbName,$this->_connectionID);
- }
- else return false;
- }
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
- {
- $offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
- // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- else
- $rs = $this->Execute($sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- return $rs;
- }
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
- //global $ADODB_COUNTRECS;
- //if($ADODB_COUNTRECS)
- return mysql_query($sql,$this->_connectionID);
- //else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
-
- if ($this->_logsql) return $this->_errorMsg;
- if (empty($this->_connectionID)) $this->_errorMsg = @mysql_error();
- else $this->_errorMsg = @mysql_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- if ($this->_logsql) return $this->_errorCode;
- if (empty($this->_connectionID)) return @mysql_errno();
- else return @mysql_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- @mysql_close($this->_connectionID);
- $this->_connectionID = false;
- }
-
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 255;
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 4294967295;
- }
-
- // "Innox - Juan Carlos Gonzalez"
- function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
- {
- global $ADODB_FETCH_MODE;
- if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
-
- if ( !empty($owner) ) {
- $table = "$owner.$table";
- }
- $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
- if ($associative) {
- $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
- } else $create_sql = $a_create_table[1];
-
- $matches = array();
-
- if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
- $foreign_keys = array();
- $num_keys = count($matches[0]);
- for ( $i = 0; $i < $num_keys; $i ++ ) {
- $my_field = explode('`, `', $matches[1][$i]);
- $ref_table = $matches[2][$i];
- $ref_field = explode('`, `', $matches[3][$i]);
-
- if ( $upper ) {
- $ref_table = strtoupper($ref_table);
- }
-
- // see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
- if (!isset($foreign_keys[$ref_table])) {
- $foreign_keys[$ref_table] = array();
- }
- $num_fields = count($my_field);
- for ( $j = 0; $j < $num_fields; $j ++ ) {
- if ( $associative ) {
- $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
- } else {
- $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
- }
- }
- }
-
- return $foreign_keys;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-
-class ADORecordSet_mysql extends ADORecordSet{
-
- var $databaseType = "mysql";
- var $canSeek = true;
-
- function ADORecordSet_mysql($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- //GLOBAL $ADODB_COUNTRECS;
- // $this->_numOfRows = ($ADODB_COUNTRECS) ? @mysql_num_rows($this->_queryID):-1;
- $this->_numOfRows = @mysql_num_rows($this->_queryID);
- $this->_numOfFields = @mysql_num_fields($this->_queryID);
- }
-
- function FetchField($fieldOffset = -1)
- {
- if ($fieldOffset != -1) {
- $o = @mysql_fetch_field($this->_queryID, $fieldOffset);
- $f = @mysql_field_flags($this->_queryID,$fieldOffset);
- if ($o) $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich#att.com)
- //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
- if ($o) $o->binary = (strpos($f,'binary')!== false);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @mysql_fetch_field($this->_queryID);
- if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
- //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
- }
-
- return $o;
- }
-
- function GetRowAssoc($upper=true)
- {
- if ($this->fetchMode == MYSQL_ASSOC && !$upper) $row = $this->fields;
- else $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- // added @ by "Michael William Miller"
- if ($this->fetchMode != MYSQL_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- if ($this->_numOfRows == 0) return false;
- return @mysql_data_seek($this->_queryID,$row);
- }
-
- function MoveNext()
- {
- //return adodb_movenext($this);
- //if (defined('ADODB_EXTENSION')) return adodb_movenext($this);
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
- function _fetch()
- {
- $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
- return is_array($this->fields);
- }
-
- function _close() {
- @mysql_free_result($this->_queryID);
- $this->_queryID = false;
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
- case 'BINARY':
- return !empty($fieldobj->binary) ? 'B' : 'X';
-
- case 'YEAR':
- case 'DATE': return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP': return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- if (!empty($fieldobj->primary_key)) return 'R';
- else return 'I';
-
- default: return 'N';
- }
- }
-
-}
-
-class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
- function ADORecordSet_ext_mysql($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return @adodb_movenext($this);
- }
-}
-
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-mysqli.inc.php b/src/adodb512/drivers/adodb-mysqli.inc.php
deleted file mode 100644
index 094c150a..00000000
--- a/src/adodb512/drivers/adodb-mysqli.inc.php
+++ /dev/null
@@ -1,1209 +0,0 @@
-_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- // returns true or false
- // To add: parameter int $port,
- // parameter string $socket
- function _connect($argHostname = NULL,
- $argUsername = NULL,
- $argPassword = NULL,
- $argDatabasename = NULL, $persist=false)
- {
- if(!extension_loaded("mysqli")) {
- return null;
- }
- $this->_connectionID = @mysqli_init();
-
- if (is_null($this->_connectionID)) {
- // mysqli_init only fails if insufficient memory
- if ($this->debug)
- ADOConnection::outp("mysqli_init() failed : " . $this->ErrorMsg());
- return false;
- }
- /*
- I suggest a simple fix which would enable adodb and mysqli driver to
- read connection options from the standard mysql configuration file
- /etc/my.cnf - "Bastien Duclaux"
- */
- foreach($this->optionFlags as $arr) {
- mysqli_options($this->_connectionID,$arr[0],$arr[1]);
- }
-
- #if (!empty($this->port)) $argHostname .= ":".$this->port;
- $ok = mysqli_real_connect($this->_connectionID,
- $argHostname,
- $argUsername,
- $argPassword,
- $argDatabasename,
- $this->port,
- $this->socket,
- $this->clientFlags);
-
- if ($ok) {
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- } else {
- if ($this->debug)
- ADOConnection::outp("Could't connect : " . $this->ErrorMsg());
- $this->_connectionID = null;
- return false;
- }
- }
-
- // returns true or false
- // How to force a persistent connection
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename, true);
-
- }
-
- // When is this used? Close old connection first?
- // In _connect(), check $this->forceNewConnect?
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->forceNewConnect = true;
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function IfNull( $field, $ifNull )
- {
- return " IFNULL($field, $ifNull) "; // if MySQL
- }
-
- // do not use $ADODB_COUNTRECS
- function GetOne($sql,$inputarr=false)
- {
- $ret = false;
- $rs = $this->Execute($sql,$inputarr);
- if ($rs) {
- if (!$rs->EOF) $ret = reset($rs->fields);
- $rs->Close();
- }
- return $ret;
- }
-
- function ServerInfo()
- {
- $arr['description'] = $this->GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
-
- //$this->Execute('SET AUTOCOMMIT=0');
- mysqli_autocommit($this->_connectionID, false);
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('COMMIT');
-
- //$this->Execute('SET AUTOCOMMIT=1');
- mysqli_autocommit($this->_connectionID, true);
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('ROLLBACK');
- //$this->Execute('SET AUTOCOMMIT=1');
- mysqli_autocommit($this->_connectionID, true);
- return true;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
- // if magic quotes disabled, use mysql_real_escape_string()
- // From readme.htm:
- // Quotes a string to be sent to the database. The $magic_quotes_enabled
- // parameter may look funny, but the idea is if you are quoting a
- // string extracted from a POST/GET variable, then
- // pass get_magic_quotes_gpc() as the second parameter. This will
- // ensure that the variable is not quoted twice, once by qstr and once
- // by the magic_quotes_gpc.
- //
- //Eg. $s = $db->qstr(_GET['name'],get_magic_quotes_gpc());
- function qstr($s, $magic_quotes = false)
- {
- if (is_null($s)) return 'NULL';
- if (!$magic_quotes) {
- if (PHP_VERSION >= 5)
- return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
-
- if ($this->replaceQuote[0] == '\\')
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
- function _insertid()
- {
- $result = @mysqli_insert_id($this->_connectionID);
- if ($result == -1){
- if ($this->debug) ADOConnection::outp("mysqli_insert_id() failed : " . $this->ErrorMsg());
- }
- return $result;
- }
-
- // Only works for INSERT, UPDATE and DELETE query's
- function _affectedrows()
- {
- $result = @mysqli_affected_rows($this->_connectionID);
- if ($result == -1) {
- if ($this->debug) ADOConnection::outp("mysqli_affected_rows() failed : " . $this->ErrorMsg());
- }
- return $result;
- }
-
- // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
- // Reference on Last_Insert_ID on the recommended way to simulate sequences
- var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
- var $_genSeqSQL = "create table %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table %s";
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $u = strtoupper($seqname);
-
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- // post-nuke sets hasGenID to false
- if (!$this->hasGenID) return false;
-
- $getnext = sprintf($this->_genIDSQL,$seqname);
- $holdtransOK = $this->_transOK; // save the current status
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
- $u = strtoupper($seqname);
- $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
- if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- $rs = $this->Execute($getnext);
- }
-
- if ($rs) {
- $this->genID = mysqli_insert_id($this->_connectionID);
- $rs->Close();
- } else
- $this->genID = 0;
-
- return $this->genID;
- }
-
- function MetaDatabases()
- {
- $query = "SHOW DATABASES";
- $ret = $this->Execute($query);
- if ($ret && is_object($ret)){
- $arr = array();
- while (!$ret->EOF){
- $db = $ret->Fields('Database');
- if ($db != 'mysql') $arr[] = $db;
- $ret->MoveNext();
- }
- return $arr;
- }
- return $ret;
- }
-
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $rs = $this->Execute(sprintf('SHOW INDEXES FROM %s',$table));
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return $false;
- }
-
- $indexes = array ();
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- if ($primary == FALSE AND $row[2] == 'PRIMARY') {
- continue;
- }
-
- if (!isset($indexes[$row[2]])) {
- $indexes[$row[2]] = array(
- 'unique' => ($row[1] == 0),
- 'columns' => array()
- );
- }
-
- $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index )
- {
- ksort ($indexes[$index]['columns']);
- }
-
- return $indexes;
- }
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'DATE_FORMAT('.$col.",'";
- $concat = false;
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= '%Y';
- break;
- case 'Q':
- case 'q':
- $s .= "'),Quarter($col)";
-
- if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
- else $s .= ",('";
- $concat = true;
- break;
- case 'M':
- $s .= '%b';
- break;
-
- case 'm':
- $s .= '%m';
- break;
- case 'D':
- case 'd':
- $s .= '%d';
- break;
-
- case 'H':
- $s .= '%H';
- break;
-
- case 'h':
- $s .= '%I';
- break;
-
- case 'i':
- $s .= '%i';
- break;
-
- case 's':
- $s .= '%s';
- break;
-
- case 'a':
- case 'A':
- $s .= '%p';
- break;
-
- case 'w':
- $s .= '%w';
- break;
-
- case 'l':
- $s .= '%W';
- break;
-
- default:
-
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $ch;
- break;
- }
- }
- $s.="')";
- if ($concat) $s = "CONCAT($s)";
- return $s;
- }
-
- // returns concatenated string
- // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005@mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)";
- else return '';
- }
-
- // dayFraction is a day in floating point
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
-
- $fraction = $dayFraction * 24 * 3600;
- return $date . ' + INTERVAL ' . $fraction.' SECOND';
-
-// return "from_unixtime(unix_timestamp($date)+$fraction)";
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= " from $showSchema";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
- // "Innox - Juan Carlos Gonzalez"
- function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
- {
- global $ADODB_FETCH_MODE;
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
-
- if ( !empty($owner) ) {
- $table = "$owner.$table";
- }
- $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
- if ($associative) {
- $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
- } else $create_sql = $a_create_table[1];
-
- $matches = array();
-
- if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
- $foreign_keys = array();
- $num_keys = count($matches[0]);
- for ( $i = 0; $i < $num_keys; $i ++ ) {
- $my_field = explode('`, `', $matches[1][$i]);
- $ref_table = $matches[2][$i];
- $ref_field = explode('`, `', $matches[3][$i]);
-
- if ( $upper ) {
- $ref_table = strtoupper($ref_table);
- }
-
- // see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
- if (!isset($foreign_keys[$ref_table])) {
- $foreign_keys[$ref_table] = array();
- }
- $num_fields = count($my_field);
- for ( $j = 0; $j < $num_fields; $j ++ ) {
- if ( $associative ) {
- $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
- } else {
- $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
- }
- }
- }
-
- return $foreign_keys;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $false = false;
- if (!$this->metaColumnsSQL)
- return $false;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false)
- $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs))
- return $false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
- $fld->zerofill = (strpos($type,'zerofill') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
-// $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID);
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
-
- if ($this->_connectionID) {
- $result = @mysqli_select_db($this->_connectionID, $dbName);
- if (!$result) {
- ADOConnection::outp("Select of database " . $dbName . " failed. " . $this->ErrorMsg());
- }
- return $result;
- }
- return false;
- }
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,
- $nrows = -1,
- $offset = -1,
- $inputarr = false,
- $secs = 0)
- {
- $offsetStr = ($offset >= 0) ? "$offset," : '';
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs, $sql . " LIMIT $offsetStr$nrows" , $inputarr );
- else
- $rs = $this->Execute($sql . " LIMIT $offsetStr$nrows" , $inputarr );
-
- return $rs;
- }
-
-
- function Prepare($sql)
- {
- return $sql;
- $stmt = $this->_connectionID->prepare($sql);
- if (!$stmt) {
- echo $this->ErrorMsg();
- return $sql;
- }
- return array($sql,$stmt);
- }
-
-
- // returns queryID or false
- function _query($sql, $inputarr)
- {
- global $ADODB_COUNTRECS;
- // Move to the next recordset, or return false if there is none. In a stored proc
- // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result
- // returns false. I think this is because the last "recordset" is actually just the
- // return value of the stored proc (ie the number of rows affected).
- // Commented out for reasons of performance. You should retrieve every recordset yourself.
- // if (!mysqli_next_result($this->connection->_connectionID)) return false;
-
- if (is_array($sql)) {
-
- // Prepare() not supported because mysqli_stmt_execute does not return a recordset, but
- // returns as bound variables.
-
- $stmt = $sql[1];
- $a = '';
- foreach($inputarr as $k => $v) {
- if (is_string($v)) $a .= 's';
- else if (is_integer($v)) $a .= 'i';
- else $a .= 'd';
- }
-
- $fnarr = array_merge( array($stmt,$a) , $inputarr);
- $ret = call_user_func_array('mysqli_stmt_bind_param',$fnarr);
- $ret = mysqli_stmt_execute($stmt);
- return $ret;
- }
-
- /*
- if (!$mysql_res = mysqli_query($this->_connectionID, $sql, ($ADODB_COUNTRECS) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)) {
- if ($this->debug) ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
- return false;
- }
-
- return $mysql_res;
- */
-
- if ($this->multiQuery) {
- $rs = mysqli_multi_query($this->_connectionID, $sql.';');
- if ($rs) {
- $rs = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->_connectionID ) : @mysqli_use_result( $this->_connectionID );
- return $rs ? $rs : true; // mysqli_more_results( $this->_connectionID )
- }
- } else {
- $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
-
- if ($rs) return $rs;
- }
-
- if($this->debug)
- ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
-
- return false;
-
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- if (empty($this->_connectionID))
- $this->_errorMsg = @mysqli_connect_error();
- else
- $this->_errorMsg = @mysqli_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- if (empty($this->_connectionID))
- return @mysqli_connect_errno();
- else
- return @mysqli_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- @mysqli_close($this->_connectionID);
- $this->_connectionID = false;
- }
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 255;
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 4294967295;
- }
-
-
-
- // this is a set of functions for managing client encoding - very important if the encodings
- // of your database and your output target (i.e. HTML) don't match
- // for instance, you may have UTF8 database and server it on-site as latin1 etc.
- // GetCharSet - get the name of the character set the client is using now
- // Under Windows, the functions should work with MySQL 4.1.11 and above, the set of charsets supported
- // depends on compile flags of mysql distribution
-
- function GetCharSet()
- {
- //we will use ADO's builtin property charSet
- if (!method_exists($this->_connectionID,'character_set_name'))
- return false;
-
- $this->charSet = @$this->_connectionID->character_set_name();
- if (!$this->charSet) {
- return false;
- } else {
- return $this->charSet;
- }
- }
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- if (!method_exists($this->_connectionID,'set_charset'))
- return false;
-
- if ($this->charSet !== $charset_name) {
- $if = @$this->_connectionID->set_charset($charset_name);
- if ($if == "0" & $this->GetCharSet() == $charset_name) {
- return true;
- } else return false;
- } else return true;
- }
-
-
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_mysqli extends ADORecordSet{
-
- var $databaseType = "mysqli";
- var $canSeek = true;
-
- function ADORecordSet_mysqli($queryID, $mode = false)
- {
- if ($mode === false)
- {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM:
- $this->fetchMode = MYSQLI_NUM;
- break;
- case ADODB_FETCH_ASSOC:
- $this->fetchMode = MYSQLI_ASSOC;
- break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQLI_BOTH;
- break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
-
- $this->_numOfRows = $ADODB_COUNTRECS ? @mysqli_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @mysqli_num_fields($this->_queryID);
- }
-
-/*
-1 = MYSQLI_NOT_NULL_FLAG
-2 = MYSQLI_PRI_KEY_FLAG
-4 = MYSQLI_UNIQUE_KEY_FLAG
-8 = MYSQLI_MULTIPLE_KEY_FLAG
-16 = MYSQLI_BLOB_FLAG
-32 = MYSQLI_UNSIGNED_FLAG
-64 = MYSQLI_ZEROFILL_FLAG
-128 = MYSQLI_BINARY_FLAG
-256 = MYSQLI_ENUM_FLAG
-512 = MYSQLI_AUTO_INCREMENT_FLAG
-1024 = MYSQLI_TIMESTAMP_FLAG
-2048 = MYSQLI_SET_FLAG
-32768 = MYSQLI_NUM_FLAG
-16384 = MYSQLI_PART_KEY_FLAG
-32768 = MYSQLI_GROUP_FLAG
-65536 = MYSQLI_UNIQUE_FLAG
-131072 = MYSQLI_BINCMP_FLAG
-*/
-
- function FetchField($fieldOffset = -1)
- {
- $fieldnr = $fieldOffset;
- if ($fieldOffset != -1) {
- $fieldOffset = @mysqli_field_seek($this->_queryID, $fieldnr);
- }
- $o = @mysqli_fetch_field($this->_queryID);
- if (!$o) return false;
- /* Properties of an ADOFieldObject as set by MetaColumns */
- $o->primary_key = $o->flags & MYSQLI_PRI_KEY_FLAG;
- $o->not_null = $o->flags & MYSQLI_NOT_NULL_FLAG;
- $o->auto_increment = $o->flags & MYSQLI_AUTO_INCREMENT_FLAG;
- $o->binary = $o->flags & MYSQLI_BINARY_FLAG;
- // $o->blob = $o->flags & MYSQLI_BLOB_FLAG; /* not returned by MetaColumns */
- $o->unsigned = $o->flags & MYSQLI_UNSIGNED_FLAG;
-
- return $o;
- }
-
- function GetRowAssoc($upper = true)
- {
- if ($this->fetchMode == MYSQLI_ASSOC && !$upper)
- return $this->fields;
- $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != MYSQLI_NUM)
- return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i = 0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- if ($this->_numOfRows == 0)
- return false;
-
- if ($row < 0)
- return false;
-
- mysqli_data_seek($this->_queryID, $row);
- $this->EOF = false;
- return true;
- }
-
-
- function NextRecordSet()
- {
- global $ADODB_COUNTRECS;
-
- mysqli_free_result($this->_queryID);
- $this->_queryID = -1;
- // Move to the next recordset, or return false if there is none. In a stored proc
- // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result
- // returns false. I think this is because the last "recordset" is actually just the
- // return value of the stored proc (ie the number of rows affected).
- if(!mysqli_next_result($this->connection->_connectionID)) {
- return false;
- }
- // CD: There is no $this->_connectionID variable, at least in the ADO version I'm using
- $this->_queryID = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->connection->_connectionID )
- : @mysqli_use_result( $this->connection->_connectionID );
- if(!$this->_queryID) {
- return false;
- }
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- // 10% speedup to move MoveNext to child class
- // This is the only implementation that works now (23-10-2003).
- // Other functions return no or the wrong results.
- function MoveNext()
- {
- if ($this->EOF) return false;
- $this->_currentRow++;
- $this->fields = @mysqli_fetch_array($this->_queryID,$this->fetchMode);
-
- if (is_array($this->fields)) return true;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
- $this->fields = mysqli_fetch_array($this->_queryID,$this->fetchMode);
- return is_array($this->fields);
- }
-
- function _close()
- {
- //if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
- //only a problem with persistant connections
-
- //mysqli_next_result($this->connection->_connectionID); trashes the DB side attached results.
-
- while(mysqli_more_results($this->connection->_connectionID)){
- @mysqli_next_result($this->connection->_connectionID);
- }
-
- //Because you can have one attached result, without tripping mysqli_more_results
- @mysqli_next_result($this->connection->_connectionID);
-
-
- mysqli_free_result($this->_queryID);
- $this->_queryID = false;
- }
-
-/*
-
-0 = MYSQLI_TYPE_DECIMAL
-1 = MYSQLI_TYPE_CHAR
-1 = MYSQLI_TYPE_TINY
-2 = MYSQLI_TYPE_SHORT
-3 = MYSQLI_TYPE_LONG
-4 = MYSQLI_TYPE_FLOAT
-5 = MYSQLI_TYPE_DOUBLE
-6 = MYSQLI_TYPE_NULL
-7 = MYSQLI_TYPE_TIMESTAMP
-8 = MYSQLI_TYPE_LONGLONG
-9 = MYSQLI_TYPE_INT24
-10 = MYSQLI_TYPE_DATE
-11 = MYSQLI_TYPE_TIME
-12 = MYSQLI_TYPE_DATETIME
-13 = MYSQLI_TYPE_YEAR
-14 = MYSQLI_TYPE_NEWDATE
-247 = MYSQLI_TYPE_ENUM
-248 = MYSQLI_TYPE_SET
-249 = MYSQLI_TYPE_TINY_BLOB
-250 = MYSQLI_TYPE_MEDIUM_BLOB
-251 = MYSQLI_TYPE_LONG_BLOB
-252 = MYSQLI_TYPE_BLOB
-253 = MYSQLI_TYPE_VAR_STRING
-254 = MYSQLI_TYPE_STRING
-255 = MYSQLI_TYPE_GEOMETRY
-*/
-
- function MetaType($t, $len = -1, $fieldobj = false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
-
- case MYSQLI_TYPE_TINY_BLOB :
- #case MYSQLI_TYPE_CHAR :
- case MYSQLI_TYPE_STRING :
- case MYSQLI_TYPE_ENUM :
- case MYSQLI_TYPE_SET :
- case 253 :
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
-
- case MYSQLI_TYPE_BLOB :
- case MYSQLI_TYPE_LONG_BLOB :
- case MYSQLI_TYPE_MEDIUM_BLOB :
-
- return !empty($fieldobj->binary) ? 'B' : 'X';
- case 'YEAR':
- case 'DATE':
- case MYSQLI_TYPE_DATE :
- case MYSQLI_TYPE_YEAR :
-
- return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
-
- case MYSQLI_TYPE_DATETIME :
- case MYSQLI_TYPE_NEWDATE :
- case MYSQLI_TYPE_TIME :
- case MYSQLI_TYPE_TIMESTAMP :
-
- return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- case MYSQLI_TYPE_INT24 :
- case MYSQLI_TYPE_LONG :
- case MYSQLI_TYPE_LONGLONG :
- case MYSQLI_TYPE_SHORT :
- case MYSQLI_TYPE_TINY :
-
- if (!empty($fieldobj->primary_key)) return 'R';
-
- return 'I';
-
-
- // Added floating-point types
- // Maybe not necessery.
- case 'FLOAT':
- case 'DOUBLE':
- // case 'DOUBLE PRECISION':
- case 'DECIMAL':
- case 'DEC':
- case 'FIXED':
- default:
- //if (!is_numeric($t)) echo "--- Error in type matching $t -----
";
- return 'N';
- }
- } // function
-
-
-} // rs class
-
-}
-
-class ADORecordSet_array_mysqli extends ADORecordSet_array {
-
- function ADORecordSet_array_mysqli($id=-1,$mode=false)
- {
- $this->ADORecordSet_array($id,$mode);
- }
-
- function MetaType($t, $len = -1, $fieldobj = false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
-
- $len = -1; // mysql max_length is not accurate
- switch (strtoupper($t)) {
- case 'STRING':
- case 'CHAR':
- case 'VARCHAR':
- case 'TINYBLOB':
- case 'TINYTEXT':
- case 'ENUM':
- case 'SET':
-
- case MYSQLI_TYPE_TINY_BLOB :
- #case MYSQLI_TYPE_CHAR :
- case MYSQLI_TYPE_STRING :
- case MYSQLI_TYPE_ENUM :
- case MYSQLI_TYPE_SET :
- case 253 :
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- case 'LONGTEXT':
- case 'MEDIUMTEXT':
- return 'X';
-
-
- // php_mysql extension always returns 'blob' even if 'text'
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
-
- case MYSQLI_TYPE_BLOB :
- case MYSQLI_TYPE_LONG_BLOB :
- case MYSQLI_TYPE_MEDIUM_BLOB :
-
- return !empty($fieldobj->binary) ? 'B' : 'X';
- case 'YEAR':
- case 'DATE':
- case MYSQLI_TYPE_DATE :
- case MYSQLI_TYPE_YEAR :
-
- return 'D';
-
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
-
- case MYSQLI_TYPE_DATETIME :
- case MYSQLI_TYPE_NEWDATE :
- case MYSQLI_TYPE_TIME :
- case MYSQLI_TYPE_TIMESTAMP :
-
- return 'T';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
-
- case MYSQLI_TYPE_INT24 :
- case MYSQLI_TYPE_LONG :
- case MYSQLI_TYPE_LONGLONG :
- case MYSQLI_TYPE_SHORT :
- case MYSQLI_TYPE_TINY :
-
- if (!empty($fieldobj->primary_key)) return 'R';
-
- return 'I';
-
-
- // Added floating-point types
- // Maybe not necessery.
- case 'FLOAT':
- case 'DOUBLE':
- // case 'DOUBLE PRECISION':
- case 'DECIMAL':
- case 'DEC':
- case 'FIXED':
- default:
- //if (!is_numeric($t)) echo "--- Error in type matching $t -----
";
- return 'N';
- }
- } // function
-
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-mysqlpo.inc.php b/src/adodb512/drivers/adodb-mysqlpo.inc.php
deleted file mode 100644
index 668bdcf0..00000000
--- a/src/adodb512/drivers/adodb-mysqlpo.inc.php
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
- Requires mysql client. Works on Windows and Unix.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
-
-
-class ADODB_mysqlt extends ADODB_mysql {
- var $databaseType = 'mysqlt';
- var $ansiOuter = true; // for Version 3.23.17 or later
- var $hasTransactions = true;
- var $autoRollback = true; // apparently mysql does not autorollback properly
-
- function ADODB_mysqlt()
- {
- global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->Execute('SET AUTOCOMMIT=0');
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('COMMIT');
- $this->Execute('SET AUTOCOMMIT=1');
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->Execute('ROLLBACK');
- $this->Execute('SET AUTOCOMMIT=1');
- return true;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
-}
-
-class ADORecordSet_mysqlt extends ADORecordSet_mysql{
- var $databaseType = "mysqlt";
-
- function ADORecordSet_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = MYSQL_BOTH; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-}
-
-class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
-
- function ADORecordSet_ext_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-mysqlt.inc.php b/src/adodb512/drivers/adodb-mysqlt.inc.php
deleted file mode 100644
index 5007b756..00000000
--- a/src/adodb512/drivers/adodb-mysqlt.inc.php
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
- Requires mysql client. Works on Windows and Unix.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
-
-
-class ADODB_mysqlt extends ADODB_mysql {
- var $databaseType = 'mysqlt';
- var $ansiOuter = true; // for Version 3.23.17 or later
- var $hasTransactions = true;
- var $autoRollback = true; // apparently mysql does not autorollback properly
-
- function ADODB_mysqlt()
- {
- global $ADODB_EXTENSION; if ($ADODB_EXTENSION) $this->rsPrefix .= 'ext_';
- }
-
- /* set transaction mode
-
- SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
-{ READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }
-
- */
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->Execute('SET AUTOCOMMIT=0');
- $this->Execute('BEGIN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $ok = $this->Execute('COMMIT');
- $this->Execute('SET AUTOCOMMIT=1');
- return $ok ? true : false;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ok = $this->Execute('ROLLBACK');
- $this->Execute('SET AUTOCOMMIT=1');
- return $ok ? true : false;
- }
-
- function RowLock($tables,$where='',$col='1 as adodbignore')
- {
- if ($this->transCnt==0) $this->BeginTrans();
- if ($where) $where = ' where '.$where;
- $rs = $this->Execute("select $col from $tables $where for update");
- return !empty($rs);
- }
-
-}
-
-class ADORecordSet_mysqlt extends ADORecordSet_mysql{
- var $databaseType = "mysqlt";
-
- function ADORecordSet_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
-
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = MYSQL_BOTH; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-}
-
-class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
-
- function ADORecordSet_ext_mysqlt($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = MYSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-netezza.inc.php b/src/adodb512/drivers/adodb-netezza.inc.php
deleted file mode 100644
index 0f5a1ee3..00000000
--- a/src/adodb512/drivers/adodb-netezza.inc.php
+++ /dev/null
@@ -1,170 +0,0 @@
- 0 ORDER BY attnum";
- var $metaColumnsSQL1 = "SELECT attname, atttype FROM _v_relation_column_def WHERE name = '%s' AND attnum > 0 ORDER BY attnum";
- // netezza doesn't have keys. it does have distributions, so maybe this is
- // something that can be pulled from the system tables
- var $metaKeySQL = "";
- var $hasAffectedRows = true;
- var $hasLimit = true;
- var $true = 't'; // string that represents TRUE for a database
- var $false = 'f'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $ansiOuter = true;
- var $autoRollback = true; // apparently pgsql does not autorollback properly before 4.3.4
- // http://bugs.php.net/bug.php?id=25404
-
-
- function ADODB_netezza()
- {
-
- }
-
- function MetaColumns($table,$upper=true)
- {
-
- // Changed this function to support Netezza which has no concept of keys
- // could posisbly work on other things from the system table later.
-
- global $ADODB_FETCH_MODE;
-
- $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) return false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
-
- // since we're returning type and length as one string,
- // split them out here.
-
- if ($first = strstr($rs->fields[1], "(")) {
- $fld->max_length = trim($first, "()");
- } else {
- $fld->max_length = -1;
- }
-
- if ($first = strpos($rs->fields[1], "(")) {
- $fld->type = substr($rs->fields[1], 0, $first);
- } else {
- $fld->type = $rs->fields[1];
- }
-
- switch ($fld->type) {
- case "byteint":
- case "boolean":
- $fld->max_length = 1;
- break;
- case "smallint":
- $fld->max_length = 2;
- break;
- case "integer":
- case "numeric":
- case "date":
- $fld->max_length = 4;
- break;
- case "bigint":
- case "time":
- case "timestamp":
- $fld->max_length = 8;
- break;
- case "timetz":
- case "time with time zone":
- $fld->max_length = 12;
- break;
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($upper) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
-
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_netezza extends ADORecordSet_postgres64
-{
- var $databaseType = "netezza";
- var $canSeek = true;
-
- function ADORecordSet_netezza($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = PGSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- // _initrs modified to disable blob handling
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1;
- $this->_numOfFields = @pg_numfields($this->_queryID);
- }
-
-}
-?>
diff --git a/src/adodb512/drivers/adodb-oci8.inc.php b/src/adodb512/drivers/adodb-oci8.inc.php
deleted file mode 100644
index 360b6b44..00000000
--- a/src/adodb512/drivers/adodb-oci8.inc.php
+++ /dev/null
@@ -1,1628 +0,0 @@
-
-
- 13 Nov 2000 jlim - removed all ora_* references.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-/*
-NLS_Date_Format
-Allows you to use a date format other than the Oracle Lite default. When a literal
-character string appears where a date value is expected, the Oracle Lite database
-tests the string to see if it matches the formats of Oracle, SQL-92, or the value
-specified for this parameter in the POLITE.INI file. Setting this parameter also
-defines the default format used in the TO_CHAR or TO_DATE functions when no
-other format string is supplied.
-
-For Oracle the default is dd-mon-yy or dd-mon-yyyy, and for SQL-92 the default is
-yy-mm-dd or yyyy-mm-dd.
-
-Using 'RR' in the format forces two-digit years less than or equal to 49 to be
-interpreted as years in the 21st century (20002049), and years over 50 as years in
-the 20th century (19501999). Setting the RR format as the default for all two-digit
-year entries allows you to become year-2000 compliant. For example:
-NLS_DATE_FORMAT='RR-MM-DD'
-
-You can also modify the date format using the ALTER SESSION command.
-*/
-
-# define the LOB descriptor type for the given type
-# returns false if no LOB descriptor
-function oci_lob_desc($type) {
- switch ($type) {
- case OCI_B_BFILE: $result = OCI_D_FILE; break;
- case OCI_B_CFILEE: $result = OCI_D_FILE; break;
- case OCI_B_CLOB: $result = OCI_D_LOB; break;
- case OCI_B_BLOB: $result = OCI_D_LOB; break;
- case OCI_B_ROWID: $result = OCI_D_ROWID; break;
- default: $result = false; break;
- }
- return $result;
-}
-
-class ADODB_oci8 extends ADOConnection {
- var $databaseType = 'oci8';
- var $dataProvider = 'oci8';
- var $replaceQuote = "''"; // string to use to replace quotes
- var $concat_operator='||';
- var $sysDate = "TRUNC(SYSDATE)";
- var $sysTimeStamp = 'SYSDATE'; // requires oracle 9 or later, otherwise use SYSDATE
- var $metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1";
- var $_stmt;
- var $_commit = OCI_COMMIT_ON_SUCCESS;
- var $_initdate = true; // init date to YYYY-MM-DD
- var $metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW') and table_name not like 'BIN\$%'"; // bin$ tables are recycle bin tables
- var $metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
- var $metaColumnsSQL2 = "select column_name,data_type,data_length, data_scale, data_precision,
- case when nullable = 'Y' then 'NULL'
- else 'NOT NULL' end as nulls,
- data_default from all_tab_cols
- where owner='%s' and table_name='%s' order by column_id"; // when there is a schema
- var $_bindInputArray = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT (%s.nextval) FROM DUAL";
- var $_genSeqSQL = "CREATE SEQUENCE %s START WITH %s";
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $hasAffectedRows = true;
- var $random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)";
- var $noNullStrings = false;
- var $connectSID = false;
- var $_bind = false;
- var $_nestedSQL = true;
- var $_hasOCIFetchStatement = false;
- var $_getarray = false; // currently not working
- var $leftOuter = ''; // oracle wierdness, $col = $value (+) for LEFT OUTER, $col (+)= $value for RIGHT OUTER
- var $session_sharing_force_blob = false; // alter session on updateblob if set to true
- var $firstrows = true; // enable first rows optimization on SelectLimit()
- var $selectOffsetAlg1 = 1000; // when to use 1st algorithm of selectlimit.
- var $NLS_DATE_FORMAT = 'YYYY-MM-DD'; // To include time, use 'RRRR-MM-DD HH24:MI:SS'
- var $dateformat = 'YYYY-MM-DD'; // DBDate format
- var $useDBDateFormatForTextInput=false;
- var $datetime = false; // MetaType('DATE') returns 'D' (datetime==false) or 'T' (datetime == true)
- var $_refLOBs = array();
-
- // var $ansiOuter = true; // if oracle9
-
- function ADODB_oci8()
- {
- $this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200;
- if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
- }
-
- /* function MetaColumns($table, $normalize=true) added by smondino@users.sourceforge.net*/
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table, $schema);
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema)
- $rs = $this->Execute(sprintf($this->metaColumnsSQL2, strtoupper($schema), strtoupper($table)));
- else
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!$rs) {
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->scale = $rs->fields[3];
- if ($rs->fields[1] == 'NUMBER') {
- if ($rs->fields[3] == 0) $fld->type = 'INT';
- $fld->max_length = $rs->fields[4];
- }
- $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0);
- $fld->binary = (strpos($fld->type,'BLOB') !== false);
- $fld->default_value = $rs->fields[6];
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
- }
-
- function Time()
- {
- $rs = $this->Execute("select TO_CHAR($this->sysTimeStamp,'YYYY-MM-DD HH24:MI:SS') from dual");
- if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
-
- return false;
- }
-
-/*
-
- Multiple modes of connection are supported:
-
- a. Local Database
- $conn->Connect(false,'scott','tiger');
-
- b. From tnsnames.ora
- $conn->Connect(false,'scott','tiger',$tnsname);
- $conn->Connect($tnsname,'scott','tiger');
-
- c. Server + service name
- $conn->Connect($serveraddress,'scott,'tiger',$service_name);
-
- d. Server + SID
- $conn->connectSID = true;
- $conn->Connect($serveraddress,'scott,'tiger',$SID);
-
-
-Example TNSName:
----------------
-NATSOFT.DOMAIN =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = kermit)(PORT = 1523))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = natsoft.domain)
- )
- )
-
- There are 3 connection modes, 0 = non-persistent, 1 = persistent, 2 = force new connection
-
-*/
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$mode=0)
- {
- if (!function_exists('OCIPLogon')) return null;
- #adodb_backtrace();
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- if($argHostname) { // added by Jorma Tuomainen
- if (empty($argDatabasename)) $argDatabasename = $argHostname;
- else {
- if(strpos($argHostname,":")) {
- $argHostinfo=explode(":",$argHostname);
- $argHostname=$argHostinfo[0];
- $argHostport=$argHostinfo[1];
- } else {
- $argHostport = empty($this->port)? "1521" : $this->port;
- }
-
- if (strncasecmp($argDatabasename,'SID=',4) == 0) {
- $argDatabasename = substr($argDatabasename,4);
- $this->connectSID = true;
- }
-
- if ($this->connectSID) {
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
- } else
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
- }
- }
-
- //if ($argHostname) print "Connect: 1st argument should be left blank for $this->databaseType
";
- if ($mode==1) {
- $this->_connectionID = ($this->charSet) ?
- OCIPLogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
- :
- OCIPLogon($argUsername,$argPassword, $argDatabasename)
- ;
- if ($this->_connectionID && $this->autoRollback) OCIrollback($this->_connectionID);
- } else if ($mode==2) {
- $this->_connectionID = ($this->charSet) ?
- OCINLogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
- :
- OCINLogon($argUsername,$argPassword, $argDatabasename);
-
- } else {
- $this->_connectionID = ($this->charSet) ?
- OCILogon($argUsername,$argPassword, $argDatabasename,$this->charSet)
- :
- OCILogon($argUsername,$argPassword, $argDatabasename);
- }
- if (!$this->_connectionID) return false;
- if ($this->_initdate) {
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
- }
-
- // looks like:
- // Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production
- // $vers = OCIServerVersion($this->_connectionID);
- // if (strpos($vers,'8i') !== false) $this->ansiOuter = true;
- return true;
- }
-
- function ServerInfo()
- {
- $arr['compat'] = $this->GetOne('select value from sys.database_compatible_level');
- $arr['description'] = @OCIServerVersion($this->_connectionID);
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,1);
- }
-
- // returns true or false
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,2);
- }
-
- function _affectedrows()
- {
- if (is_resource($this->_stmt)) return @OCIRowCount($this->_stmt);
- return 0;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " NVL($field, $ifNull) "; // if Oracle
- }
-
- // format and return date string in database date format
- function DBDate($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
- if ($isfld) return 'TO_DATE('.$d.",'".$this->dateformat."')";
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
-
- if (is_object($d)) $ds = $d->format($this->fmtDate);
- else $ds = adodb_date($this->fmtDate,$d);
-
- return "TO_DATE(".$ds.",'".$this->dateformat."')";
- }
-
- function BindDate($d)
- {
- $d = ADOConnection::DBDate($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
- function BindTimeStamp($ts)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
-
- if (is_object($ts)) $tss = $ts->format("'Y-m-d H:i:s'");
- else $tss = adodb_date("'Y-m-d H:i:s'",$ts);
-
- return $tss;
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts,$isfld=false)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if ($isfld) return 'TO_DATE(substr('.$ts.",1,19),'RRRR-MM-DD, HH24:MI:SS')";
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
-
- if (is_object($ts)) $tss = $ts->format("'Y-m-d H:i:s'");
- else $tss = adodb_date("'Y-m-d H:i:s'",$ts);
-
- return 'TO_DATE('.$tss.",'RRRR-MM-DD, HH24:MI:SS')";
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($this->autoCommit) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND upper(table_name) like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- // Mark Newnham
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $table = strtoupper($table);
-
- // get Primary index
- $primary_key = '';
-
- $false = false;
- $rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' AND CONSTRAINT_TYPE='P'",$table));
- if ($row = $rs->FetchRow())
- $primary_key = $row[1]; //constraint_name
-
- if ($primary==TRUE && $primary_key=='') {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false; //There is no primary key
- }
-
- $rs = $this->Execute(sprintf("SELECT ALL_INDEXES.INDEX_NAME, ALL_INDEXES.UNIQUENESS, ALL_IND_COLUMNS.COLUMN_POSITION, ALL_IND_COLUMNS.COLUMN_NAME FROM ALL_INDEXES,ALL_IND_COLUMNS WHERE UPPER(ALL_INDEXES.TABLE_NAME)='%s' AND ALL_IND_COLUMNS.INDEX_NAME=ALL_INDEXES.INDEX_NAME",$table));
-
-
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array ();
- // parse index data into array
-
- while ($row = $rs->FetchRow()) {
- if ($primary && $row[0] != $primary_key) continue;
- if (!isset($indexes[$row[0]])) {
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 'UNIQUE'),
- 'columns' => array()
- );
- }
- $indexes[$row[0]]['columns'][$row[2] - 1] = $row[3];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index ) {
- ksort ($indexes[$index]['columns']);
- }
-
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_commit = OCI_DEFAULT;
-
- if ($this->_transmode) $ok = $this->Execute("SET TRANSACTION ".$this->_transmode);
- else $ok = true;
-
- return $ok ? true : false;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = OCIcommit($this->_connectionID);
- $this->_commit = OCI_COMMIT_ON_SUCCESS;
- $this->autoCommit = true;
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = OCIrollback($this->_connectionID);
- $this->_commit = OCI_COMMIT_ON_SUCCESS;
- $this->autoCommit = true;
- return $ret;
- }
-
-
- function SelectDB($dbName)
- {
- return false;
- }
-
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
-
- if (is_resource($this->_stmt)) $arr = @OCIError($this->_stmt);
- if (empty($arr)) {
- if (is_resource($this->_connectionID)) $arr = @OCIError($this->_connectionID);
- else $arr = @OCIError();
- if ($arr === false) return '';
- }
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
-
- if (is_resource($this->_stmt)) $arr = @OCIError($this->_stmt);
- if (empty($arr)) {
- $arr = @OCIError($this->_connectionID);
- if ($arr == false) $arr = @OCIError();
- if ($arr == false) return '';
- }
-
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
-
- return $arr['code'];
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'TO_CHAR('.$col.",'";
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= 'YYYY';
- break;
- case 'Q':
- case 'q':
- $s .= 'Q';
- break;
-
- case 'M':
- $s .= 'Mon';
- break;
-
- case 'm':
- $s .= 'MM';
- break;
- case 'D':
- case 'd':
- $s .= 'DD';
- break;
-
- case 'H':
- $s.= 'HH24';
- break;
-
- case 'h':
- $s .= 'HH';
- break;
-
- case 'i':
- $s .= 'MI';
- break;
-
- case 's':
- $s .= 'SS';
- break;
-
- case 'a':
- case 'A':
- $s .= 'AM';
- break;
-
- case 'w':
- $s .= 'D';
- break;
-
- case 'l':
- $s .= 'DAY';
- break;
-
- case 'W':
- $s .= 'WW';
- break;
-
- default:
- // handle escape characters...
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- if (strpos('-/.:;, ',$ch) !== false) $s .= $ch;
- else $s .= '"'.$ch.'"';
-
- }
- }
- return $s. "')";
- }
-
- function GetRandRow($sql, $arr = false)
- {
- $sql = "SELECT * FROM ($sql ORDER BY dbms_random.value) WHERE rownum = 1";
-
- return $this->GetRow($sql,$arr);
- }
-
- /*
- This algorithm makes use of
-
- a. FIRST_ROWS hint
- The FIRST_ROWS hint explicitly chooses the approach to optimize response time,
- that is, minimum resource usage to return the first row. Results will be returned
- as soon as they are identified.
-
- b. Uses rownum tricks to obtain only the required rows from a given offset.
- As this uses complicated sql statements, we only use this if the $offset >= 100.
- This idea by Tomas V V Cox.
-
- This implementation does not appear to work with oracle 8.0.5 or earlier. Comment
- out this function then, and the slower SelectLimit() in the base class will be used.
- */
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // seems that oracle only supports 1 hint comment in 8i
- if ($this->firstrows) {
- if (strpos($sql,'/*+') !== false)
- $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
- else
- $sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql);
- }
-
- if ($offset == -1 || ($offset < $this->selectOffsetAlg1 && 0 < $nrows && $nrows < 1000)) {
- if ($nrows > 0) {
- if ($offset > 0) $nrows += $offset;
- //$inputarr['adodb_rownum'] = $nrows;
- if ($this->databaseType == 'oci8po') {
- $sql = "select * from (".$sql.") where rownum <= ?";
- } else {
- $sql = "select * from (".$sql.") where rownum <= :adodb_offset";
- }
- $inputarr['adodb_offset'] = $nrows;
- $nrows = -1;
- }
- // note that $nrows = 0 still has to work ==> no rows returned
-
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $rs;
-
- } else {
- // Algorithm by Tomas V V Cox, from PEAR DB oci8.php
-
- // Let Oracle return the name of the columns
- $q_fields = "SELECT * FROM (".$sql.") WHERE NULL = NULL";
-
- $false = false;
- if (! $stmt_arr = $this->Prepare($q_fields)) {
- return $false;
- }
- $stmt = $stmt_arr[1];
-
- if (is_array($inputarr)) {
- foreach($inputarr as $k => $v) {
- if (is_array($v)) {
- if (sizeof($v) == 2) // suggested by g.giunta@libero.
- OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]);
- else
- OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
- } else {
- $len = -1;
- if ($v === ' ') $len = 1;
- if (isset($bindarr)) { // is prepared sql, so no need to ocibindbyname again
- $bindarr[$k] = $v;
- } else { // dynamic sql, so rebind every time
- OCIBindByName($stmt,":$k",$inputarr[$k],$len);
-
- }
- }
- }
- }
-
- if (!OCIExecute($stmt, OCI_DEFAULT)) {
- OCIFreeStatement($stmt);
- return $false;
- }
-
- $ncols = OCINumCols($stmt);
- for ( $i = 1; $i <= $ncols; $i++ ) {
- $cols[] = '"'.OCIColumnName($stmt, $i).'"';
- }
- $result = false;
-
- OCIFreeStatement($stmt);
- $fields = implode(',', $cols);
- if ($nrows <= 0) $nrows = 999999999999;
- else $nrows += $offset;
- $offset += 1; // in Oracle rownum starts at 1
-
- if ($this->databaseType == 'oci8po') {
- $sql = "SELECT /*+ FIRST_ROWS */ $fields FROM".
- "(SELECT rownum as adodb_rownum, $fields FROM".
- " ($sql) WHERE rownum <= ?".
- ") WHERE adodb_rownum >= ?";
- } else {
- $sql = "SELECT /*+ FIRST_ROWS */ $fields FROM".
- "(SELECT rownum as adodb_rownum, $fields FROM".
- " ($sql) WHERE rownum <= :adodb_nrows".
- ") WHERE adodb_rownum >= :adodb_offset";
- }
- $inputarr['adodb_nrows'] = $nrows;
- $inputarr['adodb_offset'] = $offset;
-
- if ($secs2cache>0) $rs = $this->CacheExecute($secs2cache, $sql,$inputarr);
- else $rs = $this->Execute($sql,$inputarr);
- return $rs;
- }
-
- }
-
- /**
- * Usage:
- * Store BLOBs and CLOBs
- *
- * Example: to store $var in a blob
- *
- * $conn->Execute('insert into TABLE (id,ablob) values(12,empty_blob())');
- * $conn->UpdateBlob('TABLE', 'ablob', $varHoldingBlob, 'ID=12', 'BLOB');
- *
- * $blobtype supports 'BLOB' and 'CLOB', but you need to change to 'empty_clob()'.
- *
- * to get length of LOB:
- * select DBMS_LOB.GETLENGTH(ablob) from TABLE
- *
- * If you are using CURSOR_SHARING = force, it appears this will case a segfault
- * under oracle 8.1.7.0. Run:
- * $db->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
- * before UpdateBlob() then...
- */
-
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- //if (strlen($val) < 4000) return $this->Execute("UPDATE $table SET $column=:blob WHERE $where",array('blob'=>$val)) != false;
-
- switch(strtoupper($blobtype)) {
- default: ADOConnection::outp("UpdateBlob: Unknown blobtype=$blobtype"); return false;
- case 'BLOB': $type = OCI_B_BLOB; break;
- case 'CLOB': $type = OCI_B_CLOB; break;
- }
-
- if ($this->databaseType == 'oci8po')
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
- else
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
-
- $desc = OCINewDescriptor($this->_connectionID, OCI_D_LOB);
- $arr['blob'] = array($desc,-1,$type);
- if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
- $commit = $this->autoCommit;
- if ($commit) $this->BeginTrans();
- $rs = $this->_Execute($sql,$arr);
- if ($rez = !empty($rs)) $desc->save($val);
- $desc->free();
- if ($commit) $this->CommitTrans();
- if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=FORCE');
-
- if ($rez) $rs->Close();
- return $rez;
- }
-
- /**
- * Usage: store file pointed to by $val in a blob
- */
- function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB')
- {
- switch(strtoupper($blobtype)) {
- default: ADOConnection::outp( "UpdateBlob: Unknown blobtype=$blobtype"); return false;
- case 'BLOB': $type = OCI_B_BLOB; break;
- case 'CLOB': $type = OCI_B_CLOB; break;
- }
-
- if ($this->databaseType == 'oci8po')
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?";
- else
- $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob";
-
- $desc = OCINewDescriptor($this->_connectionID, OCI_D_LOB);
- $arr['blob'] = array($desc,-1,$type);
-
- $this->BeginTrans();
- $rs = ADODB_oci8::Execute($sql,$arr);
- if ($rez = !empty($rs)) $desc->savefile($val);
- $desc->free();
- $this->CommitTrans();
-
- if ($rez) $rs->Close();
- return $rez;
- }
-
- /**
- * Execute SQL
- *
- * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
- * @param [inputarr] holds the input data to bind to. Null elements will be set to null.
- * @return RecordSet or false
- */
- function Execute($sql,$inputarr=false)
- {
- if ($this->fnExecute) {
- $fn = $this->fnExecute;
- $ret = $fn($this,$sql,$inputarr);
- if (isset($ret)) return $ret;
- }
- if ($inputarr) {
- #if (!is_array($inputarr)) $inputarr = array($inputarr);
-
- $element0 = reset($inputarr);
-
- if (!$this->_bindInputArray) {
- # is_object check because oci8 descriptors can be passed in
- if (is_array($element0) && !is_object(reset($element0))) {
- if (is_string($sql))
- $stmt = $this->Prepare($sql);
- else
- $stmt = $sql;
-
- foreach($inputarr as $arr) {
- $ret = $this->_Execute($stmt,$arr);
- if (!$ret) return $ret;
- }
- } else {
- $sqlarr = explode(':',$sql);
- $sql = '';
- $lastnomatch = -2;
- #var_dump($sqlarr);echo "
";var_dump($inputarr);echo"
";
- foreach($sqlarr as $k => $str) {
- if ($k == 0) { $sql = $str; continue; }
- // we need $lastnomatch because of the following datetime,
- // eg. '10:10:01', which causes code to think that there is bind param :10 and :1
- $ok = preg_match('/^([0-9]*)/', $str, $arr);
-
- if (!$ok) $sql .= $str;
- else {
- $at = $arr[1];
- if (isset($inputarr[$at]) || is_null($inputarr[$at])) {
- if ((strlen($at) == strlen($str) && $k < sizeof($arr)-1)) {
- $sql .= ':'.$str;
- $lastnomatch = $k;
- } else if ($lastnomatch == $k-1) {
- $sql .= ':'.$str;
- } else {
- if (is_null($inputarr[$at])) $sql .= 'null';
- else $sql .= $this->qstr($inputarr[$at]);
- $sql .= substr($str, strlen($at));
- }
- } else {
- $sql .= ':'.$str;
- }
-
- }
- }
- $inputarr = false;
- }
- }
- $ret = $this->_Execute($sql,$inputarr);
-
-
- } else {
- $ret = $this->_Execute($sql,false);
- }
-
- return $ret;
- }
-
- /*
- Example of usage:
-
- $stmt = $this->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- */
- function Prepare($sql,$cursor=false)
- {
- static $BINDNUM = 0;
-
- $stmt = OCIParse($this->_connectionID,$sql);
-
- if (!$stmt) {
- $this->_errorMsg = false;
- $this->_errorCode = false;
- $arr = @OCIError($this->_connectionID);
- if ($arr === false) return false;
-
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
- return false;
- }
-
- $BINDNUM += 1;
-
- $sttype = @OCIStatementType($stmt);
- if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
- return array($sql,$stmt,0,$BINDNUM, ($cursor) ? OCINewCursor($this->_connectionID) : false);
- }
- return array($sql,$stmt,0,$BINDNUM);
- }
-
- /*
- Call an oracle stored procedure and returns a cursor variable as a recordset.
- Concept by Robert Tuttle robert@ud.com
-
- Example:
- Note: we return a cursor variable in :RS2
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS2); END;",'RS2');
-
- $rs = $db->ExecuteCursor(
- "BEGIN :RS2 = adodb.getdata(:VAR1); END;",
- 'RS2',
- array('VAR1' => 'Mr Bean'));
-
- */
- function ExecuteCursor($sql,$cursorName='rs',$params=false)
- {
- if (is_array($sql)) $stmt = $sql;
- else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor
-
- if (is_array($stmt) && sizeof($stmt) >= 5) {
- $hasref = true;
- $ignoreCur = false;
- $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
- if ($params) {
- foreach($params as $k => $v) {
- $this->Parameter($stmt,$params[$k], $k);
- }
- }
- } else
- $hasref = false;
-
- $rs = $this->Execute($stmt);
- if ($rs) {
- if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
- else if ($hasref) $rs->_refcursor = $stmt[4];
- }
- return $rs;
- }
-
- /*
- Bind a variable -- very, very fast for executing repeated statements in oracle.
- Better than using
- for ($i = 0; $i < $max; $i++) {
- $p1 = ?; $p2 = ?; $p3 = ?;
- $this->Execute("insert into table (col0, col1, col2) values (:0, :1, :2)",
- array($p1,$p2,$p3));
- }
-
- Usage:
- $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");
- $DB->Bind($stmt, $p1);
- $DB->Bind($stmt, $p2);
- $DB->Bind($stmt, $p3);
- for ($i = 0; $i < $max; $i++) {
- $p1 = ?; $p2 = ?; $p3 = ?;
- $DB->Execute($stmt);
- }
-
- Some timings:
- ** Test table has 3 cols, and 1 index. Test to insert 1000 records
- Time 0.6081s (1644.60 inserts/sec) with direct OCIParse/OCIExecute
- Time 0.6341s (1577.16 inserts/sec) with ADOdb Prepare/Bind/Execute
- Time 1.5533s ( 643.77 inserts/sec) with pure SQL using Execute
-
- Now if PHP only had batch/bulk updating like Java or PL/SQL...
-
- Note that the order of parameters differs from OCIBindByName,
- because we default the names to :0, :1, :2
- */
- function Bind(&$stmt,&$var,$size=4000,$type=false,$name=false,$isOutput=false)
- {
-
- if (!is_array($stmt)) return false;
-
- if (($type == OCI_B_CURSOR) && sizeof($stmt) >= 5) {
- return OCIBindByName($stmt[1],":".$name,$stmt[4],$size,$type);
- }
-
- if ($name == false) {
- if ($type !== false) $rez = OCIBindByName($stmt[1],":".$stmt[2],$var,$size,$type);
- else $rez = OCIBindByName($stmt[1],":".$stmt[2],$var,$size); // +1 byte for null terminator
- $stmt[2] += 1;
- } else if (oci_lob_desc($type)) {
- if ($this->debug) {
- ADOConnection::outp("Bind: name = $name");
- }
- //we have to create a new Descriptor here
- $numlob = count($this->_refLOBs);
- $this->_refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
- $this->_refLOBs[$numlob]['TYPE'] = $isOutput;
-
- $tmp = $this->_refLOBs[$numlob]['LOB'];
- $rez = OCIBindByName($stmt[1], ":".$name, $tmp, -1, $type);
- if ($this->debug) {
- ADOConnection::outp("Bind: descriptor has been allocated, var (".$name.") binded");
- }
-
- // if type is input then write data to lob now
- if ($isOutput == false) {
- $var = $this->BlobEncode($var);
- $tmp->WriteTemporary($var);
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- if ($this->debug) {
- ADOConnection::outp("Bind: LOB has been written to temp");
- }
- } else {
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- }
- $rez = $tmp;
- } else {
- if ($this->debug)
- ADOConnection::outp("Bind: name = $name");
-
- if ($type !== false) $rez = OCIBindByName($stmt[1],":".$name,$var,$size,$type);
- else $rez = OCIBindByName($stmt[1],":".$name,$var,$size); // +1 byte for null terminator
- }
-
- return $rez;
- }
-
- function Param($name,$type=false)
- {
- return ':'.$name;
- }
-
- /*
- Usage:
- $stmt = $db->Prepare('select * from table where id =:myid and group=:group');
- $db->Parameter($stmt,$id,'myid');
- $db->Parameter($stmt,$group,'group');
- $db->Execute($stmt);
-
- @param $stmt Statement returned by Prepare() or PrepareSP().
- @param $var PHP variable to bind to
- @param $name Name of stored procedure variable name to bind to.
- @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8.
- @param [$maxLen] Holds an maximum length of the variable.
- @param [$type] The data type of $var. Legal values depend on driver.
-
- See OCIBindByName documentation at php.net.
- */
- function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)
- {
- if ($this->debug) {
- $prefix = ($isOutput) ? 'Out' : 'In';
- $ztype = (empty($type)) ? 'false' : $type;
- ADOConnection::outp( "{$prefix}Parameter(\$stmt, \$php_var='$var', \$name='$name', \$maxLen=$maxLen, \$type=$ztype);");
- }
- return $this->Bind($stmt,$var,$maxLen,$type,$name,$isOutput);
- }
-
- /*
- returns query ID if successful, otherwise false
- this version supports:
-
- 1. $db->execute('select * from table');
-
- 2. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- $db->execute($prepared_statement, array(1,2,3));
-
- 3. $db->execute('insert into table (a,b,c) values (:a,:b,:c)',array('a'=>1,'b'=>2,'c'=>3));
-
- 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
- $db->execute($stmt);
- */
- function _query($sql,$inputarr=false)
- {
- if (is_array($sql)) { // is prepared sql
- $stmt = $sql[1];
-
- // we try to bind to permanent array, so that OCIBindByName is persistent
- // and carried out once only - note that max array element size is 4000 chars
- if (is_array($inputarr)) {
- $bindpos = $sql[3];
- if (isset($this->_bind[$bindpos])) {
- // all tied up already
- $bindarr = $this->_bind[$bindpos];
- } else {
- // one statement to bind them all
- $bindarr = array();
- foreach($inputarr as $k => $v) {
- $bindarr[$k] = $v;
- OCIBindByName($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
- }
- $this->_bind[$bindpos] = $bindarr;
- }
- }
- } else {
- $stmt=OCIParse($this->_connectionID,$sql);
- }
-
- $this->_stmt = $stmt;
- if (!$stmt) return false;
-
- if (defined('ADODB_PREFETCH_ROWS')) @OCISetPrefetch($stmt,ADODB_PREFETCH_ROWS);
-
- if (is_array($inputarr)) {
- foreach($inputarr as $k => $v) {
- if (is_array($v)) {
- if (sizeof($v) == 2) // suggested by g.giunta@libero.
- OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]);
- else
- OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
-
- if ($this->debug==99) {
- if (is_object($v[0]))
- echo "name=:$k",' len='.$v[1],' type='.$v[2],'
';
- else
- echo "name=:$k",' var='.$inputarr[$k][0],' len='.$v[1],' type='.$v[2],'
';
-
- }
- } else {
- $len = -1;
- if ($v === ' ') $len = 1;
- if (isset($bindarr)) { // is prepared sql, so no need to ocibindbyname again
- $bindarr[$k] = $v;
- } else { // dynamic sql, so rebind every time
- OCIBindByName($stmt,":$k",$inputarr[$k],$len);
- }
- }
- }
- }
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
- if (OCIExecute($stmt,$this->_commit)) {
-//OCIInternalDebug(1);
- if (count($this -> _refLOBs) > 0) {
-
- foreach ($this -> _refLOBs as $key => $value) {
- if ($this -> _refLOBs[$key]['TYPE'] == true) {
- $tmp = $this -> _refLOBs[$key]['LOB'] -> load();
- if ($this -> debug) {
- ADOConnection::outp("OUT LOB: LOB has been loaded.
");
- }
- //$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
- $this -> _refLOBs[$key]['VAR'] = $tmp;
- } else {
- $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
- $this -> _refLOBs[$key]['LOB']->free();
- unset($this -> _refLOBs[$key]);
- if ($this->debug) {
- ADOConnection::outp("IN LOB: LOB has been saved.
");
- }
- }
- }
- }
-
- switch (@OCIStatementType($stmt)) {
- case "SELECT":
- return $stmt;
-
- case 'DECLARE':
- case "BEGIN":
- if (is_array($sql) && !empty($sql[4])) {
- $cursor = $sql[4];
- if (is_resource($cursor)) {
- $ok = OCIExecute($cursor);
- return $cursor;
- }
- return $stmt;
- } else {
- if (is_resource($stmt)) {
- OCIFreeStatement($stmt);
- return true;
- }
- return $stmt;
- }
- break;
- default :
- // ociclose -- no because it could be used in a LOB?
- return true;
- }
- }
- return false;
- }
-
- // From Oracle Whitepaper: PHP Scalability and High Availability
- function IsConnectionError($err)
- {
- switch($err) {
- case 378: /* buffer pool param incorrect */
- case 602: /* core dump */
- case 603: /* fatal error */
- case 609: /* attach failed */
- case 1012: /* not logged in */
- case 1033: /* init or shutdown in progress */
- case 1043: /* Oracle not available */
- case 1089: /* immediate shutdown in progress */
- case 1090: /* shutdown in progress */
- case 1092: /* instance terminated */
- case 3113: /* disconnect */
- case 3114: /* not connected */
- case 3122: /* closing window */
- case 3135: /* lost contact */
- case 12153: /* TNS: not connected */
- case 27146: /* fatal or instance terminated */
- case 28511: /* Lost RPC */
- return true;
- }
- return false;
- }
-
- // returns true or false
- function _close()
- {
- if (!$this->_connectionID) return;
-
- if (!$this->autoCommit) OCIRollback($this->_connectionID);
- if (count($this->_refLOBs) > 0) {
- foreach ($this ->_refLOBs as $key => $value) {
- $this->_refLOBs[$key]['LOB']->free();
- unset($this->_refLOBs[$key]);
- }
- }
- OCILogoff($this->_connectionID);
-
- $this->_stmt = false;
- $this->_connectionID = false;
- }
-
- function MetaPrimaryKeys($table, $owner=false,$internalKey=false)
- {
- if ($internalKey) return array('ROWID');
-
- // tested with oracle 8.1.7
- $table = strtoupper($table);
- if ($owner) {
- $owner_clause = "AND ((a.OWNER = b.OWNER) AND (a.OWNER = UPPER('$owner')))";
- $ptab = 'ALL_';
- } else {
- $owner_clause = '';
- $ptab = 'USER_';
- }
- $sql = "
-SELECT /*+ RULE */ distinct b.column_name
- FROM {$ptab}CONSTRAINTS a
- , {$ptab}CONS_COLUMNS b
- WHERE ( UPPER(b.table_name) = ('$table'))
- AND (UPPER(a.table_name) = ('$table') and a.constraint_type = 'P')
- $owner_clause
- AND (a.constraint_name = b.constraint_name)";
-
- $rs = $this->Execute($sql);
- if ($rs && !$rs->EOF) {
- $arr = $rs->GetArray();
- $a = array();
- foreach($arr as $v) {
- $a[] = reset($v);
- }
- return $a;
- }
- else return false;
- }
-
- // http://gis.mit.edu/classes/11.521/sqlnotes/referential_integrity.html
- function MetaForeignKeys($table, $owner=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
- if (!$owner) {
- $owner = $this->user;
- $tabp = 'user_';
- } else
- $tabp = 'all_';
-
- $owner = ' and owner='.$this->qstr(strtoupper($owner));
-
- $sql =
-"select constraint_name,r_owner,r_constraint_name
- from {$tabp}constraints
- where constraint_type = 'R' and table_name = $table $owner";
-
- $constraints = $this->GetArray($sql);
- $arr = false;
- foreach($constraints as $constr) {
- $cons = $this->qstr($constr[0]);
- $rowner = $this->qstr($constr[1]);
- $rcons = $this->qstr($constr[2]);
- $cols = $this->GetArray("select column_name from {$tabp}cons_columns where constraint_name=$cons $owner order by position");
- $tabcol = $this->GetArray("select table_name,column_name from {$tabp}cons_columns where owner=$rowner and constraint_name=$rcons order by position");
-
- if ($cols && $tabcol)
- for ($i=0, $max=sizeof($cols); $i < $max; $i++) {
- $arr[$tabcol[$i][0]] = $cols[$i][0].'='.$tabcol[$i][1];
- }
- }
- $ADODB_FETCH_MODE = $save;
-
- return $arr;
- }
-
-
- function CharMax()
- {
- return 4000;
- }
-
- function TextMax()
- {
- return 4000;
- }
-
- /**
- * Quotes a string.
- * An example is $db->qstr("Don't bother",magic_quotes_runtime());
- *
- * @param s the string to quote
- * @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc().
- * This undoes the stupidity of magic quotes for GPC.
- *
- * @return quoted string to be sent back to database
- */
- function qstr($s,$magic_quotes=false)
- {
- //$nofixquotes=false;
-
- if ($this->noNullStrings && strlen($s)==0)$s = ' ';
- if (!$magic_quotes) {
- if ($this->replaceQuote[0] == '\\'){
- $s = str_replace('\\','\\\\',$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for " unless sybase is on
- if (!ini_get('magic_quotes_sybase')) {
- $s = str_replace('\\"','"',$s);
- $s = str_replace('\\\\','\\',$s);
- return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
- } else {
- return "'".$s."'";
- }
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8 extends ADORecordSet {
-
- var $databaseType = 'oci8';
- var $bind=false;
- var $_fieldobjs;
-
- //var $_arr = false;
-
- function ADORecordset_oci8($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_NUM:
- default:
- $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- }
-
- $this->adodbFetchMode = $mode;
- $this->_queryID = $queryID;
- }
-
-
- function Init()
- {
- if ($this->_inited) return;
-
- $this->_inited = true;
- if ($this->_queryID) {
-
- $this->_currentRow = 0;
- @$this->_initrs();
- $this->EOF = !$this->_fetch();
-
- /*
- // based on idea by Gaetano Giunta to detect unusual oracle errors
- // see http://phplens.com/lens/lensforum/msgs.php?id=6771
- $err = OCIError($this->_queryID);
- if ($err && $this->connection->debug) ADOConnection::outp($err);
- */
-
- if (!is_array($this->fields)) {
- $this->_numOfRows = 0;
- $this->fields = array();
- }
- } else {
- $this->fields = array();
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
- }
-
- function _initrs()
- {
- $this->_numOfRows = -1;
- $this->_numOfFields = OCInumcols($this->_queryID);
- if ($this->_numOfFields>0) {
- $this->_fieldobjs = array();
- $max = $this->_numOfFields;
- for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i);
- }
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
-
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name =OCIcolumnname($this->_queryID, $fieldOffset);
- $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
- $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
- switch($fld->type) {
- case 'NUMBER':
- $p = OCIColumnPrecision($this->_queryID, $fieldOffset);
- $sc = OCIColumnScale($this->_queryID, $fieldOffset);
- if ($p != 0 && $sc == 0) $fld->type = 'INT';
- $fld->scale = $p;
- break;
-
- case 'CLOB':
- case 'NCLOB':
- case 'BLOB':
- $fld->max_length = -1;
- break;
- }
- return $fld;
- }
-
- /* For some reason, OCIcolumnname fails when called after _initrs() so we cache it */
- function FetchField($fieldOffset = -1)
- {
- return $this->_fieldobjs[$fieldOffset];
- }
-
-
- /*
- // 10% speedup to move MoveNext to child class
- function _MoveNext()
- {
- //global $ADODB_EXTENSION;if ($ADODB_EXTENSION) return @adodb_movenext($this);
-
- if ($this->EOF) return false;
-
- $this->_currentRow++;
- if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode))
- return true;
- $this->EOF = true;
-
- return false;
- } */
-
-
- function MoveNext()
- {
- if (@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
- /*
- # does not work as first record is retrieved in _initrs(), so is not included in GetArray()
- function GetArray($nRows = -1)
- {
- global $ADODB_OCI8_GETARRAY;
-
- if (true || !empty($ADODB_OCI8_GETARRAY)) {
- # does not support $ADODB_ANSI_PADDING_OFF
-
- //OCI_RETURN_NULLS and OCI_RETURN_LOBS is set by OCIfetchstatement
- switch($this->adodbFetchMode) {
- case ADODB_FETCH_NUM:
-
- $ncols = @OCIfetchstatement($this->_queryID, $results, 0, $nRows, OCI_FETCHSTATEMENT_BY_ROW+OCI_NUM);
- $results = array_merge(array($this->fields),$results);
- return $results;
-
- case ADODB_FETCH_ASSOC:
- if (ADODB_ASSOC_CASE != 2 || $this->databaseType != 'oci8') break;
-
- $ncols = @OCIfetchstatement($this->_queryID, $assoc, 0, $nRows, OCI_FETCHSTATEMENT_BY_ROW);
- $results = array_merge(array($this->fields),$assoc);
- return $results;
-
- default:
- break;
- }
- }
-
- $results = ADORecordSet::GetArray($nRows);
- return $results;
-
- } */
-
- /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- $arr = array();
- for ($i=1; $i < $offset; $i++)
- if (!@OCIFetch($this->_queryID)) return $arr;
-
- if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) return $arr;;
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch()
- {
- return @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
-
- function _close()
- {
- if ($this->connection->_stmt === $this->_queryID) $this->connection->_stmt = false;
- if (!empty($this->_refcursor)) {
- OCIFreeCursor($this->_refcursor);
- $this->_refcursor = false;
- }
- @OCIFreeStatement($this->_queryID);
- $this->_queryID = false;
-
- }
-
- function MetaType($t,$len=-1)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'VARCHAR2':
- case 'CHAR':
- case 'VARBINARY':
- case 'BINARY':
- case 'NCHAR':
- case 'NVARCHAR':
- case 'NVARCHAR2':
- if ($len <= $this->blobSize) return 'C';
-
- case 'NCLOB':
- case 'LONG':
- case 'LONG VARCHAR':
- case 'CLOB':
- return 'X';
-
- case 'LONG RAW':
- case 'LONG VARBINARY':
- case 'BLOB':
- return 'B';
-
- case 'DATE':
- return ($this->connection->datetime) ? 'T' : 'D';
-
-
- case 'TIMESTAMP': return 'T';
-
- case 'INT':
- case 'SMALLINT':
- case 'INTEGER':
- return 'I';
-
- default: return 'N';
- }
- }
-}
-
-class ADORecordSet_ext_oci8 extends ADORecordSet_oci8 {
- function ADORecordSet_ext_oci8($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- case ADODB_FETCH_NUM:
- default: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
- }
- $this->adodbFetchMode = $mode;
- $this->_queryID = $queryID;
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-oci805.inc.php b/src/adodb512/drivers/adodb-oci805.inc.php
deleted file mode 100644
index 6d8a202c..00000000
--- a/src/adodb512/drivers/adodb-oci805.inc.php
+++ /dev/null
@@ -1,59 +0,0 @@
-ADODB_oci8();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // seems that oracle only supports 1 hint comment in 8i
- if (strpos($sql,'/*+') !== false)
- $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
- else
- $sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql);
-
- /*
- The following is only available from 8.1.5 because order by in inline views not
- available before then...
- http://www.jlcomp.demon.co.uk/faq/top_sql.html
- if ($nrows > 0) {
- if ($offset > 0) $nrows += $offset;
- $sql = "select * from ($sql) where rownum <= $nrows";
- $nrows = -1;
- }
- */
-
- return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- }
-}
-
-class ADORecordset_oci805 extends ADORecordset_oci8 {
- var $databaseType = "oci805";
- function ADORecordset_oci805($id,$mode=false)
- {
- $this->ADORecordset_oci8($id,$mode);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-oci8po.inc.php b/src/adodb512/drivers/adodb-oci8po.inc.php
deleted file mode 100644
index 3f80db18..00000000
--- a/src/adodb512/drivers/adodb-oci8po.inc.php
+++ /dev/null
@@ -1,218 +0,0 @@
-
-
- Should some emulation of RecordCount() be implemented?
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
-
-class ADODB_oci8po extends ADODB_oci8 {
- var $databaseType = 'oci8po';
- var $dataProvider = 'oci8';
- var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
- var $metaTablesSQL = "select lower(table_name),table_type from cat where table_type in ('TABLE','VIEW')";
-
- function ADODB_oci8po()
- {
- $this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200;
- # oci8po does not support adodb extension: adodb_movenext()
- }
-
- function Param($name)
- {
- return '?';
- }
-
- function Prepare($sql,$cursor=false)
- {
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
- for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) {
- $sql .= ':'.($i-1) . $sqlarr[$i];
- }
- return ADODB_oci8::Prepare($sql,$cursor);
- }
-
- // emulate handling of parameters ? ?, replacing with :bind0 :bind1
- function _query($sql,$inputarr=false)
- {
- if (is_array($inputarr)) {
- $i = 0;
- if (is_array($sql)) {
- foreach($inputarr as $v) {
- $arr['bind'.$i++] = $v;
- }
- } else {
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
- foreach($inputarr as $k => $v) {
- $sql .= ":$k" . $sqlarr[++$i];
- }
- }
- }
- return ADODB_oci8::_query($sql,$inputarr);
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8po extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8po';
-
- function ADORecordset_oci8po($queryID,$mode=false)
- {
- $this->ADORecordset_oci8($queryID,$mode);
- }
-
- function Fields($colname)
- {
- if ($this->fetchMode & OCI_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- // lowercase field names...
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name = OCIcolumnname($this->_queryID, $fieldOffset);
- if (ADODB_ASSOC_CASE == 0) $fld->name = strtolower($fld->name);
- $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
- $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
- if ($fld->type == 'NUMBER') {
- //$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
- $sc = OCIColumnScale($this->_queryID, $fieldOffset);
- if ($sc == 0) $fld->type = 'INT';
- }
- return $fld;
- }
- /*
- function MoveNext()
- {
- if (@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $this->_currentRow += 1;
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }*/
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- global $ADODB_ANSI_PADDING_OFF;
- $this->_currentRow++;
-
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- return true;
- }
- if (!$this->EOF) {
- $this->EOF = true;
- $this->_currentRow++;
- }
- return false;
- }
-
- /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- for ($i=1; $i < $offset; $i++)
- if (!@OCIFetch($this->_queryID)) {
- $arr = array();
- return $arr;
- }
- if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $arr = array();
- return $arr;
- }
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
- // Create associative array
- function _updatefields()
- {
- if (ADODB_ASSOC_CASE == 2) return; // native
-
- $arr = array();
- $lowercase = (ADODB_ASSOC_CASE == 0);
-
- foreach($this->fields as $k => $v) {
- if (is_integer($k)) $arr[$k] = $v;
- else {
- if ($lowercase)
- $arr[strtolower($k)] = $v;
- else
- $arr[strtoupper($k)] = $v;
- }
- }
- $this->fields = $arr;
- }
-
- function _fetch()
- {
- $ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
- if ($ret) {
- global $ADODB_ANSI_PADDING_OFF;
-
- if ($this->fetchMode & OCI_ASSOC) $this->_updatefields();
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- }
- return $ret;
- }
-
-}
-
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-odbc.inc.php b/src/adodb512/drivers/adodb-odbc.inc.php
deleted file mode 100644
index 0beb4bff..00000000
--- a/src/adodb512/drivers/adodb-odbc.inc.php
+++ /dev/null
@@ -1,744 +0,0 @@
-_haserrorfunctions = ADODB_PHPVER >= 0x4050;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if ($this->debug && $argDatabasename && $this->databaseType != 'vfp') {
- ADOConnection::outp("For odbc Connect(), $argDatabasename is not used. Place dsn in 1st parameter.");
- }
- if (isset($php_errormsg)) $php_errormsg = '';
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->debug && $argDatabasename) {
- ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter.");
- }
- // print "dsn=$argDSN u=$argUsername p=$argPassword
"; flush();
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
-
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
-
- function ServerInfo()
- {
-
- if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
- $dsn = strtoupper($this->host);
- $first = true;
- $found = false;
-
- if (!function_exists('odbc_data_source')) return false;
-
- while(true) {
-
- $rez = @odbc_data_source($this->_connectionID,
- $first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT);
- $first = false;
- if (!is_array($rez)) break;
- if (strtoupper($rez['server']) == $dsn) {
- $found = true;
- break;
- }
- }
- if (!$found) return ADOConnection::ServerInfo();
- if (!isset($rez['version'])) $rez['version'] = '';
- return $rez;
- } else {
- return ADOConnection::ServerInfo();
- }
- }
-
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- $start -= 1;
- return $this->Execute("insert into $seqname values($start)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- while (--$MAXLOOPS>=0) {
- $num = $this->GetOne("select id from $seq");
- if ($num === false) {
- $this->Execute(sprintf($this->_genSeqSQL ,$seq));
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into $seq values($start)");
- if (!$ok) return false;
- }
- $this->Execute("update $seq set id=id+1 where id=$num");
-
- if ($this->affected_rows() > 0) {
- $num += 1;
- $this->genID = $num;
- return $num;
- } elseif ($this->affected_rows() == 0) {
- // some drivers do not return a valid value => try with another method
- $value = $this->GetOne("select id from $seq");
- if ($value == $num + 1) {
- return $value;
- }
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @odbc_errormsg();
- return @odbc_errormsg($this->_connectionID);
- } else return ADOConnection::ErrorMsg();
- }
-
- function ErrorNo()
- {
-
- if ($this->_haserrorfunctions) {
- if ($this->_errorCode !== false) {
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
- }
-
- if (empty($this->_connectionID)) $e = @odbc_error();
- else $e = @odbc_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- if (strlen($e)<=2) return 0;
- return $e;
- } else return ADOConnection::ErrorNo();
- }
-
-
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- return odbc_autocommit($this->_connectionID,false);
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_commit($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_rollback($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function MetaPrimaryKeys($table)
- {
- global $ADODB_FETCH_MODE;
-
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = @odbc_primarykeys($this->_connectionID,'',$schema,$table);
-
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- $rs->Close();
- //print_r($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
-
-
- function MetaTables($ttype=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID);
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcdatetime_data_type_changes.asp
-/ SQL data type codes /
-#define SQL_UNKNOWN_TYPE 0
-#define SQL_CHAR 1
-#define SQL_NUMERIC 2
-#define SQL_DECIMAL 3
-#define SQL_INTEGER 4
-#define SQL_SMALLINT 5
-#define SQL_FLOAT 6
-#define SQL_REAL 7
-#define SQL_DOUBLE 8
-#if (ODBCVER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (ODBCVER >= 0x0300)
-#define SQL_TYPE_DATE 91
-#define SQL_TYPE_TIME 92
-#define SQL_TYPE_TIMESTAMP 93
-
-#define SQL_UNICODE (-95)
-#define SQL_UNICODE_VARCHAR (-96)
-#define SQL_UNICODE_LONGVARCHAR (-97)
-*/
- function ODBCTypes($t)
- {
- switch ((integer)$t) {
- case 1:
- case 12:
- case 0:
- case -95:
- case -96:
- return 'C';
- case -97:
- case -1: //text
- return 'X';
- case -4: //image
- return 'B';
-
- case 9:
- case 91:
- return 'D';
-
- case 10:
- case 11:
- case 92:
- case 93:
- return 'T';
-
- case 4:
- case 5:
- case -6:
- return 'I';
-
- case -11: // uniqidentifier
- return 'R';
- case -7: //bit
- return 'L';
-
- default:
- return 'N';
- }
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- /*if (false) { // after testing, confirmed that the following does not work becoz of a bug
- $qid2 = odbc_tables($this->_connectionID);
- $rs = new ADORecordSet_odbc($qid2);
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- while (!$rs->EOF) {
- if ($table == strtoupper($rs->fields[2])) {
- $q = $rs->fields[0];
- $o = $rs->fields[1];
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
-
- $qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
- } */
-
- switch ($this->databaseType) {
- case 'access':
- case 'vfp':
- $qid = odbc_columns($this->_connectionID);#,'%','',strtoupper($table),'%');
- break;
-
-
- case 'db2':
- $colname = "%";
- $qid = odbc_columns($this->_connectionID, "", $schema, $table, $colname);
- break;
-
- default:
- $qid = @odbc_columns($this->_connectionID,'%','%',strtoupper($table),'%');
- if (empty($qid)) $qid = odbc_columns($this->_connectionID);
- break;
- }
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- $retarr = array();
-
- /*
- $rs->fields indices
- 0 TABLE_QUALIFIER
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 DATA_TYPE
- 5 TYPE_NAME
- 6 PRECISION
- 7 LENGTH
- 8 SCALE
- 9 RADIX
- 10 NULLABLE
- 11 REMARKS
- */
- while (!$rs->EOF) {
- // adodb_pr($rs->fields);
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->ODBCTypes($rs->fields[4]);
-
- // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
- // access uses precision to store length for char/varchar
- if ($fld->type == 'C' or $fld->type == 'X') {
- if ($this->databaseType == 'access')
- $fld->max_length = $rs->fields[6];
- else if ($rs->fields[4] <= -95) // UNICODE
- $fld->max_length = $rs->fields[7]/2;
- else
- $fld->max_length = $rs->fields[7];
- } else
- $fld->max_length = $rs->fields[7];
- $fld->not_null = !empty($rs->fields[10]);
- $fld->scale = $rs->fields[8];
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close(); //-- crashes 4.03pl1 -- why?
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = odbc_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether odbc driver is parsing prepared stmts, so just return sql
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- GLOBAL $php_errormsg;
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_error = '';
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = odbc_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! odbc_execute($stmtid,$inputarr)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!odbc_execute($stmtid)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
- } else
- $stmtid = odbc_exec($this->_connectionID,$sql);
-
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- if (@odbc_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = odbc_num_rows($stmtid);
- $stmtid = true;
- } else {
- $this->_lastAffectedRows = 0;
- odbc_binmode($stmtid,$this->binmode);
- odbc_longreadlen($stmtid,$this->maxblobsize);
- }
-
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- } else {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- }
- return $stmtid;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @odbc_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_odbc extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "odbc";
- var $dataProvider = "odbc";
- var $useFetchArray;
- var $_has_stupid_odbc_fetch_api_change;
-
- function ADORecordSet_odbc($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
-
- // the following is required for mysql odbc driver in 4.3.1 -- why?
- $this->EOF = false;
- $this->_currentRow = -1;
- //$this->ADORecordSet($id);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1)
- {
-
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $o->name = @odbc_field_name($this->_queryID,$off);
- $o->type = @odbc_field_type($this->_queryID,$off);
- $o->max_length = @odbc_field_len($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @odbc_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @odbc_num_fields($this->_queryID);
- // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
- if ($this->_numOfRows == 0) $this->_numOfRows = -1;
- //$this->useFetchArray = $this->connection->useFetchArray;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $rs = $this->GetArray($nrows);
- return $rs;
- }
- $savem = $this->fetchMode;
- $this->fetchMode = ADODB_FETCH_NUM;
- $this->Move($offset);
- $this->fetchMode = $savem;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- }
-
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- function MoveNext()
- {
- if ($this->_numOfRows != 0 && !$this->EOF) {
- $this->_currentRow++;
-
- if ($this->_has_stupid_odbc_fetch_api_change)
- $rez = @odbc_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- }
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
-
- if ($this->_has_stupid_odbc_fetch_api_change)
- $rez = @odbc_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- }
- return true;
- }
- $this->fields = false;
- return false;
- }
-
- function _close()
- {
- return @odbc_free_result($this->_queryID);
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-odbc_db2.inc.php b/src/adodb512/drivers/adodb-odbc_db2.inc.php
deleted file mode 100644
index 8bec473c..00000000
--- a/src/adodb512/drivers/adodb-odbc_db2.inc.php
+++ /dev/null
@@ -1,368 +0,0 @@
-curMode = SQL_CUR_USE_ODBC;
-$db->Connect($dsn, $userid, $pwd);
-
-
-
-USING CLI INTERFACE
-===================
-
-I have had reports that the $host and $database params have to be reversed in
-Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum.hu:
-
-> The symptom is that if I change the database engine from postgres or any other to DB2 then the following
-> connection command becomes wrong despite being described this version to be correct in the docs.
->
-> $connection_object->Connect( $DATABASE_HOST, $DATABASE_AUTH_USER_NAME, $DATABASE_AUTH_PASSWORD, $DATABASE_NAME )
->
-> In case of DB2 I had to swap the first and last arguments in order to connect properly.
-
-
-System Error 5
-==============
-IF you get a System Error 5 when trying to Connect/Load, it could be a permission problem. Give the user connecting
-to DB2 full rights to the DB2 SQLLIB directory, and place the user in the DBUSERS group.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (!defined('_ADODB_ODBC_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-if (!defined('ADODB_ODBC_DB2')){
-define('ADODB_ODBC_DB2',1);
-
-class ADODB_ODBC_DB2 extends ADODB_odbc {
- var $databaseType = "db2";
- var $concat_operator = '||';
- var $sysTime = 'CURRENT TIME';
- var $sysDate = 'CURRENT DATE';
- var $sysTimeStamp = 'CURRENT TIMESTAMP';
- // The complete string representation of a timestamp has the form
- // yyyy-mm-dd-hh.mm.ss.nnnnnn.
- var $fmtTimeStamp = "'Y-m-d-H.i.s'";
- var $ansiOuter = true;
- var $identitySQL = 'values IDENTITY_VAL_LOCAL()';
- var $_bindInputArray = true;
- var $hasInsertID = true;
- var $rsPrefix = 'ADORecordset_odbc_';
-
- function ADODB_DB2()
- {
- if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
- $this->ADODB_odbc();
- }
-
- function IfNull( $field, $ifNull )
- {
- return " COALESCE($field, $ifNull) "; // if DB2 UDB
- }
-
- function ServerInfo()
- {
- //odbc_setoption($this->_connectionID,1,101 /*SQL_ATTR_ACCESS_MODE*/, 1 /*SQL_MODE_READ_ONLY*/);
- $vers = $this->GetOne('select versionnumber from sysibm.sysversions');
- //odbc_setoption($this->_connectionID,1,101, 0 /*SQL_MODE_READ_WRITE*/);
- return array('description'=>'DB2 ODBC driver', 'version'=>$vers);
- }
-
- function _insertid()
- {
- return $this->GetOne($this->identitySQL);
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($this->_autocommit) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- function MetaTables($ttype=false,$showSchema=false, $qtable="%", $qschema="%")
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID, "", $qschema, $qtable, "");
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
-
- if (!$arr[$i][2]) continue;
- if (strncmp($arr[$i][1],'SYS',3) === 0) continue;
-
- $type = $arr[$i][3];
-
- if ($showSchema) $arr[$i][2] = $arr[$i][1].'.'.$arr[$i][2];
-
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'T',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'S',1) !== 0) $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $false = false;
- // get index details
- $table = strtoupper($table);
- $SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
- if ($primary)
- $SQL.= " AND UNIQUERULE='P'";
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $indexes = array ();
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 'U' || $row[1] == 'P'),
- 'columns' => array()
- );
- $cols = ltrim($row[2],'+');
- $indexes[$row[0]]['columns'] = explode('+', $cols);
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- // use right() and replace() ?
- if (!$col) $col = $this->sysDate;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '||';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "char(year($col))";
- break;
- case 'M':
- $s .= "substr(monthname($col),1,3)";
- break;
- case 'm':
- $s .= "right(digits(month($col)),2)";
- break;
- case 'D':
- case 'd':
- $s .= "right(digits(day($col)),2)";
- break;
- case 'H':
- case 'h':
- if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";
- else $s .= "''";
- break;
- case 'i':
- case 'I':
- if ($col != $this->sysDate)
- $s .= "right(digits(minute($col)),2)";
- else $s .= "''";
- break;
- case 'S':
- case 's':
- if ($col != $this->sysDate)
- $s .= "right(digits(second($col)),2)";
- else $s .= "''";
- break;
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- }
- }
- return $s;
- }
-
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false)
- {
- $nrows = (integer) $nrows;
- if ($offset <= 0) {
- // could also use " OPTIMIZE FOR $nrows ROWS "
- if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- $rs = $this->Execute($sql,$inputArr);
- } else {
- if ($offset > 0 && $nrows < 0);
- else {
- $nrows += $offset;
- $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- }
- $rs = ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
- }
-
- return $rs;
- }
-
-};
-
-
-class ADORecordSet_odbc_db2 extends ADORecordSet_odbc {
-
- var $databaseType = "db2";
-
- function ADORecordSet_db2($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'CHAR':
- case 'CHARACTER':
- case 'C':
- if ($len <= $this->blobSize) return 'C';
-
- case 'LONGCHAR':
- case 'TEXT':
- case 'CLOB':
- case 'DBCLOB': // double-byte
- case 'X':
- return 'X';
-
- case 'BLOB':
- case 'GRAPHIC':
- case 'VARGRAPHIC':
- return 'B';
-
- case 'DATE':
- case 'D':
- return 'D';
-
- case 'TIME':
- case 'TIMESTAMP':
- case 'T':
- return 'T';
-
- //case 'BOOLEAN':
- //case 'BIT':
- // return 'L';
-
- //case 'COUNTER':
- // return 'R';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'SMALLINT':
- case 'I':
- return 'I';
-
- default: return 'N';
- }
- }
-}
-
-} //define
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-odbc_mssql.inc.php b/src/adodb512/drivers/adodb-odbc_mssql.inc.php
deleted file mode 100644
index fe473410..00000000
--- a/src/adodb512/drivers/adodb-odbc_mssql.inc.php
+++ /dev/null
@@ -1,307 +0,0 @@
- 'master'";
- var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
- var $metaColumnsSQL = "select c.name,t.name,c.length from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
- var $hasTop = 'top'; // support mssql/interbase SELECT TOP 10 * FROM TABLE
- var $sysDate = 'GetDate()';
- var $sysTimeStamp = 'GetDate()';
- var $leftOuter = '*=';
- var $rightOuter = '=*';
- var $substr = 'substring';
- var $length = 'len';
- var $ansiOuter = true; // for mssql7 or later
- var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000
- var $hasInsertID = true;
- var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON,
- # concatenating a null value with a string yields a NULL result
-
- function ADODB_odbc_mssql()
- {
- $this->ADODB_odbc();
- //$this->curmode = SQL_CUR_USE_ODBC;
- }
-
- // crashes php...
- function ServerInfo()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $row = $this->GetRow("execute sp_server_info 2");
- $ADODB_FETCH_MODE = $save;
- if (!is_array($row)) return false;
- $arr['description'] = $row[2];
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
-"select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where upper(object_name(fkeyid)) = $table
-order by constraint_name, referenced_table_name, keyno";
-
- $constraints = $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {$this->debug=1;
- $save = $this->metaTablesSQL;
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $arr = ADOConnection::MetaColumns($table);
- return $arr;
- }
-
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_odbc::_query($sql,$inputarr);
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- // "Stein-Aksel Basma"
- // tested with MSSQL 2000
- function MetaPrimaryKeys($table)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = '';
- $this->_findschema($table,$schema);
- //if (!$schema) $schema = $this->database;
- if ($schema) $schema = "and k.table_catalog like '$schema%'";
-
- $sql = "select distinct k.column_name,ordinal_position from information_schema.key_column_usage k,
- information_schema.table_constraints tc
- where tc.constraint_name = k.constraint_name and tc.constraint_type =
- 'PRIMARY KEY' and k.table_name = '$table' $schema order by ordinal_position ";
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $a = $this->GetCol($sql);
- $ADODB_FETCH_MODE = $savem;
-
- if ($a && sizeof($a)>0) return $a;
- $false = false;
- return $false;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- if ($nrows > 0 && $offset <= 0) {
- $sql = preg_replace(
- '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop." $nrows ",$sql);
- $rs = $this->Execute($sql,$inputarr);
- } else
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
-
- return $rs;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yyyy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(quarter,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "replace(str(day($col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
-}
-
-class ADORecordSet_odbc_mssql extends ADORecordSet_odbc {
-
- var $databaseType = 'odbc_mssql';
-
- function ADORecordSet_odbc_mssql($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-odbc_oracle.inc.php b/src/adodb512/drivers/adodb-odbc_oracle.inc.php
deleted file mode 100644
index 7c2c77f8..00000000
--- a/src/adodb512/drivers/adodb-odbc_oracle.inc.php
+++ /dev/null
@@ -1,115 +0,0 @@
-ADODB_odbc();
- }
-
- function MetaTables()
- {
- $false = false;
- $rs = $this->Execute($this->metaTablesSQL);
- if ($rs === false) return $false;
- $arr = $rs->GetArray();
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- $arr2[] = $arr[$i][0];
- }
- $rs->Close();
- return $arr2;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
- if ($rs === false) {
- $false = false;
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
-
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- $php_errormsg = '';
- $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
- $this->_errorMsg = $php_errormsg;
-
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
- //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
- return $this->_connectionID != false;
- }
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
- $php_errormsg = '';
- $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC );
- $this->_errorMsg = $php_errormsg;
-
- $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
- //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
- return $this->_connectionID != false;
- }
-}
-
-class ADORecordSet_odbc_oracle extends ADORecordSet_odbc {
-
- var $databaseType = 'odbc_oracle';
-
- function ADORecordSet_odbc_oracle($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-odbtp.inc.php b/src/adodb512/drivers/adodb-odbtp.inc.php
deleted file mode 100644
index 2c7b1247..00000000
--- a/src/adodb512/drivers/adodb-odbtp.inc.php
+++ /dev/null
@@ -1,839 +0,0 @@
-
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-define("_ADODB_ODBTP_LAYER", 2 );
-
-class ADODB_odbtp extends ADOConnection{
- var $databaseType = "odbtp";
- var $dataProvider = "odbtp";
- var $fmtDate = "'Y-m-d'";
- var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
- var $replaceQuote = "''"; // string to use to replace quotes
- var $odbc_driver = 0;
- var $hasAffectedRows = true;
- var $hasInsertID = false;
- var $hasGenID = true;
- var $hasMoveFirst = true;
-
- var $_genSeqSQL = "create table %s (seq_name char(30) not null unique , seq_value integer not null)";
- var $_dropSeqSQL = "delete from adodb_seq where seq_name = '%s'";
- var $_bindInputArray = false;
- var $_useUnicodeSQL = false;
- var $_canPrepareSP = false;
- var $_dontPoolDBC = true;
-
- function ADODB_odbtp()
- {
- }
-
- function ServerInfo()
- {
- return array('description' => @odbtp_get_attr( ODB_ATTR_DBMSNAME, $this->_connectionID),
- 'version' => @odbtp_get_attr( ODB_ATTR_DBMSVER, $this->_connectionID));
- }
-
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @odbtp_last_error();
- return @odbtp_last_error($this->_connectionID);
- }
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
- if (empty($this->_connectionID)) return @odbtp_last_error_state();
- return @odbtp_last_error_state($this->_connectionID);
- }
-/*
- function DBDate($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
- if ($isfld) return "convert(date, $d, 120)";
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
- $d = adodb_date($this->fmtDate,$d);
- return "convert(date, $d, 120)";
- }
-
- function DBTimeStamp($d,$isfld=false)
- {
- if (empty($d) && $d !== 0) return 'null';
- if ($isfld) return "convert(datetime, $d, 120)";
-
- if (is_string($d)) $d = ADORecordSet::UnixDate($d);
- $d = adodb_date($this->fmtDate,$d);
- return "convert(datetime, $d, 120)";
- }
-*/
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
- function _affectedrows()
- {
- if ($this->_queryID) {
- return @odbtp_affected_rows ($this->_queryID);
- } else
- return 0;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- //verify existence
- $num = $this->GetOne("select seq_value from adodb_seq");
- $seqtab='adodb_seq';
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO ) {
- $path = @odbtp_get_attr( ODB_ATTR_DATABASENAME, $this->_connectionID );
- //if using vfp dbc file
- if( !strcasecmp(strrchr($path, '.'), '.dbc') )
- $path = substr($path,0,strrpos($path,'\/'));
- $seqtab = $path . '/' . $seqtab;
- }
- if($num == false) {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL ,$seqtab));
- }
- $num = $this->GetOne("select seq_value from adodb_seq where seq_name='$seqname'");
- if ($num) {
- return false;
- }
- $start -= 1;
- return $this->Execute("insert into adodb_seq values('$seqname',$start)");
- }
-
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- function GenID($seq='adodbseq',$start=1)
- {
- $seqtab='adodb_seq';
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO) {
- $path = @odbtp_get_attr( ODB_ATTR_DATABASENAME, $this->_connectionID );
- //if using vfp dbc file
- if( !strcasecmp(strrchr($path, '.'), '.dbc') )
- $path = substr($path,0,strrpos($path,'\/'));
- $seqtab = $path . '/' . $seqtab;
- }
- $MAXLOOPS = 100;
- while (--$MAXLOOPS>=0) {
- $num = $this->GetOne("select seq_value from adodb_seq where seq_name='$seq'");
- if ($num === false) {
- //verify if abodb_seq table exist
- $ok = $this->GetOne("select seq_value from adodb_seq ");
- if(!$ok) {
- //creating the sequence table adodb_seq
- $this->Execute(sprintf($this->_genSeqSQL ,$seqtab));
- }
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into adodb_seq values('$seq',$start)");
- if (!$ok) return false;
- }
- $ok = $this->Execute("update adodb_seq set seq_value=seq_value+1 where seq_name='$seq'");
- if($ok) {
- $num += 1;
- $this->genID = $num;
- return $num;
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- //example for $UserOrDSN
- //for visual fox : DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=c:\YourDbfFileDir;EXCLUSIVE=NO;
- //for visual fox dbc: DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBC;SOURCEDB=c:\YourDbcFileDir\mydb.dbc;EXCLUSIVE=NO;
- //for access : DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\path_to_access_db\base_test.mdb;UID=root;PWD=;
- //for mssql : DRIVER={SQL Server};SERVER=myserver;UID=myuid;PWD=mypwd;DATABASE=OdbtpTest;
- //if uid & pwd can be separate
- function _connect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
- {
- if ($argPassword && stripos($UserOrDSN,'DRIVER=') !== false) {
- $this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN.';PWD='.$argPassword);
- } else
- $this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN,$argPassword,$argDatabase);
- if ($this->_connectionID === false) {
- $this->_errorMsg = $this->ErrorMsg() ;
- return false;
- }
-
- odbtp_convert_datetime($this->_connectionID,true);
-
- if ($this->_dontPoolDBC) {
- if (function_exists('odbtp_dont_pool_dbc'))
- @odbtp_dont_pool_dbc($this->_connectionID);
- }
- else {
- $this->_dontPoolDBC = true;
- }
- $this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
- $dbms = strtolower(@odbtp_get_attr(ODB_ATTR_DBMSNAME, $this->_connectionID));
- $this->odbc_name = $dbms;
-
- // Account for inconsistent DBMS names
- if( $this->odbc_driver == ODB_DRIVER_ORACLE )
- $dbms = 'oracle';
- else if( $this->odbc_driver == ODB_DRIVER_SYBASE )
- $dbms = 'sybase';
-
- // Set DBMS specific attributes
- switch( $dbms ) {
- case 'microsoft sql server':
- $this->databaseType = 'odbtp_mssql';
- $this->fmtDate = "'Y-m-d'";
- $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
- $this->sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
- $this->sysTimeStamp = 'GetDate()';
- $this->ansiOuter = true;
- $this->leftOuter = '*=';
- $this->rightOuter = '=*';
- $this->hasTop = 'top';
- $this->hasInsertID = true;
- $this->hasTransactions = true;
- $this->_bindInputArray = true;
- $this->_canSelectDb = true;
- $this->substr = "substring";
- $this->length = 'len';
- $this->identitySQL = 'select SCOPE_IDENTITY()';
- $this->metaDatabasesSQL = "select name from master..sysdatabases where name <> 'master'";
- $this->_canPrepareSP = true;
- break;
- case 'access':
- $this->databaseType = 'odbtp_access';
- $this->fmtDate = "#Y-m-d#";
- $this->fmtTimeStamp = "#Y-m-d h:i:sA#";
- $this->sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
- $this->sysTimeStamp = 'NOW';
- $this->hasTop = 'top';
- $this->hasTransactions = false;
- $this->_canPrepareSP = true; // For MS Access only.
- break;
- case 'visual foxpro':
- $this->databaseType = 'odbtp_vfp';
- $this->fmtDate = "{^Y-m-d}";
- $this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
- $this->sysDate = 'date()';
- $this->sysTimeStamp = 'datetime()';
- $this->ansiOuter = true;
- $this->hasTop = 'top';
- $this->hasTransactions = false;
- $this->replaceQuote = "'+chr(39)+'";
- $this->true = '.T.';
- $this->false = '.F.';
-
- break;
- case 'oracle':
- $this->databaseType = 'odbtp_oci8';
- $this->fmtDate = "'Y-m-d 00:00:00'";
- $this->fmtTimeStamp = "'Y-m-d h:i:sA'";
- $this->sysDate = 'TRUNC(SYSDATE)';
- $this->sysTimeStamp = 'SYSDATE';
- $this->hasTransactions = true;
- $this->_bindInputArray = true;
- $this->concat_operator = '||';
- break;
- case 'sybase':
- $this->databaseType = 'odbtp_sybase';
- $this->fmtDate = "'Y-m-d'";
- $this->fmtTimeStamp = "'Y-m-d H:i:s'";
- $this->sysDate = 'GetDate()';
- $this->sysTimeStamp = 'GetDate()';
- $this->leftOuter = '*=';
- $this->rightOuter = '=*';
- $this->hasInsertID = true;
- $this->hasTransactions = true;
- $this->identitySQL = 'select SCOPE_IDENTITY()';
- break;
- default:
- $this->databaseType = 'odbtp';
- if( @odbtp_get_attr(ODB_ATTR_TXNCAPABLE, $this->_connectionID) )
- $this->hasTransactions = true;
- else
- $this->hasTransactions = false;
- }
- @odbtp_set_attr(ODB_ATTR_FULLCOLINFO, TRUE, $this->_connectionID );
-
- if ($this->_useUnicodeSQL )
- @odbtp_set_attr(ODB_ATTR_UNICODESQL, TRUE, $this->_connectionID);
-
- return true;
- }
-
- function _pconnect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
- {
- $this->_dontPoolDBC = false;
- return $this->_connect($HostOrInterface, $UserOrDSN, $argPassword, $argDatabase);
- }
-
- function SelectDB($dbName)
- {
- if (!@odbtp_select_db($dbName, $this->_connectionID)) {
- return false;
- }
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- return true;
- }
-
- function MetaTables($ttype='',$showSchema=false,$mask=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savefm = $this->SetFetchMode(false);
-
- $arr = $this->GetArray("||SQLTables||||$ttype");
-
- if (isset($savefm)) $this->SetFetchMode($savefm);
- $ADODB_FETCH_MODE = $savem;
-
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3] == 'SYSTEM TABLE' ) continue;
- if ($arr[$i][2])
- $arr2[] = $showSchema && $arr[$i][1]? $arr[$i][1].'.'.$arr[$i][2] : $arr[$i][2];
- }
- return $arr2;
- }
-
- function MetaColumns($table,$upper=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
- if ($upper) $table = strtoupper($table);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savefm = $this->SetFetchMode(false);
-
- $rs = $this->Execute( "||SQLColumns||$schema|$table" );
-
- if (isset($savefm)) $this->SetFetchMode($savefm);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs || $rs->EOF) {
- $false = false;
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) {
- //print_r($rs->fields);
- if (strtoupper($rs->fields[2]) == $table) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $rs->fields[5];
- $fld->max_length = $rs->fields[6];
- $fld->not_null = !empty($rs->fields[9]);
- $fld->scale = $rs->fields[7];
- if (isset($rs->fields[12])) // vfp does not have field 12
- if (!is_null($rs->fields[12])) {
- $fld->has_default = true;
- $fld->default_value = $rs->fields[12];
- }
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (!empty($retarr))
- break;
- $rs->MoveNext();
- }
- $rs->Close();
-
- return $retarr;
- }
-
- function MetaPrimaryKeys($table, $owner='')
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $arr = $this->GetArray("||SQLPrimaryKeys||$owner|$table");
- $ADODB_FETCH_MODE = $savem;
-
- //print_r($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
- function MetaForeignKeys($table, $owner='', $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $constraints = $this->GetArray("||SQLForeignKeys|||||$owner|$table");
- $ADODB_FETCH_MODE = $savem;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[11]][$constr[2]][] = $constr[7].'='.$constr[3];
- }
- if (!$arr) {
- $false = false;
- return $false;
- }
-
- $arr2 = array();
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- if (defined('ODB_TXN_DEFAULT'))
- $txn = ODB_TXN_DEFAULT;
- else
- $txn = ODB_TXN_READUNCOMMITTED;
- $rs = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS,$txn,$this->_connectionID);
- if(!$rs) return false;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->autoCommit = true;
- if( ($ret = @odbtp_commit($this->_connectionID)) )
- $ret = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS, ODB_TXN_NONE, $this->_connectionID);//set transaction off
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->autoCommit = true;
- if( ($ret = @odbtp_rollback($this->_connectionID)) )
- $ret = @odbtp_set_attr(ODB_ATTR_TRANSACTIONS, ODB_TXN_NONE, $this->_connectionID);//set transaction off
- return $ret;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- // TOP requires ORDER BY for Visual FoxPro
- if( $this->odbc_driver == ODB_DRIVER_FOXPRO ) {
- if (!preg_match('/ORDER[ \t\r\n]+BY/is',$sql)) $sql .= ' ORDER BY 1';
- }
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $stmt = @odbtp_prepare($sql,$this->_connectionID);
- if (!$stmt) {
- // print "Prepare Error for ($sql) ".$this->ErrorMsg()."
";
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- function PrepareSP($sql)
- {
- if (!$this->_canPrepareSP) return $sql; // Can't prepare procedures
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $stmt = @odbtp_prepare_proc($sql,$this->_connectionID);
- if (!$stmt) return false;
- return array($sql,$stmt);
- }
-
- /*
- Usage:
- $stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group
-
- # note that the parameter does not have @ in front!
- $db->Parameter($stmt,$id,'myid');
- $db->Parameter($stmt,$group,'group',false,64);
- $db->Parameter($stmt,$group,'photo',false,100000,ODB_BINARY);
- $db->Execute($stmt);
-
- @param $stmt Statement returned by Prepare() or PrepareSP().
- @param $var PHP variable to bind to. Can set to null (for isNull support).
- @param $name Name of stored procedure variable name to bind to.
- @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in odbtp.
- @param [$maxLen] Holds an maximum length of the variable.
- @param [$type] The data type of $var. Legal values depend on driver.
-
- See odbtp_attach_param documentation at http://odbtp.sourceforge.net.
- */
- function Parameter(&$stmt, &$var, $name, $isOutput=false, $maxLen=0, $type=0)
- {
- if ( $this->odbc_driver == ODB_DRIVER_JET ) {
- $name = '['.$name.']';
- if( !$type && $this->_useUnicodeSQL
- && @odbtp_param_bindtype($stmt[1], $name) == ODB_CHAR )
- {
- $type = ODB_WCHAR;
- }
- }
- else {
- $name = '@'.$name;
- }
- return @odbtp_attach_param($stmt[1], $name, $var, $type, $maxLen);
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
-
- function UpdateBlob($table,$column,$val,$where,$blobtype='image')
- {
- $sql = "UPDATE $table SET $column = ? WHERE $where";
- if( !($stmt = @odbtp_prepare($sql, $this->_connectionID)) )
- return false;
- if( !@odbtp_input( $stmt, 1, ODB_BINARY, 1000000, $blobtype ) )
- return false;
- if( !@odbtp_set( $stmt, 1, $val ) )
- return false;
- return @odbtp_execute( $stmt ) != false;
- }
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- switch ( $this->odbc_driver) {
- case ODB_DRIVER_MSSQL:
- return $this->MetaIndexes_mssql($table, $primary);
- default:
- return array();
- }
- }
-
- function MetaIndexes_mssql($table,$primary=false, $owner = false)
- {
- $table = strtolower($this->qstr($table));
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND lower(O.Name) = $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if ($primary && !$row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function IfNull( $field, $ifNull )
- {
- switch( $this->odbc_driver ) {
- case ODB_DRIVER_MSSQL:
- return " ISNULL($field, $ifNull) ";
- case ODB_DRIVER_JET:
- return " IIF(IsNull($field), $ifNull, $field) ";
- }
- return " CASE WHEN $field is null THEN $ifNull ELSE $field END ";
- }
-
- function _query($sql,$inputarr=false)
- {
- global $php_errormsg;
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = @odbtp_prepare($sql,$this->_connectionID);
- if ($stmtid == false) {
- $this->_errorMsg = $php_errormsg;
- return false;
- }
- }
- $num_params = @odbtp_num_params( $stmtid );
- /*
- for( $param = 1; $param <= $num_params; $param++ ) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $inputarr[$param-1] );
- }*/
-
- $param = 1;
- foreach($inputarr as $v) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $v );
- $param += 1;
- if ($param > $num_params) break;
- }
-
- if (!@odbtp_execute($stmtid) ) {
- return false;
- }
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!@odbtp_execute($stmtid)) {
- return false;
- }
- } else {
- $stmtid = odbtp_query($sql,$this->_connectionID);
- }
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- $this->_lastAffectedRows = @odbtp_affected_rows($stmtid);
- }
- return $stmtid;
- }
-
- function _close()
- {
- $ret = @odbtp_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-}
-
-class ADORecordSet_odbtp extends ADORecordSet {
-
- var $databaseType = 'odbtp';
- var $canSeek = true;
-
- function ADORecordSet_odbtp($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function _initrs()
- {
- $this->_numOfFields = @odbtp_num_fields($this->_queryID);
- if (!($this->_numOfRows = @odbtp_num_rows($this->_queryID)))
- $this->_numOfRows = -1;
-
- if (!$this->connection->_useUnicodeSQL) return;
-
- if ($this->connection->odbc_driver == ODB_DRIVER_JET) {
- if (!@odbtp_get_attr(ODB_ATTR_MAPCHARTOWCHAR,
- $this->connection->_connectionID))
- {
- for ($f = 0; $f < $this->_numOfFields; $f++) {
- if (@odbtp_field_bindtype($this->_queryID, $f) == ODB_CHAR)
- @odbtp_bind_field($this->_queryID, $f, ODB_WCHAR);
- }
- }
- }
- }
-
- function FetchField($fieldOffset = 0)
- {
- $off=$fieldOffset; // offsets begin at 0
- $o= new ADOFieldObject();
- $o->name = @odbtp_field_name($this->_queryID,$off);
- $o->type = @odbtp_field_type($this->_queryID,$off);
- $o->max_length = @odbtp_field_length($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- function _seek($row)
- {
- return @odbtp_data_seek($this->_queryID, $row);
- }
-
- function fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $name = @odbtp_field_name( $this->_queryID, $i );
- $this->bind[strtoupper($name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _fetch_odbtp($type=0)
- {
- switch ($this->fetchMode) {
- case ADODB_FETCH_NUM:
- $this->fields = @odbtp_fetch_row($this->_queryID, $type);
- break;
- case ADODB_FETCH_ASSOC:
- $this->fields = @odbtp_fetch_assoc($this->_queryID, $type);
- break;
- default:
- $this->fields = @odbtp_fetch_array($this->_queryID, $type);
- }
- if ($this->databaseType = 'odbtp_vfp') {
- if ($this->fields)
- foreach($this->fields as $k => $v) {
- if (strncmp($v,'1899-12-30',10) == 0) $this->fields[$k] = '';
- }
- }
- return is_array($this->fields);
- }
-
- function _fetch()
- {
- return $this->_fetch_odbtp();
- }
-
- function MoveFirst()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_FIRST)) return false;
- $this->EOF = false;
- $this->_currentRow = 0;
- return true;
- }
-
- function MoveLast()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_LAST)) return false;
- $this->EOF = false;
- $this->_currentRow = $this->_numOfRows - 1;
- return true;
- }
-
- function NextRecordSet()
- {
- if (!@odbtp_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- function _close()
- {
- return @odbtp_free_query($this->_queryID);
- }
-}
-
-class ADORecordSet_odbtp_mssql extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_mssql';
-
- function ADORecordSet_odbtp_mssql($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_access extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_access';
-
- function ADORecordSet_odbtp_access($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_vfp extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_vfp';
-
- function ADORecordSet_odbtp_vfp($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_oci8 extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_oci8';
-
- function ADORecordSet_odbtp_oci8($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_sybase extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_sybase';
-
- function ADORecordSet_odbtp_sybase($id,$mode=false)
- {
- return $this->ADORecordSet_odbtp($id,$mode);
- }
-}
-?>
diff --git a/src/adodb512/drivers/adodb-odbtp_unicode.inc.php b/src/adodb512/drivers/adodb-odbtp_unicode.inc.php
deleted file mode 100644
index e61cee75..00000000
--- a/src/adodb512/drivers/adodb-odbtp_unicode.inc.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-/*
- Because the ODBTP server sends and reads UNICODE text data using UTF-8
- encoding, the following HTML meta tag must be included within the HTML
- head section of every HTML form and script page:
-
-
-
- Also, all SQL query strings must be submitted as UTF-8 encoded text.
-*/
-
-if (!defined('_ADODB_ODBTP_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbtp.inc.php");
-}
-
-class ADODB_odbtp_unicode extends ADODB_odbtp {
- var $databaseType = 'odbtp';
- var $_useUnicodeSQL = true;
-
- function ADODB_odbtp_unicode()
- {
- $this->ADODB_odbtp();
- }
-}
-?>
diff --git a/src/adodb512/drivers/adodb-oracle.inc.php b/src/adodb512/drivers/adodb-oracle.inc.php
deleted file mode 100644
index fa18eee1..00000000
--- a/src/adodb512/drivers/adodb-oracle.inc.php
+++ /dev/null
@@ -1,342 +0,0 @@
-format($this->fmtDate);
- else $ds = adodb_date($this->fmtDate,$d);
- return 'TO_DATE('.$ds.",'YYYY-MM-DD')";
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts)
- {
-
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
- if (is_object($ts)) $ds = $ts->format($this->fmtDate);
- else $ds = adodb_date($this->fmtTimeStamp,$ts);
- return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
- }
-
-
- function BindDate($d)
- {
- $d = ADOConnection::DBDate($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
- function BindTimeStamp($d)
- {
- $d = ADOConnection::DBTimeStamp($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
-
-
- function BeginTrans()
- {
- $this->autoCommit = false;
- ora_commitoff($this->_connectionID);
- return true;
- }
-
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- $ret = ora_commit($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- function RollbackTrans()
- {
- $ret = ora_rollback($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- /* there seems to be a bug in the oracle extension -- always returns ORA-00000 - no error */
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
-
- if (is_resource($this->_curs)) $this->_errorMsg = @ora_error($this->_curs);
- if (empty($this->_errorMsg)) $this->_errorMsg = @ora_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
-
- if (is_resource($this->_curs)) $this->_errorCode = @ora_errorcode($this->_curs);
- if (empty($this->_errorCode)) $this->_errorCode = @ora_errorcode($this->_connectionID);
- return $this->_errorCode;
- }
-
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename, $mode=0)
- {
- if (!function_exists('ora_plogon')) return null;
-
- // Reset error messages before connecting
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- // G. Giunta 2003/08/13 - This looks danegrously suspicious: why should we want to set
- // the oracle home to the host name of remote DB?
-// if ($argHostname) putenv("ORACLE_HOME=$argHostname");
-
- if($argHostname) { // code copied from version submitted for oci8 by Jorma Tuomainen
- if (empty($argDatabasename)) $argDatabasename = $argHostname;
- else {
- if(strpos($argHostname,":")) {
- $argHostinfo=explode(":",$argHostname);
- $argHostname=$argHostinfo[0];
- $argHostport=$argHostinfo[1];
- } else {
- $argHostport="1521";
- }
-
-
- if ($this->connectSID) {
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
- } else
- $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
- .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
- }
-
- }
-
- if ($argDatabasename) $argUsername .= "@$argDatabasename";
-
- //if ($argHostname) print "Connect: 1st argument should be left blank for $this->databaseType
";
- if ($mode == 1)
- $this->_connectionID = ora_plogon($argUsername,$argPassword);
- else
- $this->_connectionID = ora_logon($argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($this->autoCommit) ora_commiton($this->_connectionID);
- if ($this->_initdate) {
- $rs = $this->_query("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
- if ($rs) ora_close($rs);
- }
-
- return true;
- }
-
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename, 1);
- }
-
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- // Reset error messages before executing
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $curs = ora_open($this->_connectionID);
-
- if ($curs === false) return false;
- $this->_curs = $curs;
- if (!ora_parse($curs,$sql)) return false;
- if (ora_exec($curs)) return $curs;
- // before we close the cursor, we have to store the error message
- // that we can obtain ONLY from the cursor (and not from the connection)
- $this->_errorCode = @ora_errorcode($curs);
- $this->_errorMsg = @ora_error($curs);
- //
- @ora_close($curs);
- return false;
- }
-
-
- // returns true or false
- function _close()
- {
- return @ora_logoff($this->_connectionID);
- }
-
-
-
-}
-
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oracle extends ADORecordSet {
-
- var $databaseType = "oracle";
- var $bind = false;
-
- function ADORecordset_oracle($queryID,$mode=false)
- {
-
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $queryID;
-
- $this->_inited = true;
- $this->fields = array();
- if ($queryID) {
- $this->_currentRow = 0;
- $this->EOF = !$this->_fetch();
- @$this->_initrs();
- } else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
-
- return $this->_queryID;
- }
-
-
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
-
- function FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fld->name = ora_columnname($this->_queryID, $fieldOffset);
- $fld->type = ora_columntype($this->_queryID, $fieldOffset);
- $fld->max_length = ora_columnsize($this->_queryID, $fieldOffset);
- return $fld;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _initrs()
- {
- $this->_numOfRows = -1;
- $this->_numOfFields = @ora_numcols($this->_queryID);
- }
-
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch($ignore_fields=false) {
-// should remove call by reference, but ora_fetch_into requires it in 4.0.3pl1
- if ($this->fetchMode & ADODB_FETCH_ASSOC)
- return @ora_fetch_into($this->_queryID,$this->fields,ORA_FETCHINTO_NULLS|ORA_FETCHINTO_ASSOC);
- else
- return @ora_fetch_into($this->_queryID,$this->fields,ORA_FETCHINTO_NULLS);
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
-
- function _close()
-{
- return @ora_close($this->_queryID);
- }
-
- function MetaType($t,$len=-1)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'VARCHAR2':
- case 'CHAR':
- case 'VARBINARY':
- case 'BINARY':
- if ($len <= $this->blobSize) return 'C';
- case 'LONG':
- case 'LONG VARCHAR':
- case 'CLOB':
- return 'X';
- case 'LONG RAW':
- case 'LONG VARBINARY':
- case 'BLOB':
- return 'B';
-
- case 'DATE': return 'D';
-
- //case 'T': return 'T';
-
- case 'BIT': return 'L';
- case 'INT':
- case 'SMALLINT':
- case 'INTEGER': return 'I';
- default: return 'N';
- }
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-pdo.inc.php b/src/adodb512/drivers/adodb-pdo.inc.php
deleted file mode 100644
index bc88507c..00000000
--- a/src/adodb512/drivers/adodb-pdo.inc.php
+++ /dev/null
@@ -1,626 +0,0 @@
-_driver;
- $this->fmtDate = $d->fmtDate;
- $this->fmtTimeStamp = $d->fmtTimeStamp;
- $this->replaceQuote = $d->replaceQuote;
- $this->sysDate = $d->sysDate;
- $this->sysTimeStamp = $d->sysTimeStamp;
- $this->random = $d->random;
- $this->concat_operator = $d->concat_operator;
- $this->nameQuote = $d->nameQuote;
-
- $this->hasGenID = $d->hasGenID;
- $this->_genIDSQL = $d->_genIDSQL;
- $this->_genSeqSQL = $d->_genSeqSQL;
- $this->_dropSeqSQL = $d->_dropSeqSQL;
-
- $d->_init($this);
- }
-
- function Time()
- {
- if (!empty($this->_driver->_hasdual)) $sql = "select $this->sysTimeStamp from dual";
- else $sql = "select $this->sysTimeStamp";
-
- $rs = $this->_Execute($sql);
- if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
-
- return false;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persist=false)
- {
- $at = strpos($argDSN,':');
- $this->dsnType = substr($argDSN,0,$at);
-
- if ($argDatabasename) {
- $argDSN .= ';dbname='.$argDatabasename;
- }
- try {
- $this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
- } catch (Exception $e) {
- $this->_connectionID = false;
- $this->_errorno = -1;
- //var_dump($e);
- $this->_errormsg = 'Connection attempt failed: '.$e->getMessage();
- return false;
- }
-
- if ($this->_connectionID) {
- switch(ADODB_ASSOC_CASE){
- case 0: $m = PDO::CASE_LOWER; break;
- case 1: $m = PDO::CASE_UPPER; break;
- default:
- case 2: $m = PDO::CASE_NATURAL; break;
- }
-
- //$this->_connectionID->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_SILENT );
- $this->_connectionID->setAttribute(PDO::ATTR_CASE,$m);
-
- $class = 'ADODB_pdo_'.$this->dsnType;
- //$this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- switch($this->dsnType) {
- case 'oci':
- case 'mysql':
- case 'pgsql':
- case 'mssql':
- case 'sqlite':
- include_once(ADODB_DIR.'/drivers/adodb-pdo_'.$this->dsnType.'.inc.php');
- break;
- }
- if (class_exists($class))
- $this->_driver = new $class();
- else
- $this->_driver = new ADODB_pdo_base();
-
- $this->_driver->_connectionID = $this->_connectionID;
- $this->_UpdatePDO();
- return true;
- }
- $this->_driver = new ADODB_pdo_base();
- return false;
- }
-
- function Concat()
- {
- $args = func_get_args();
- if(method_exists($this->_driver, 'Concat'))
- return call_user_func_array(array($this->_driver, 'Concat'), $args);
-
- return call_user_func_array(array($this,'parent::Concat'), $args);
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argDSN, $argUsername, $argPassword, $argDatabasename, true);
- }
-
- /*------------------------------------------------------------------------------*/
-
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $save = $this->_driver->fetchMode;
- $this->_driver->fetchMode = $this->fetchMode;
- $this->_driver->debug = $this->debug;
- $ret = $this->_driver->SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- $this->_driver->fetchMode = $save;
- return $ret;
- }
-
-
- function ServerInfo()
- {
- return $this->_driver->ServerInfo();
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- return $this->_driver->MetaTables($ttype,$showSchema,$mask);
- }
-
- function MetaColumns($table,$normalize=true)
- {
- return $this->_driver->MetaColumns($table,$normalize);
- }
-
- function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false)
- {
- $obj = $stmt[1];
- if ($type) $obj->bindParam($name,$var,$type,$maxLen);
- else $obj->bindParam($name, $var);
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- return $this->_driver->OffsetDate($dayFraction,$date);
- }
-
- function ErrorMsg()
- {
- if ($this->_errormsg !== false) return $this->_errormsg;
- if (!empty($this->_stmt)) $arr = $this->_stmt->errorInfo();
- else if (!empty($this->_connectionID)) $arr = $this->_connectionID->errorInfo();
- else return 'No Connection Established';
-
-
- if ($arr) {
- if (sizeof($arr)<2) return '';
- if ((integer)$arr[1]) return $arr[2];
- else return '';
- } else return '-1';
- }
-
-
- function ErrorNo()
- {
- if ($this->_errorno !== false) return $this->_errorno;
- if (!empty($this->_stmt)) $err = $this->_stmt->errorCode();
- else if (!empty($this->_connectionID)) {
- $arr = $this->_connectionID->errorInfo();
- if (isset($arr[0])) $err = $arr[0];
- else $err = -1;
- } else
- return 0;
-
- if ($err == '00000') return 0; // allows empty check
- return $err;
- }
-
- function SetTransactionMode($transaction_mode)
- {
- if(method_exists($this->_driver, 'SetTransactionMode'))
- return $this->_driver->SetTransactionMode($transaction_mode);
-
- return parent::SetTransactionMode($seqname);
- }
-
- function BeginTrans()
- {
- if(method_exists($this->_driver, 'BeginTrans'))
- return $this->_driver->BeginTrans();
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,false);
- return $this->_connectionID->beginTransaction();
- }
-
- function CommitTrans($ok=true)
- {
- if(method_exists($this->_driver, 'CommitTrans'))
- return $this->_driver->CommitTrans($ok);
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
-
- $ret = $this->_connectionID->commit();
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if(method_exists($this->_driver, 'RollbackTrans'))
- return $this->_driver->RollbackTrans();
-
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
-
- $ret = $this->_connectionID->rollback();
- $this->_connectionID->setAttribute(PDO::ATTR_AUTOCOMMIT,true);
- return $ret;
- }
-
- function Prepare($sql)
- {
- $this->_stmt = $this->_connectionID->prepare($sql);
- if ($this->_stmt) return array($sql,$this->_stmt);
-
- return false;
- }
-
- function PrepareStmt($sql)
- {
- $stmt = $this->_connectionID->prepare($sql);
- if (!$stmt) return false;
- $obj = new ADOPDOStatement($stmt,$this);
- return $obj;
- }
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if(method_exists($this->_driver, 'CreateSequence'))
- return $this->_driver->CreateSequence($seqname, $startID);
-
- return parent::CreateSequence($seqname, $startID);
- }
-
- function DropSequence($seqname='adodbseq')
- {
- if(method_exists($this->_driver, 'DropSequence'))
- return $this->_driver->DropSequence($seqname);
-
- return parent::DropSequence($seqname);
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- if(method_exists($this->_driver, 'GenID'))
- return $this->_driver->GenID($seqname, $startID);
-
- return parent::GenID($seqname, $startID);
- }
-
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- if (is_array($sql)) {
- $stmt = $sql[1];
- } else {
- $stmt = $this->_connectionID->prepare($sql);
- }
- #adodb_backtrace();
- #var_dump($this->_bindInputArray);
- if ($stmt) {
- $this->_driver->debug = $this->debug;
- if ($inputarr) $ok = $stmt->execute($inputarr);
- else $ok = $stmt->execute();
- }
-
-
- $this->_errormsg = false;
- $this->_errorno = false;
-
- if ($ok) {
- $this->_stmt = $stmt;
- return $stmt;
- }
-
- if ($stmt) {
-
- $arr = $stmt->errorinfo();
- if ((integer)$arr[1]) {
- $this->_errormsg = $arr[2];
- $this->_errorno = $arr[1];
- }
-
- } else {
- $this->_errormsg = false;
- $this->_errorno = false;
- }
- return false;
- }
-
- // returns true or false
- function _close()
- {
- $this->_stmt = false;
- return true;
- }
-
- function _affectedrows()
- {
- return ($this->_stmt) ? $this->_stmt->rowCount() : 0;
- }
-
- function _insertid()
- {
- return ($this->_connectionID) ? $this->_connectionID->lastInsertId() : 0;
- }
-}
-
-class ADODB_pdo_base extends ADODB_pdo {
-
- var $sysDate = "'?'";
- var $sysTimeStamp = "'?'";
-
-
- function _init($parentDriver)
- {
- $parentDriver->_bindInputArray = true;
- #$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
- }
-
- function ServerInfo()
- {
- return ADOConnection::ServerInfo();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function MetaTables()
- {
- return false;
- }
-
- function MetaColumns()
- {
- return false;
- }
-}
-
-class ADOPDOStatement {
-
- var $databaseType = "pdo";
- var $dataProvider = "pdo";
- var $_stmt;
- var $_connectionID;
-
- function ADOPDOStatement($stmt,$connection)
- {
- $this->_stmt = $stmt;
- $this->_connectionID = $connection;
- }
-
- function Execute($inputArr=false)
- {
- $savestmt = $this->_connectionID->_stmt;
- $rs = $this->_connectionID->Execute(array(false,$this->_stmt),$inputArr);
- $this->_connectionID->_stmt = $savestmt;
- return $rs;
- }
-
- function InParameter(&$var,$name,$maxLen=4000,$type=false)
- {
-
- if ($type) $this->_stmt->bindParam($name,$var,$type,$maxLen);
- else $this->_stmt->bindParam($name, $var);
- }
-
- function Affected_Rows()
- {
- return ($this->_stmt) ? $this->_stmt->rowCount() : 0;
- }
-
- function ErrorMsg()
- {
- if ($this->_stmt) $arr = $this->_stmt->errorInfo();
- else $arr = $this->_connectionID->errorInfo();
-
- if (is_array($arr)) {
- if ((integer) $arr[0] && isset($arr[2])) return $arr[2];
- else return '';
- } else return '-1';
- }
-
- function NumCols()
- {
- return ($this->_stmt) ? $this->_stmt->columnCount() : 0;
- }
-
- function ErrorNo()
- {
- if ($this->_stmt) return $this->_stmt->errorCode();
- else return $this->_connectionID->errorInfo();
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_pdo extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "pdo";
- var $dataProvider = "pdo";
-
- function ADORecordSet_pdo($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->adodbFetchMode = $mode;
- switch($mode) {
- case ADODB_FETCH_NUM: $mode = PDO::FETCH_NUM; break;
- case ADODB_FETCH_ASSOC: $mode = PDO::FETCH_ASSOC; break;
-
- case ADODB_FETCH_BOTH:
- default: $mode = PDO::FETCH_BOTH; break;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
- $this->ADORecordSet($id);
- }
-
-
- function Init()
- {
- if ($this->_inited) return;
- $this->_inited = true;
- if ($this->_queryID) @$this->_initrs();
- else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- }
- if ($this->_numOfRows != 0 && $this->_currentRow == -1) {
- $this->_currentRow = 0;
- if ($this->EOF = ($this->_fetch() === false)) {
- $this->_numOfRows = 0; // _numOfRows could be -1
- }
- } else {
- $this->EOF = true;
- }
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
-
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @$this->_queryID->rowCount() : -1;
- if (!$this->_numOfRows) $this->_numOfRows = -1;
- $this->_numOfFields = $this->_queryID->columnCount();
- }
-
- // returns the field object
- function FetchField($fieldOffset = -1)
- {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $arr = @$this->_queryID->getColumnMeta($fieldOffset);
- if (!$arr) {
- $o->name = 'bad getColumnMeta()';
- $o->max_length = -1;
- $o->type = 'VARCHAR';
- $o->precision = 0;
- # $false = false;
- return $o;
- }
- //adodb_pr($arr);
- $o->name = $arr['name'];
- if (isset($arr['native_type']) && $arr['native_type'] <> "null") $o->type = $arr['native_type'];
- else $o->type = adodb_pdo_type($arr['pdo_type']);
- $o->max_length = $arr['len'];
- $o->precision = $arr['precision'];
-
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch()
- {
- if (!$this->_queryID) return false;
-
- $this->fields = $this->_queryID->fetch($this->fetchMode);
- return !empty($this->fields);
- }
-
- function _close()
- {
- $this->_queryID = false;
- }
-
- function Fields($colname)
- {
- if ($this->adodbFetchMode != ADODB_FETCH_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-pdo_mssql.inc.php b/src/adodb512/drivers/adodb-pdo_mssql.inc.php
deleted file mode 100644
index 5a7dd518..00000000
--- a/src/adodb512/drivers/adodb-pdo_mssql.inc.php
+++ /dev/null
@@ -1,61 +0,0 @@
-hasTransactions = false; ## <<< BUG IN PDO mssql driver
- $parentDriver->_bindInputArray = false;
- $parentDriver->hasInsertID = true;
- }
-
- function ServerInfo()
- {
- return ADOConnection::ServerInfo();
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- return false;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- return false;
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-pdo_mysql.inc.php b/src/adodb512/drivers/adodb-pdo_mysql.inc.php
deleted file mode 100644
index 94b59fbd..00000000
--- a/src/adodb512/drivers/adodb-pdo_mysql.inc.php
+++ /dev/null
@@ -1,182 +0,0 @@
-hasTransactions = false;
- #$parentDriver->_bindInputArray = false;
- $parentDriver->hasInsertID = true;
- $parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
- }
-
- // dayFraction is a day in floating point
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
-
- $fraction = $dayFraction * 24 * 3600;
- return $date . ' + INTERVAL ' . $fraction.' SECOND';
-
-// return "from_unixtime(unix_timestamp($date)+$fraction)";
- }
-
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005#mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)"; return '';
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= " from $showSchema";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET SESSION TRANSACTION ".$transaction_mode);
- }
-
- function MetaColumns($table,$normalize=true)
- {
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
- {
- $offsetStr =($offset>=0) ? "$offset," : '';
- // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr);
- else
- $rs = $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr);
- return $rs;
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-pdo_oci.inc.php b/src/adodb512/drivers/adodb-pdo_oci.inc.php
deleted file mode 100644
index 6e9dcc07..00000000
--- a/src/adodb512/drivers/adodb-pdo_oci.inc.php
+++ /dev/null
@@ -1,93 +0,0 @@
-_bindInputArray = true;
- $parentDriver->_nestedSQL = true;
- if ($this->_initdate) {
- $parentDriver->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'");
- }
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND table_name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!$rs) {
- return $false;
- }
- $retarr = array();
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->scale = $rs->fields[3];
- if ($rs->fields[1] == 'NUMBER' && $rs->fields[3] == 0) {
- $fld->type ='INT';
- $fld->max_length = $rs->fields[4];
- }
- $fld->not_null = (strncmp($rs->fields[5], 'NOT',3) === 0);
- $fld->binary = (strpos($fld->type,'BLOB') !== false);
- $fld->default_value = $rs->fields[6];
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-pdo_pgsql.inc.php b/src/adodb512/drivers/adodb-pdo_pgsql.inc.php
deleted file mode 100644
index 5405dc36..00000000
--- a/src/adodb512/drivers/adodb-pdo_pgsql.inc.php
+++ /dev/null
@@ -1,230 +0,0 @@
- 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // used when schema defined
- var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
-FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n
-WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
- and c.relnamespace=n.oid and n.nspname='%s'
- and a.attname not like '....%%' AND a.attnum > 0
- AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // get primary key etc -- from Freek Dijkstra
- var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key
- FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
-
- var $hasAffectedRows = true;
- var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- // below suggested by Freek Dijkstra
- var $true = 't'; // string that represents TRUE for a database
- var $false = 'f'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $hasMoveFirst = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT NEXTVAL('%s')";
- var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
- var $random = 'random()'; /// random function
- var $concat_operator='||';
-
- function _init($parentDriver)
- {
-
- $parentDriver->hasTransactions = false; ## <<< BUG IN PDO pgsql driver
- $parentDriver->hasInsertID = true;
- $parentDriver->_nestedSQL = true;
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : '';
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $info = $this->ServerInfo();
- if ($info['version'] >= 7.3) {
- $this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
- and schemaname not in ( 'pg_catalog','information_schema')
- union
- select viewname,'V' from pg_views where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema') ";
- }
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtolower($mask));
- if ($info['version']>=7.3)
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema')
- union
-select viewname,'V' from pg_views where viewname like $mask and schemaname not in ( 'pg_catalog','information_schema') ";
- else
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask
- union
-select viewname,'V' from pg_views where viewname like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
-
- if ($normalize) $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
- else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) {
- $false = false;
- return $false;
- }
- if (!empty($this->metaKeySQL)) {
- // If we want the primary keys, we have to issue a separate query
- // Of course, a modified version of the metaColumnsSQL query using a
- // LEFT JOIN would have been much more elegant, but postgres does
- // not support OUTER JOINS. So here is the clumsy way.
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
- $rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
- // fetch all result in once for performance.
- $keys = $rskey->GetArray();
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- $rskey->Close();
- unset($rskey);
- }
-
- $rsdefa = array();
- if (!empty($this->metaDefaultsSQL)) {
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $sql = sprintf($this->metaDefaultsSQL, ($table));
- $rsdef = $this->Execute($sql);
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rsdef) {
- while (!$rsdef->EOF) {
- $num = $rsdef->fields['num'];
- $s = $rsdef->fields['def'];
- if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
- $s = substr($s, 1);
- $s = substr($s, 0, strlen($s) - 1);
- }
-
- $rsdefa[$num] = $s;
- $rsdef->MoveNext();
- }
- } else {
- ADOConnection::outp( "==> SQL => " . $sql);
- }
- unset($rsdef);
- }
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
- if ($fld->max_length <= 0) $fld->max_length = -1;
- if ($fld->type == 'numeric') {
- $fld->scale = $fld->max_length & 0xFFFF;
- $fld->max_length >>= 16;
- }
- // dannym
- // 5 hasdefault; 6 num-of-column
- $fld->has_default = ($rs->fields[5] == 't');
- if ($fld->has_default) {
- $fld->default_value = $rsdefa[$rs->fields[6]];
- }
-
- //Freek
- if ($rs->fields[4] == $this->true) {
- $fld->not_null = true;
- }
-
- // Freek
- if (is_array($keys)) {
- foreach($keys as $key) {
- if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true)
- $fld->primary_key = true;
- if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true)
- $fld->unique = true; // What name is more compatible?
- }
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr)) {
- $false = false;
- return $false;
- } else return $retarr;
-
- }
-
-}
-
-?>
diff --git a/src/adodb512/drivers/adodb-pdo_sqlite.inc.php b/src/adodb512/drivers/adodb-pdo_sqlite.inc.php
deleted file mode 100644
index 0306a05c..00000000
--- a/src/adodb512/drivers/adodb-pdo_sqlite.inc.php
+++ /dev/null
@@ -1,203 +0,0 @@
-pdoDriver = $parentDriver;
- $parentDriver->_bindInputArray = true;
- $parentDriver->hasTransactions = false; // // should be set to false because of PDO SQLite driver not supporting changing autocommit mode
- $parentDriver->hasInsertID = true;
- }
-
- function ServerInfo()
- {
- $parent = $this->pdoDriver;
- @($ver = array_pop($parent->GetCol("SELECT sqlite_version()")));
- @($enc = array_pop($parent->GetCol("PRAGMA encoding")));
-
- $arr['version'] = $ver;
- $arr['description'] = 'SQLite ';
- $arr['encoding'] = $enc;
-
- return $arr;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $parent = $this->pdoDriver;
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
- if ($secs2cache)
- $rs = $parent->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $parent->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- function GenID($seq='adodbseq',$start=1)
- {
- $parent = $this->pdoDriver;
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- while (--$MAXLOOPS>=0) {
- @($num = array_pop($parent->GetCol("SELECT id FROM {$seq}")));
- if ($num === false || !is_numeric($num)) {
- @$parent->Execute(sprintf($this->_genSeqSQL ,$seq));
- $start -= 1;
- $num = '0';
- $cnt = $parent->GetOne(sprintf($this->_genSeqCountSQL,$seq));
- if (!$cnt) {
- $ok = $parent->Execute(sprintf($this->_genSeq2SQL,$seq,$start));
- }
- if (!$ok) return false;
- }
- $parent->Execute(sprintf($this->_genIDSQL,$seq,$num));
-
- if ($parent->affected_rows() > 0) {
- $num += 1;
- $parent->genID = intval($num);
- return intval($num);
- }
- }
- if ($fn = $parent->raiseErrorFn) {
- $fn($parent->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- $parent = $this->pdoDriver;
- $ok = $parent->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- $start -= 1;
- return $parent->Execute("insert into $seqname values($start)");
- }
-
- function SetTransactionMode($transaction_mode)
- {
- $parent = $this->pdoDriver;
- $parent->_transmode = strtoupper($transaction_mode);
- }
-
- function BeginTrans()
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- $parent->transCnt += 1;
- $parent->_autocommit = false;
- return $parent->Execute("BEGIN {$parent->_transmode}");
- }
-
- function CommitTrans($ok=true)
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- if (!$ok) return $parent->RollbackTrans();
- if ($parent->transCnt) $parent->transCnt -= 1;
- $parent->_autocommit = true;
-
- $ret = $parent->Execute('COMMIT');
- return $ret;
- }
-
- function RollbackTrans()
- {
- $parent = $this->pdoDriver;
- if ($parent->transOff) return true;
- if ($parent->transCnt) $parent->transCnt -= 1;
- $parent->_autocommit = true;
-
- $ret = $parent->Execute('ROLLBACK');
- return $ret;
- }
-
-
- // mark newnham
- function MetaColumns($tab,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $parent = $this->pdoDriver;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($parent->fetchMode !== false) $savem = $parent->SetFetchMode(false);
- $rs = $parent->Execute("PRAGMA table_info('$tab')");
- if (isset($savem)) $parent->SetFetchMode($savem);
- if (!$rs) {
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $arr = array();
- while ($r = $rs->FetchRow()) {
- $type = explode('(',$r['type']);
- $size = '';
- if (sizeof($type)==2)
- $size = trim($type[1],')');
- $fn = strtoupper($r['name']);
- $fld = new ADOFieldObject;
- $fld->name = $r['name'];
- $fld->type = $type[0];
- $fld->max_length = $size;
- $fld->not_null = $r['notnull'];
- $fld->primary_key = $r['pk'];
- $fld->default_value = $r['dflt_value'];
- $fld->scale = 0;
- if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
- else $arr[strtoupper($fld->name)] = $fld;
- }
- $rs->Close();
- $ADODB_FETCH_MODE = $save;
- return $arr;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $parent = $this->pdoDriver;
-
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtoupper($mask));
- $this->metaTablesSQL .= " AND name LIKE $mask";
- }
-
- $ret = $parent->GetCol($this->metaTablesSQL);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-postgres.inc.php b/src/adodb512/drivers/adodb-postgres.inc.php
deleted file mode 100644
index 6f580ff6..00000000
--- a/src/adodb512/drivers/adodb-postgres.inc.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-postgres64.inc.php b/src/adodb512/drivers/adodb-postgres64.inc.php
deleted file mode 100644
index 8258149c..00000000
--- a/src/adodb512/drivers/adodb-postgres64.inc.php
+++ /dev/null
@@ -1,1071 +0,0 @@
-
- jlim - changed concat operator to || and data types to MetaType to match documented pgsql types
- see http://www.postgresql.org/devel-corner/docs/postgres/datatype.htm
- 22 Nov 2000 jlim - added changes to FetchField() and MetaTables() contributed by "raser"
- 27 Nov 2000 jlim - added changes to _connect/_pconnect from ideas by "Lennie"
- 15 Dec 2000 jlim - added changes suggested by Additional code changes by "Eric G. Werk" egw@netguide.dk.
- 31 Jan 2002 jlim - finally installed postgresql. testing
- 01 Mar 2001 jlim - Freek Dijkstra changes, also support for text type
-
- See http://www.varlena.com/varlena/GeneralBits/47.php
-
- -- What indexes are on my table?
- select * from pg_indexes where tablename = 'tablename';
-
- -- What triggers are on my table?
- select c.relname as "Table", t.tgname as "Trigger Name",
- t.tgconstrname as "Constraint Name", t.tgenabled as "Enabled",
- t.tgisconstraint as "Is Constraint", cc.relname as "Referenced Table",
- p.proname as "Function Name"
- from pg_trigger t, pg_class c, pg_class cc, pg_proc p
- where t.tgfoid = p.oid and t.tgrelid = c.oid
- and t.tgconstrrelid = cc.oid
- and c.relname = 'tablename';
-
- -- What constraints are on my table?
- select r.relname as "Table", c.conname as "Constraint Name",
- contype as "Constraint Type", conkey as "Key Columns",
- confkey as "Foreign Columns", consrc as "Source"
- from pg_class r, pg_constraint c
- where r.oid = c.conrelid
- and relname = 'tablename';
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-function adodb_addslashes($s)
-{
- $len = strlen($s);
- if ($len == 0) return "''";
- if (strncmp($s,"'",1) === 0 && substr($s,$len-1) == "'") return $s; // already quoted
-
- return "'".addslashes($s)."'";
-}
-
-class ADODB_postgres64 extends ADOConnection{
- var $databaseType = 'postgres64';
- var $dataProvider = 'postgres';
- var $hasInsertID = true;
- var $_resultid = false;
- var $concat_operator='||';
- var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1";
- var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
- and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages',
- 'sql_packages', 'sql_sizing', 'sql_sizing_profiles')
- union
- select viewname,'V' from pg_views where viewname not like 'pg\_%'";
- //"select tablename from pg_tables where tablename not like 'pg_%' order by 1";
- var $isoDates = true; // accepts dates in ISO format
- var $sysDate = "CURRENT_DATE";
- var $sysTimeStamp = "CURRENT_TIMESTAMP";
- var $blobEncodeType = 'C';
- var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum
- FROM pg_class c, pg_attribute a,pg_type t
- WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
-AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // used when schema defined
- var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
-FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n
-WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
- and c.relnamespace=n.oid and n.nspname='%s'
- and a.attname not like '....%%' AND a.attnum > 0
- AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-
- // get primary key etc -- from Freek Dijkstra
- var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key
- FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
-
- var $hasAffectedRows = true;
- var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- // below suggested by Freek Dijkstra
- var $true = 'TRUE'; // string that represents TRUE for a database
- var $false = 'FALSE'; // string that represents FALSE for a database
- var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d H:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
- var $hasMoveFirst = true;
- var $hasGenID = true;
- var $_genIDSQL = "SELECT NEXTVAL('%s')";
- var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
- var $_dropSeqSQL = "DROP SEQUENCE %s";
- var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
- var $random = 'random()'; /// random function
- var $autoRollback = true; // apparently pgsql does not autorollback properly before php 4.3.4
- // http://bugs.php.net/bug.php?id=25404
-
- var $uniqueIisR = true;
- var $_bindInputArray = false; // requires postgresql 7.3+ and ability to modify database
- var $disableBlobs = false; // set to true to disable blob checking, resulting in 2-5% improvement in performance.
-
- // The last (fmtTimeStamp is not entirely correct:
- // PostgreSQL also has support for time zones,
- // and writes these time in this format: "2001-03-01 18:59:26+02".
- // There is no code for the "+02" time zone information, so I just left that out.
- // I'm not familiar enough with both ADODB as well as Postgres
- // to know what the concequences are. The other values are correct (wheren't in 0.94)
- // -- Freek Dijkstra
-
- function ADODB_postgres64()
- {
- // changes the metaColumnsSQL, adds columns: attnum[6]
- }
-
- function ServerInfo()
- {
- if (isset($this->version)) return $this->version;
-
- $arr['description'] = $this->GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- $this->version = $arr;
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " coalesce($field, $ifNull) ";
- }
-
- // get the last id - never tested
- function pg_insert_id($tablename,$fieldname)
- {
- $result=pg_exec($this->_connectionID, "SELECT last_value FROM ${tablename}_${fieldname}_seq");
- if ($result) {
- $arr = @pg_fetch_row($result,0);
- pg_freeresult($result);
- if (isset($arr[0])) return $arr[0];
- }
- return false;
- }
-
-/* Warning from http://www.php.net/manual/function.pg-getlastoid.php:
-Using a OID as a unique identifier is not generally wise.
-Unless you are very careful, you might end up with a tuple having
-a different OID if a database must be reloaded. */
- function _insertid($table,$column)
- {
- if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
- $oid = pg_getlastoid($this->_resultid);
- // to really return the id, we need the table and column-name, else we can only return the oid != id
- return empty($table) || empty($column) ? $oid : $this->GetOne("SELECT $column FROM $table WHERE oid=".(int)$oid);
- }
-
-// I get this error with PHP before 4.0.6 - jlim
-// Warning: This compilation does not support pg_cmdtuples() in adodb-postgres.inc.php on line 44
- function _affectedrows()
- {
- if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false;
- return pg_cmdtuples($this->_resultid);
- }
-
-
- // returns true/false
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- return @pg_Exec($this->_connectionID, "begin ".$this->_transmode);
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if (!$this->transCnt) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- // returns true/false.
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
-
- $this->transCnt -= 1;
- return @pg_Exec($this->_connectionID, "commit");
- }
-
- // returns true/false
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt -= 1;
- return @pg_Exec($this->_connectionID, "rollback");
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $info = $this->ServerInfo();
- if ($info['version'] >= 7.3) {
- $this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
- and schemaname not in ( 'pg_catalog','information_schema')
- union
- select viewname,'V' from pg_views where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema') ";
- }
- if ($mask) {
- $save = $this->metaTablesSQL;
- $mask = $this->qstr(strtolower($mask));
- if ($info['version']>=7.3)
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema')
- union
-select viewname,'V' from pg_views where viewname like $mask and schemaname not in ( 'pg_catalog','information_schema') ";
- else
- $this->metaTablesSQL = "
-select tablename,'T' from pg_tables where tablename like $mask
- union
-select viewname,'V' from pg_views where viewname like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
-
- // if magic quotes disabled, use pg_escape_string()
- function qstr($s,$magic_quotes=false)
- {
- if (is_bool($s)) return $s ? 'true' : 'false';
-
- if (!$magic_quotes) {
- if (ADODB_PHPVER >= 0x5200) {
- return "'".pg_escape_string($this->_connectionID,$s)."'";
- }
- if (ADODB_PHPVER >= 0x4200) {
- return "'".pg_escape_string($s)."'";
- }
- if ($this->replaceQuote[0] == '\\'){
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\\000"),$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'TO_CHAR('.$col.",'";
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= 'YYYY';
- break;
- case 'Q':
- case 'q':
- $s .= 'Q';
- break;
-
- case 'M':
- $s .= 'Mon';
- break;
-
- case 'm':
- $s .= 'MM';
- break;
- case 'D':
- case 'd':
- $s .= 'DD';
- break;
-
- case 'H':
- $s.= 'HH24';
- break;
-
- case 'h':
- $s .= 'HH';
- break;
-
- case 'i':
- $s .= 'MI';
- break;
-
- case 's':
- $s .= 'SS';
- break;
-
- case 'a':
- case 'A':
- $s .= 'AM';
- break;
-
- case 'w':
- $s .= 'D';
- break;
-
- case 'l':
- $s .= 'DAY';
- break;
-
- case 'W':
- $s .= 'WW';
- break;
-
- default:
- // handle escape characters...
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- if (strpos('-/.:;, ',$ch) !== false) $s .= $ch;
- else $s .= '"'.$ch.'"';
-
- }
- }
- return $s. "')";
- }
-
-
-
- /*
- * Load a Large Object from a file
- * - the procedure stores the object id in the table and imports the object using
- * postgres proprietary blob handling routines
- *
- * contributed by Mattia Rossi mattia@technologist.com
- * modified for safe mode by juraj chlebec
- */
- function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB')
- {
- pg_exec ($this->_connectionID, "begin");
-
- $fd = fopen($path,'r');
- $contents = fread($fd,filesize($path));
- fclose($fd);
-
- $oid = pg_lo_create($this->_connectionID);
- $handle = pg_lo_open($this->_connectionID, $oid, 'w');
- pg_lo_write($handle, $contents);
- pg_lo_close($handle);
-
- // $oid = pg_lo_import ($path);
- pg_exec($this->_connectionID, "commit");
- $rs = ADOConnection::UpdateBlob($table,$column,$oid,$where,$blobtype);
- $rez = !empty($rs);
- return $rez;
- }
-
- /*
- * Deletes/Unlinks a Blob from the database, otherwise it
- * will be left behind
- *
- * Returns TRUE on success or FALSE on failure.
- *
- * contributed by Todd Rogers todd#windfox.net
- */
- function BlobDelete( $blob )
- {
- pg_exec ($this->_connectionID, "begin");
- $result = @pg_lo_unlink($blob);
- pg_exec ($this->_connectionID, "commit");
- return( $result );
- }
-
- /*
- Hueristic - not guaranteed to work.
- */
- function GuessOID($oid)
- {
- if (strlen($oid)>16) return false;
- return is_numeric($oid);
- }
-
- /*
- * If an OID is detected, then we use pg_lo_* to open the oid file and read the
- * real blob from the db using the oid supplied as a parameter. If you are storing
- * blobs using bytea, we autodetect and process it so this function is not needed.
- *
- * contributed by Mattia Rossi mattia@technologist.com
- *
- * see http://www.postgresql.org/idocs/index.php?largeobjects.html
- *
- * Since adodb 4.54, this returns the blob, instead of sending it to stdout. Also
- * added maxsize parameter, which defaults to $db->maxblobsize if not defined.
- */
- function BlobDecode($blob,$maxsize=false,$hastrans=true)
- {
- if (!$this->GuessOID($blob)) return $blob;
-
- if ($hastrans) @pg_exec($this->_connectionID,"begin");
- $fd = @pg_lo_open($this->_connectionID,$blob,"r");
- if ($fd === false) {
- if ($hastrans) @pg_exec($this->_connectionID,"commit");
- return $blob;
- }
- if (!$maxsize) $maxsize = $this->maxblobsize;
- $realblob = @pg_loread($fd,$maxsize);
- @pg_loclose($fd);
- if ($hastrans) @pg_exec($this->_connectionID,"commit");
- return $realblob;
- }
-
- /*
- See http://www.postgresql.org/idocs/index.php?datatype-binary.html
-
- NOTE: SQL string literals (input strings) must be preceded with two backslashes
- due to the fact that they must pass through two parsers in the PostgreSQL
- backend.
- */
- function BlobEncode($blob)
- {
- if (ADODB_PHPVER >= 0x5200) return pg_escape_bytea($this->_connectionID, $blob);
- if (ADODB_PHPVER >= 0x4200) return pg_escape_bytea($blob);
-
- /*92=backslash, 0=null, 39=single-quote*/
- $badch = array(chr(92),chr(0),chr(39)); # \ null '
- $fixch = array('\\\\134','\\\\000','\\\\047');
- return adodb_str_replace($badch,$fixch,$blob);
-
- // note that there is a pg_escape_bytea function only for php 4.2.0 or later
- }
-
- // assumes bytea for blob, and varchar for clob
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- if ($blobtype == 'CLOB') {
- return $this->Execute("UPDATE $table SET $column=" . $this->qstr($val) . " WHERE $where");
- }
- // do not use bind params which uses qstr(), as blobencode() already quotes data
- return $this->Execute("UPDATE $table SET $column='".$this->BlobEncode($val)."'::bytea WHERE $where");
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
- else if (strncmp($date,"'",1) == 0) {
- $len = strlen($date);
- if (10 <= $len && $len <= 12) $date = 'date '.$date;
- else $date = 'timestamp '.$date;
- }
-
-
- return "($date+interval'".($dayFraction * 1440)." minutes')";
- #return "($date+interval'$dayFraction days')";
- }
-
-
- // for schema support, pass in the $table param "$schema.$tabname".
- // converts field names to lowercase, $upper is ignored
- // see http://phplens.com/lens/lensforum/msgs.php?id=14018 for more info
- function MetaColumns($table,$normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $false = false;
- $this->_findschema($table,$schema);
-
- if ($normalize) $table = strtolower($table);
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
-
- if ($schema) $rs = $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
- else $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rs === false) {
- return $false;
- }
- if (!empty($this->metaKeySQL)) {
- // If we want the primary keys, we have to issue a separate query
- // Of course, a modified version of the metaColumnsSQL query using a
- // LEFT JOIN would have been much more elegant, but postgres does
- // not support OUTER JOINS. So here is the clumsy way.
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
- $rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
- // fetch all result in once for performance.
- $keys = $rskey->GetArray();
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- $rskey->Close();
- unset($rskey);
- }
-
- $rsdefa = array();
- if (!empty($this->metaDefaultsSQL)) {
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $sql = sprintf($this->metaDefaultsSQL, ($table));
- $rsdef = $this->Execute($sql);
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if ($rsdef) {
- while (!$rsdef->EOF) {
- $num = $rsdef->fields['num'];
- $s = $rsdef->fields['def'];
- if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
- $s = substr($s, 1);
- $s = substr($s, 0, strlen($s) - 1);
- }
-
- $rsdefa[$num] = $s;
- $rsdef->MoveNext();
- }
- } else {
- ADOConnection::outp( "==> SQL => " . $sql);
- }
- unset($rsdef);
- }
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
- $fld->max_length = $rs->fields[2];
- $fld->attnum = $rs->fields[6];
-
- if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
- if ($fld->max_length <= 0) $fld->max_length = -1;
- if ($fld->type == 'numeric') {
- $fld->scale = $fld->max_length & 0xFFFF;
- $fld->max_length >>= 16;
- }
- // dannym
- // 5 hasdefault; 6 num-of-column
- $fld->has_default = ($rs->fields[5] == 't');
- if ($fld->has_default) {
- $fld->default_value = $rsdefa[$rs->fields[6]];
- }
-
- //Freek
- $fld->not_null = $rs->fields[4] == 't';
-
-
- // Freek
- if (is_array($keys)) {
- foreach($keys as $key) {
- if ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')
- $fld->primary_key = true;
- if ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')
- $fld->unique = true; // What name is more compatible?
- }
- }
-
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr))
- return $false;
- else
- return $retarr;
-
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- global $ADODB_FETCH_MODE;
-
- $schema = false;
- $this->_findschema($table,$schema);
-
- if ($schema) { // requires pgsql 7.3+ - pg_namespace used.
- $sql = '
-SELECT c.relname as "Name", i.indisunique as "Unique", i.indkey as "Columns"
-FROM pg_catalog.pg_class c
-JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid
-JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
- ,pg_namespace n
-WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\')) and c.relnamespace=c2.relnamespace and c.relnamespace=n.oid and n.nspname=\'%s\'';
- } else {
- $sql = '
-SELECT c.relname as "Name", i.indisunique as "Unique", i.indkey as "Columns"
-FROM pg_catalog.pg_class c
-JOIN pg_catalog.pg_index i ON i.indexrelid=c.oid
-JOIN pg_catalog.pg_class c2 ON c2.oid=i.indrelid
-WHERE (c2.relname=\'%s\' or c2.relname=lower(\'%s\'))';
- }
-
- if ($primary == FALSE) {
- $sql .= ' AND i.indisprimary=false;';
- }
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute(sprintf($sql,$table,$table,$schema));
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $col_names = $this->MetaColumnNames($table,true,true);
- //3rd param is use attnum,
- // see http://sourceforge.net/tracker/index.php?func=detail&aid=1451245&group_id=42718&atid=433976
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $columns = array();
- foreach (explode(' ', $row[2]) as $col) {
- $columns[] = $col_names[$col];
- }
-
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 't'),
- 'columns' => $columns
- );
- }
- return $indexes;
- }
-
- // returns true or false
- //
- // examples:
- // $db->Connect("host=host1 user=user1 password=secret port=4341");
- // $db->Connect('host1','user1','secret');
- function _connect($str,$user='',$pwd='',$db='',$ctype=0)
- {
-
- if (!function_exists('pg_connect')) return null;
-
- $this->_errorMsg = false;
-
- if ($user || $pwd || $db) {
- $user = adodb_addslashes($user);
- $pwd = adodb_addslashes($pwd);
- if (strlen($db) == 0) $db = 'template1';
- $db = adodb_addslashes($db);
- if ($str) {
- $host = explode(":", $str);
- if ($host[0]) $str = "host=".adodb_addslashes($host[0]);
- else $str = '';
- if (isset($host[1])) $str .= " port=$host[1]";
- else if (!empty($this->port)) $str .= " port=".$this->port;
- }
- if ($user) $str .= " user=".$user;
- if ($pwd) $str .= " password=".$pwd;
- if ($db) $str .= " dbname=".$db;
- }
-
- //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
-
- if ($ctype === 1) { // persistent
- $this->_connectionID = pg_pconnect($str);
- } else {
- if ($ctype === -1) { // nconnect, we trick pgsql ext by changing the connection str
- static $ncnt;
-
- if (empty($ncnt)) $ncnt = 1;
- else $ncnt += 1;
-
- $str .= str_repeat(' ',$ncnt);
- }
- $this->_connectionID = pg_connect($str);
- }
- if ($this->_connectionID === false) return false;
- $this->Execute("set datestyle='ISO'");
-
- $info = $this->ServerInfo();
- $this->pgVersion = (float) substr($info['version'],0,3);
- if ($this->pgVersion >= 7.1) { // good till version 999
- $this->_nestedSQL = true;
- }
- return true;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName,-1);
- }
-
- // returns true or false
- //
- // examples:
- // $db->PConnect("host=host1 user=user1 password=secret port=4341");
- // $db->PConnect('host1','user1','secret');
- function _pconnect($str,$user='',$pwd='',$db='')
- {
- return $this->_connect($str,$user,$pwd,$db,1);
- }
-
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
- $this->_errorMsg = false;
- if ($inputarr) {
- /*
- It appears that PREPARE/EXECUTE is slower for many queries.
-
- For query executed 1000 times:
- "select id,firstname,lastname from adoxyz
- where firstname not like ? and lastname not like ? and id = ?"
-
- with plan = 1.51861286163 secs
- no plan = 1.26903700829 secs
-
-
-
- */
- $plan = 'P'.md5($sql);
-
- $execp = '';
- foreach($inputarr as $v) {
- if ($execp) $execp .= ',';
- if (is_string($v)) {
- if (strncmp($v,"'",1) !== 0) $execp .= $this->qstr($v);
- } else {
- $execp .= $v;
- }
- }
-
- if ($execp) $exsql = "EXECUTE $plan ($execp)";
- else $exsql = "EXECUTE $plan";
-
-
- $rez = @pg_exec($this->_connectionID,$exsql);
- if (!$rez) {
- # Perhaps plan does not exist? Prepare/compile plan.
- $params = '';
- foreach($inputarr as $v) {
- if ($params) $params .= ',';
- if (is_string($v)) {
- $params .= 'VARCHAR';
- } else if (is_integer($v)) {
- $params .= 'INTEGER';
- } else {
- $params .= "REAL";
- }
- }
- $sqlarr = explode('?',$sql);
- //print_r($sqlarr);
- $sql = '';
- $i = 1;
- foreach($sqlarr as $v) {
- $sql .= $v.' $'.$i;
- $i++;
- }
- $s = "PREPARE $plan ($params) AS ".substr($sql,0,strlen($sql)-2);
- //adodb_pr($s);
- $rez = pg_exec($this->_connectionID,$s);
- //echo $this->ErrorMsg();
- }
- if ($rez)
- $rez = pg_exec($this->_connectionID,$exsql);
- } else {
- //adodb_backtrace();
- $rez = pg_exec($this->_connectionID,$sql);
- }
- // check if no data returned, then no need to create real recordset
- if ($rez && pg_numfields($rez) <= 0) {
- if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {
- pg_freeresult($this->_resultid);
- }
- $this->_resultid = $rez;
- return true;
- }
-
- return $rez;
- }
-
- function _errconnect()
- {
- if (defined('DB_ERROR_CONNECT_FAILED')) return DB_ERROR_CONNECT_FAILED;
- else return 'Database connection failed';
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (ADODB_PHPVER >= 0x4300) {
- if (!empty($this->_resultid)) {
- $this->_errorMsg = @pg_result_error($this->_resultid);
- if ($this->_errorMsg) return $this->_errorMsg;
- }
-
- if (!empty($this->_connectionID)) {
- $this->_errorMsg = @pg_last_error($this->_connectionID);
- } else $this->_errorMsg = $this->_errconnect();
- } else {
- if (empty($this->_connectionID)) $this->_errconnect();
- else $this->_errorMsg = @pg_errormessage($this->_connectionID);
- }
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- $e = $this->ErrorMsg();
- if (strlen($e)) {
- return ADOConnection::MetaError($e);
- }
- return 0;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->transCnt) $this->RollbackTrans();
- if ($this->_resultid) {
- @pg_freeresult($this->_resultid);
- $this->_resultid = false;
- }
- @pg_close($this->_connectionID);
- $this->_connectionID = false;
- return true;
- }
-
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 1000000000; // should be 1 Gb?
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 1000000000; // should be 1 Gb?
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_postgres64 extends ADORecordSet{
- var $_blobArr;
- var $databaseType = "postgres64";
- var $canSeek = true;
- function ADORecordSet_postgres64($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode)
- {
- case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
- case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- default: $this->fetchMode = PGSQL_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
- $this->ADORecordSet($queryID);
- }
-
- function GetRowAssoc($upper=true)
- {
- if ($this->fetchMode == PGSQL_ASSOC && !$upper) return $this->fields;
- $row = ADORecordSet::GetRowAssoc($upper);
- return $row;
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $qid = $this->_queryID;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($qid):-1;
- $this->_numOfFields = @pg_numfields($qid);
-
- // cache types for blob decode check
- // apparently pg_fieldtype actually performs an sql query on the database to get the type.
- if (empty($this->connection->noBlobs))
- for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) {
- if (pg_fieldtype($qid,$i) == 'bytea') {
- $this->_blobArr[$i] = pg_fieldname($qid,$i);
- }
- }
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode != PGSQL_NUM) return @$this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function FetchField($off = 0)
- {
- // offsets begin at 0
-
- $o= new ADOFieldObject();
- $o->name = @pg_fieldname($this->_queryID,$off);
- $o->type = @pg_fieldtype($this->_queryID,$off);
- $o->max_length = @pg_fieldsize($this->_queryID,$off);
- return $o;
- }
-
- function _seek($row)
- {
- return @pg_fetch_row($this->_queryID,$row);
- }
-
- function _decode($blob)
- {
- if ($blob === NULL) return NULL;
- eval('$realblob="'.adodb_str_replace(array('"','$'),array('\"','\$'),$blob).'";');
- return $realblob;
- }
-
- function _fixblobs()
- {
- if ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) {
- foreach($this->_blobArr as $k => $v) {
- $this->fields[$k] = ADORecordSet_postgres64::_decode($this->fields[$k]);
- }
- }
- if ($this->fetchMode == PGSQL_ASSOC || $this->fetchMode == PGSQL_BOTH) {
- foreach($this->_blobArr as $k => $v) {
- $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]);
- }
- }
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
- if (is_array($this->fields) && $this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-
- function _fetch()
- {
-
- if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0)
- return false;
-
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
-
- return (is_array($this->fields));
- }
-
- function _close()
- {
- return @pg_freeresult($this->_queryID);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- switch (strtoupper($t)) {
- case 'MONEY': // stupid, postgres expects money to be a string
- case 'INTERVAL':
- case 'CHAR':
- case 'CHARACTER':
- case 'VARCHAR':
- case 'NAME':
- case 'BPCHAR':
- case '_VARCHAR':
- case 'INET':
- case 'MACADDR':
- if ($len <= $this->blobSize) return 'C';
-
- case 'TEXT':
- return 'X';
-
- case 'IMAGE': // user defined type
- case 'BLOB': // user defined type
- case 'BIT': // This is a bit string, not a single bit, so don't return 'L'
- case 'VARBIT':
- case 'BYTEA':
- return 'B';
-
- case 'BOOL':
- case 'BOOLEAN':
- return 'L';
-
- case 'DATE':
- return 'D';
-
-
- case 'TIMESTAMP WITHOUT TIME ZONE':
- case 'TIME':
- case 'DATETIME':
- case 'TIMESTAMP':
- case 'TIMESTAMPTZ':
- return 'T';
-
- case 'SMALLINT':
- case 'BIGINT':
- case 'INTEGER':
- case 'INT8':
- case 'INT4':
- case 'INT2':
- if (isset($fieldobj) &&
- empty($fieldobj->primary_key) && (!$this->connection->uniqueIisR || empty($fieldobj->unique))) return 'I';
-
- case 'OID':
- case 'SERIAL':
- return 'R';
-
- default:
- return 'N';
- }
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-postgres7.inc.php b/src/adodb512/drivers/adodb-postgres7.inc.php
deleted file mode 100644
index eecfdc37..00000000
--- a/src/adodb512/drivers/adodb-postgres7.inc.php
+++ /dev/null
@@ -1,313 +0,0 @@
-ADODB_postgres64();
- if (ADODB_ASSOC_CASE !== 2) {
- $this->rsPrefix .= 'assoc_';
- }
- $this->_bindInputArray = PHP_VERSION >= 5.1;
- }
-
-
- // the following should be compat with postgresql 7.2,
- // which makes obsolete the LIMIT limit,offset syntax
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : '';
- $limitStr = ($nrows >= 0) ? " LIMIT ".((integer)$nrows) : '';
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
- /*
- function Prepare($sql)
- {
- $info = $this->ServerInfo();
- if ($info['version']>=7.3) {
- return array($sql,false);
- }
- return $sql;
- }
- */
-
- /*
- I discovered that the MetaForeignKeys method no longer worked for Postgres 8.3.
- I went ahead and modified it to work for both 8.2 and 8.3.
- Please feel free to include this change in your next release of adodb.
- William Kolodny [William.Kolodny#gt-t.net]
- */
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- $sql="
- SELECT fum.ftblname AS lookup_table, split_part(fum.rf, ')'::text, 1) AS lookup_field,
- fum.ltable AS dep_table, split_part(fum.lf, ')'::text, 1) AS dep_field
- FROM (
- SELECT fee.ltable, fee.ftblname, fee.consrc, split_part(fee.consrc,'('::text, 2) AS lf,
- split_part(fee.consrc, '('::text, 3) AS rf
- FROM (
- SELECT foo.relname AS ltable, foo.ftblname,
- pg_get_constraintdef(foo.oid) AS consrc
- FROM (
- SELECT c.oid, c.conname AS name, t.relname, ft.relname AS ftblname
- FROM pg_constraint c
- JOIN pg_class t ON (t.oid = c.conrelid)
- JOIN pg_class ft ON (ft.oid = c.confrelid)
- JOIN pg_namespace nft ON (nft.oid = ft.relnamespace)
- LEFT JOIN pg_description ds ON (ds.objoid = c.oid)
- JOIN pg_namespace n ON (n.oid = t.relnamespace)
- WHERE c.contype = 'f'::\"char\"
- ORDER BY t.relname, n.nspname, c.conname, c.oid
- ) foo
- ) fee) fum
- WHERE fum.ltable='".strtolower($table)."'
- ORDER BY fum.ftblname, fum.ltable, split_part(fum.lf, ')'::text, 1)
- ";
- $rs = $this->Execute($sql);
-
- if (!$rs || $rs->EOF) return false;
-
- $a = array();
- while (!$rs->EOF) {
- if ($upper) {
- $a[strtoupper($rs->Fields('lookup_table'))][] = strtoupper(str_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field')));
- } else {
- $a[$rs->Fields('lookup_table')][] = str_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field'));
- }
- $rs->MoveNext();
- }
-
- return $a;
-
- }
-
- // from Edward Jaramilla, improved version - works on pg 7.4
- function _old_MetaForeignKeys($table, $owner=false, $upper=false)
- {
- $sql = 'SELECT t.tgargs as args
- FROM
- pg_trigger t,pg_class c,pg_proc p
- WHERE
- t.tgenabled AND
- t.tgrelid = c.oid AND
- t.tgfoid = p.oid AND
- p.proname = \'RI_FKey_check_ins\' AND
- c.relname = \''.strtolower($table).'\'
- ORDER BY
- t.tgrelid';
-
- $rs = $this->Execute($sql);
-
- if (!$rs || $rs->EOF) return false;
-
- $arr = $rs->GetArray();
- $a = array();
- foreach($arr as $v) {
- $data = explode(chr(0), $v['args']);
- $size = count($data)-1; //-1 because the last node is empty
- for($i = 4; $i < $size; $i++) {
- if ($upper)
- $a[strtoupper($data[2])][] = strtoupper($data[$i].'='.$data[++$i]);
- else
- $a[$data[2]][] = $data[$i].'='.$data[++$i];
- }
- }
- return $a;
- }
-
- function _query($sql,$inputarr=false)
- {
- if (! $this->_bindInputArray) {
- // We don't have native support for parameterized queries, so let's emulate it at the parent
- return ADODB_postgres64::_query($sql, $inputarr);
- }
- $this->_errorMsg = false;
- // -- added Cristiano da Cunha Duarte
- if ($inputarr) {
- $sqlarr = explode('?',trim($sql));
- $sql = '';
- $i = 1;
- $last = sizeof($sqlarr)-1;
- foreach($sqlarr as $v) {
- if ($last < $i) $sql .= $v;
- else $sql .= $v.' $'.$i;
- $i++;
- }
-
- $rez = pg_query_params($this->_connectionID,$sql, $inputarr);
- } else {
- $rez = pg_query($this->_connectionID,$sql);
- }
- // check if no data returned, then no need to create real recordset
- if ($rez && pg_numfields($rez) <= 0) {
- if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {
- pg_freeresult($this->_resultid);
- }
- $this->_resultid = $rez;
- return true;
- }
- return $rez;
- }
-
- // this is a set of functions for managing client encoding - very important if the encodings
- // of your database and your output target (i.e. HTML) don't match
- //for instance, you may have UNICODE database and server it on-site as WIN1251 etc.
- // GetCharSet - get the name of the character set the client is using now
- // the functions should work with Postgres 7.0 and above, the set of charsets supported
- // depends on compile flags of postgres distribution - if no charsets were compiled into the server
- // it will return 'SQL_ANSI' always
- function GetCharSet()
- {
- //we will use ADO's builtin property charSet
- $this->charSet = @pg_client_encoding($this->_connectionID);
- if (!$this->charSet) {
- return false;
- } else {
- return $this->charSet;
- }
- }
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- $this->GetCharSet();
- if ($this->charSet !== $charset_name) {
- $if = pg_set_client_encoding($this->_connectionID, $charset_name);
- if ($if == "0" & $this->GetCharSet() == $charset_name) {
- return true;
- } else return false;
- } else return true;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_postgres7 extends ADORecordSet_postgres64{
-
- var $databaseType = "postgres7";
-
-
- function ADORecordSet_postgres7($queryID,$mode=false)
- {
- $this->ADORecordSet_postgres64($queryID,$mode);
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if (is_array($this->fields)) {
- if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-
-}
-
-class ADORecordSet_assoc_postgres7 extends ADORecordSet_postgres64{
-
- var $databaseType = "postgres7";
-
-
- function ADORecordSet_assoc_postgres7($queryID,$mode=false)
- {
- $this->ADORecordSet_postgres64($queryID,$mode);
- }
-
- function _fetch()
- {
- if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0)
- return false;
-
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if ($this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
- $this->_updatefields();
- }
-
- return (is_array($this->fields));
- }
-
- // Create associative array
- function _updatefields()
- {
- if (ADODB_ASSOC_CASE == 2) return; // native
-
- $arr = array();
- $lowercase = (ADODB_ASSOC_CASE == 0);
-
- foreach($this->fields as $k => $v) {
- if (is_integer($k)) $arr[$k] = $v;
- else {
- if ($lowercase)
- $arr[strtolower($k)] = $v;
- else
- $arr[strtoupper($k)] = $v;
- }
- }
- $this->fields = $arr;
- }
-
- function MoveNext()
- {
- if (!$this->EOF) {
- $this->_currentRow++;
- if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
- $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
-
- if (is_array($this->fields)) {
- if ($this->fields) {
- if (isset($this->_blobArr)) $this->_fixblobs();
-
- $this->_updatefields();
- }
- return true;
- }
- }
-
-
- $this->fields = false;
- $this->EOF = true;
- }
- return false;
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-postgres8.inc.php b/src/adodb512/drivers/adodb-postgres8.inc.php
deleted file mode 100644
index 3134e3c3..00000000
--- a/src/adodb512/drivers/adodb-postgres8.inc.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-proxy.inc.php b/src/adodb512/drivers/adodb-proxy.inc.php
deleted file mode 100644
index a7292b8c..00000000
--- a/src/adodb512/drivers/adodb-proxy.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-ADORecordset($id,$mode);
- }
- };
-} // define
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-sapdb.inc.php b/src/adodb512/drivers/adodb-sapdb.inc.php
deleted file mode 100644
index 8a4bf9ac..00000000
--- a/src/adodb512/drivers/adodb-sapdb.inc.php
+++ /dev/null
@@ -1,184 +0,0 @@
-curmode = SQL_CUR_USE_ODBC;
- $this->ADODB_odbc();
- }
-
- function ServerInfo()
- {
- $info = ADODB_odbc::ServerInfo();
- if (!$info['version'] && preg_match('/([0-9.]+)/',$info['description'],$matches)) {
- $info['version'] = $matches[1];
- }
- return $info;
- }
-
- function MetaPrimaryKeys($table)
- {
- $table = $this->Quote(strtoupper($table));
-
- return $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos");
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner = false)
- {
- $table = $this->Quote(strtoupper($table));
-
- $sql = "SELECT INDEXNAME,TYPE,COLUMNNAME FROM INDEXCOLUMNS ".
- " WHERE TABLENAME=$table".
- " ORDER BY INDEXNAME,COLUMNNO";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $indexes[$row[0]]['unique'] = $row[1] == 'UNIQUE';
- $indexes[$row[0]]['columns'][] = $row[2];
- }
- if ($primary) {
- $indexes['SYSPRIMARYKEYINDEX'] = array(
- 'unique' => True, // by definition
- 'columns' => $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table AND mode='KEY' ORDER BY pos"),
- );
- }
- return $indexes;
- }
-
- function MetaColumns ($table)
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $table = $this->Quote(strtoupper($table));
-
- $retarr = array();
- foreach($this->GetAll("SELECT COLUMNNAME,DATATYPE,LEN,DEC,NULLABLE,MODE,\"DEFAULT\",CASE WHEN \"DEFAULT\" IS NULL THEN 0 ELSE 1 END AS HAS_DEFAULT FROM COLUMNS WHERE tablename=$table ORDER BY pos") as $column)
- {
- $fld = new ADOFieldObject();
- $fld->name = $column[0];
- $fld->type = $column[1];
- $fld->max_length = $fld->type == 'LONG' ? 2147483647 : $column[2];
- $fld->scale = $column[3];
- $fld->not_null = $column[4] == 'NO';
- $fld->primary_key = $column[5] == 'KEY';
- if ($fld->has_default = $column[7]) {
- if ($fld->primary_key && $column[6] == 'DEFAULT SERIAL (1)') {
- $fld->auto_increment = true;
- $fld->has_default = false;
- } else {
- $fld->default_value = $column[6];
- switch($fld->type) {
- case 'VARCHAR':
- case 'CHARACTER':
- case 'LONG':
- $fld->default_value = $column[6];
- break;
- default:
- $fld->default_value = trim($column[6]);
- break;
- }
- }
- }
- $retarr[$fld->name] = $fld;
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- return $retarr;
- }
-
- function MetaColumnNames($table)
- {
- $table = $this->Quote(strtoupper($table));
-
- return $this->GetCol("SELECT columnname FROM COLUMNS WHERE tablename=$table ORDER BY pos");
- }
-
- // unlike it seems, this depends on the db-session and works in a multiuser environment
- function _insertid($table,$column)
- {
- return empty($table) ? False : $this->GetOne("SELECT $table.CURRVAL FROM DUAL");
- }
-
- /*
- SelectLimit implementation problems:
-
- The following will return random 10 rows as order by performed after "WHERE rowno<10"
- which is not ideal...
-
- select * from table where rowno < 10 order by 1
-
- This means that we have to use the adoconnection base class SelectLimit when
- there is an "order by".
-
- See http://listserv.sap.com/pipermail/sapdb.general/2002-January/010405.html
- */
-
-};
-
-
-class ADORecordSet_sapdb extends ADORecordSet_odbc {
-
- var $databaseType = "sapdb";
-
- function ADORecordSet_sapdb($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-}
-
-} //define
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-sqlanywhere.inc.php b/src/adodb512/drivers/adodb-sqlanywhere.inc.php
deleted file mode 100644
index 3933d85e..00000000
--- a/src/adodb512/drivers/adodb-sqlanywhere.inc.php
+++ /dev/null
@@ -1,169 +0,0 @@
-create_blobvar($blobVarName);
-
- b) load blob var from file. $filename must be complete path
-
- $dbcon->load_blobvar_from_file($blobVarName, $filename);
-
- c) Use the $blobVarName in SQL insert or update statement in the values
- clause:
-
- $recordSet = $dbconn->Execute('INSERT INTO tabname (idcol, blobcol) '
- .
- 'VALUES (\'test\', ' . $blobVarName . ')');
-
- instead of loading blob from a file, you can also load from
- an unformatted (raw) blob variable:
- $dbcon->load_blobvar_from_var($blobVarName, $varName);
-
- d) drop blob variable on db server to free up resources:
- $dbconn->drop_blobvar($blobVarName);
-
- Sybase_SQLAnywhere data driver. Requires ODBC.
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (!defined('_ADODB_ODBC_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-
-if (!defined('ADODB_SYBASE_SQLANYWHERE')){
-
- define('ADODB_SYBASE_SQLANYWHERE',1);
-
- class ADODB_sqlanywhere extends ADODB_odbc {
- var $databaseType = "sqlanywhere";
- var $hasInsertID = true;
-
- function ADODB_sqlanywhere()
- {
- $this->ADODB_odbc();
- }
-
- function _insertid() {
- return $this->GetOne('select @@identity');
- }
-
- function create_blobvar($blobVarName) {
- $this->Execute("create variable $blobVarName long binary");
- return;
- }
-
- function drop_blobvar($blobVarName) {
- $this->Execute("drop variable $blobVarName");
- return;
- }
-
- function load_blobvar_from_file($blobVarName, $filename) {
- $chunk_size = 1000;
-
- $fd = fopen ($filename, "rb");
-
- $integer_chunks = (integer)filesize($filename) / $chunk_size;
- $modulus = filesize($filename) % $chunk_size;
- if ($modulus != 0){
- $integer_chunks += 1;
- }
-
- for($loop=1;$loop<=$integer_chunks;$loop++){
- $contents = fread ($fd, $chunk_size);
- $contents = bin2hex($contents);
-
- $hexstring = '';
-
- for($loop2=0;$loop2qstr($hexstring);
-
- $this->Execute("set $blobVarName = $blobVarName || " . $hexstring);
- }
-
- fclose ($fd);
- return;
- }
-
- function load_blobvar_from_var($blobVarName, &$varName) {
- $chunk_size = 1000;
-
- $integer_chunks = (integer)strlen($varName) / $chunk_size;
- $modulus = strlen($varName) % $chunk_size;
- if ($modulus != 0){
- $integer_chunks += 1;
- }
-
- for($loop=1;$loop<=$integer_chunks;$loop++){
- $contents = substr ($varName, (($loop - 1) * $chunk_size), $chunk_size);
- $contents = bin2hex($contents);
-
- $hexstring = '';
-
- for($loop2=0;$loop2qstr($hexstring);
-
- $this->Execute("set $blobVarName = $blobVarName || " . $hexstring);
- }
-
- return;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,&$val,$where,$blobtype='BLOB')
- {
- $blobVarName = 'hold_blob';
- $this->create_blobvar($blobVarName);
- $this->load_blobvar_from_var($blobVarName, $val);
- $this->Execute("UPDATE $table SET $column=$blobVarName WHERE $where");
- $this->drop_blobvar($blobVarName);
- return true;
- }
- }; //class
-
- class ADORecordSet_sqlanywhere extends ADORecordSet_odbc {
-
- var $databaseType = "sqlanywhere";
-
- function ADORecordSet_sqlanywhere($id,$mode=false)
- {
- $this->ADORecordSet_odbc($id,$mode);
- }
-
-
- }; //class
-
-
-} //define
-?>
diff --git a/src/adodb512/drivers/adodb-sqlite.inc.php b/src/adodb512/drivers/adodb-sqlite.inc.php
deleted file mode 100644
index bb95a42e..00000000
--- a/src/adodb512/drivers/adodb-sqlite.inc.php
+++ /dev/null
@@ -1,398 +0,0 @@
-fmtDate)."'";
- case 'sysTimeStamp' : return "'".date($this->sysTimeStamp)."'";
- }
- }*/
-
- function ServerInfo()
- {
- $arr['version'] = sqlite_libversion();
- $arr['description'] = 'SQLite ';
- $arr['encoding'] = sqlite_libencoding();
- return $arr;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("BEGIN TRANSACTION");
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- $ret = $this->Execute("COMMIT");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $ret = $this->Execute("ROLLBACK");
- if ($this->transCnt>0)$this->transCnt -= 1;
- return !empty($ret);
- }
-
- // mark newnham
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute("PRAGMA table_info('$table')");
- if (isset($savem)) $this->SetFetchMode($savem);
- if (!$rs) {
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $arr = array();
- while ($r = $rs->FetchRow()) {
- $type = explode('(',$r['type']);
- $size = '';
- if (sizeof($type)==2)
- $size = trim($type[1],')');
- $fn = strtoupper($r['name']);
- $fld = new ADOFieldObject;
- $fld->name = $r['name'];
- $fld->type = $type[0];
- $fld->max_length = $size;
- $fld->not_null = $r['notnull'];
- $fld->default_value = $r['dflt_value'];
- $fld->scale = 0;
- if ($save == ADODB_FETCH_NUM) $arr[] = $fld;
- else $arr[strtoupper($fld->name)] = $fld;
- }
- $rs->Close();
- $ADODB_FETCH_MODE = $save;
- return $arr;
- }
-
- function _init($parentDriver)
- {
-
- $parentDriver->hasTransactions = false;
- $parentDriver->hasInsertID = true;
- }
-
- function _insertid()
- {
- return sqlite_last_insert_rowid($this->_connectionID);
- }
-
- function _affectedrows()
- {
- return sqlite_changes($this->_connectionID);
- }
-
- function ErrorMsg()
- {
- if ($this->_logsql) return $this->_errorMsg;
- return ($this->_errorNo) ? sqlite_error_string($this->_errorNo) : '';
- }
-
- function ErrorNo()
- {
- return $this->_errorNo;
- }
-
- function SQLDate($fmt, $col=false)
- {
- $fmt = $this->qstr($fmt);
- return ($col) ? "adodb_date2($fmt,$col)" : "adodb_date($fmt)";
- }
-
-
- function _createFunctions()
- {
- @sqlite_create_function($this->_connectionID, 'adodb_date', 'adodb_date', 1);
- @sqlite_create_function($this->_connectionID, 'adodb_date2', 'adodb_date2', 2);
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_open($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlite_open')) return null;
- if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
-
- $this->_connectionID = sqlite_popen($argHostname);
- if ($this->_connectionID === false) return false;
- $this->_createFunctions();
- return true;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- $rez = sqlite_query($sql,$this->_connectionID);
- if (!$rez) {
- $this->_errorNo = sqlite_last_error($this->_connectionID);
- }
-
- return $rez;
- }
-
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
- $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
- if ($secs2cache)
- $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
- else
- $rs = $this->Execute($sql."$limitStr$offsetStr",$inputarr);
-
- return $rs;
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- var $_genSeqSQL = "create table %s (id integer)";
-
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- while (--$MAXLOOPS>=0) {
- @($num = $this->GetOne("select id from $seq"));
- if ($num === false) {
- $this->Execute(sprintf($this->_genSeqSQL ,$seq));
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into $seq values($start)");
- if (!$ok) return false;
- }
- $this->Execute("update $seq set id=id+1 where id=$num");
-
- if ($this->affected_rows() > 0) {
- $num += 1;
- $this->genID = $num;
- return $num;
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- $start -= 1;
- return $this->Execute("insert into $seqname values($start)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname)
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- // returns true or false
- function _close()
- {
- return @sqlite_close($this->_connectionID);
- }
-
- function MetaIndexes($table, $primary = FALSE, $owner=false, $owner = false)
- {
- $false = false;
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array ();
- while ($row = $rs->FetchRow()) {
- if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
- if (!isset($indexes[$row[0]])) {
-
- $indexes[$row[0]] = array(
- 'unique' => preg_match("/unique/i",$row[1]),
- 'columns' => array());
- }
- /**
- * There must be a more elegant way of doing this,
- * the index elements appear in the SQL statement
- * in cols[1] between parentheses
- * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
- */
- $cols = explode("(",$row[1]);
- $cols = explode(")",$cols[1]);
- array_pop($cols);
- $indexes[$row[0]]['columns'] = $cols;
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_sqlite extends ADORecordSet {
-
- var $databaseType = "sqlite";
- var $bind = false;
-
- function ADORecordset_sqlite($queryID,$mode=false)
- {
-
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch($mode) {
- case ADODB_FETCH_NUM: $this->fetchMode = SQLITE_NUM; break;
- case ADODB_FETCH_ASSOC: $this->fetchMode = SQLITE_ASSOC; break;
- default: $this->fetchMode = SQLITE_BOTH; break;
- }
- $this->adodbFetchMode = $mode;
-
- $this->_queryID = $queryID;
-
- $this->_inited = true;
- $this->fields = array();
- if ($queryID) {
- $this->_currentRow = 0;
- $this->EOF = !$this->_fetch();
- @$this->_initrs();
- } else {
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
-
- return $this->_queryID;
- }
-
-
- function FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fld->name = sqlite_field_name($this->_queryID, $fieldOffset);
- $fld->type = 'VARCHAR';
- $fld->max_length = -1;
- return $fld;
- }
-
- function _initrs()
- {
- $this->_numOfRows = @sqlite_num_rows($this->_queryID);
- $this->_numOfFields = @sqlite_num_fields($this->_queryID);
- }
-
- function Fields($colname)
- {
- if ($this->fetchMode != SQLITE_NUM) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _seek($row)
- {
- return sqlite_seek($this->_queryID, $row);
- }
-
- function _fetch($ignore_fields=false)
- {
- $this->fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
- return !empty($this->fields);
- }
-
- function _close()
- {
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-sqlitepo.inc.php b/src/adodb512/drivers/adodb-sqlitepo.inc.php
deleted file mode 100644
index 2bdb99a7..00000000
--- a/src/adodb512/drivers/adodb-sqlitepo.inc.php
+++ /dev/null
@@ -1,62 +0,0 @@
-ADODB_sqlite();
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_sqlitepo extends ADORecordset_sqlite {
-
- var $databaseType = 'sqlitepo';
-
- function ADORecordset_sqlitepo($queryID,$mode=false)
- {
- $this->ADORecordset_sqlite($queryID,$mode);
- }
-
- // Modified to strip table names from returned fields
- function _fetch($ignore_fields=false)
- {
- $this->fields = array();
- $fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
- if(is_array($fields))
- foreach($fields as $n => $v)
- {
- if(($p = strpos($n, ".")) !== false)
- $n = substr($n, $p+1);
- $this->fields[$n] = $v;
- }
-
- return !empty($this->fields);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-sybase.inc.php b/src/adodb512/drivers/adodb-sybase.inc.php
deleted file mode 100644
index e333f3d1..00000000
--- a/src/adodb512/drivers/adodb-sybase.inc.php
+++ /dev/null
@@ -1,428 +0,0 @@
-GetOne('select @@identity');
- }
- // might require begintrans -- committrans
- function _affectedrows()
- {
- return $this->GetOne('select @@rowcount');
- }
-
-
- function BeginTrans()
- {
-
- if ($this->transOff) return true;
- $this->transCnt += 1;
-
- $this->Execute('BEGIN TRAN');
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
-
- if (!$ok) return $this->RollbackTrans();
-
- $this->transCnt -= 1;
- $this->Execute('COMMIT TRAN');
- return true;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt -= 1;
- $this->Execute('ROLLBACK TRAN');
- return true;
- }
-
- // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4
- function RowLock($tables,$where,$col='top 1 null as ignore')
- {
- if (!$this->_hastrans) $this->BeginTrans();
- $tables = str_replace(',',' HOLDLOCK,',$tables);
- return $this->GetOne("select $col from $tables HOLDLOCK where $where");
-
- }
-
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- return @sybase_select_db($dbName);
- }
- else return false;
- }
-
- /* Returns: the last error message from previous database operation
- Note: This function is NOT available for Microsoft SQL Server. */
-
-
- function ErrorMsg()
- {
- if ($this->_logsql) return $this->_errorMsg;
- if (function_exists('sybase_get_last_message'))
- $this->_errorMsg = sybase_get_last_message();
- else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform';
- return $this->_errorMsg;
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sybase_connect')) return null;
-
- if ($this->charSet) {
- $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword, $this->charSet);
- } else {
- $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
- }
-
- $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sybase_connect')) return null;
-
- if ($this->charSet) {
- $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword, $this->charSet);
- } else {
- $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword);
- }
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- global $ADODB_COUNTRECS;
-
- if ($ADODB_COUNTRECS == false && ADODB_PHPVER >= 0x4300)
- return sybase_unbuffered_query($sql,$this->_connectionID);
- else
- return sybase_query($sql,$this->_connectionID);
- }
-
- // See http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- if ($secs2cache > 0) {// we do not cache rowcount, so we have to load entire recordset
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $rs;
- }
-
- $nrows = (integer) $nrows;
- $offset = (integer) $offset;
-
- $cnt = ($nrows >= 0) ? $nrows : 999999999;
- if ($offset > 0 && $cnt) $cnt += $offset;
-
- $this->Execute("set rowcount $cnt");
- $rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,0);
- $this->Execute("set rowcount 0");
-
- return $rs;
- }
-
- // returns true or false
- function _close()
- {
- return @sybase_close($this->_connectionID);
- }
-
- static function UnixDate($v)
- {
- return ADORecordSet_array_sybase::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_sybase::UnixTimeStamp($v);
- }
-
-
-
- # Added 2003-10-05 by Chris Phillipson
- # Used ASA SQL Reference Manual -- http://sybooks.sybase.com/onlinebooks/group-aw/awg0800e/dbrfen8/@ebt-link;pt=16756?target=%25N%15_12018_START_RESTART_N%25
- # to convert similar Microsoft SQL*Server (mssql) API into Sybase compatible version
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "str_replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(qq,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "str_replace(str(datepart(dd,$col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "str_replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "str_replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "str_replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
- # Added 2003-10-07 by Chris Phillipson
- # Used ASA SQL Reference Manual -- http://sybooks.sybase.com/onlinebooks/group-aw/awg0800e/dbrfen8/@ebt-link;pt=5981;uf=0?target=0;window=new;showtoc=true;book=dbrfen8
- # to convert similar Microsoft SQL*Server (mssql) API into Sybase compatible version
- function MetaPrimaryKeys($table)
- {
- $sql = "SELECT c.column_name " .
- "FROM syscolumn c, systable t " .
- "WHERE t.table_name='$table' AND c.table_id=t.table_id " .
- "AND t.table_type='BASE' " .
- "AND c.pkey = 'Y' " .
- "ORDER BY c.column_id";
-
- $a = $this->GetCol($sql);
- if ($a && sizeof($a)>0) return $a;
- return false;
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-global $ADODB_sybase_mths;
-$ADODB_sybase_mths = array(
- 'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,
- 'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
-
-class ADORecordset_sybase extends ADORecordSet {
-
- var $databaseType = "sybase";
- var $canSeek = true;
- // _mths works only in non-localised system
- var $_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
-
- function ADORecordset_sybase($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC;
- else $this->fetchMode = $mode;
- $this->ADORecordSet($id,$mode);
- }
-
- /* Returns: an object containing field information.
- Get column information in the Recordset object. fetchField() can be used in order to obtain information about
- fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
- fetchField() is retrieved. */
- function FetchField($fieldOffset = -1)
- {
- if ($fieldOffset != -1) {
- $o = @sybase_fetch_field($this->_queryID, $fieldOffset);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @sybase_fetch_field($this->_queryID);
- }
- // older versions of PHP did not support type, only numeric
- if ($o && !isset($o->type)) $o->type = ($o->numeric) ? 'float' : 'varchar';
- return $o;
- }
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS)? @sybase_num_rows($this->_queryID):-1;
- $this->_numOfFields = @sybase_num_fields($this->_queryID);
- }
-
- function _seek($row)
- {
- return @sybase_data_seek($this->_queryID, $row);
- }
-
- function _fetch($ignore_fields=false)
- {
- if ($this->fetchMode == ADODB_FETCH_NUM) {
- $this->fields = @sybase_fetch_row($this->_queryID);
- } else if ($this->fetchMode == ADODB_FETCH_ASSOC) {
- $this->fields = @sybase_fetch_row($this->_queryID);
- if (is_array($this->fields)) {
- $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
- return true;
- }
- return false;
- } else {
- $this->fields = @sybase_fetch_array($this->_queryID);
- }
- if ( is_array($this->fields)) {
- return true;
- }
-
- return false;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
- function _close() {
- return @sybase_free_result($this->_queryID);
- }
-
- // sybase/mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_sybase::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_sybase::UnixTimeStamp($v);
- }
-}
-
-class ADORecordSet_array_sybase extends ADORecordSet_array {
- function ADORecordSet_array_sybase($id=-1)
- {
- $this->ADORecordSet_array($id);
- }
-
- // sybase/mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- global $ADODB_sybase_mths;
-
- //Dec 30 2000 12:00AM
- if (!preg_match( "/([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})/"
- ,$v, $rr)) return parent::UnixDate($v);
-
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $themth = substr(strtoupper($rr[1]),0,3);
- $themth = $ADODB_sybase_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return mktime(0,0,0,$themth,$rr[2],$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
- global $ADODB_sybase_mths;
- //11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com
- //Changed [0-9] to [0-9 ] in day conversion
- if (!preg_match( "/([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})/"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $themth = substr(strtoupper($rr[1]),0,3);
- $themth = $ADODB_sybase_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]);
- }
-}
-?>
diff --git a/src/adodb512/drivers/adodb-sybase_ase.inc.php b/src/adodb512/drivers/adodb-sybase_ase.inc.php
deleted file mode 100644
index 5d2023ce..00000000
--- a/src/adodb512/drivers/adodb-sybase_ase.inc.php
+++ /dev/null
@@ -1,119 +0,0 @@
-metaTablesSQL) {
- // complicated state saving by the need for backward compat
-
- if ($ttype == 'VIEWS'){
- $sql = str_replace('U', 'V', $this->metaTablesSQL);
- }elseif (false === $ttype){
- $sql = str_replace('U',"U' OR type='V", $this->metaTablesSQL);
- }else{ // TABLES OR ANY OTHER
- $sql = $this->metaTablesSQL;
- }
- $rs = $this->Execute($sql);
-
- if ($rs === false || !method_exists($rs, 'GetArray')){
- return $false;
- }
- $arr = $rs->GetArray();
-
- $arr2 = array();
- foreach($arr as $key=>$value){
- $arr2[] = trim($value['name']);
- }
- return $arr2;
- }
- return $false;
- }
-
- function MetaDatabases()
- {
- $arr = array();
- if ($this->metaDatabasesSQL!='') {
- $rs = $this->Execute($this->metaDatabasesSQL);
- if ($rs && !$rs->EOF){
- while (!$rs->EOF){
- $arr[] = $rs->Fields('name');
- $rs->MoveNext();
- }
- return $arr;
- }
- }
- return false;
- }
-
- // fix a bug which prevent the metaColumns query to be executed for Sybase ASE
- function MetaColumns($table,$upper=false)
- {
- $false = false;
- if (!empty($this->metaColumnsSQL)) {
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
- if ($rs === false) return $false;
-
- $retarr = array();
- while (!$rs->EOF) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->Fields('field_name');
- $fld->type = $rs->Fields('type');
- $fld->max_length = $rs->Fields('width');
- $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
- return $false;
- }
-
- function getProcedureList($schema)
- {
- return false;
- }
-
- function ErrorMsg()
- {
- if (!function_exists('sybase_connect')){
- return 'Your PHP doesn\'t contain the Sybase connection module!';
- }
- return parent::ErrorMsg();
- }
-}
-
-class adorecordset_sybase_ase extends ADORecordset_sybase {
-var $databaseType = "sybase_ase";
-function ADORecordset_sybase_ase($id,$mode=false)
- {
- $this->ADORecordSet_sybase($id,$mode);
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/drivers/adodb-vfp.inc.php b/src/adodb512/drivers/adodb-vfp.inc.php
deleted file mode 100644
index d1ccae31..00000000
--- a/src/adodb512/drivers/adodb-vfp.inc.php
+++ /dev/null
@@ -1,107 +0,0 @@
-ADODB_odbc();
- }
-
- function Time()
- {
- return time();
- }
-
- function BeginTrans() { return false;}
-
- // quote string to be sent back to database
- function qstr($s,$nofixquotes=false)
- {
- if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
- return "'".$s."'";
- }
-
-
- // TOP requires ORDER BY for VFP
- function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
- {
- $this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false;
- $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- return $ret;
- }
-
-
-
-};
-
-
-class ADORecordSet_vfp extends ADORecordSet_odbc {
-
- var $databaseType = "vfp";
-
-
- function ADORecordSet_vfp($id,$mode=false)
- {
- return $this->ADORecordSet_odbc($id,$mode);
- }
-
- function MetaType($t,$len=-1)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- switch (strtoupper($t)) {
- case 'C':
- if ($len <= $this->blobSize) return 'C';
- case 'M':
- return 'X';
-
- case 'D': return 'D';
-
- case 'T': return 'T';
-
- case 'L': return 'L';
-
- case 'I': return 'I';
-
- default: return 'N';
- }
- }
-}
-
-} //define
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-ar.inc.php b/src/adodb512/lang/adodb-ar.inc.php
deleted file mode 100644
index 4b750952..00000000
--- a/src/adodb512/lang/adodb-ar.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'ar',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' ',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' ',
- DB_ERROR_INVALID => ' ',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => ' ',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => 'DSN ',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-bg.inc.php b/src/adodb512/lang/adodb-bg.inc.php
deleted file mode 100644
index ee307c13..00000000
--- a/src/adodb512/lang/adodb-bg.inc.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-*/
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'bg',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' ',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' ',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => ' ',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-bgutf8.inc.php b/src/adodb512/lang/adodb-bgutf8.inc.php
deleted file mode 100644
index 5281ed53..00000000
--- a/src/adodb512/lang/adodb-bgutf8.inc.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-*/
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'bgutf8',
- DB_ERROR => 'неизвестна грешка',
- DB_ERROR_ALREADY_EXISTS => 'вече съществува',
- DB_ERROR_CANNOT_CREATE => 'не може да бъде създадена',
- DB_ERROR_CANNOT_DELETE => 'не може да бъде изтрита',
- DB_ERROR_CANNOT_DROP => 'не може да бъде унищожена',
- DB_ERROR_CONSTRAINT => 'нарушено условие',
- DB_ERROR_DIVZERO => 'деление на нула',
- DB_ERROR_INVALID => 'неправилно',
- DB_ERROR_INVALID_DATE => 'некоректна дата или час',
- DB_ERROR_INVALID_NUMBER => 'невалиден номер',
- DB_ERROR_MISMATCH => 'погрешна употреба',
- DB_ERROR_NODBSELECTED => 'не е избрана база данни',
- DB_ERROR_NOSUCHFIELD => 'несъществуващо поле',
- DB_ERROR_NOSUCHTABLE => 'несъществуваща таблица',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'не е намерена',
- DB_ERROR_NOT_LOCKED => 'не е заключена',
- DB_ERROR_SYNTAX => 'грешен синтаксис',
- DB_ERROR_UNSUPPORTED => 'не се поддържа',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'некоректен брой колони в реда',
- DB_ERROR_INVALID_DSN => 'невалиден DSN',
- DB_ERROR_CONNECT_FAILED => 'връзката не може да бъде осъществена',
- 0 => 'няма грешки', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'предоставените данни са недостатъчни',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'разширението не е намерено',
- DB_ERROR_NOSUCHDB => 'несъществуваща база данни',
- DB_ERROR_ACCESS_VIOLATION => 'нямате достатъчно права'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-ca.inc.php b/src/adodb512/lang/adodb-ca.inc.php
deleted file mode 100644
index 3640ebd0..00000000
--- a/src/adodb512/lang/adodb-ca.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'ca',
- DB_ERROR => 'error desconegut',
- DB_ERROR_ALREADY_EXISTS => 'ja existeix',
- DB_ERROR_CANNOT_CREATE => 'no es pot crear',
- DB_ERROR_CANNOT_DELETE => 'no es pot esborrar',
- DB_ERROR_CANNOT_DROP => 'no es pot eliminar',
- DB_ERROR_CONSTRAINT => 'violaci de constraint',
- DB_ERROR_DIVZERO => 'divisi per zero',
- DB_ERROR_INVALID => 'no s vlid',
- DB_ERROR_INVALID_DATE => 'la data o l\'hora no sn vlides',
- DB_ERROR_INVALID_NUMBER => 'el nombre no s vlid',
- DB_ERROR_MISMATCH => 'no hi ha coincidncia',
- DB_ERROR_NODBSELECTED => 'cap base de dades seleccionada',
- DB_ERROR_NOSUCHFIELD => 'camp inexistent',
- DB_ERROR_NOSUCHTABLE => 'taula inexistent',
- DB_ERROR_NOT_CAPABLE => 'l\'execuci secundria de DB no pot',
- DB_ERROR_NOT_FOUND => 'no trobat',
- DB_ERROR_NOT_LOCKED => 'no blocat',
- DB_ERROR_SYNTAX => 'error de sintaxi',
- DB_ERROR_UNSUPPORTED => 'no suportat',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'el nombre de columnes no coincideix amb el nombre de valors en la fila',
- DB_ERROR_INVALID_DSN => 'el DSN no s vlid',
- DB_ERROR_CONNECT_FAILED => 'connexi fallida',
- 0 => 'cap error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'les dades subministrades sn insuficients',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensi no trobada',
- DB_ERROR_NOSUCHDB => 'base de dades inexistent',
- DB_ERROR_ACCESS_VIOLATION => 'permisos insuficients'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-cn.inc.php b/src/adodb512/lang/adodb-cn.inc.php
deleted file mode 100644
index 44d5f490..00000000
--- a/src/adodb512/lang/adodb-cn.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'cn',
- DB_ERROR => 'δ֪',
- DB_ERROR_ALREADY_EXISTS => 'Ѿ',
- DB_ERROR_CANNOT_CREATE => 'ܴ',
- DB_ERROR_CANNOT_DELETE => 'ɾ',
- DB_ERROR_CANNOT_DROP => 'ܶ',
- DB_ERROR_CONSTRAINT => 'Լ',
- DB_ERROR_DIVZERO => '0',
- DB_ERROR_INVALID => 'Ч',
- DB_ERROR_INVALID_DATE => 'Чڻʱ',
- DB_ERROR_INVALID_NUMBER => 'Ч',
- DB_ERROR_MISMATCH => 'ƥ',
- DB_ERROR_NODBSELECTED => 'ûݿⱻѡ',
- DB_ERROR_NOSUCHFIELD => 'ûӦֶ',
- DB_ERROR_NOSUCHTABLE => 'ûӦı',
- DB_ERROR_NOT_CAPABLE => 'ݿ̨',
- DB_ERROR_NOT_FOUND => 'ûз',
- DB_ERROR_NOT_LOCKED => 'ûб',
- DB_ERROR_SYNTAX => '',
- DB_ERROR_UNSUPPORTED => '֧',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'ۼֵ',
- DB_ERROR_INVALID_DSN => 'ЧԴ (DSN)',
- DB_ERROR_CONNECT_FAILED => 'ʧ',
- 0 => 'ûд', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ṩݲܷҪ',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'չûб',
- DB_ERROR_NOSUCHDB => 'ûӦݿ',
- DB_ERROR_ACCESS_VIOLATION => 'ûкʵȨ'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-cz.inc.php b/src/adodb512/lang/adodb-cz.inc.php
deleted file mode 100644
index 1f5c08a9..00000000
--- a/src/adodb512/lang/adodb-cz.inc.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'cz',
- DB_ERROR => 'neznm chyba',
- DB_ERROR_ALREADY_EXISTS => 'ji? existuje',
- DB_ERROR_CANNOT_CREATE => 'nelze vytvo?it',
- DB_ERROR_CANNOT_DELETE => 'nelze smazat',
- DB_ERROR_CANNOT_DROP => 'nelze odstranit',
- DB_ERROR_CONSTRAINT => 'poru?en omezujc podmnky',
- DB_ERROR_DIVZERO => 'd?len nulou',
- DB_ERROR_INVALID => 'neplatn',
- DB_ERROR_INVALID_DATE => 'neplatn datum nebo ?as',
- DB_ERROR_INVALID_NUMBER => 'neplatn ?slo',
- DB_ERROR_MISMATCH => 'nesouhlas',
- DB_ERROR_NODBSELECTED => '?dn databze nen vybrna',
- DB_ERROR_NOSUCHFIELD => 'pole nenalezeno',
- DB_ERROR_NOSUCHTABLE => 'tabulka nenalezena',
- DB_ERROR_NOT_CAPABLE => 'nepodporovno',
- DB_ERROR_NOT_FOUND => 'nenalezeno',
- DB_ERROR_NOT_LOCKED => 'nezam?eno',
- DB_ERROR_SYNTAX => 'syntaktick chyba',
- DB_ERROR_UNSUPPORTED => 'nepodporovno',
- DB_ERROR_VALUE_COUNT_ON_ROW => '',
- DB_ERROR_INVALID_DSN => 'neplatn DSN',
- DB_ERROR_CONNECT_FAILED => 'p?ipojen selhalo',
- 0 => 'bez chyb', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'mlo zdrojovch dat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'roz??en nenalezeno',
- DB_ERROR_NOSUCHDB => 'databze neexistuje',
- DB_ERROR_ACCESS_VIOLATION => 'nedostate?n prva'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-da.inc.php b/src/adodb512/lang/adodb-da.inc.php
deleted file mode 100644
index ca0e72d6..00000000
--- a/src/adodb512/lang/adodb-da.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'da',
- DB_ERROR => 'ukendt fejl',
- DB_ERROR_ALREADY_EXISTS => 'eksisterer allerede',
- DB_ERROR_CANNOT_CREATE => 'kan ikke oprette',
- DB_ERROR_CANNOT_DELETE => 'kan ikke slette',
- DB_ERROR_CANNOT_DROP => 'kan ikke droppe',
- DB_ERROR_CONSTRAINT => 'begrænsning krænket',
- DB_ERROR_DIVZERO => 'division med nul',
- DB_ERROR_INVALID => 'ugyldig',
- DB_ERROR_INVALID_DATE => 'ugyldig dato eller klokkeslet',
- DB_ERROR_INVALID_NUMBER => 'ugyldigt tal',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'ingen database valgt',
- DB_ERROR_NOSUCHFIELD => 'felt findes ikke',
- DB_ERROR_NOSUCHTABLE => 'tabel findes ikke',
- DB_ERROR_NOT_CAPABLE => 'DB backend opgav',
- DB_ERROR_NOT_FOUND => 'ikke fundet',
- DB_ERROR_NOT_LOCKED => 'ikke låst',
- DB_ERROR_SYNTAX => 'syntaksfejl',
- DB_ERROR_UNSUPPORTED => 'ikke understøttet',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'resulterende antal felter svarer ikke til forespørgslens antal felter',
- DB_ERROR_INVALID_DSN => 'ugyldig DSN',
- DB_ERROR_CONNECT_FAILED => 'tilslutning mislykkedes',
- 0 => 'ingen fejl', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'utilstrækkelige data angivet',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'udvidelse ikke fundet',
- DB_ERROR_NOSUCHDB => 'database ikke fundet',
- DB_ERROR_ACCESS_VIOLATION => 'utilstrækkelige rettigheder'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-de.inc.php b/src/adodb512/lang/adodb-de.inc.php
deleted file mode 100644
index 44c57e9f..00000000
--- a/src/adodb512/lang/adodb-de.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'de',
- DB_ERROR => 'Unbekannter Fehler',
- DB_ERROR_ALREADY_EXISTS => 'existiert bereits',
- DB_ERROR_CANNOT_CREATE => 'kann nicht erstellen',
- DB_ERROR_CANNOT_DELETE => 'kann nicht löschen',
- DB_ERROR_CANNOT_DROP => 'Tabelle oder Index konnte nicht gelöscht werden',
- DB_ERROR_CONSTRAINT => 'Constraint Verletzung',
- DB_ERROR_DIVZERO => 'Division durch Null',
- DB_ERROR_INVALID => 'ung¨ltig',
- DB_ERROR_INVALID_DATE => 'ung¨ltiges Datum oder Zeit',
- DB_ERROR_INVALID_NUMBER => 'ung¨ltige Zahl',
- DB_ERROR_MISMATCH => 'Unverträglichkeit',
- DB_ERROR_NODBSELECTED => 'keine Dantebank ausgewählt',
- DB_ERROR_NOSUCHFIELD => 'Feld nicht vorhanden',
- DB_ERROR_NOSUCHTABLE => 'Tabelle nicht vorhanden',
- DB_ERROR_NOT_CAPABLE => 'Funktion nicht installiert',
- DB_ERROR_NOT_FOUND => 'nicht gefunden',
- DB_ERROR_NOT_LOCKED => 'nicht gesperrt',
- DB_ERROR_SYNTAX => 'Syntaxfehler',
- DB_ERROR_UNSUPPORTED => 'nicht Unterst¨tzt',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'Anzahl der zur¨ckgelieferten Felder entspricht nicht der Anzahl der Felder in der Abfrage',
- DB_ERROR_INVALID_DSN => 'ung¨ltiger DSN',
- DB_ERROR_CONNECT_FAILED => 'Verbindung konnte nicht hergestellt werden',
- 0 => 'kein Fehler', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'Nicht gen¨gend Daten geliefert',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'erweiterung nicht gefunden',
- DB_ERROR_NOSUCHDB => 'keine Datenbank',
- DB_ERROR_ACCESS_VIOLATION => 'ungen¨gende Rechte'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-en.inc.php b/src/adodb512/lang/adodb-en.inc.php
deleted file mode 100644
index 6895995e..00000000
--- a/src/adodb512/lang/adodb-en.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'en',
- DB_ERROR => 'unknown error',
- DB_ERROR_ALREADY_EXISTS => 'already exists',
- DB_ERROR_CANNOT_CREATE => 'can not create',
- DB_ERROR_CANNOT_DELETE => 'can not delete',
- DB_ERROR_CANNOT_DROP => 'can not drop',
- DB_ERROR_CONSTRAINT => 'constraint violation',
- DB_ERROR_DIVZERO => 'division by zero',
- DB_ERROR_INVALID => 'invalid',
- DB_ERROR_INVALID_DATE => 'invalid date or time',
- DB_ERROR_INVALID_NUMBER => 'invalid number',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'no database selected',
- DB_ERROR_NOSUCHFIELD => 'no such field',
- DB_ERROR_NOSUCHTABLE => 'no such table',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'not found',
- DB_ERROR_NOT_LOCKED => 'not locked',
- DB_ERROR_SYNTAX => 'syntax error',
- DB_ERROR_UNSUPPORTED => 'not supported',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
- DB_ERROR_INVALID_DSN => 'invalid DSN',
- DB_ERROR_CONNECT_FAILED => 'connect failed',
- 0 => 'no error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'insufficient data supplied',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
- DB_ERROR_NOSUCHDB => 'no such database',
- DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-es.inc.php b/src/adodb512/lang/adodb-es.inc.php
deleted file mode 100644
index 1e0afbb4..00000000
--- a/src/adodb512/lang/adodb-es.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'es',
- DB_ERROR => 'error desconocido',
- DB_ERROR_ALREADY_EXISTS => 'ya existe',
- DB_ERROR_CANNOT_CREATE => 'imposible crear',
- DB_ERROR_CANNOT_DELETE => 'imposible borrar',
- DB_ERROR_CANNOT_DROP => 'imposible hacer drop',
- DB_ERROR_CONSTRAINT => 'violacion de constraint',
- DB_ERROR_DIVZERO => 'division por cero',
- DB_ERROR_INVALID => 'invalido',
- DB_ERROR_INVALID_DATE => 'fecha u hora invalida',
- DB_ERROR_INVALID_NUMBER => 'numero invalido',
- DB_ERROR_MISMATCH => 'error',
- DB_ERROR_NODBSELECTED => 'no hay base de datos seleccionada',
- DB_ERROR_NOSUCHFIELD => 'campo invalido',
- DB_ERROR_NOSUCHTABLE => 'tabla no existe',
- DB_ERROR_NOT_CAPABLE => 'capacidad invalida para esta DB',
- DB_ERROR_NOT_FOUND => 'no encontrado',
- DB_ERROR_NOT_LOCKED => 'no bloqueado',
- DB_ERROR_SYNTAX => 'error de sintaxis',
- DB_ERROR_UNSUPPORTED => 'no soportado',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
- DB_ERROR_INVALID_DSN => 'DSN invalido',
- DB_ERROR_CONNECT_FAILED => 'fallo la conexion',
- 0 => 'sin error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'insuficientes datos',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
- DB_ERROR_NOSUCHDB => 'base de datos no encontrada',
- DB_ERROR_ACCESS_VIOLATION => 'permisos insuficientes'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-esperanto.inc.php b/src/adodb512/lang/adodb-esperanto.inc.php
deleted file mode 100644
index 16ca00e2..00000000
--- a/src/adodb512/lang/adodb-esperanto.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'eo',
- DB_ERROR => 'nekonata eraro',
- DB_ERROR_ALREADY_EXISTS => 'jam ekzistas',
- DB_ERROR_CANNOT_CREATE => 'maleblas krei',
- DB_ERROR_CANNOT_DELETE => 'maleblas elimini',
- DB_ERROR_CANNOT_DROP => 'maleblas elimini (drop)',
- DB_ERROR_CONSTRAINT => 'rompo de kondicxoj de provo',
- DB_ERROR_DIVZERO => 'divido per 0 (nul)',
- DB_ERROR_INVALID => 'malregule',
- DB_ERROR_INVALID_DATE => 'malregula dato kaj tempo',
- DB_ERROR_INVALID_NUMBER => 'malregula nombro',
- DB_ERROR_MISMATCH => 'eraro',
- DB_ERROR_NODBSELECTED => 'datumbazo ne elektita',
- DB_ERROR_NOSUCHFIELD => 'ne ekzistas kampo',
- DB_ERROR_NOSUCHTABLE => 'ne ekzistas tabelo',
- DB_ERROR_NOT_CAPABLE => 'DBMS ne povas',
- DB_ERROR_NOT_FOUND => 'ne trovita',
- DB_ERROR_NOT_LOCKED => 'ne blokita',
- DB_ERROR_SYNTAX => 'sintaksa eraro',
- DB_ERROR_UNSUPPORTED => 'ne apogata',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'nombrilo de valoroj en linio',
- DB_ERROR_INVALID_DSN => 'malregula DSN-o',
- DB_ERROR_CONNECT_FAILED => 'konekto malsukcesa',
- 0 => 'cxio bone', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ne suficxe da datumo',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'etendo ne trovita',
- DB_ERROR_NOSUCHDB => 'datumbazo ne ekzistas',
- DB_ERROR_ACCESS_VIOLATION => 'ne suficxe da rajto por atingo'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-fa.inc.php b/src/adodb512/lang/adodb-fa.inc.php
deleted file mode 100644
index a58a21cc..00000000
--- a/src/adodb512/lang/adodb-fa.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- */
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'fa',
- DB_ERROR => 'خطای ناشناخته',
- DB_ERROR_ALREADY_EXISTS => 'وجود دارد',
- DB_ERROR_CANNOT_CREATE => 'امکان create وجود ندارد',
- DB_ERROR_CANNOT_DELETE => 'امکان حذف وجود ندارد',
- DB_ERROR_CANNOT_DROP => 'امکان drop وجود ندارد',
- DB_ERROR_CONSTRAINT => 'نقض شرط',
- DB_ERROR_DIVZERO => 'تقسیم بر صفر',
- DB_ERROR_INVALID => 'نامعتبر',
- DB_ERROR_INVALID_DATE => 'زمان یا تاریخ نامعتبر',
- DB_ERROR_INVALID_NUMBER => 'عدد نامعتبر',
- DB_ERROR_MISMATCH => 'عدم مطابقت',
- DB_ERROR_NODBSELECTED => 'بانک اطلاعاتی انتخاب نشده است',
- DB_ERROR_NOSUCHFIELD => 'چنین ستونی وجود ندارد',
- DB_ERROR_NOSUCHTABLE => 'چنین جدولی وجود ندارد',
- DB_ERROR_NOT_CAPABLE => 'backend بانک اطلاعاتی قادر نیست',
- DB_ERROR_NOT_FOUND => 'پیدا نشد',
- DB_ERROR_NOT_LOCKED => 'قفل نشده',
- DB_ERROR_SYNTAX => 'خطای دستوری',
- DB_ERROR_UNSUPPORTED => 'پشتیبانی نمی شود',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'شمارش مقادیر روی ردیف',
- DB_ERROR_INVALID_DSN => 'DSN نامعتبر',
- DB_ERROR_CONNECT_FAILED => 'ارتباط برقرار نشد',
- 0 => 'بدون خطا', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'داده ناکافی است',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension پیدا نشد',
- DB_ERROR_NOSUCHDB => 'چنین بانک اطلاعاتی وجود ندارد',
- DB_ERROR_ACCESS_VIOLATION => 'حق دسترسی ناکافی'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-fr.inc.php b/src/adodb512/lang/adodb-fr.inc.php
deleted file mode 100644
index 11127cd6..00000000
--- a/src/adodb512/lang/adodb-fr.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'fr',
- DB_ERROR => 'erreur inconnue',
- DB_ERROR_ALREADY_EXISTS => 'existe déjà',
- DB_ERROR_CANNOT_CREATE => 'crétion impossible',
- DB_ERROR_CANNOT_DELETE => 'effacement impossible',
- DB_ERROR_CANNOT_DROP => 'suppression impossible',
- DB_ERROR_CONSTRAINT => 'violation de contrainte',
- DB_ERROR_DIVZERO => 'division par zéro',
- DB_ERROR_INVALID => 'invalide',
- DB_ERROR_INVALID_DATE => 'date ou heure invalide',
- DB_ERROR_INVALID_NUMBER => 'nombre invalide',
- DB_ERROR_MISMATCH => 'erreur de concordance',
- DB_ERROR_NODBSELECTED => 'pas de base de donnéessélectionnée',
- DB_ERROR_NOSUCHFIELD => 'nom de colonne invalide',
- DB_ERROR_NOSUCHTABLE => 'table ou vue inexistante',
- DB_ERROR_NOT_CAPABLE => 'fonction optionnelle non installée',
- DB_ERROR_NOT_FOUND => 'pas trouvé',
- DB_ERROR_NOT_LOCKED => 'non verrouillé',
- DB_ERROR_SYNTAX => 'erreur de syntaxe',
- DB_ERROR_UNSUPPORTED => 'non supporté',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valeur insérée trop grande pour colonne',
- DB_ERROR_INVALID_DSN => 'DSN invalide',
- DB_ERROR_CONNECT_FAILED => 'échec à la connexion',
- 0 => "pas d'erreur", // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'données fournies insuffisantes',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extension non trouvée',
- DB_ERROR_NOSUCHDB => 'base de données inconnue',
- DB_ERROR_ACCESS_VIOLATION => 'droits insuffisants'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-hu.inc.php b/src/adodb512/lang/adodb-hu.inc.php
deleted file mode 100644
index d6f0ef82..00000000
--- a/src/adodb512/lang/adodb-hu.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'hu',
- DB_ERROR => 'ismeretlen hiba',
- DB_ERROR_ALREADY_EXISTS => 'mr ltezik',
- DB_ERROR_CANNOT_CREATE => 'nem sikerlt ltrehozni',
- DB_ERROR_CANNOT_DELETE => 'nem sikerlt trlni',
- DB_ERROR_CANNOT_DROP => 'nem sikerlt eldobni',
- DB_ERROR_CONSTRAINT => 'szablyok megszegse',
- DB_ERROR_DIVZERO => 'oszts nullval',
- DB_ERROR_INVALID => 'rvnytelen',
- DB_ERROR_INVALID_DATE => 'rvnytelen dtum vagy id',
- DB_ERROR_INVALID_NUMBER => 'rvnytelen szm',
- DB_ERROR_MISMATCH => 'nem megfelel',
- DB_ERROR_NODBSELECTED => 'nincs kivlasztott adatbzis',
- DB_ERROR_NOSUCHFIELD => 'nincs ilyen mez',
- DB_ERROR_NOSUCHTABLE => 'nincs ilyen tbla',
- DB_ERROR_NOT_CAPABLE => 'DB backend nem tmogatja',
- DB_ERROR_NOT_FOUND => 'nem tallhat',
- DB_ERROR_NOT_LOCKED => 'nincs lezrva',
- DB_ERROR_SYNTAX => 'szintaktikai hiba',
- DB_ERROR_UNSUPPORTED => 'nem tmogatott',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'soron vgzett rtk szmlls',
- DB_ERROR_INVALID_DSN => 'hibs DSN',
- DB_ERROR_CONNECT_FAILED => 'sikertelen csatlakozs',
- 0 => 'nincs hiba', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'tl kevs az adat',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'bvtmny nem tallhat',
- DB_ERROR_NOSUCHDB => 'nincs ilyen adatbzis',
- DB_ERROR_ACCESS_VIOLATION => 'nincs jogosultsg'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-it.inc.php b/src/adodb512/lang/adodb-it.inc.php
deleted file mode 100644
index ac5cc5a7..00000000
--- a/src/adodb512/lang/adodb-it.inc.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'it',
- DB_ERROR => 'errore sconosciuto',
- DB_ERROR_ALREADY_EXISTS => 'esiste già',
- DB_ERROR_CANNOT_CREATE => 'non posso creare',
- DB_ERROR_CANNOT_DELETE => 'non posso cancellare',
- DB_ERROR_CANNOT_DROP => 'non posso eliminare',
- DB_ERROR_CONSTRAINT => 'violazione constraint',
- DB_ERROR_DIVZERO => 'divisione per zero',
- DB_ERROR_INVALID => 'non valido',
- DB_ERROR_INVALID_DATE => 'data od ora non valida',
- DB_ERROR_INVALID_NUMBER => 'numero non valido',
- DB_ERROR_MISMATCH => 'diversi',
- DB_ERROR_NODBSELECTED => 'nessun database selezionato',
- DB_ERROR_NOSUCHFIELD => 'nessun campo trovato',
- DB_ERROR_NOSUCHTABLE => 'nessuna tabella trovata',
- DB_ERROR_NOT_CAPABLE => 'DB backend non abilitato',
- DB_ERROR_NOT_FOUND => 'non trovato',
- DB_ERROR_NOT_LOCKED => 'non bloccato',
- DB_ERROR_SYNTAX => 'errore di sintassi',
- DB_ERROR_UNSUPPORTED => 'non supportato',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valore inserito troppo grande per una colonna',
- DB_ERROR_INVALID_DSN => 'DSN non valido',
- DB_ERROR_CONNECT_FAILED => 'connessione fallita',
- 0 => 'nessun errore', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'dati inseriti insufficienti',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'estensione non trovata',
- DB_ERROR_NOSUCHDB => 'database non trovato',
- DB_ERROR_ACCESS_VIOLATION => 'permessi insufficienti'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-nl.inc.php b/src/adodb512/lang/adodb-nl.inc.php
deleted file mode 100644
index abe77b52..00000000
--- a/src/adodb512/lang/adodb-nl.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'nl',
- DB_ERROR => 'onbekende fout',
- DB_ERROR_ALREADY_EXISTS => 'bestaat al',
- DB_ERROR_CANNOT_CREATE => 'kan niet aanmaken',
- DB_ERROR_CANNOT_DELETE => 'kan niet wissen',
- DB_ERROR_CANNOT_DROP => 'kan niet verwijderen',
- DB_ERROR_CONSTRAINT => 'constraint overtreding',
- DB_ERROR_DIVZERO => 'poging tot delen door nul',
- DB_ERROR_INVALID => 'ongeldig',
- DB_ERROR_INVALID_DATE => 'ongeldige datum of tijd',
- DB_ERROR_INVALID_NUMBER => 'ongeldig nummer',
- DB_ERROR_MISMATCH => 'is incorrect',
- DB_ERROR_NODBSELECTED => 'geen database geselecteerd',
- DB_ERROR_NOSUCHFIELD => 'onbekend veld',
- DB_ERROR_NOSUCHTABLE => 'onbekende tabel',
- DB_ERROR_NOT_CAPABLE => 'database systeem is niet tot uitvoer in staat',
- DB_ERROR_NOT_FOUND => 'niet gevonden',
- DB_ERROR_NOT_LOCKED => 'niet vergrendeld',
- DB_ERROR_SYNTAX => 'syntaxis fout',
- DB_ERROR_UNSUPPORTED => 'niet ondersteund',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'waarde telling op rij',
- DB_ERROR_INVALID_DSN => 'ongeldige DSN',
- DB_ERROR_CONNECT_FAILED => 'connectie mislukt',
- 0 => 'geen fout', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'onvoldoende data gegeven',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensie niet gevonden',
- DB_ERROR_NOSUCHDB => 'onbekende database',
- DB_ERROR_ACCESS_VIOLATION => 'onvoldoende rechten'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-pl.inc.php b/src/adodb512/lang/adodb-pl.inc.php
deleted file mode 100644
index 9d9e3906..00000000
--- a/src/adodb512/lang/adodb-pl.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'pl',
- DB_ERROR => 'niezidentyfikowany bd',
- DB_ERROR_ALREADY_EXISTS => 'ju istniej',
- DB_ERROR_CANNOT_CREATE => 'nie mona stworzy',
- DB_ERROR_CANNOT_DELETE => 'nie mona usun',
- DB_ERROR_CANNOT_DROP => 'nie mona porzuci',
- DB_ERROR_CONSTRAINT => 'pogwacenie uprawnie',
- DB_ERROR_DIVZERO => 'dzielenie przez zero',
- DB_ERROR_INVALID => 'bdny',
- DB_ERROR_INVALID_DATE => 'bdna godzina lub data',
- DB_ERROR_INVALID_NUMBER => 'bdny numer',
- DB_ERROR_MISMATCH => 'niedopasowanie',
- DB_ERROR_NODBSELECTED => 'baza danych nie zostaa wybrana',
- DB_ERROR_NOSUCHFIELD => 'nie znaleziono pola',
- DB_ERROR_NOSUCHTABLE => 'nie znaleziono tabeli',
- DB_ERROR_NOT_CAPABLE => 'nie zdolny',
- DB_ERROR_NOT_FOUND => 'nie znaleziono',
- DB_ERROR_NOT_LOCKED => 'nie zakmnity',
- DB_ERROR_SYNTAX => 'bd skadni',
- DB_ERROR_UNSUPPORTED => 'nie obsuguje',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'warto liczona w szeregu',
- DB_ERROR_INVALID_DSN => 'bdny DSN',
- DB_ERROR_CONNECT_FAILED => 'poczenie nie zostao zrealizowane',
- 0 => 'brak bdw', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'niedostateczna ilo informacji',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'nie znaleziono rozszerzenia',
- DB_ERROR_NOSUCHDB => 'nie znaleziono bazy',
- DB_ERROR_ACCESS_VIOLATION => 'niedostateczne uprawnienia'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-pt-br.inc.php b/src/adodb512/lang/adodb-pt-br.inc.php
deleted file mode 100644
index cd28f7e5..00000000
--- a/src/adodb512/lang/adodb-pt-br.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'pt-br',
- DB_ERROR => 'erro desconhecido',
- DB_ERROR_ALREADY_EXISTS => 'j existe',
- DB_ERROR_CANNOT_CREATE => 'impossvel criar',
- DB_ERROR_CANNOT_DELETE => 'impossvel exclur',
- DB_ERROR_CANNOT_DROP => 'impossvel remover',
- DB_ERROR_CONSTRAINT => 'violao do confinamente',
- DB_ERROR_DIVZERO => 'diviso por zero',
- DB_ERROR_INVALID => 'invlido',
- DB_ERROR_INVALID_DATE => 'data ou hora invlida',
- DB_ERROR_INVALID_NUMBER => 'nmero invlido',
- DB_ERROR_MISMATCH => 'erro',
- DB_ERROR_NODBSELECTED => 'nenhum banco de dados selecionado',
- DB_ERROR_NOSUCHFIELD => 'campo invlido',
- DB_ERROR_NOSUCHTABLE => 'tabela inexistente',
- DB_ERROR_NOT_CAPABLE => 'capacidade invlida para este BD',
- DB_ERROR_NOT_FOUND => 'no encontrado',
- DB_ERROR_NOT_LOCKED => 'no bloqueado',
- DB_ERROR_SYNTAX => 'erro de sintaxe',
- DB_ERROR_UNSUPPORTED =>
-'no suportado',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'a quantidade de colunas no corresponde ao de valores',
- DB_ERROR_INVALID_DSN => 'DSN invlido',
- DB_ERROR_CONNECT_FAILED => 'falha na conexo',
- 0 => 'sem erro', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'dados insuficientes',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extenso no encontrada',
- DB_ERROR_NOSUCHDB => 'banco de dados no encontrado',
- DB_ERROR_ACCESS_VIOLATION => 'permisso insuficiente'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-ro.inc.php b/src/adodb512/lang/adodb-ro.inc.php
deleted file mode 100644
index bcd7d132..00000000
--- a/src/adodb512/lang/adodb-ro.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- */
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'ro',
- DB_ERROR => 'eroare necunoscuta',
- DB_ERROR_ALREADY_EXISTS => 'deja exista',
- DB_ERROR_CANNOT_CREATE => 'nu se poate creea',
- DB_ERROR_CANNOT_DELETE => 'nu se poate sterge',
- DB_ERROR_CANNOT_DROP => 'nu se poate executa drop',
- DB_ERROR_CONSTRAINT => 'violare de constrain',
- DB_ERROR_DIVZERO => 'se divide la zero',
- DB_ERROR_INVALID => 'invalid',
- DB_ERROR_INVALID_DATE => 'data sau timp invalide',
- DB_ERROR_INVALID_NUMBER => 'numar invalid',
- DB_ERROR_MISMATCH => 'nepotrivire-mismatch',
- DB_ERROR_NODBSELECTED => 'nu exista baza de date selectata',
- DB_ERROR_NOSUCHFIELD => 'camp inexistent',
- DB_ERROR_NOSUCHTABLE => 'tabela inexistenta',
- DB_ERROR_NOT_CAPABLE => 'functie optionala neinstalata',
- DB_ERROR_NOT_FOUND => 'negasit',
- DB_ERROR_NOT_LOCKED => 'neblocat',
- DB_ERROR_SYNTAX => 'eroare de sintaxa',
- DB_ERROR_UNSUPPORTED => 'nu e suportat',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'valoare prea mare pentru coloana',
- DB_ERROR_INVALID_DSN => 'DSN invalid',
- DB_ERROR_CONNECT_FAILED => 'conectare esuata',
- 0 => 'fara eroare', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'data introduse insuficiente',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'extensie negasita',
- DB_ERROR_NOSUCHDB => 'nu exista baza de date',
- DB_ERROR_ACCESS_VIOLATION => 'permisiuni insuficiente'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-ru1251.inc.php b/src/adodb512/lang/adodb-ru1251.inc.php
deleted file mode 100644
index e273f427..00000000
--- a/src/adodb512/lang/adodb-ru1251.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'ru1251',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' (drop)',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' 0',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => '',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => ' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-sv.inc.php b/src/adodb512/lang/adodb-sv.inc.php
deleted file mode 100644
index 64a5b4bb..00000000
--- a/src/adodb512/lang/adodb-sv.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
- 'en',
- DB_ERROR => 'Oknt fel',
- DB_ERROR_ALREADY_EXISTS => 'finns redan',
- DB_ERROR_CANNOT_CREATE => 'kan inte skapa',
- DB_ERROR_CANNOT_DELETE => 'kan inte ta bort',
- DB_ERROR_CANNOT_DROP => 'kan inte slppa',
- DB_ERROR_CONSTRAINT => 'begrnsning krnkt',
- DB_ERROR_DIVZERO => 'division med noll',
- DB_ERROR_INVALID => 'ogiltig',
- DB_ERROR_INVALID_DATE => 'ogiltigt datum eller tid',
- DB_ERROR_INVALID_NUMBER => 'ogiltigt tal',
- DB_ERROR_MISMATCH => 'felaktig matchning',
- DB_ERROR_NODBSELECTED => 'ingen databas vald',
- DB_ERROR_NOSUCHFIELD => 'inget sdant flt',
- DB_ERROR_NOSUCHTABLE => 'ingen sdan tabell',
- DB_ERROR_NOT_CAPABLE => 'DB backend klarar det inte',
- DB_ERROR_NOT_FOUND => 'finns inte',
- DB_ERROR_NOT_LOCKED => 'inte lst',
- DB_ERROR_SYNTAX => 'syntaxfel',
- DB_ERROR_UNSUPPORTED => 'stds ej',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'vrde rknat p rad',
- DB_ERROR_INVALID_DSN => 'ogiltig DSN',
- DB_ERROR_CONNECT_FAILED => 'anslutning misslyckades',
- 0 => 'inget fel', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'otillrckligt med data angivet',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'utkning hittades ej',
- DB_ERROR_NOSUCHDB => 'ingen sdan databas',
- DB_ERROR_ACCESS_VIOLATION => 'otillrckliga rttigheter'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb-uk1251.inc.php b/src/adodb512/lang/adodb-uk1251.inc.php
deleted file mode 100644
index 675016d1..00000000
--- a/src/adodb512/lang/adodb-uk1251.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
- 'uk1251',
- DB_ERROR => ' ',
- DB_ERROR_ALREADY_EXISTS => ' ',
- DB_ERROR_CANNOT_CREATE => ' ',
- DB_ERROR_CANNOT_DELETE => ' ',
- DB_ERROR_CANNOT_DROP => ' (drop)',
- DB_ERROR_CONSTRAINT => ' ',
- DB_ERROR_DIVZERO => ' 0',
- DB_ERROR_INVALID => '',
- DB_ERROR_INVALID_DATE => ' ',
- DB_ERROR_INVALID_NUMBER => ' ',
- DB_ERROR_MISMATCH => '',
- DB_ERROR_NODBSELECTED => ' ',
- DB_ERROR_NOSUCHFIELD => ' ',
- DB_ERROR_NOSUCHTABLE => ' ',
- DB_ERROR_NOT_CAPABLE => ' ',
- DB_ERROR_NOT_FOUND => ' ',
- DB_ERROR_NOT_LOCKED => ' ',
- DB_ERROR_SYNTAX => ' ',
- DB_ERROR_UNSUPPORTED => ' ',
- DB_ERROR_VALUE_COUNT_ON_ROW => ' ',
- DB_ERROR_INVALID_DSN => ' DSN',
- DB_ERROR_CONNECT_FAILED => '\' ',
- 0 => ' ', // DB_OK
- DB_ERROR_NEED_MORE_DATA => ' ',
- DB_ERROR_EXTENSION_NOT_FOUND=> ' ',
- DB_ERROR_NOSUCHDB => ' ',
- DB_ERROR_ACCESS_VIOLATION => ' '
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/lang/adodb_th.inc.php b/src/adodb512/lang/adodb_th.inc.php
deleted file mode 100644
index 3fdd9970..00000000
--- a/src/adodb512/lang/adodb_th.inc.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-$ADODB_LANG_ARRAY = array (
- 'LANG' => 'th',
- DB_ERROR => 'error ไม่รู้สาเหตุ',
- DB_ERROR_ALREADY_EXISTS => 'มี?ล้ว',
- DB_ERROR_CANNOT_CREATE => 'สร้างไม่ได้',
- DB_ERROR_CANNOT_DELETE => 'ลบไม่ได้',
- DB_ERROR_CANNOT_DROP => 'drop ไม่ได้',
- DB_ERROR_CONSTRAINT => 'constraint violation',
- DB_ERROR_DIVZERO => 'หา?ด้วยสู?',
- DB_ERROR_INVALID => 'ไม่ valid',
- DB_ERROR_INVALID_DATE => 'วันที่ เวลา ไม่ valid',
- DB_ERROR_INVALID_NUMBER => 'เลขไม่ valid',
- DB_ERROR_MISMATCH => 'mismatch',
- DB_ERROR_NODBSELECTED => 'ไม่ได้เลือ??านข้อมูล',
- DB_ERROR_NOSUCHFIELD => 'ไม่มีฟีลด์นี้',
- DB_ERROR_NOSUCHTABLE => 'ไม่มีตารางนี้',
- DB_ERROR_NOT_CAPABLE => 'DB backend not capable',
- DB_ERROR_NOT_FOUND => 'ไม่พบ',
- DB_ERROR_NOT_LOCKED => 'ไม่ได้ล๊อ?',
- DB_ERROR_SYNTAX => 'ผิด syntax',
- DB_ERROR_UNSUPPORTED => 'ไม่ support',
- DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
- DB_ERROR_INVALID_DSN => 'invalid DSN',
- DB_ERROR_CONNECT_FAILED => 'ไม่สามารถ connect',
- 0 => 'no error', // DB_OK
- DB_ERROR_NEED_MORE_DATA => 'ข้อมูลไม่เพียงพอ',
- DB_ERROR_EXTENSION_NOT_FOUND=> 'ไม่พบ extension',
- DB_ERROR_NOSUCHDB => 'ไม่มีข้อมูลนี้',
- DB_ERROR_ACCESS_VIOLATION => 'permissions ไม่พอ'
-);
-?>
\ No newline at end of file
diff --git a/src/adodb512/license.txt b/src/adodb512/license.txt
deleted file mode 100644
index 9821fcb7..00000000
--- a/src/adodb512/license.txt
+++ /dev/null
@@ -1,182 +0,0 @@
-ADOdb is dual licensed using BSD and LGPL.
-
-In plain English, you do not need to distribute your application in source code form, nor do you need to distribute ADOdb source code, provided you follow the rest of terms of the BSD license.
-
-For more info about ADOdb, visit http://adodb.sourceforge.net/
-
-BSD Style-License
-=================
-
-Copyright (c) 2000, 2001, 2002, 2003, 2004 John Lim
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list
-of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice, this list
-of conditions and the following disclaimer in the documentation and/or other materials
-provided with the distribution.
-
-Neither the name of the John Lim nor the names of its contributors may be used to
-endorse or promote products derived from this software without specific prior written
-permission.
-
-DISCLAIMER:
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
-JOHN LIM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==========================================================
-GNU LESSER GENERAL PUBLIC LICENSE
-Version 2.1, February 1999
-
-Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-
-Preamble
-The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
-
-This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
-
-When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
-
-To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
-
-For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
-
-We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
-
-To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
-
-Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
-
-Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
-
-When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
-
-We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
-
-For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
-
-In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
-
-Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
-
-The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
-
-
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
-
-A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
-
-The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
-
-"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
-
-Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
-
-1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
-
-You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
-
-
-a) The modified work must itself be a software library.
-b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
-c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
-d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
-(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
-
-3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
-
-Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
-
-This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
-
-4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
-
-If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
-
-5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
-
-However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
-
-When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
-
-If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
-
-Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
-
-6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
-
-You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
-
-
-a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
-b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
-c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
-d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
-e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
-For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
-
-It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
-
-7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
-
-
-a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
-b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
-8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
-
-9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
-
-10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
-
-11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
-
-This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
-
-12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
-
-13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
-
-14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
-
-NO WARRANTY
-
-15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/src/adodb512/pear/Auth/Container/ADOdb.php b/src/adodb512/pear/Auth/Container/ADOdb.php
deleted file mode 100644
index 640c74be..00000000
--- a/src/adodb512/pear/Auth/Container/ADOdb.php
+++ /dev/null
@@ -1,405 +0,0 @@
-
- Richard Tango-Lowy
-*/
-
-require_once 'Auth/Container.php';
-require_once 'adodb.inc.php';
-require_once 'adodb-pear.inc.php';
-require_once 'adodb-errorpear.inc.php';
-
-/**
- * Storage driver for fetching login data from a database using ADOdb-PHP.
- *
- * This storage driver can use all databases which are supported
- * by the ADBdb DB abstraction layer to fetch login data.
- * See http://php.weblogs.com/adodb for information on ADOdb.
- * NOTE: The ADOdb directory MUST be in your PHP include_path!
- *
- * @author Richard Tango-Lowy
- * @package Auth
- * @version $Revision: 1.3 $
- */
-class Auth_Container_ADOdb extends Auth_Container
-{
-
- /**
- * Additional options for the storage container
- * @var array
- */
- var $options = array();
-
- /**
- * DB object
- * @var object
- */
- var $db = null;
- var $dsn = '';
-
- /**
- * User that is currently selected from the DB.
- * @var string
- */
- var $activeUser = '';
-
- // {{{ Constructor
-
- /**
- * Constructor of the container class
- *
- * Initate connection to the database via PEAR::ADOdb
- *
- * @param string Connection data or DB object
- * @return object Returns an error object if something went wrong
- */
- function Auth_Container_ADOdb($dsn)
- {
- $this->_setDefaults();
-
- if (is_array($dsn)) {
- $this->_parseOptions($dsn);
-
- if (empty($this->options['dsn'])) {
- PEAR::raiseError('No connection parameters specified!');
- }
- } else {
- // Extract db_type from dsn string.
- $this->options['dsn'] = $dsn;
- }
- }
-
- // }}}
- // {{{ _connect()
-
- /**
- * Connect to database by using the given DSN string
- *
- * @access private
- * @param string DSN string
- * @return mixed Object on error, otherwise bool
- */
- function _connect($dsn)
- {
- if (is_string($dsn) || is_array($dsn)) {
- if(!$this->db) {
- $this->db = ADONewConnection($dsn);
- if( $err = ADODB_Pear_error() ) {
- return PEAR::raiseError($err);
- }
- }
-
- } else {
- return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
- 41,
- PEAR_ERROR_RETURN,
- null,
- null
- );
- }
-
- if(!$this->db) {
- return PEAR::raiseError(ADODB_Pear_error());
- } else {
- return true;
- }
- }
-
- // }}}
- // {{{ _prepare()
-
- /**
- * Prepare database connection
- *
- * This function checks if we have already opened a connection to
- * the database. If that's not the case, a new connection is opened.
- *
- * @access private
- * @return mixed True or a DB error object.
- */
- function _prepare()
- {
- if(!$this->db) {
- $res = $this->_connect($this->options['dsn']);
- }
- return true;
- }
-
- // }}}
- // {{{ query()
-
- /**
- * Prepare query to the database
- *
- * This function checks if we have already opened a connection to
- * the database. If that's not the case, a new connection is opened.
- * After that the query is passed to the database.
- *
- * @access public
- * @param string Query string
- * @return mixed a DB_result object or DB_OK on success, a DB
- * or PEAR error on failure
- */
- function query($query)
- {
- $err = $this->_prepare();
- if ($err !== true) {
- return $err;
- }
- return $this->db->query($query);
- }
-
- // }}}
- // {{{ _setDefaults()
-
- /**
- * Set some default options
- *
- * @access private
- * @return void
- */
- function _setDefaults()
- {
- $this->options['db_type'] = 'mysql';
- $this->options['table'] = 'auth';
- $this->options['usernamecol'] = 'username';
- $this->options['passwordcol'] = 'password';
- $this->options['dsn'] = '';
- $this->options['db_fields'] = '';
- $this->options['cryptType'] = 'md5';
- }
-
- // }}}
- // {{{ _parseOptions()
-
- /**
- * Parse options passed to the container class
- *
- * @access private
- * @param array
- */
- function _parseOptions($array)
- {
- foreach ($array as $key => $value) {
- if (isset($this->options[$key])) {
- $this->options[$key] = $value;
- }
- }
-
- /* Include additional fields if they exist */
- if(!empty($this->options['db_fields'])){
- if(is_array($this->options['db_fields'])){
- $this->options['db_fields'] = join($this->options['db_fields'], ', ');
- }
- $this->options['db_fields'] = ', '.$this->options['db_fields'];
- }
- }
-
- // }}}
- // {{{ fetchData()
-
- /**
- * Get user information from database
- *
- * This function uses the given username to fetch
- * the corresponding login data from the database
- * table. If an account that matches the passed username
- * and password is found, the function returns true.
- * Otherwise it returns false.
- *
- * @param string Username
- * @param string Password
- * @return mixed Error object or boolean
- */
- function fetchData($username, $password)
- {
- // Prepare for a database query
- $err = $this->_prepare();
- if ($err !== true) {
- return PEAR::raiseError($err->getMessage(), $err->getCode());
- }
-
- // Find if db_fields contains a *, i so assume all col are selected
- if(strstr($this->options['db_fields'], '*')){
- $sql_from = "*";
- }
- else{
- $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
- }
-
- $query = "SELECT ".$sql_from.
- " FROM ".$this->options['table'].
- " WHERE ".$this->options['usernamecol']." = " . $this->db->Quote($username);
-
- $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rset = $this->db->Execute( $query );
- $res = $rset->fetchRow();
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- }
- if (!is_array($res)) {
- $this->activeUser = '';
- return false;
- }
- if ($this->verifyPassword(trim($password, "\r\n"),
- trim($res[$this->options['passwordcol']], "\r\n"),
- $this->options['cryptType'])) {
- // Store additional field values in the session
- foreach ($res as $key => $value) {
- if ($key == $this->options['passwordcol'] ||
- $key == $this->options['usernamecol']) {
- continue;
- }
- // Use reference to the auth object if exists
- // This is because the auth session variable can change so a static call to setAuthData does not make sence
- if(is_object($this->_auth_obj)){
- $this->_auth_obj->setAuthData($key, $value);
- } else {
- Auth::setAuthData($key, $value);
- }
- }
-
- return true;
- }
-
- $this->activeUser = $res[$this->options['usernamecol']];
- return false;
- }
-
- // }}}
- // {{{ listUsers()
-
- function listUsers()
- {
- $err = $this->_prepare();
- if ($err !== true) {
- return PEAR::raiseError($err->getMessage(), $err->getCode());
- }
-
- $retVal = array();
-
- // Find if db_fileds contains a *, i so assume all col are selected
- if(strstr($this->options['db_fields'], '*')){
- $sql_from = "*";
- }
- else{
- $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
- }
-
- $query = sprintf("SELECT %s FROM %s",
- $sql_from,
- $this->options['table']
- );
- $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- foreach ($res as $user) {
- $user['username'] = $user[$this->options['usernamecol']];
- $retVal[] = $user;
- }
- }
- return $retVal;
- }
-
- // }}}
- // {{{ addUser()
-
- /**
- * Add user to the storage container
- *
- * @access public
- * @param string Username
- * @param string Password
- * @param mixed Additional information that are stored in the DB
- *
- * @return mixed True on success, otherwise error object
- */
- function addUser($username, $password, $additional = "")
- {
- if (function_exists($this->options['cryptType'])) {
- $cryptFunction = $this->options['cryptType'];
- } else {
- $cryptFunction = 'md5';
- }
-
- $additional_key = '';
- $additional_value = '';
-
- if (is_array($additional)) {
- foreach ($additional as $key => $value) {
- $additional_key .= ', ' . $key;
- $additional_value .= ", '" . $value . "'";
- }
- }
-
- $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
- $this->options['table'],
- $this->options['usernamecol'],
- $this->options['passwordcol'],
- $additional_key,
- $username,
- $cryptFunction($password),
- $additional_value
- );
-
- $res = $this->query($query);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- return true;
- }
- }
-
- // }}}
- // {{{ removeUser()
-
- /**
- * Remove user from the storage container
- *
- * @access public
- * @param string Username
- *
- * @return mixed True on success, otherwise error object
- */
- function removeUser($username)
- {
- $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
- $this->options['table'],
- $this->options['usernamecol'],
- $username
- );
-
- $res = $this->query($query);
-
- if (DB::isError($res)) {
- return PEAR::raiseError($res->getMessage(), $res->getCode());
- } else {
- return true;
- }
- }
-
- // }}}
-}
-
-function showDbg( $string ) {
- print "
--- $string";
-}
-function dump( $var, $str, $vardump = false ) {
- print "$str
";
- ( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var ));
- print "
";
-}
-?>
diff --git a/src/adodb512/pear/readme.Auth.txt b/src/adodb512/pear/readme.Auth.txt
deleted file mode 100644
index b6b0c157..00000000
--- a/src/adodb512/pear/readme.Auth.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-From: Rich Tango-Lowy (richtl#arscognita.com)
-Date: Sat, May 29, 2004 11:20 am
-
-OK, I hacked out an ADOdb container for PEAR-Auth. The error handling's
-a bit of a mess, but all the methods work.
-
-Copy ADOdb.php to your pear/Auth/Container/ directory.
-
-Use the ADOdb container exactly as you would the DB
-container, but specify 'ADOdb' instead of 'DB':
-
-$dsn = "mysql://myuser:mypass@localhost/authdb";
-$a = new Auth("ADOdb", $dsn, "loginFunction");
-
-
--------------------
-
-John Lim adds:
-
-See http://pear.php.net/manual/en/package.authentication.php
diff --git a/src/adodb512/perf/perf-db2.inc.php b/src/adodb512/perf/perf-db2.inc.php
deleted file mode 100644
index 7531e592..00000000
--- a/src/adodb512/perf/perf-db2.inc.php
+++ /dev/null
@@ -1,102 +0,0 @@
- array('RATIO',
- "SELECT
- case when sum(POOL_DATA_L_READS+POOL_INDEX_L_READS)=0 then 0
- else 100*(1-sum(POOL_DATA_P_READS+POOL_INDEX_P_READS)/sum(POOL_DATA_L_READS+POOL_INDEX_L_READS)) end
- FROM TABLE(SNAPSHOT_APPL('',-2)) as t",
- '=WarnCacheRatio'),
-
- 'Data Cache',
- 'data cache buffers' => array('DATAC',
- 'select sum(npages) from SYSCAT.BUFFERPOOLS',
- 'See tuning reference.' ),
- 'cache blocksize' => array('DATAC',
- 'select avg(pagesize) from SYSCAT.BUFFERPOOLS',
- '' ),
- 'data cache size' => array('DATAC',
- 'select sum(npages*pagesize) from SYSCAT.BUFFERPOOLS',
- '' ),
- 'Connections',
- 'current connections' => array('SESS',
- "SELECT count(*) FROM TABLE(SNAPSHOT_APPL_INFO('',-2)) as t",
- ''),
-
- false
- );
-
-
- function perf_db2(&$conn)
- {
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $qno = rand();
- $ok = $this->conn->Execute("EXPLAIN PLAN SET QUERYNO=$qno FOR $sql");
- ob_start();
- if (!$ok) echo "Have EXPLAIN tables been created?
";
- else {
- $rs = $this->conn->Execute("select * from explain_statement where queryno=$qno");
- if ($rs) rs2html($rs);
- }
- $s = ob_get_contents();
- ob_end_clean();
- $this->conn->LogSQL($save);
-
- $s .= $this->Tracer($sql);
- return $s;
- }
-
-
- function Tables()
- {
- $rs = $this->conn->Execute("select tabschema,tabname,card as rows,
- npages pages_used,fpages pages_allocated, tbspace tablespace
- from syscat.tables where tabschema not in ('SYSCAT','SYSIBM','SYSSTAT') order by 1,2");
- return rs2html($rs,false,false,false,false);
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/perf/perf-informix.inc.php b/src/adodb512/perf/perf-informix.inc.php
deleted file mode 100644
index 9dc3e9b9..00000000
--- a/src/adodb512/perf/perf-informix.inc.php
+++ /dev/null
@@ -1,70 +0,0 @@
- array('RATIOH',
- "select round((1-(wt.value / (rd.value + wr.value)))*100,2)
- from sysmaster:sysprofile wr, sysmaster:sysprofile rd, sysmaster:sysprofile wt
- where rd.name = 'pagreads' and
- wr.name = 'pagwrites' and
- wt.name = 'buffwts'",
- '=WarnCacheRatio'),
- 'IO',
- 'data reads' => array('IO',
- "select value from sysmaster:sysprofile where name='pagreads'",
- 'Page reads'),
-
- 'data writes' => array('IO',
- "select value from sysmaster:sysprofile where name='pagwrites'",
- 'Page writes'),
-
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from sysmaster:syssessions',
- 'Number of sessions'),
-
- false
-
- );
-
- function perf_informix(&$conn)
- {
- $this->conn = $conn;
- }
-
-}
-?>
diff --git a/src/adodb512/perf/perf-mssql.inc.php b/src/adodb512/perf/perf-mssql.inc.php
deleted file mode 100644
index 0ddd3a84..00000000
--- a/src/adodb512/perf/perf-mssql.inc.php
+++ /dev/null
@@ -1,164 +0,0 @@
- array('RATIO',
- "select round((a.cntr_value*100.0)/b.cntr_value,2) from master.dbo.sysperfinfo a, master.dbo.sysperfinfo b where a.counter_name = 'Buffer cache hit ratio' and b.counter_name='Buffer cache hit ratio base'",
- '=WarnCacheRatio'),
- 'prepared sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Prepared',1,100),
- ''),
- 'adhoc sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Adhoc',1,100),
- ''),
- 'IO',
- 'data reads' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page reads/sec'"),
- 'data writes' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page writes/sec'"),
-
- 'Data Cache',
- 'data cache size' => array('DATAC',
- "select cntr_value*8192 from master.dbo.sysperfinfo where counter_name = 'Total Pages' and object_name='SQLServer:Buffer Manager'",
- '' ),
- 'data cache blocksize' => array('DATAC',
- "select 8192",'page size'),
- 'Connections',
- 'current connections' => array('SESS',
- '=sp_who',
- ''),
- 'max connections' => array('SESS',
- "SELECT @@MAX_CONNECTIONS",
- ''),
-
- false
- );
-
-
- function perf_mssql(&$conn)
- {
- if ($conn->dataProvider == 'odbc') {
- $this->sql1 = 'sql1';
- //$this->explain = false;
- }
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = 'Explain: '.htmlspecialchars($sql).'
';
- $this->conn->Execute("SET SHOWPLAN_ALL ON;");
- $sql = str_replace('?',"''",$sql);
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs = $this->conn->Execute($sql);
- //adodb_printr($rs);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- $rs->MoveNext();
- $s .= ' Rows IO CPU Plan ';
- while (!$rs->EOF) {
- $s .= ''.round($rs->fields[8],1).' '.round($rs->fields[9],3).' '.round($rs->fields[10],3).' '.htmlspecialchars($rs->fields[0])."
\n"; ## NOTE CORRUPT tag is intentional!!!!
- $rs->MoveNext();
- }
- $s .= '
';
-
- $rs->NextRecordSet();
- }
-
- $this->conn->Execute("SET SHOWPLAN_ALL OFF;");
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables()
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- //$this->conn->debug=1;
- $s = 'tablename size_in_k index size reserved size ';
- $rs1 = $this->conn->Execute("select distinct name from sysobjects where xtype='U'");
- if ($rs1) {
- while (!$rs1->EOF) {
- $tab = $rs1->fields[0];
- $tabq = $this->conn->qstr($tab);
- $rs2 = $this->conn->Execute("sp_spaceused $tabq");
- if ($rs2) {
- $s .= ''.$tab.' '.$rs2->fields[3].' '.$rs2->fields[4].' '.$rs2->fields[2].' ';
- $rs2->Close();
- }
- $rs1->MoveNext();
- }
- $rs1->Close();
- }
- $ADODB_FETCH_MODE = $save;
- return $s.'
';
- }
-
- function sp_who()
- {
- $arr = $this->conn->GetArray('sp_who');
- return sizeof($arr);
- }
-
- function HealthCheck($cli=false)
- {
-
- $this->conn->Execute('dbcc traceon(3604)');
- $html = adodb_perf::HealthCheck($cli);
- $this->conn->Execute('dbcc traceoff(3604)');
- return $html;
- }
-
-
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/perf/perf-mssqlnative.inc.php b/src/adodb512/perf/perf-mssqlnative.inc.php
deleted file mode 100644
index 34193898..00000000
--- a/src/adodb512/perf/perf-mssqlnative.inc.php
+++ /dev/null
@@ -1,164 +0,0 @@
- array('RATIO',
- "select round((a.cntr_value*100.0)/b.cntr_value,2) from master.dbo.sysperfinfo a, master.dbo.sysperfinfo b where a.counter_name = 'Buffer cache hit ratio' and b.counter_name='Buffer cache hit ratio base'",
- '=WarnCacheRatio'),
- 'prepared sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Prepared',1,100),
- ''),
- 'adhoc sql hit ratio' => array('RATIO',
- array('dbcc cachestats','Adhoc',1,100),
- ''),
- 'IO',
- 'data reads' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page reads/sec'"),
- 'data writes' => array('IO',
- "select cntr_value from master.dbo.sysperfinfo where counter_name = 'Page writes/sec'"),
-
- 'Data Cache',
- 'data cache size' => array('DATAC',
- "select cntr_value*8192 from master.dbo.sysperfinfo where counter_name = 'Total Pages' and object_name='SQLServer:Buffer Manager'",
- '' ),
- 'data cache blocksize' => array('DATAC',
- "select 8192",'page size'),
- 'Connections',
- 'current connections' => array('SESS',
- '=sp_who',
- ''),
- 'max connections' => array('SESS',
- "SELECT @@MAX_CONNECTIONS",
- ''),
-
- false
- );
-
-
- function perf_mssqlnative(&$conn)
- {
- if ($conn->dataProvider == 'odbc') {
- $this->sql1 = 'sql1';
- //$this->explain = false;
- }
- $this->conn =& $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = 'Explain: '.htmlspecialchars($sql).'
';
- $this->conn->Execute("SET SHOWPLAN_ALL ON;");
- $sql = str_replace('?',"''",$sql);
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $rs =& $this->conn->Execute($sql);
- //adodb_printr($rs);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- $rs->MoveNext();
- $s .= ' Rows IO CPU Plan ';
- while (!$rs->EOF) {
- $s .= ''.round($rs->fields[8],1).' '.round($rs->fields[9],3).' '.round($rs->fields[10],3).' '.htmlspecialchars($rs->fields[0])."
\n"; ## NOTE CORRUPT tag is intentional!!!!
- $rs->MoveNext();
- }
- $s .= '
';
-
- $rs->NextRecordSet();
- }
-
- $this->conn->Execute("SET SHOWPLAN_ALL OFF;");
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables()
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- //$this->conn->debug=1;
- $s = 'tablename size_in_k index size reserved size ';
- $rs1 = $this->conn->Execute("select distinct name from sysobjects where xtype='U'");
- if ($rs1) {
- while (!$rs1->EOF) {
- $tab = $rs1->fields[0];
- $tabq = $this->conn->qstr($tab);
- $rs2 = $this->conn->Execute("sp_spaceused $tabq");
- if ($rs2) {
- $s .= ''.$tab.' '.$rs2->fields[3].' '.$rs2->fields[4].' '.$rs2->fields[2].' ';
- $rs2->Close();
- }
- $rs1->MoveNext();
- }
- $rs1->Close();
- }
- $ADODB_FETCH_MODE = $save;
- return $s.'
';
- }
-
- function sp_who()
- {
- $arr = $this->conn->GetArray('sp_who');
- return sizeof($arr);
- }
-
- function HealthCheck($cli=false)
- {
-
- $this->conn->Execute('dbcc traceon(3604)');
- $html = adodb_perf::HealthCheck($cli);
- $this->conn->Execute('dbcc traceoff(3604)');
- return $html;
- }
-
-
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/perf/perf-mysql.inc.php b/src/adodb512/perf/perf-mysql.inc.php
deleted file mode 100644
index ac35173b..00000000
--- a/src/adodb512/perf/perf-mysql.inc.php
+++ /dev/null
@@ -1,315 +0,0 @@
- array('RATIO',
- '=GetKeyHitRatio',
- '=WarnCacheRatio'),
- 'InnoDB cache hit ratio' => array('RATIO',
- '=GetInnoDBHitRatio',
- '=WarnCacheRatio'),
- 'data cache hit ratio' => array('HIDE', # only if called
- '=FindDBHitRatio',
- '=WarnCacheRatio'),
- 'sql cache hit ratio' => array('RATIO',
- '=GetQHitRatio',
- ''),
- 'IO',
- 'data reads' => array('IO',
- '=GetReads',
- 'Number of selects (Key_reads is not accurate)'),
- 'data writes' => array('IO',
- '=GetWrites',
- 'Number of inserts/updates/deletes * coef (Key_writes is not accurate)'),
-
- 'Data Cache',
- 'MyISAM data cache size' => array('DATAC',
- array("show variables", 'key_buffer_size'),
- '' ),
- 'BDB data cache size' => array('DATAC',
- array("show variables", 'bdb_cache_size'),
- '' ),
- 'InnoDB data cache size' => array('DATAC',
- array("show variables", 'innodb_buffer_pool_size'),
- '' ),
- 'Memory Usage',
- 'read buffer size' => array('CACHE',
- array("show variables", 'read_buffer_size'),
- '(per session)'),
- 'sort buffer size' => array('CACHE',
- array("show variables", 'sort_buffer_size'),
- 'Size of sort buffer (per session)' ),
- 'table cache' => array('CACHE',
- array("show variables", 'table_cache'),
- 'Number of tables to keep open'),
- 'Connections',
- 'current connections' => array('SESS',
- array('show status','Threads_connected'),
- ''),
- 'max connections' => array( 'SESS',
- array("show variables",'max_connections'),
- ''),
-
- false
- );
-
- function perf_mysql(&$conn)
- {
- $this->conn = $conn;
- }
-
- function Explain($sql,$partial=false)
- {
-
- if (strtoupper(substr(trim($sql),0,6)) !== 'SELECT') return 'Unable to EXPLAIN non-select statement
';
- $save = $this->conn->LogSQL(false);
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $sql = str_replace('?',"''",$sql);
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $sql = $this->conn->GetOne("select sql1 from adodb_logsql where sql1 like $sqlq");
- }
-
- $s = 'Explain: '.htmlspecialchars($sql).'
';
- $rs = $this->conn->Execute('EXPLAIN '.$sql);
- $s .= rs2html($rs,false,false,false,false);
- $this->conn->LogSQL($save);
- $s .= $this->Tracer($sql);
- return $s;
- }
-
- function Tables()
- {
- if (!$this->tablesSQL) return false;
-
- $rs = $this->conn->Execute($this->tablesSQL);
- if (!$rs) return false;
-
- $html = rs2html($rs,false,false,false,false);
- return $html;
- }
-
- function GetReads()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return 0;
- $val = 0;
- while (!$rs->EOF) {
- switch($rs->fields[0]) {
- case 'Com_select':
- $val = $rs->fields[1];
- $rs->Close();
- return $val;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
-
- return $val;
- }
-
- function GetWrites()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return 0;
- $val = 0.0;
- while (!$rs->EOF) {
- switch($rs->fields[0]) {
- case 'Com_insert':
- $val += $rs->fields[1]; break;
- case 'Com_delete':
- $val += $rs->fields[1]; break;
- case 'Com_update':
- $val += $rs->fields[1]/2;
- $rs->Close();
- return $val;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
-
- return $val;
- }
-
- function FindDBHitRatio()
- {
- // first find out type of table
- //$this->conn->debug=1;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show table status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs) return '';
- $type = strtoupper($rs->fields[1]);
- $rs->Close();
- switch($type){
- case 'MYISAM':
- case 'ISAM':
- return $this->DBParameter('MyISAM cache hit ratio').' (MyISAM)';
- case 'INNODB':
- return $this->DBParameter('InnoDB cache hit ratio').' (InnoDB)';
- default:
- return $type.' not supported';
- }
-
- }
-
- function GetQHitRatio()
- {
- //Total number of queries = Qcache_inserts + Qcache_hits + Qcache_not_cached
- $hits = $this->_DBParameter(array("show status","Qcache_hits"));
- $total = $this->_DBParameter(array("show status","Qcache_inserts"));
- $total += $this->_DBParameter(array("show status","Qcache_not_cached"));
-
- $total += $hits;
- if ($total) return round(($hits*100)/$total,2);
- return 0;
- }
-
- /*
- Use session variable to store Hit percentage, because MySQL
- does not remember last value of SHOW INNODB STATUS hit ratio
-
- # 1st query to SHOW INNODB STATUS
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- Buffer pool hit rate 1000 / 1000
-
- # 2nd query to SHOW INNODB STATUS
- 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
- No buffer pool activity since the last printout
- */
- function GetInnoDBHitRatio()
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute('show innodb status');
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
-
- if (!$rs || $rs->EOF) return 0;
- $stat = $rs->fields[0];
- $rs->Close();
- $at = strpos($stat,'Buffer pool hit rate');
- $stat = substr($stat,$at,200);
- if (preg_match('!Buffer pool hit rate\s*([0-9]*) / ([0-9]*)!',$stat,$arr)) {
- $val = 100*$arr[1]/$arr[2];
- $_SESSION['INNODB_HIT_PCT'] = $val;
- return round($val,2);
- } else {
- if (isset($_SESSION['INNODB_HIT_PCT'])) return $_SESSION['INNODB_HIT_PCT'];
- return 0;
- }
- return 0;
- }
-
- function GetKeyHitRatio()
- {
- $hits = $this->_DBParameter(array("show status","Key_read_requests"));
- $reqs = $this->_DBParameter(array("show status","Key_reads"));
- if ($reqs == 0) return 0;
-
- return round(($hits/($reqs+$hits))*100,2);
- }
-
- // start hack
- var $optimizeTableLow = 'CHECK TABLE %s FAST QUICK';
- var $optimizeTableHigh = 'OPTIMIZE TABLE %s';
-
- /**
- * @see adodb_perf#optimizeTable
- */
- function optimizeTable( $table, $mode = ADODB_OPT_LOW)
- {
- if ( !is_string( $table)) return false;
-
- $conn = $this->conn;
- if ( !$conn) return false;
-
- $sql = '';
- switch( $mode) {
- case ADODB_OPT_LOW : $sql = $this->optimizeTableLow; break;
- case ADODB_OPT_HIGH : $sql = $this->optimizeTableHigh; break;
- default :
- {
- // May dont use __FUNCTION__ constant for BC (__FUNCTION__ Added in PHP 4.3.0)
- ADOConnection::outp( sprintf( "%s: '%s' using of undefined mode '%s'
", __CLASS__, __FUNCTION__, $mode));
- return false;
- }
- }
- $sql = sprintf( $sql, $table);
-
- return $conn->Execute( $sql) !== false;
- }
- // end hack
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/perf/perf-oci8.inc.php b/src/adodb512/perf/perf-oci8.inc.php
deleted file mode 100644
index 115fc455..00000000
--- a/src/adodb512/perf/perf-oci8.inc.php
+++ /dev/null
@@ -1,618 +0,0 @@
- array('RATIOH',
- "select round((1-(phy.value / (cur.value + con.value)))*100,2)
- from v\$sysstat cur, v\$sysstat con, v\$sysstat phy
- where cur.name = 'db block gets' and
- con.name = 'consistent gets' and
- phy.name = 'physical reads'",
- '=WarnCacheRatio'),
-
- 'sql cache hit ratio' => array( 'RATIOH',
- 'select round(100*(sum(pins)-sum(reloads))/sum(pins),2) from v$librarycache',
- 'increase shared_pool_size if too ratio low'),
-
- 'datadict cache hit ratio' => array('RATIOH',
- "select
- round((1 - (sum(getmisses) / (sum(gets) +
- sum(getmisses))))*100,2)
- from v\$rowcache",
- 'increase shared_pool_size if too ratio low'),
-
- 'memory sort ratio' => array('RATIOH',
- "SELECT ROUND((100 * b.VALUE) /DECODE ((a.VALUE + b.VALUE),
- 0,1,(a.VALUE + b.VALUE)),2)
-FROM v\$sysstat a,
- v\$sysstat b
-WHERE a.name = 'sorts (disk)'
-AND b.name = 'sorts (memory)'",
- "% of memory sorts compared to disk sorts - should be over 95%"),
-
- 'IO',
- 'data reads' => array('IO',
- "select value from v\$sysstat where name='physical reads'"),
-
- 'data writes' => array('IO',
- "select value from v\$sysstat where name='physical writes'"),
-
- 'Data Cache',
-
- 'data cache buffers' => array( 'DATAC',
- "select a.value/b.value from v\$parameter a, v\$parameter b
- where a.name = 'db_cache_size' and b.name= 'db_block_size'",
- 'Number of cache buffers. Tune db_cache_size if the data cache hit ratio is too low.'),
- 'data cache blocksize' => array('DATAC',
- "select value from v\$parameter where name='db_block_size'",
- '' ),
-
- 'Memory Pools',
- 'Mem Max Target (11g+)' => array( 'DATAC',
- "select value from v\$parameter where name = 'memory_max_target'",
- 'The memory_max_size is the maximum value to which memory_target can be set.' ),
- 'Memory target (11g+)' => array( 'DATAC',
- "select value from v\$parameter where name = 'memory_target'",
- 'If memory_target is defined then SGA and PGA targets are consolidated into one memory_target.' ),
- 'SGA Max Size' => array( 'DATAC',
- "select nvl(value,0)/1024.0/1024 || 'M' from v\$parameter where name = 'sga_max_size'",
- 'The sga_max_size is the maximum value to which sga_target can be set.' ),
- 'SGA target' => array( 'DATAC',
- "select nvl(value,0)/1024.0/1024 || 'M' from v\$parameter where name = 'sga_target'",
- 'If sga_target is defined then data cache, shared, java and large pool size can be 0. This is because all these pools are consolidated into one sga_target.' ),
- 'PGA aggr target' => array( 'DATAC',
- "select value from v\$parameter where name = 'pga_aggregate_target'",
- 'If pga_aggregate_target is defined then this is the maximum memory that can be allocated for cursor operations such as sorts, group by, joins, merges. When in doubt, set it to 20% of sga_target.' ),
- 'data cache size' => array('DATAC',
- "select value from v\$parameter where name = 'db_cache_size'",
- 'db_cache_size' ),
- 'shared pool size' => array('DATAC',
- "select value from v\$parameter where name = 'shared_pool_size'",
- 'shared_pool_size, which holds shared sql, stored procedures, dict cache and similar shared structs' ),
- 'java pool size' => array('DATAJ',
- "select value from v\$parameter where name = 'java_pool_size'",
- 'java_pool_size' ),
- 'large pool buffer size' => array('CACHE',
- "select value from v\$parameter where name='large_pool_size'",
- 'this pool is for large mem allocations (not because it is larger than shared pool), for MTS sessions, parallel queries, io buffers (large_pool_size) ' ),
-
- 'pga buffer size' => array('CACHE',
- "select value from v\$parameter where name='pga_aggregate_target'",
- 'program global area is private memory for sorting, and hash and bitmap merges - since oracle 9i (pga_aggregate_target)' ),
-
- 'dynamic memory usage' => array('CACHE', "select '-' from dual", '=DynMemoryUsage'),
-
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from sys.v_$session where username is not null',
- ''),
- 'max connections' => array( 'SESS',
- "select value from v\$parameter where name='sessions'",
- ''),
-
- 'Memory Utilization',
- 'data cache utilization ratio' => array('RATIOU',
- "select round((1-bytes/sgasize)*100, 2)
- from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
- where name = 'free memory' and pool = 'shared pool'",
- 'Percentage of data cache actually in use - should be over 85%'),
-
- 'shared pool utilization ratio' => array('RATIOU',
- 'select round((sga.bytes/case when p.value=0 then sga.bytes else to_number(p.value) end)*100,2)
- from v$sgastat sga, v$parameter p
- where sga.name = \'free memory\' and sga.pool = \'shared pool\'
- and p.name = \'shared_pool_size\'',
- 'Percentage of shared pool actually used - too low is bad, too high is worse'),
-
- 'large pool utilization ratio' => array('RATIOU',
- "select round((1-bytes/sgasize)*100, 2)
- from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
- where name = 'free memory' and pool = 'large pool'",
- 'Percentage of large_pool actually in use - too low is bad, too high is worse'),
- 'sort buffer size' => array('CACHE',
- "select value from v\$parameter where name='sort_area_size'",
- 'max in-mem sort_area_size (per query), uses memory in pga' ),
-
- 'pga usage at peak' => array('RATIOU',
- '=PGA','Mb utilization at peak transactions (requires Oracle 9i+)'),
- 'Transactions',
- 'rollback segments' => array('ROLLBACK',
- "select count(*) from sys.v_\$rollstat",
- ''),
-
- 'peak transactions' => array('ROLLBACK',
- "select max_utilization tx_hwm
- from sys.v_\$resource_limit
- where resource_name = 'transactions'",
- 'Taken from high-water-mark'),
- 'max transactions' => array('ROLLBACK',
- "select value from v\$parameter where name = 'transactions'",
- 'max transactions / rollback segments < 3.5 (or transactions_per_rollback_segment)'),
- 'Parameters',
- 'cursor sharing' => array('CURSOR',
- "select value from v\$parameter where name = 'cursor_sharing'",
- 'Cursor reuse strategy. Recommended is FORCE (8i+) or SIMILAR (9i+). See cursor_sharing.'),
- /*
- 'cursor reuse' => array('CURSOR',
- "select count(*) from (select sql_text_wo_constants, count(*)
- from t1
- group by sql_text_wo_constants
-having count(*) > 100)",'These are sql statements that should be using bind variables'),*/
- 'index cache cost' => array('COST',
- "select value from v\$parameter where name = 'optimizer_index_caching'",
- '=WarnIndexCost'),
- 'random page cost' => array('COST',
- "select value from v\$parameter where name = 'optimizer_index_cost_adj'",
- '=WarnPageCost'),
-
- 'Backup',
- 'Achivelog Mode' => array('BACKUP', 'select log_mode from v$database', 'To turn on archivelog:
-
- SQLPLUS> connect sys as sysdba;
- SQLPLUS> shutdown immediate;
-
- SQLPLUS> startup mount exclusive;
- SQLPLUS> alter database archivelog;
- SQLPLUS> archive log start;
- SQLPLUS> alter database open;
-
'),
-
- 'DBID' => array('BACKUP','select dbid from v$database','Primary key of database, used for recovery with an RMAN Recovery Catalog'),
- 'Archive Log Dest' => array('BACKUP', "SELECT NVL(v1.value,v2.value)
-FROM v\$parameter v1, v\$parameter v2 WHERE v1.name='log_archive_dest' AND v2.name='log_archive_dest_10'", ''),
-
- 'Flashback Area' => array('BACKUP', "select nvl(value,'Flashback Area not used') from v\$parameter where name=lower('DB_RECOVERY_FILE_DEST')", 'Flashback area is a folder where all backup data and logs can be stored and managed by Oracle. If Error: message displayed, then it is not in use.'),
-
- 'Flashback Usage' => array('BACKUP', "select nvl('-','Flashback Area not used') from v\$parameter where name=lower('DB_RECOVERY_FILE_DEST')", '=FlashUsage', 'Flashback area usage.'),
-
- 'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. I recommend it be set to x2 or x3 times the frequency of your full backup.'),
- 'Recent RMAN Jobs' => array('BACKUP', "select '-' from dual", "=RMAN"),
-
- // 'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. I recommend it be set to x2 or x3 times the frequency of your full backup.'),
-
- false
-
- );
-
-
- function perf_oci8(&$conn)
- {
- $savelog = $conn->LogSQL(false);
- $this->version = $conn->ServerInfo();
- $conn->LogSQL($savelog);
- $this->conn = $conn;
- }
-
- function RMAN()
- {
- $rs = $this->conn->Execute("select * from (select start_time, end_time, operation, status, mbytes_processed, output_device_type
- from V\$RMAN_STATUS order by start_time desc) where rownum <=10");
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
-
- }
- function DynMemoryUsage()
- {
- if (@$this->version['version'] >= 11) {
- $rs = $this->conn->Execute("select component, current_size/1024./1024 as \"CurrSize (M)\" from V\$MEMORY_DYNAMIC_COMPONENTS");
-
- } else
- $rs = $this->conn->Execute("select name, round(bytes/1024./1024,2) as \"CurrSize (M)\" from V\$sgainfo");
-
-
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
- }
-
- function FlashUsage()
- {
- $rs = $this->conn->Execute("select * from V\$FLASH_RECOVERY_AREA_USAGE");
- $ret = rs2html($rs,false,false,false,false);
- return " ".$ret."
";
- }
-
- function WarnPageCost($val)
- {
- if ($val == 100) $s = 'Too High. ';
- else $s = '';
-
- return $s.'Recommended is 20-50 for TP, and 50 for data warehouses. Default is 100. See optimizer_index_cost_adj. ';
- }
-
- function WarnIndexCost($val)
- {
- if ($val == 0) $s = 'Too Low. ';
- else $s = '';
-
- return $s.'Percentage of indexed data blocks expected in the cache.
- Recommended is 20 (fast disk array) to 30 (slower hard disks). Default is 0.
- See optimizer_index_caching.';
- }
-
- function PGA()
- {
- if ($this->version['version'] < 9) return 'Oracle 9i or later required';
-
- $rs = $this->conn->Execute("select a.mb,a.targ as pga_size_pct,a.pct from
- (select round(pga_target_for_estimate/1024.0/1024.0,0) MB,
- pga_target_factor targ,estd_pga_cache_hit_percentage pct,rownum as r
- from v\$pga_target_advice) a left join
- (select round(pga_target_for_estimate/1024.0/1024.0,0) MB,
- pga_target_factor targ,estd_pga_cache_hit_percentage pct,rownum as r
- from v\$pga_target_advice) b on
- a.r = b.r+1 where
- b.pct < 100");
- if (!$rs) return "Only in 9i or later";
- $rs->Close();
- if ($rs->EOF) return "PGA could be too big";
-
- return reset($rs->fields);
- }
-
- function Explain($sql,$partial=false)
- {
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->SelectLimit("select ID FROM PLAN_TABLE");
- if (!$rs) {
- echo "Missing PLAN_TABLE
-
-CREATE TABLE PLAN_TABLE (
- STATEMENT_ID VARCHAR2(30),
- TIMESTAMP DATE,
- REMARKS VARCHAR2(80),
- OPERATION VARCHAR2(30),
- OPTIONS VARCHAR2(30),
- OBJECT_NODE VARCHAR2(128),
- OBJECT_OWNER VARCHAR2(30),
- OBJECT_NAME VARCHAR2(30),
- OBJECT_INSTANCE NUMBER(38),
- OBJECT_TYPE VARCHAR2(30),
- OPTIMIZER VARCHAR2(255),
- SEARCH_COLUMNS NUMBER,
- ID NUMBER(38),
- PARENT_ID NUMBER(38),
- POSITION NUMBER(38),
- COST NUMBER(38),
- CARDINALITY NUMBER(38),
- BYTES NUMBER(38),
- OTHER_TAG VARCHAR2(255),
- PARTITION_START VARCHAR2(255),
- PARTITION_STOP VARCHAR2(255),
- PARTITION_ID NUMBER(38),
- OTHER LONG,
- DISTRIBUTION VARCHAR2(30)
-);
-
";
- return false;
- }
-
- $rs->Close();
- // $this->conn->debug=1;
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
-
- $s = "Explain: ".htmlspecialchars($sql)."
";
-
- $this->conn->BeginTrans();
- $id = "ADODB ".microtime();
-
- $rs = $this->conn->Execute("EXPLAIN PLAN SET STATEMENT_ID='$id' FOR $sql");
- $m = $this->conn->ErrorMsg();
- if ($m) {
- $this->conn->RollbackTrans();
- $this->conn->LogSQL($savelog);
- $s .= "$m
";
- return $s;
- }
- $rs = $this->conn->Execute("
- select
- ''||lpad('--', (level-1)*2,'-') || trim(operation) || ' ' || trim(options)||'' as Operation,
- object_name,COST,CARDINALITY,bytes
- FROM plan_table
-START WITH id = 0 and STATEMENT_ID='$id'
-CONNECT BY prior id=parent_id and statement_id='$id'");
-
- $s .= rs2html($rs,false,false,false,false);
- $this->conn->RollbackTrans();
- $this->conn->LogSQL($savelog);
- $s .= $this->Tracer($sql,$partial);
- return $s;
- }
-
-
- function CheckMemory()
- {
- if ($this->version['version'] < 9) return 'Oracle 9i or later required';
-
- $rs = $this->conn->Execute("
-select b.size_for_estimate as cache_mb_estimate,
- case when b.size_factor=1 then
- '<<= Current'
- when a.estd_physical_read_factor-b.estd_physical_read_factor > 0.001 and b.estd_physical_read_factor<1 then
- '- BETTER than current by ' || round((1-b.estd_physical_read_factor)/b.estd_physical_read_factor*100,2) || '%'
- else ' ' end as RATING,
- b.estd_physical_read_factor \"Phys. Reads Factor\",
- round((a.estd_physical_read_factor-b.estd_physical_read_factor)/b.estd_physical_read_factor*100,2) as \"% Improve\"
- from (select size_for_estimate,size_factor,estd_physical_read_factor,rownum r from v\$db_cache_advice order by 1) a ,
- (select size_for_estimate,size_factor,estd_physical_read_factor,rownum r from v\$db_cache_advice order by 1) b where a.r = b.r-1
- ");
- if (!$rs) return false;
-
- /*
- The v$db_cache_advice utility show the marginal changes in physical data block reads for different sizes of db_cache_size
- */
- $s = "Data Cache Estimate
";
- if ($rs->EOF) {
- $s .= "Cache that is 50% of current size is still too big
";
- } else {
- $s .= "Ideal size of Data Cache is when %Improve gets close to zero.";
- $s .= rs2html($rs,false,false,false,false);
- }
- return $s;
- }
-
- /*
- Generate html for suspicious/expensive sql
- */
- function tohtml(&$rs,$type)
- {
- $o1 = $rs->FetchField(0);
- $o2 = $rs->FetchField(1);
- $o3 = $rs->FetchField(2);
- if ($rs->EOF) return 'None found
';
- $check = '';
- $sql = '';
- $s = "\n\n".$o1->name.' '.$o2->name.' '.$o3->name.' ';
- while (!$rs->EOF) {
- if ($check != $rs->fields[0].'::'.$rs->fields[1]) {
- if ($check) {
- $carr = explode('::',$check);
- $prefix = "';
- $suffix = '';
- if (strlen($prefix)>2000) {
- $prefix = '';
- $suffix = '';
- }
-
- $s .= "\n".$carr[0].' '.$carr[1].' '.$prefix.$sql.$suffix.' ';
- }
- $sql = $rs->fields[2];
- $check = $rs->fields[0].'::'.$rs->fields[1];
- } else
- $sql .= $rs->fields[2];
- if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
- $rs->MoveNext();
- }
- $rs->Close();
-
- $carr = explode('::',$check);
- $prefix = "';
- $suffix = '';
- if (strlen($prefix)>2000) {
- $prefix = '';
- $suffix = '';
- }
- $s .= "\n".$carr[0].' '.$carr[1].' '.$prefix.$sql.$suffix.' ';
-
- return $s."
\n\n";
- }
-
- // code thanks to Ixora.
- // http://www.ixora.com.au/scripts/query_opt.htm
- // requires oracle 8.1.7 or later
- function SuspiciousSQL($numsql=10)
- {
- $sql = "
-select
- substr(to_char(s.pct, '99.00'), 2) || '%' load,
- s.executions executes,
- p.sql_text
-from
- (
- select
- address,
- buffer_gets,
- executions,
- pct,
- rank() over (order by buffer_gets desc) ranking
- from
- (
- select
- address,
- buffer_gets,
- executions,
- 100 * ratio_to_report(buffer_gets) over () pct
- from
- sys.v_\$sql
- where
- command_type != 47 and module != 'T.O.A.D.'
- )
- where
- buffer_gets > 50 * executions
- ) s,
- sys.v_\$sqltext p
-where
- s.ranking <= $numsql and
- p.address = s.address
-order by
- 1 desc, s.address, p.piece";
-
- global $ADODB_CACHE_MODE;
- if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
- $partial = empty($_GET['part']);
- echo "".$this->Explain($_GET['sql'],$partial)."\n";
- }
-
- if (isset($_GET['sql'])) return $this->_SuspiciousSQL($numsql);
-
- $s = '';
- $timer = time();
- $s .= $this->_SuspiciousSQL($numsql);
- $timer = time() - $timer;
-
- if ($timer > $this->noShowIxora) return $s;
- $s .= '';
-
- $save = $ADODB_CACHE_MODE;
- $ADODB_CACHE_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->SelectLimit($sql);
- $this->conn->LogSQL($savelog);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
- if ($rs) {
- $s .= "\n
Ixora Suspicious SQL
";
- $s .= $this->tohtml($rs,'expsixora');
- }
-
- return $s;
- }
-
- // code thanks to Ixora.
- // http://www.ixora.com.au/scripts/query_opt.htm
- // requires oracle 8.1.7 or later
- function ExpensiveSQL($numsql = 10)
- {
- $sql = "
-select
- substr(to_char(s.pct, '99.00'), 2) || '%' load,
- s.executions executes,
- p.sql_text
-from
- (
- select
- address,
- disk_reads,
- executions,
- pct,
- rank() over (order by disk_reads desc) ranking
- from
- (
- select
- address,
- disk_reads,
- executions,
- 100 * ratio_to_report(disk_reads) over () pct
- from
- sys.v_\$sql
- where
- command_type != 47 and module != 'T.O.A.D.'
- )
- where
- disk_reads > 50 * executions
- ) s,
- sys.v_\$sqltext p
-where
- s.ranking <= $numsql and
- p.address = s.address
-order by
- 1 desc, s.address, p.piece
-";
- global $ADODB_CACHE_MODE;
- if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
- $partial = empty($_GET['part']);
- echo "".$this->Explain($_GET['sql'],$partial)."\n";
- }
- if (isset($_GET['sql'])) {
- $var = $this->_ExpensiveSQL($numsql);
- return $var;
- }
-
- $s = '';
- $timer = time();
- $s .= $this->_ExpensiveSQL($numsql);
- $timer = time() - $timer;
- if ($timer > $this->noShowIxora) return $s;
-
- $s .= '';
- $save = $ADODB_CACHE_MODE;
- $ADODB_CACHE_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->Execute($sql);
- $this->conn->LogSQL($savelog);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
-
- if ($rs) {
- $s .= "\n
Ixora Expensive SQL
";
- $s .= $this->tohtml($rs,'expeixora');
- }
-
- return $s;
- }
-
- function clearsql()
- {
- $perf_table = adodb_perf::table();
- // using the naive "delete from $perf_table where created<".$this->conn->sysTimeStamp will cause the table to lock, possibly
- // for a long time
- $sql =
-"DECLARE cnt pls_integer;
-BEGIN
- cnt := 0;
- FOR rec IN (SELECT ROWID AS rr FROM $perf_table WHERE createdconn->Execute($sql);
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/perf/perf-postgres.inc.php b/src/adodb512/perf/perf-postgres.inc.php
deleted file mode 100644
index 7cb9ea2e..00000000
--- a/src/adodb512/perf/perf-postgres.inc.php
+++ /dev/null
@@ -1,153 +0,0 @@
- array('RATIO',
- "select case when count(*)=3 then 'TRUE' else 'FALSE' end from pg_settings where (name='stats_block_level' or name='stats_row_level' or name='stats_start_collector') and setting='on' ",
- 'Value must be TRUE to enable hit ratio statistics (stats_start_collector,stats_row_level and stats_block_level must be set to true in postgresql.conf)'),
- 'data cache hit ratio' => array('RATIO',
- "select case when blks_hit=0 then 0 else round( ((1-blks_read::float/blks_hit)*100)::numeric, 2) end from pg_stat_database where datname='\$DATABASE'",
- '=WarnCacheRatio'),
- 'IO',
- 'data reads' => array('IO',
- 'select sum(heap_blks_read+toast_blks_read) from pg_statio_user_tables',
- ),
- 'data writes' => array('IO',
- 'select round((sum(n_tup_ins/4.0+n_tup_upd/8.0+n_tup_del/4.0)/16)::numeric,2) from pg_stat_user_tables',
- 'Count of inserts/updates/deletes * coef'),
-
- 'Data Cache',
- 'data cache buffers' => array('DATAC',
- "select setting from pg_settings where name='shared_buffers'",
- 'Number of cache buffers. Tuning'),
- 'cache blocksize' => array('DATAC',
- 'select 8192',
- '(estimate)' ),
- 'data cache size' => array( 'DATAC',
- "select setting::integer*8192 from pg_settings where name='shared_buffers'",
- '' ),
- 'operating system cache size' => array( 'DATA',
- "select setting::integer*8192 from pg_settings where name='effective_cache_size'",
- '(effective cache size)' ),
- 'Memory Usage',
- # Postgres 7.5 changelog: Rename server parameters SortMem and VacuumMem to work_mem and maintenance_work_mem;
- 'sort/work buffer size' => array('CACHE',
- "select setting::integer*1024 from pg_settings where name='sort_mem' or name = 'work_mem' order by name",
- 'Size of sort buffer (per query)' ),
- 'Connections',
- 'current connections' => array('SESS',
- 'select count(*) from pg_stat_activity',
- ''),
- 'max connections' => array('SESS',
- "select setting from pg_settings where name='max_connections'",
- ''),
- 'Parameters',
- 'rollback buffers' => array('COST',
- "select setting from pg_settings where name='wal_buffers'",
- 'WAL buffers'),
- 'random page cost' => array('COST',
- "select setting from pg_settings where name='random_page_cost'",
- 'Cost of doing a seek (default=4). See random_page_cost'),
- false
- );
-
- function perf_postgres(&$conn)
- {
- $this->conn = $conn;
- }
-
- var $optimizeTableLow = 'VACUUM %s';
- var $optimizeTableHigh = 'VACUUM ANALYZE %s';
-
-/**
- * @see adodb_perf#optimizeTable
- */
-
- function optimizeTable($table, $mode = ADODB_OPT_LOW)
- {
- if(! is_string($table)) return false;
-
- $conn = $this->conn;
- if (! $conn) return false;
-
- $sql = '';
- switch($mode) {
- case ADODB_OPT_LOW : $sql = $this->optimizeTableLow; break;
- case ADODB_OPT_HIGH: $sql = $this->optimizeTableHigh; break;
- default :
- {
- ADOConnection::outp(sprintf("%s: '%s' using of undefined mode '%s'
", __CLASS__, 'optimizeTable', $mode));
- return false;
- }
- }
- $sql = sprintf($sql, $table);
-
- return $conn->Execute($sql) !== false;
- }
-
- function Explain($sql,$partial=false)
- {
- $save = $this->conn->LogSQL(false);
-
- if ($partial) {
- $sqlq = $this->conn->qstr($sql.'%');
- $arr = $this->conn->GetArray("select distinct distinct sql1 from adodb_logsql where sql1 like $sqlq");
- if ($arr) {
- foreach($arr as $row) {
- $sql = reset($row);
- if (crc32($sql) == $partial) break;
- }
- }
- }
- $sql = str_replace('?',"''",$sql);
- $s = 'Explain: '.htmlspecialchars($sql).'
';
- $rs = $this->conn->Execute('EXPLAIN '.$sql);
- $this->conn->LogSQL($save);
- $s .= '';
- if ($rs)
- while (!$rs->EOF) {
- $s .= reset($rs->fields)."\n";
- $rs->MoveNext();
- }
- $s .= '';
- $s .= $this->Tracer($sql,$partial);
- return $s;
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/pivottable.inc.php b/src/adodb512/pivottable.inc.php
deleted file mode 100644
index 48890b81..00000000
--- a/src/adodb512/pivottable.inc.php
+++ /dev/null
@@ -1,187 +0,0 @@
-databaseType,'access') !== false;
- // note - vfp 6 still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
-
- //$hidecnt = false;
-
- if ($where) $where = "\nWHERE $where";
- if (!is_array($colfield)) $colarr = $db->GetCol("select distinct $colfield from $tables $where order by 1");
- if (!$aggfield) $hidecnt = false;
-
- $sel = "$rowfields, ";
- if (is_array($colfield)) {
- foreach ($colfield as $k => $v) {
- $k = trim($k);
- if (!$hidecnt) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($v,1,0)) AS \"$k\", "
- :
- "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
- }
- if ($aggfield) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", "
- :
- "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
- }
- }
- } else {
- foreach ($colarr as $v) {
- if (!is_numeric($v)) $vq = $db->qstr($v);
- else $vq = $v;
- $v = trim($v);
- if (strlen($v) == 0 ) $v = 'null';
- if (!$hidecnt) {
- $sel .= $iif ?
- "\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", "
- :
- "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
- }
- if ($aggfield) {
- if ($hidecnt) $label = $v;
- else $label = "{$v}_$aggfield";
- $sel .= $iif ?
- "\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", "
- :
- "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
- }
- }
- }
- if ($aggfield && $aggfield != '1'){
- $agg = "$aggfn($aggfield)";
- $sel .= "\n\t$agg as \"$sumlabel$aggfield\", ";
- }
-
- if ($showcount)
- $sel .= "\n\tSUM(1) as Total";
- else
- $sel = substr($sel,0,strlen($sel)-2);
-
-
- // Strip aliases
- $rowfields = preg_replace('/ AS (\w+)/i', '', $rowfields);
-
- $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields";
-
- return $sql;
- }
-
-/* EXAMPLES USING MS NORTHWIND DATABASE */
-if (0) {
-
-# example1
-#
-# Query the main "product" table
-# Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the Categories
-# and define the joins to link to lookup tables
-# "categories" and "suppliers"
-#
-
- $sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'CompanyName,QuantityPerUnit', # row fields
- 'CategoryName', # column fields
- 'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where
-);
- print "$sql";
- $rs = $gDB->Execute($sql);
- rs2html($rs);
-
-/*
-Generated SQL:
-
-SELECT CompanyName,QuantityPerUnit,
- SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages",
- SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS "Condiments",
- SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS "Confections",
- SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS "Dairy Products",
- SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS "Grains/Cereals",
- SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS "Meat/Poultry",
- SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS "Produce",
- SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS "Seafood",
- SUM(1) as Total
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY CompanyName,QuantityPerUnit
-*/
-//=====================================================================
-
-# example2
-#
-# Query the main "product" table
-# Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the UnitsInStock for diiferent ranges
-# and define the joins to link to lookup tables
-# "categories" and "suppliers"
-#
- $sql = PivotTableSQL(
- $gDB, # adodb connection
- 'products p ,categories c ,suppliers s', # tables
- 'CompanyName,QuantityPerUnit', # row fields
- # column ranges
-array(
-' 0 ' => 'UnitsInStock <= 0',
-"1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5',
-"6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10',
-"11 to 15" => '10 < UnitsInStock and UnitsInStock <= 15',
-"16+" =>'15 < UnitsInStock'
-),
- ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where
- 'UnitsInStock', # sum this field
- 'Sum' # sum label prefix
-);
- print "$sql";
- $rs = $gDB->Execute($sql);
- rs2html($rs);
- /*
- Generated SQL:
-
-SELECT CompanyName,QuantityPerUnit,
- SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS "Sum 0 ",
- SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN UnitsInStock ELSE 0 END) AS "Sum 1 to 5",
- SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock ELSE 0 END) AS "Sum 6 to 10",
- SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN UnitsInStock ELSE 0 END) AS "Sum 11 to 15",
- SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS "Sum 16+",
- SUM(UnitsInStock) AS "Sum UnitsInStock",
- SUM(1) as Total
-FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID
-GROUP BY CompanyName,QuantityPerUnit
- */
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/readme.txt b/src/adodb512/readme.txt
deleted file mode 100644
index 009b94c5..00000000
--- a/src/adodb512/readme.txt
+++ /dev/null
@@ -1,62 +0,0 @@
->> ADODB Library for PHP4
-
-(c) 2000-2004 John Lim (jlim@natsoft.com.my)
-
-Released under both BSD and GNU Lesser GPL library license.
-This means you can use it in proprietary products.
-
-
->> Introduction
-
-PHP's database access functions are not standardised. This creates a
-need for a database class library to hide the differences between the
-different databases (encapsulate the differences) so we can easily
-switch databases.
-
-We currently support MySQL, Interbase, Sybase, PostgreSQL, Oracle,
-Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2,
-Sybase SQL Anywhere, generic ODBC and Microsoft's ADO.
-
-We hope more people will contribute drivers to support other databases.
-
-
->> Documentation and Examples
-
-Refer to the adodb/docs directory for full documentation and examples.
-There is also a tutorial tute.htm that contrasts ADODB code with
-mysql code.
-
-
->>> Files
-Adodb.inc.php is the main file. You need to include only this file.
-
-Adodb-*.inc.php are the database specific driver code.
-
-Test.php contains a list of test commands to exercise the class library.
-
-Adodb-session.php is the PHP4 session handling code.
-
-Testdatabases.inc.php contains the list of databases to apply the tests on.
-
-Benchmark.php is a simple benchmark to test the throughput of a simple SELECT
-statement for databases described in testdatabases.inc.php. The benchmark
-tables are created in test.php.
-
-readme.htm is the main documentation.
-
-tute.htm is the tutorial.
-
-
->> More Info
-
-For more information, including installation see readme.htm
-or visit
- http://adodb.sourceforge.net/
-
-
->> Feature Requests and Bug Reports
-
-Email to jlim@natsoft.com.my
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/rsfilter.inc.php b/src/adodb512/rsfilter.inc.php
deleted file mode 100644
index 501ffc9b..00000000
--- a/src/adodb512/rsfilter.inc.php
+++ /dev/null
@@ -1,61 +0,0 @@
- $v) {
- $arr[$k] = ucwords($v);
- }
- }
- $rs = RSFilter($rs,'do_ucwords');
- */
-function RSFilter($rs,$fn)
-{
- if ($rs->databaseType != 'array') {
- if (!$rs->connection) return false;
-
- $rs = $rs->connection->_rs2rs($rs);
- }
- $rows = $rs->RecordCount();
- for ($i=0; $i < $rows; $i++) {
- if (is_array ($fn)) {
- $obj = $fn[0];
- $method = $fn[1];
- $obj->$method ($rs->_array[$i],$rs);
- } else {
- $fn($rs->_array[$i],$rs);
- }
-
- }
- if (!$rs->EOF) {
- $rs->_currentRow = 0;
- $rs->fields = $rs->_array[0];
- }
-
- return $rs;
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/server.php b/src/adodb512/server.php
deleted file mode 100644
index 91d68124..00000000
--- a/src/adodb512/server.php
+++ /dev/null
@@ -1,100 +0,0 @@
-Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg());
-$sql = undomq($_REQUEST['sql']);
-
-if (isset($_REQUEST['fetch']))
- $ADODB_FETCH_MODE = $_REQUEST['fetch'];
-
-if (isset($_REQUEST['nrows'])) {
- $nrows = $_REQUEST['nrows'];
- $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : -1;
- $rs = $conn->SelectLimit($sql,$nrows,$offset);
-} else
- $rs = $conn->Execute($sql);
-if ($rs){
- //$rs->timeToLive = 1;
- echo _rs2serialize($rs,$conn,$sql);
- $rs->Close();
-} else
- err($conn->ErrorNo(). $sep .$conn->ErrorMsg());
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-compress-bzip2.php b/src/adodb512/session/adodb-compress-bzip2.php
deleted file mode 100644
index f6a5f290..00000000
--- a/src/adodb512/session/adodb-compress-bzip2.php
+++ /dev/null
@@ -1,118 +0,0 @@
-_block_size;
- }
-
- /**
- */
- function setBlockSize($block_size) {
- assert('$block_size >= 1');
- assert('$block_size <= 9');
- $this->_block_size = (int) $block_size;
- }
-
- /**
- */
- function getWorkLevel() {
- return $this->_work_level;
- }
-
- /**
- */
- function setWorkLevel($work_level) {
- assert('$work_level >= 0');
- assert('$work_level <= 250');
- $this->_work_level = (int) $work_level;
- }
-
- /**
- */
- function getMinLength() {
- return $this->_min_length;
- }
-
- /**
- */
- function setMinLength($min_length) {
- assert('$min_length >= 0');
- $this->_min_length = (int) $min_length;
- }
-
- /**
- */
- function ADODB_Compress_Bzip2($block_size = null, $work_level = null, $min_length = null) {
- if (!is_null($block_size)) {
- $this->setBlockSize($block_size);
- }
-
- if (!is_null($work_level)) {
- $this->setWorkLevel($work_level);
- }
-
- if (!is_null($min_length)) {
- $this->setMinLength($min_length);
- }
- }
-
- /**
- */
- function write($data, $key) {
- if (strlen($data) < $this->_min_length) {
- return $data;
- }
-
- if (!is_null($this->_block_size)) {
- if (!is_null($this->_work_level)) {
- return bzcompress($data, $this->_block_size, $this->_work_level);
- } else {
- return bzcompress($data, $this->_block_size);
- }
- }
-
- return bzcompress($data);
- }
-
- /**
- */
- function read($data, $key) {
- return $data ? bzdecompress($data) : $data;
- }
-
-}
-
-return 1;
-
-?>
diff --git a/src/adodb512/session/adodb-compress-gzip.php b/src/adodb512/session/adodb-compress-gzip.php
deleted file mode 100644
index af74e855..00000000
--- a/src/adodb512/session/adodb-compress-gzip.php
+++ /dev/null
@@ -1,93 +0,0 @@
-_level;
- }
-
- /**
- */
- function setLevel($level) {
- assert('$level >= 0');
- assert('$level <= 9');
- $this->_level = (int) $level;
- }
-
- /**
- */
- function getMinLength() {
- return $this->_min_length;
- }
-
- /**
- */
- function setMinLength($min_length) {
- assert('$min_length >= 0');
- $this->_min_length = (int) $min_length;
- }
-
- /**
- */
- function ADODB_Compress_Gzip($level = null, $min_length = null) {
- if (!is_null($level)) {
- $this->setLevel($level);
- }
-
- if (!is_null($min_length)) {
- $this->setMinLength($min_length);
- }
- }
-
- /**
- */
- function write($data, $key) {
- if (strlen($data) < $this->_min_length) {
- return $data;
- }
-
- if (!is_null($this->_level)) {
- return gzcompress($data, $this->_level);
- } else {
- return gzcompress($data);
- }
- }
-
- /**
- */
- function read($data, $key) {
- return $data ? gzuncompress($data) : $data;
- }
-
-}
-
-return 1;
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-cryptsession.php b/src/adodb512/session/adodb-cryptsession.php
deleted file mode 100644
index bb144da9..00000000
--- a/src/adodb512/session/adodb-cryptsession.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-cryptsession2.php b/src/adodb512/session/adodb-cryptsession2.php
deleted file mode 100644
index 0b0d3b9c..00000000
--- a/src/adodb512/session/adodb-cryptsession2.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-encrypt-mcrypt.php b/src/adodb512/session/adodb-encrypt-mcrypt.php
deleted file mode 100644
index d6e858cf..00000000
--- a/src/adodb512/session/adodb-encrypt-mcrypt.php
+++ /dev/null
@@ -1,109 +0,0 @@
-_cipher;
- }
-
- /**
- */
- function setCipher($cipher) {
- $this->_cipher = $cipher;
- }
-
- /**
- */
- function getMode() {
- return $this->_mode;
- }
-
- /**
- */
- function setMode($mode) {
- $this->_mode = $mode;
- }
-
- /**
- */
- function getSource() {
- return $this->_source;
- }
-
- /**
- */
- function setSource($source) {
- $this->_source = $source;
- }
-
- /**
- */
- function ADODB_Encrypt_MCrypt($cipher = null, $mode = null, $source = null) {
- if (!$cipher) {
- $cipher = MCRYPT_RIJNDAEL_256;
- }
- if (!$mode) {
- $mode = MCRYPT_MODE_ECB;
- }
- if (!$source) {
- $source = MCRYPT_RAND;
- }
-
- $this->_cipher = $cipher;
- $this->_mode = $mode;
- $this->_source = $source;
- }
-
- /**
- */
- function write($data, $key) {
- $iv_size = mcrypt_get_iv_size($this->_cipher, $this->_mode);
- $iv = mcrypt_create_iv($iv_size, $this->_source);
- return mcrypt_encrypt($this->_cipher, $key, $data, $this->_mode, $iv);
- }
-
- /**
- */
- function read($data, $key) {
- $iv_size = mcrypt_get_iv_size($this->_cipher, $this->_mode);
- $iv = mcrypt_create_iv($iv_size, $this->_source);
- $rv = mcrypt_decrypt($this->_cipher, $key, $data, $this->_mode, $iv);
- return rtrim($rv, "\0");
- }
-
-}
-
-return 1;
-
-?>
diff --git a/src/adodb512/session/adodb-encrypt-md5.php b/src/adodb512/session/adodb-encrypt-md5.php
deleted file mode 100644
index f2209cc9..00000000
--- a/src/adodb512/session/adodb-encrypt-md5.php
+++ /dev/null
@@ -1,39 +0,0 @@
-encrypt($data, $key);
- }
-
- /**
- */
- function read($data, $key) {
- $md5crypt = new MD5Crypt();
- return $md5crypt->decrypt($data, $key);
- }
-
-}
-
-return 1;
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-encrypt-secret.php b/src/adodb512/session/adodb-encrypt-secret.php
deleted file mode 100644
index 4dc11eec..00000000
--- a/src/adodb512/session/adodb-encrypt-secret.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
diff --git a/src/adodb512/session/adodb-encrypt-sha1.php b/src/adodb512/session/adodb-encrypt-sha1.php
deleted file mode 100644
index 0884af60..00000000
--- a/src/adodb512/session/adodb-encrypt-sha1.php
+++ /dev/null
@@ -1,32 +0,0 @@
-encrypt($data, $key);
-
- }
-
-
- function read($data, $key)
- {
- $sha1crypt = new SHA1Crypt();
- return $sha1crypt->decrypt($data, $key);
-
- }
-}
-
-
-
-return 1;
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-sess.txt b/src/adodb512/session/adodb-sess.txt
deleted file mode 100644
index c6c76858..00000000
--- a/src/adodb512/session/adodb-sess.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-John,
-
-I have been an extremely satisfied ADODB user for several years now.
-
-To give you something back for all your hard work, I've spent the last 3
-days rewriting the adodb-session.php code.
-
-----------
-What's New
-----------
-
-Here's a list of the new code's benefits:
-
-* Combines the functionality of the three files:
-
-adodb-session.php
-adodb-session-clob.php
-adodb-cryptsession.php
-
-each with very similar functionality, into a single file adodb-session.php.
-This will ease maintenance and support issues.
-
-* Supports multiple encryption and compression schemes.
- Currently, we support:
-
- MD5Crypt (crypt.inc.php)
- MCrypt
- Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
- GZip
- BZip2
-
-These can be stacked, so if you want to compress and then encrypt your
-session data, it's easy.
-Also, the built-in MCrypt functions will be *much* faster, and more secure,
-than the MD5Crypt code.
-
-* adodb-session.php contains a single class ADODB_Session that encapsulates
-all functionality.
- This eliminates the use of global vars and defines (though they are
-supported for backwards compatibility).
-
-* All user defined parameters are now static functions in the ADODB_Session
-class.
-
-New parameters include:
-
-* encryptionKey(): Define the encryption key used to encrypt the session.
-Originally, it was a hard coded string.
-
-* persist(): Define if the database will be opened in persistent mode.
-Originally, the user had to call adodb_sess_open().
-
-* dataFieldName(): Define the field name used to store the session data, as
-'DATA' appears to be a reserved word in the following cases:
- ANSI SQL
- IBM DB2
- MS SQL Server
- Postgres
- SAP
-
-* filter(): Used to support multiple, simulataneous encryption/compression
-schemes.
-
-* Debug support is improved thru _rsdump() function, which is called after
-every database call.
-
-------------
-What's Fixed
-------------
-
-The new code includes several bug fixes and enhancements:
-
-* sesskey is compared in BINARY mode for MySQL, to avoid problems with
-session keys that differ only by case.
- Of course, the user should define the sesskey field as BINARY, to
-correctly fix this problem, otherwise performance will suffer.
-
-* In ADODB_Session::gc(), if $expire_notify is true, the multiple DELETES in
-the original code have been optimized to a single DELETE.
-
-* In ADODB_Session::destroy(), since "SELECT expireref, sesskey FROM $table
-WHERE sesskey = $qkey" will only return a single value, we don't loop on the
-result, we simply process the row, if any.
-
-* We close $rs after every use.
-
----------------
-What's the Same
----------------
-
-I know backwards compatibility is *very* important to you. Therefore, the
-new code is 100% backwards compatible.
-
-If you like my code, but don't "trust" it's backwards compatible, maybe we
-offer it as beta code, in a new directory for a release or two?
-
-------------
-What's To Do
-------------
-
-I've vascillated over whether to use a single function to get/set
-parameters:
-
-$user = ADODB_Session::user(); // get
-ADODB_Session::user($user); // set
-
-or to use separate functions (which is the PEAR/Java way):
-
-$user = ADODB_Session::getUser();
-ADODB_Session::setUser($user);
-
-I've chosen the former as it's makes for a simpler API, and reduces the
-amount of code, but I'd be happy to change it to the latter.
-
-Also, do you think the class should be a singleton class, versus a static
-class?
-
-Let me know if you find this code useful, and will be including it in the
-next release of ADODB.
-
-If so, I will modify the current documentation to detail the new
-functionality. To that end, what file(s) contain the documentation? Please
-send them to me if they are not publically available.
-
-Also, if there is *anything* in the code that you like to see changed, let
-me know.
-
-Thanks,
-
-Ross
-
diff --git a/src/adodb512/session/adodb-session-clob.php b/src/adodb512/session/adodb-session-clob.php
deleted file mode 100644
index 532151b2..00000000
--- a/src/adodb512/session/adodb-session-clob.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-session-clob2.php b/src/adodb512/session/adodb-session-clob2.php
deleted file mode 100644
index 6aed5734..00000000
--- a/src/adodb512/session/adodb-session-clob2.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-session.php b/src/adodb512/session/adodb-session.php
deleted file mode 100644
index 5699025f..00000000
--- a/src/adodb512/session/adodb-session.php
+++ /dev/null
@@ -1,934 +0,0 @@
-Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
-
- /* it is possible that the update statement fails due to a collision */
- if (!$ok) {
- session_id($old_id);
- if (empty($ck)) $ck = session_get_cookie_params();
- setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
- return false;
- }
-
- return true;
-}
-
-/*
- Generate database table for session data
- @see http://phplens.com/lens/lensforum/msgs.php?id=12280
- @return 0 if failure, 1 if errors, 2 if successful.
- @author Markus Staab http://www.public-4u.de
-*/
-function adodb_session_create_table($schemaFile=null,$conn = null)
-{
- // set default values
- if ($schemaFile===null) $schemaFile = ADODB_SESSION . '/session_schema.xml';
- if ($conn===null) $conn = ADODB_Session::_conn();
-
- if (!$conn) return 0;
-
- $schema = new adoSchema($conn);
- $schema->ParseSchema($schemaFile);
- return $schema->ExecuteSchema();
-}
-
-/*!
- \static
-*/
-class ADODB_Session {
- /////////////////////
- // getter/setter methods
- /////////////////////
-
- /*
-
- function Lock($lock=null)
- {
- static $_lock = false;
-
- if (!is_null($lock)) $_lock = $lock;
- return $lock;
- }
- */
- /*!
- */
- function driver($driver = null) {
- static $_driver = 'mysql';
- static $set = false;
-
- if (!is_null($driver)) {
- $_driver = trim($driver);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_DRIVER'])) {
- return $GLOBALS['ADODB_SESSION_DRIVER'];
- }
- }
-
- return $_driver;
- }
-
- /*!
- */
- function host($host = null) {
- static $_host = 'localhost';
- static $set = false;
-
- if (!is_null($host)) {
- $_host = trim($host);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_CONNECT'])) {
- return $GLOBALS['ADODB_SESSION_CONNECT'];
- }
- }
-
- return $_host;
- }
-
- /*!
- */
- function user($user = null) {
- static $_user = 'root';
- static $set = false;
-
- if (!is_null($user)) {
- $_user = trim($user);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_USER'])) {
- return $GLOBALS['ADODB_SESSION_USER'];
- }
- }
-
- return $_user;
- }
-
- /*!
- */
- function password($password = null) {
- static $_password = '';
- static $set = false;
-
- if (!is_null($password)) {
- $_password = $password;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_PWD'])) {
- return $GLOBALS['ADODB_SESSION_PWD'];
- }
- }
-
- return $_password;
- }
-
- /*!
- */
- function database($database = null) {
- static $_database = 'xphplens_2';
- static $set = false;
-
- if (!is_null($database)) {
- $_database = trim($database);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_DB'])) {
- return $GLOBALS['ADODB_SESSION_DB'];
- }
- }
-
- return $_database;
- }
-
- /*!
- */
- function persist($persist = null)
- {
- static $_persist = true;
-
- if (!is_null($persist)) {
- $_persist = trim($persist);
- }
-
- return $_persist;
- }
-
- /*!
- */
- function lifetime($lifetime = null) {
- static $_lifetime;
- static $set = false;
-
- if (!is_null($lifetime)) {
- $_lifetime = (int) $lifetime;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESS_LIFE'])) {
- return $GLOBALS['ADODB_SESS_LIFE'];
- }
- }
- if (!$_lifetime) {
- $_lifetime = ini_get('session.gc_maxlifetime');
- if ($_lifetime <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetimenot set: $lifetime
";
- $_lifetime = 1440;
- }
- }
-
- return $_lifetime;
- }
-
- /*!
- */
- function debug($debug = null) {
- static $_debug = false;
- static $set = false;
-
- if (!is_null($debug)) {
- $_debug = (bool) $debug;
-
- $conn = ADODB_Session::_conn();
- if ($conn) {
- $conn->debug = $_debug;
- }
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESS_DEBUG'])) {
- return $GLOBALS['ADODB_SESS_DEBUG'];
- }
- }
-
- return $_debug;
- }
-
- /*!
- */
- function expireNotify($expire_notify = null) {
- static $_expire_notify;
- static $set = false;
-
- if (!is_null($expire_notify)) {
- $_expire_notify = $expire_notify;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'])) {
- return $GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'];
- }
- }
-
- return $_expire_notify;
- }
-
- /*!
- */
- function table($table = null) {
- static $_table = 'sessions';
- static $set = false;
-
- if (!is_null($table)) {
- $_table = trim($table);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_TBL'])) {
- return $GLOBALS['ADODB_SESSION_TBL'];
- }
- }
-
- return $_table;
- }
-
- /*!
- */
- function optimize($optimize = null) {
- static $_optimize = false;
- static $set = false;
-
- if (!is_null($optimize)) {
- $_optimize = (bool) $optimize;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- return true;
- }
- }
-
- return $_optimize;
- }
-
- /*!
- */
- function syncSeconds($sync_seconds = null) {
- static $_sync_seconds = 60;
- static $set = false;
-
- if (!is_null($sync_seconds)) {
- $_sync_seconds = (int) $sync_seconds;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (defined('ADODB_SESSION_SYNCH_SECS')) {
- return ADODB_SESSION_SYNCH_SECS;
- }
- }
-
- return $_sync_seconds;
- }
-
- /*!
- */
- function clob($clob = null) {
- static $_clob = false;
- static $set = false;
-
- if (!is_null($clob)) {
- $_clob = strtolower(trim($clob));
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_USE_LOBS'])) {
- return $GLOBALS['ADODB_SESSION_USE_LOBS'];
- }
- }
-
- return $_clob;
- }
-
- /*!
- */
- function dataFieldName($data_field_name = null) {
- static $_data_field_name = 'data';
-
- if (!is_null($data_field_name)) {
- $_data_field_name = trim($data_field_name);
- }
-
- return $_data_field_name;
- }
-
- /*!
- */
- function filter($filter = null) {
- static $_filter = array();
-
- if (!is_null($filter)) {
- if (!is_array($filter)) {
- $filter = array($filter);
- }
- $_filter = $filter;
- }
-
- return $_filter;
- }
-
- /*!
- */
- function encryptionKey($encryption_key = null) {
- static $_encryption_key = 'CRYPTED ADODB SESSIONS ROCK!';
-
- if (!is_null($encryption_key)) {
- $_encryption_key = $encryption_key;
- }
-
- return $_encryption_key;
- }
-
- /////////////////////
- // private methods
- /////////////////////
-
- /*!
- */
- function _conn($conn=null) {
- return $GLOBALS['ADODB_SESS_CONN'];
- }
-
- /*!
- */
- function _crc($crc = null) {
- static $_crc = false;
-
- if (!is_null($crc)) {
- $_crc = $crc;
- }
-
- return $_crc;
- }
-
- /*!
- */
- function _init() {
- session_module_name('user');
- session_set_save_handler(
- array('ADODB_Session', 'open'),
- array('ADODB_Session', 'close'),
- array('ADODB_Session', 'read'),
- array('ADODB_Session', 'write'),
- array('ADODB_Session', 'destroy'),
- array('ADODB_Session', 'gc')
- );
- }
-
-
- /*!
- */
- function _sessionKey() {
- // use this function to create the encryption key for crypted sessions
- // crypt the used key, ADODB_Session::encryptionKey() as key and session_id() as salt
- return crypt(ADODB_Session::encryptionKey(), session_id());
- }
-
- /*!
- */
- function _dumprs($rs) {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
-
- if (!$conn) {
- return;
- }
-
- if (!$debug) {
- return;
- }
-
- if (!$rs) {
- echo "
\$rs is null or false
\n";
- return;
- }
-
- //echo "
\nAffected_Rows=",$conn->Affected_Rows(),"
\n";
-
- if (!is_object($rs)) {
- return;
- }
-
- require_once ADODB_SESSION.'/../tohtml.inc.php';
- rs2html($rs);
- }
-
- /////////////////////
- // public methods
- /////////////////////
-
- function config($driver, $host, $user, $password, $database=false,$options=false)
- {
- ADODB_Session::driver($driver);
- ADODB_Session::host($host);
- ADODB_Session::user($user);
- ADODB_Session::password($password);
- ADODB_Session::database($database);
-
- if ($driver == 'oci8' || $driver == 'oci8po') $options['lob'] = 'CLOB';
-
- if (isset($options['table'])) ADODB_Session::table($options['table']);
- if (isset($options['lob'])) ADODB_Session::clob($options['lob']);
- if (isset($options['debug'])) ADODB_Session::debug($options['debug']);
- }
-
- /*!
- Create the connection to the database.
-
- If $conn already exists, reuse that connection
- */
- function open($save_path, $session_name, $persist = null)
- {
- $conn = ADODB_Session::_conn();
-
- if ($conn) {
- return true;
- }
-
- $database = ADODB_Session::database();
- $debug = ADODB_Session::debug();
- $driver = ADODB_Session::driver();
- $host = ADODB_Session::host();
- $password = ADODB_Session::password();
- $user = ADODB_Session::user();
-
- if (!is_null($persist)) {
- ADODB_Session::persist($persist);
- } else {
- $persist = ADODB_Session::persist();
- }
-
-# these can all be defaulted to in php.ini
-# assert('$database');
-# assert('$driver');
-# assert('$host');
-
- $conn = ADONewConnection($driver);
-
- if ($debug) {
- $conn->debug = true;
-// ADOConnection::outp( " driver=$driver user=$user pwd=$password db=$database ");
- }
-
- if ($persist) {
- switch($persist) {
- default:
- case 'P': $ok = $conn->PConnect($host, $user, $password, $database); break;
- case 'C': $ok = $conn->Connect($host, $user, $password, $database); break;
- case 'N': $ok = $conn->NConnect($host, $user, $password, $database); break;
- }
- } else {
- $ok = $conn->Connect($host, $user, $password, $database);
- }
-
- if ($ok) $GLOBALS['ADODB_SESS_CONN'] = $conn;
- else
- ADOConnection::outp('Session: connection failed
', false);
-
-
- return $ok;
- }
-
- /*!
- Close the connection
- */
- function close()
- {
-/*
- $conn = ADODB_Session::_conn();
- if ($conn) $conn->Close();
-*/
- return true;
- }
-
- /*
- Slurp in the session variables and return the serialized string
- */
- function read($key)
- {
- $conn = ADODB_Session::_conn();
- $data = ADODB_Session::dataFieldName();
- $filter = ADODB_Session::filter();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return '';
- }
-
- //assert('$table');
-
- $qkey = $conn->quote($key);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- $sql = "SELECT $data FROM $table WHERE sesskey = $binary $qkey AND expiry >= " . time();
- /* Lock code does not work as it needs to hold transaction within whole page, and we don't know if
- developer has commited elsewhere... :(
- */
- #if (ADODB_Session::Lock())
- # $rs = $conn->RowLock($table, "$binary sesskey = $qkey AND expiry >= " . time(), $data);
- #else
-
- $rs = $conn->Execute($sql);
- //ADODB_Session::_dumprs($rs);
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else {
- $v = reset($rs->fields);
- $filter = array_reverse($filter);
- foreach ($filter as $f) {
- if (is_object($f)) {
- $v = $f->read($v, ADODB_Session::_sessionKey());
- }
- }
- $v = rawurldecode($v);
- }
-
- $rs->Close();
-
- ADODB_Session::_crc(strlen($v) . crc32($v));
- return $v;
- }
-
- return '';
- }
-
- /*!
- Write the serialized data to a database.
-
- If the data has not been modified since the last read(), we do not write.
- */
- function write($key, $val)
- {
- global $ADODB_SESSION_READONLY;
-
- if (!empty($ADODB_SESSION_READONLY)) return;
-
- $clob = ADODB_Session::clob();
- $conn = ADODB_Session::_conn();
- $crc = ADODB_Session::_crc();
- $data = ADODB_Session::dataFieldName();
- $debug = ADODB_Session::debug();
- $driver = ADODB_Session::driver();
- $expire_notify = ADODB_Session::expireNotify();
- $filter = ADODB_Session::filter();
- $lifetime = ADODB_Session::lifetime();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return false;
- }
- $qkey = $conn->qstr($key);
-
- //assert('$table');
-
- $expiry = time() + $lifetime;
-
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($crc !== false && $crc == (strlen($val) . crc32($val))) {
- if ($debug) {
- ADOConnection::outp( 'Session: Only updating date - crc32 not changed
');
- }
-
- $expirevar = '';
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $expirevar = $$var;
- }
- }
-
-
- $sql = "UPDATE $table SET expiry = ".$conn->Param('0').",expireref=".$conn->Param('1')." WHERE $binary sesskey = ".$conn->Param('2')." AND expiry >= ".$conn->Param('3');
- $rs = $conn->Execute($sql,array($expiry,$expirevar,$key,time()));
- return true;
- }
- $val = rawurlencode($val);
- foreach ($filter as $f) {
- if (is_object($f)) {
- $val = $f->write($val, ADODB_Session::_sessionKey());
- }
- }
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, $data => $val, 'expireref' => '');
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $arr['expireref'] = $$var;
- }
- }
-
- if (!$clob) { // no lobs, simply use replace()
- $arr[$data] = $val;
- $rs = $conn->Replace($table, $arr, 'sesskey', $autoQuote = true);
-
- } else {
- // what value shall we insert/update for lob row?
- switch ($driver) {
- // empty_clob or empty_lob for oracle dbs
- case 'oracle':
- case 'oci8':
- case 'oci8po':
- case 'oci805':
- $lob_value = sprintf('empty_%s()', strtolower($clob));
- break;
-
- // null for all other
- default:
- $lob_value = 'null';
- break;
- }
-
- $conn->StartTrans();
- $expiryref = $conn->qstr($arr['expireref']);
- // do we insert or update? => as for sesskey
- $rs = $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = $qkey");
- if ($rs && reset($rs->fields) > 0) {
- $sql = "UPDATE $table SET expiry = $expiry, $data = $lob_value, expireref=$expiryref WHERE sesskey = $qkey";
- } else {
- $sql = "INSERT INTO $table (expiry, $data, sesskey,expireref) VALUES ($expiry, $lob_value, $qkey,$expiryref)";
- }
- if ($rs)$rs->Close();
-
-
- $err = '';
- $rs1 = $conn->Execute($sql);
- if (!$rs1) $err = $conn->ErrorMsg()."\n";
-
- $rs2 = $conn->UpdateBlob($table, $data, $val, " sesskey=$qkey", strtoupper($clob));
- if (!$rs2) $err .= $conn->ErrorMsg()."\n";
-
- $rs = ($rs && $rs2) ? true : false;
- $conn->CompleteTrans();
- }
-
- if (!$rs) {
- ADOConnection::outp('Session Replace: ' . $conn->ErrorMsg() . '
', false);
- return false;
- } else {
- // bug in access driver (could be odbc?) means that info is not committed
- // properly unless select statement executed in Win2000
- if ($conn->databaseType == 'access') {
- $sql = "SELECT sesskey FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- if ($rs) {
- $rs->Close();
- }
- }
- }/*
- if (ADODB_Session::Lock()) {
- $conn->CommitTrans();
- }*/
- return $rs ? true : false;
- }
-
- /*!
- */
- function destroy($key) {
- $conn = ADODB_Session::_conn();
- $table = ADODB_Session::table();
- $expire_notify = ADODB_Session::expireNotify();
-
- if (!$conn) {
- return false;
- }
-
- //assert('$table');
-
- $qkey = $conn->quote($key);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- if ($expire_notify) {
- reset($expire_notify);
- $fn = next($expire_notify);
- $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
- $sql = "SELECT expireref, sesskey FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- $conn->SetFetchMode($savem);
- if (!$rs) {
- return false;
- }
- if (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- //assert('$ref');
- //assert('$key');
- $fn($ref, $key);
- }
- $rs->Close();
- }
-
- $sql = "DELETE FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
-
- return $rs ? true : false;
- }
-
- /*!
- */
- function gc($maxlifetime)
- {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
- $expire_notify = ADODB_Session::expireNotify();
- $optimize = ADODB_Session::optimize();
- $sync_seconds = ADODB_Session::syncSeconds();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return false;
- }
-
-
- $time = time();
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- if ($expire_notify) {
- reset($expire_notify);
- $fn = next($expire_notify);
- $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
- $sql = "SELECT expireref, sesskey FROM $table WHERE expiry < $time";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- $conn->SetFetchMode($savem);
- if ($rs) {
- $conn->StartTrans();
- $keys = array();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref, $key);
- $del = $conn->Execute("DELETE FROM $table WHERE sesskey=".$conn->Param('0'),array($key));
- $rs->MoveNext();
- }
- $rs->Close();
-
- $conn->CompleteTrans();
- }
- } else {
-
- if (1) {
- $sql = "SELECT sesskey FROM $table WHERE expiry < $time";
- $arr = $conn->GetAll($sql);
- foreach ($arr as $row) {
- $sql2 = "DELETE FROM $table WHERE sesskey=".$conn->Param('0');
- $conn->Execute($sql2,array(reset($row)));
- }
- } else {
- $sql = "DELETE FROM $table WHERE expiry < $time";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- if ($rs) $rs->Close();
- }
- if ($debug) {
- ADOConnection::outp("Garbage Collection: $sql
");
- }
- }
-
- // suggested by Cameron, "GaM3R"
- if ($optimize) {
- $driver = ADODB_Session::driver();
-
- if (preg_match('/mysql/i', $driver)) {
- $sql = "OPTIMIZE TABLE $table";
- }
- if (preg_match('/postgres/i', $driver)) {
- $sql = "VACUUM $table";
- }
- if (!empty($sql)) {
- $conn->Execute($sql);
- }
- }
-
- if ($sync_seconds) {
- $sql = 'SELECT ';
- if ($conn->dataProvider === 'oci8') {
- $sql .= "TO_CHAR({$conn->sysTimeStamp}, 'RRRR-MM-DD HH24:MI:SS')";
- } else {
- $sql .= $conn->sysTimeStamp;
- }
- $sql .= " FROM $table";
-
- $rs = $conn->SelectLimit($sql, 1);
- if ($rs && !$rs->EOF) {
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $conn->UnixTimeStamp($dbts);
- $t = time();
-
- if (abs($dbt - $t) >= $sync_seconds) {
- $msg = __FILE__ .
- ": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: " .
- " database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 60) . ' minutes)';
- error_log($msg);
- if ($debug) {
- ADOConnection::outp("$msg
");
- }
- }
- }
- }
-
- return true;
- }
-}
-
-ADODB_Session::_init();
-if (empty($ADODB_SESSION_READONLY))
- register_shutdown_function('session_write_close');
-
-// for backwards compatability only
-function adodb_sess_open($save_path, $session_name, $persist = true) {
- return ADODB_Session::open($save_path, $session_name, $persist);
-}
-
-// for backwards compatability only
-function adodb_sess_gc($t)
-{
- return ADODB_Session::gc($t);
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-session2.php b/src/adodb512/session/adodb-session2.php
deleted file mode 100644
index dc45b5da..00000000
--- a/src/adodb512/session/adodb-session2.php
+++ /dev/null
@@ -1,946 +0,0 @@
-Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
-
- /* it is possible that the update statement fails due to a collision */
- if (!$ok) {
- session_id($old_id);
- if (empty($ck)) $ck = session_get_cookie_params();
- setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
- return false;
- }
-
- return true;
-}
-
-/*
- Generate database table for session data
- @see http://phplens.com/lens/lensforum/msgs.php?id=12280
- @return 0 if failure, 1 if errors, 2 if successful.
- @author Markus Staab http://www.public-4u.de
-*/
-function adodb_session_create_table($schemaFile=null,$conn = null)
-{
- // set default values
- if ($schemaFile===null) $schemaFile = ADODB_SESSION . '/session_schema2.xml';
- if ($conn===null) $conn = ADODB_Session::_conn();
-
- if (!$conn) return 0;
-
- $schema = new adoSchema($conn);
- $schema->ParseSchema($schemaFile);
- return $schema->ExecuteSchema();
-}
-
-/*!
- \static
-*/
-class ADODB_Session {
- /////////////////////
- // getter/setter methods
- /////////////////////
-
- /*
-
- function Lock($lock=null)
- {
- static $_lock = false;
-
- if (!is_null($lock)) $_lock = $lock;
- return $lock;
- }
- */
- /*!
- */
- static function driver($driver = null)
- {
- static $_driver = 'mysql';
- static $set = false;
-
- if (!is_null($driver)) {
- $_driver = trim($driver);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_DRIVER'])) {
- return $GLOBALS['ADODB_SESSION_DRIVER'];
- }
- }
-
- return $_driver;
- }
-
- /*!
- */
- static function host($host = null) {
- static $_host = 'localhost';
- static $set = false;
-
- if (!is_null($host)) {
- $_host = trim($host);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_CONNECT'])) {
- return $GLOBALS['ADODB_SESSION_CONNECT'];
- }
- }
-
- return $_host;
- }
-
- /*!
- */
- static function user($user = null)
- {
- static $_user = 'root';
- static $set = false;
-
- if (!is_null($user)) {
- $_user = trim($user);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_USER'])) {
- return $GLOBALS['ADODB_SESSION_USER'];
- }
- }
-
- return $_user;
- }
-
- /*!
- */
- static function password($password = null)
- {
- static $_password = '';
- static $set = false;
-
- if (!is_null($password)) {
- $_password = $password;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_PWD'])) {
- return $GLOBALS['ADODB_SESSION_PWD'];
- }
- }
-
- return $_password;
- }
-
- /*!
- */
- static function database($database = null)
- {
- static $_database = '';
- static $set = false;
-
- if (!is_null($database)) {
- $_database = trim($database);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_DB'])) {
- return $GLOBALS['ADODB_SESSION_DB'];
- }
- }
- return $_database;
- }
-
- /*!
- */
- static function persist($persist = null)
- {
- static $_persist = true;
-
- if (!is_null($persist)) {
- $_persist = trim($persist);
- }
-
- return $_persist;
- }
-
- /*!
- */
- static function lifetime($lifetime = null)
- {
- static $_lifetime;
- static $set = false;
-
- if (!is_null($lifetime)) {
- $_lifetime = (int) $lifetime;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESS_LIFE'])) {
- return $GLOBALS['ADODB_SESS_LIFE'];
- }
- }
- if (!$_lifetime) {
- $_lifetime = ini_get('session.gc_maxlifetime');
- if ($_lifetime <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetimenot set: $lifetime
";
- $_lifetime = 1440;
- }
- }
-
- return $_lifetime;
- }
-
- /*!
- */
- static function debug($debug = null)
- {
- static $_debug = false;
- static $set = false;
-
- if (!is_null($debug)) {
- $_debug = (bool) $debug;
-
- $conn = ADODB_Session::_conn();
- if ($conn) {
- #$conn->debug = $_debug;
- }
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESS_DEBUG'])) {
- return $GLOBALS['ADODB_SESS_DEBUG'];
- }
- }
-
- return $_debug;
- }
-
- /*!
- */
- static function expireNotify($expire_notify = null)
- {
- static $_expire_notify;
- static $set = false;
-
- if (!is_null($expire_notify)) {
- $_expire_notify = $expire_notify;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'])) {
- return $GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'];
- }
- }
-
- return $_expire_notify;
- }
-
- /*!
- */
- static function table($table = null)
- {
- static $_table = 'sessions2';
- static $set = false;
-
- if (!is_null($table)) {
- $_table = trim($table);
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_TBL'])) {
- return $GLOBALS['ADODB_SESSION_TBL'];
- }
- }
-
- return $_table;
- }
-
- /*!
- */
- static function optimize($optimize = null)
- {
- static $_optimize = false;
- static $set = false;
-
- if (!is_null($optimize)) {
- $_optimize = (bool) $optimize;
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- return true;
- }
- }
-
- return $_optimize;
- }
-
- /*!
- */
- static function syncSeconds($sync_seconds = null) {
- //echo ("WARNING: ADODB_SESSION::syncSeconds is longer used, please remove this function for your code
");
-
- return 0;
- }
-
- /*!
- */
- static function clob($clob = null) {
- static $_clob = false;
- static $set = false;
-
- if (!is_null($clob)) {
- $_clob = strtolower(trim($clob));
- $set = true;
- } elseif (!$set) {
- // backwards compatibility
- if (isset($GLOBALS['ADODB_SESSION_USE_LOBS'])) {
- return $GLOBALS['ADODB_SESSION_USE_LOBS'];
- }
- }
-
- return $_clob;
- }
-
- /*!
- */
- static function dataFieldName($data_field_name = null) {
- //echo ("WARNING: ADODB_SESSION::dataFieldName() is longer used, please remove this function for your code
");
- return '';
- }
-
- /*!
- */
- static function filter($filter = null) {
- static $_filter = array();
-
- if (!is_null($filter)) {
- if (!is_array($filter)) {
- $filter = array($filter);
- }
- $_filter = $filter;
- }
-
- return $_filter;
- }
-
- /*!
- */
- static function encryptionKey($encryption_key = null) {
- static $_encryption_key = 'CRYPTED ADODB SESSIONS ROCK!';
-
- if (!is_null($encryption_key)) {
- $_encryption_key = $encryption_key;
- }
-
- return $_encryption_key;
- }
-
- /////////////////////
- // private methods
- /////////////////////
-
- /*!
- */
- static function _conn($conn=null) {
- return isset($GLOBALS['ADODB_SESS_CONN']) ? $GLOBALS['ADODB_SESS_CONN'] : false;
- }
-
- /*!
- */
- static function _crc($crc = null) {
- static $_crc = false;
-
- if (!is_null($crc)) {
- $_crc = $crc;
- }
-
- return $_crc;
- }
-
- /*!
- */
- static function _init() {
- session_module_name('user');
- session_set_save_handler(
- array('ADODB_Session', 'open'),
- array('ADODB_Session', 'close'),
- array('ADODB_Session', 'read'),
- array('ADODB_Session', 'write'),
- array('ADODB_Session', 'destroy'),
- array('ADODB_Session', 'gc')
- );
- }
-
-
- /*!
- */
- static function _sessionKey() {
- // use this function to create the encryption key for crypted sessions
- // crypt the used key, ADODB_Session::encryptionKey() as key and session_id() as salt
- return crypt(ADODB_Session::encryptionKey(), session_id());
- }
-
- /*!
- */
- static function _dumprs(&$rs) {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
-
- if (!$conn) {
- return;
- }
-
- if (!$debug) {
- return;
- }
-
- if (!$rs) {
- echo "
\$rs is null or false
\n";
- return;
- }
-
- //echo "
\nAffected_Rows=",$conn->Affected_Rows(),"
\n";
-
- if (!is_object($rs)) {
- return;
- }
- $rs = $conn->_rs2rs($rs);
-
- require_once ADODB_SESSION.'/../tohtml.inc.php';
- rs2html($rs);
- $rs->MoveFirst();
- }
-
- /////////////////////
- // public methods
- /////////////////////
-
- static function config($driver, $host, $user, $password, $database=false,$options=false)
- {
- ADODB_Session::driver($driver);
- ADODB_Session::host($host);
- ADODB_Session::user($user);
- ADODB_Session::password($password);
- ADODB_Session::database($database);
-
- if ($driver == 'oci8' || $driver == 'oci8po') $options['lob'] = 'CLOB';
-
- if (isset($options['table'])) ADODB_Session::table($options['table']);
- if (isset($options['lob'])) ADODB_Session::clob($options['lob']);
- if (isset($options['debug'])) ADODB_Session::debug($options['debug']);
- }
-
- /*!
- Create the connection to the database.
-
- If $conn already exists, reuse that connection
- */
- static function open($save_path, $session_name, $persist = null)
- {
- $conn = ADODB_Session::_conn();
-
- if ($conn) {
- return true;
- }
-
- $database = ADODB_Session::database();
- $debug = ADODB_Session::debug();
- $driver = ADODB_Session::driver();
- $host = ADODB_Session::host();
- $password = ADODB_Session::password();
- $user = ADODB_Session::user();
-
- if (!is_null($persist)) {
- ADODB_Session::persist($persist);
- } else {
- $persist = ADODB_Session::persist();
- }
-
-# these can all be defaulted to in php.ini
-# assert('$database');
-# assert('$driver');
-# assert('$host');
-
- $conn = ADONewConnection($driver);
-
- if ($debug) {
- $conn->debug = true;
- ADOConnection::outp( " driver=$driver user=$user db=$database ");
- }
-
- if (empty($conn->_connectionID)) { // not dsn
- if ($persist) {
- switch($persist) {
- default:
- case 'P': $ok = $conn->PConnect($host, $user, $password, $database); break;
- case 'C': $ok = $conn->Connect($host, $user, $password, $database); break;
- case 'N': $ok = $conn->NConnect($host, $user, $password, $database); break;
- }
- } else {
- $ok = $conn->Connect($host, $user, $password, $database);
- }
- }
-
- if ($ok) $GLOBALS['ADODB_SESS_CONN'] = $conn;
- else
- ADOConnection::outp('Session: connection failed
', false);
-
-
- return $ok;
- }
-
- /*!
- Close the connection
- */
- static function close()
- {
-/*
- $conn = ADODB_Session::_conn();
- if ($conn) $conn->Close();
-*/
- return true;
- }
-
- /*
- Slurp in the session variables and return the serialized string
- */
- static function read($key)
- {
- $conn = ADODB_Session::_conn();
- $filter = ADODB_Session::filter();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return '';
- }
-
- //assert('$table');
-
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- $sql = "SELECT sessdata FROM $table WHERE sesskey = $binary ".$conn->Param(0)." AND expiry >= " . $conn->sysTimeStamp;
- /* Lock code does not work as it needs to hold transaction within whole page, and we don't know if
- developer has commited elsewhere... :(
- */
- #if (ADODB_Session::Lock())
- # $rs = $conn->RowLock($table, "$binary sesskey = $qkey AND expiry >= " . time(), sessdata);
- #else
- $rs = $conn->Execute($sql, array($key));
- //ADODB_Session::_dumprs($rs);
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else {
- $v = reset($rs->fields);
- $filter = array_reverse($filter);
- foreach ($filter as $f) {
- if (is_object($f)) {
- $v = $f->read($v, ADODB_Session::_sessionKey());
- }
- }
- $v = rawurldecode($v);
- }
-
- $rs->Close();
-
- ADODB_Session::_crc(strlen($v) . crc32($v));
- return $v;
- }
-
- return '';
- }
-
- /*!
- Write the serialized data to a database.
-
- If the data has not been modified since the last read(), we do not write.
- */
- static function write($key, $oval)
- {
- global $ADODB_SESSION_READONLY;
-
- if (!empty($ADODB_SESSION_READONLY)) return;
-
- $clob = ADODB_Session::clob();
- $conn = ADODB_Session::_conn();
- $crc = ADODB_Session::_crc();
- $debug = ADODB_Session::debug();
- $driver = ADODB_Session::driver();
- $expire_notify = ADODB_Session::expireNotify();
- $filter = ADODB_Session::filter();
- $lifetime = ADODB_Session::lifetime();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return false;
- }
- if ($debug) $conn->debug = 1;
- $sysTimeStamp = $conn->sysTimeStamp;
-
- //assert('$table');
-
- $expiry = $conn->OffsetDate($lifetime/(24*3600),$sysTimeStamp);
-
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($crc !== false && $crc == (strlen($oval) . crc32($oval))) {
- if ($debug) {
- echo 'Session: Only updating date - crc32 not changed
';
- }
-
- $expirevar = '';
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $expirevar = $$var;
- }
- }
-
-
- $sql = "UPDATE $table SET expiry = $expiry ,expireref=".$conn->Param('0').", modified = $sysTimeStamp WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= $sysTimeStamp";
- $rs = $conn->Execute($sql,array($expirevar,$key));
- return true;
- }
- $val = rawurlencode($oval);
- foreach ($filter as $f) {
- if (is_object($f)) {
- $val = $f->write($val, ADODB_Session::_sessionKey());
- }
- }
-
- $expireref = '';
- if ($expire_notify) {
- $var = reset($expire_notify);
- global $$var;
- if (isset($$var)) {
- $expireref = $$var;
- }
- }
-
- if (!$clob) { // no lobs, simply use replace()
- $rs = $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key));
- if ($rs) $rs->Close();
-
- if ($rs && reset($rs->fields) > 0) {
- $sql = "UPDATE $table SET expiry=$expiry, sessdata=".$conn->Param(0).", expireref= ".$conn->Param(1).",modified=$sysTimeStamp WHERE sesskey = ".$conn->Param('2');
-
- } else {
- $sql = "INSERT INTO $table (expiry, sessdata, expireref, sesskey, created, modified)
- VALUES ($expiry,".$conn->Param('0').", ". $conn->Param('1').", ".$conn->Param('2').", $sysTimeStamp, $sysTimeStamp)";
- }
-
-
- $rs = $conn->Execute($sql,array($val,$expireref,$key));
-
- } else {
- // what value shall we insert/update for lob row?
- switch ($driver) {
- // empty_clob or empty_lob for oracle dbs
- case 'oracle':
- case 'oci8':
- case 'oci8po':
- case 'oci805':
- $lob_value = sprintf('empty_%s()', strtolower($clob));
- break;
-
- // null for all other
- default:
- $lob_value = 'null';
- break;
- }
-
- $conn->StartTrans();
-
- $rs = $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key));
-
- if ($rs && reset($rs->fields) > 0) {
- $sql = "UPDATE $table SET expiry=$expiry, sessdata=$lob_value, expireref= ".$conn->Param(0).",modified=$sysTimeStamp WHERE sesskey = ".$conn->Param('1');
-
- } else {
- $sql = "INSERT INTO $table (expiry, sessdata, expireref, sesskey, created, modified)
- VALUES ($expiry,$lob_value, ". $conn->Param('0').", ".$conn->Param('1').", $sysTimeStamp, $sysTimeStamp)";
- }
-
- $rs = $conn->Execute($sql,array($expireref,$key));
-
- $qkey = $conn->qstr($key);
- $rs2 = $conn->UpdateBlob($table, 'sessdata', $val, " sesskey=$qkey", strtoupper($clob));
- if ($debug) echo "
",htmlspecialchars($oval), "
";
- $rs = @$conn->CompleteTrans();
-
-
- }
-
- if (!$rs) {
- ADOConnection::outp('Session Replace: ' . $conn->ErrorMsg() . '
', false);
- return false;
- } else {
- // bug in access driver (could be odbc?) means that info is not committed
- // properly unless select statement executed in Win2000
- if ($conn->databaseType == 'access') {
- $sql = "SELECT sesskey FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- if ($rs) {
- $rs->Close();
- }
- }
- }/*
- if (ADODB_Session::Lock()) {
- $conn->CommitTrans();
- }*/
- return $rs ? true : false;
- }
-
- /*!
- */
- static function destroy($key) {
- $conn = ADODB_Session::_conn();
- $table = ADODB_Session::table();
- $expire_notify = ADODB_Session::expireNotify();
-
- if (!$conn) {
- return false;
- }
- $debug = ADODB_Session::debug();
- if ($debug) $conn->debug = 1;
- //assert('$table');
-
- $qkey = $conn->quote($key);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- if ($expire_notify) {
- reset($expire_notify);
- $fn = next($expire_notify);
- $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
- $sql = "SELECT expireref, sesskey FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- ADODB_Session::_dumprs($rs);
- $conn->SetFetchMode($savem);
- if (!$rs) {
- return false;
- }
- if (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- //assert('$ref');
- //assert('$key');
- $fn($ref, $key);
- }
- $rs->Close();
- }
-
- $sql = "DELETE FROM $table WHERE $binary sesskey = $qkey";
- $rs = $conn->Execute($sql);
- if ($rs) {
- $rs->Close();
- }
-
- return $rs ? true : false;
- }
-
- /*!
- */
- static function gc($maxlifetime)
- {
- $conn = ADODB_Session::_conn();
- $debug = ADODB_Session::debug();
- $expire_notify = ADODB_Session::expireNotify();
- $optimize = ADODB_Session::optimize();
- $table = ADODB_Session::table();
-
- if (!$conn) {
- return false;
- }
-
-
- $debug = ADODB_Session::debug();
- if ($debug) {
- $conn->debug = 1;
- $COMMITNUM = 2;
- } else {
- $COMMITNUM = 20;
- }
-
- //assert('$table');
-
- $time = $conn->OffsetDate(-$maxlifetime/24/3600,$conn->sysTimeStamp);
- $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
-
- if ($expire_notify) {
- reset($expire_notify);
- $fn = next($expire_notify);
- } else {
- $fn = false;
- }
-
- $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
- $sql = "SELECT expireref, sesskey FROM $table WHERE expiry < $time ORDER BY 2"; # add order by to prevent deadlock
- $rs = $conn->SelectLimit($sql,1000);
- ADODB_Session::_dumprs($rs);
- if ($debug) $conn->SetFetchMode($savem);
- if ($rs) {
- $tr = $conn->hasTransactions;
- if ($tr) $conn->BeginTrans();
- $keys = array();
- $ccnt = 0;
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- if ($fn) $fn($ref, $key);
- $del = $conn->Execute("DELETE FROM $table WHERE sesskey=".$conn->Param('0'),array($key));
- $rs->MoveNext();
- $ccnt += 1;
- if ($tr && $ccnt % $COMMITNUM == 0) {
- if ($debug) echo "Commit
\n";
- $conn->CommitTrans();
- $conn->BeginTrans();
- }
- }
- $rs->Close();
-
- if ($tr) $conn->CommitTrans();
- }
-
-
- // suggested by Cameron, "GaM3R"
- if ($optimize) {
- $driver = ADODB_Session::driver();
-
- if (preg_match('/mysql/i', $driver)) {
- $sql = "OPTIMIZE TABLE $table";
- }
- if (preg_match('/postgres/i', $driver)) {
- $sql = "VACUUM $table";
- }
- if (!empty($sql)) {
- $conn->Execute($sql);
- }
- }
-
-
- return true;
- }
-}
-
-ADODB_Session::_init();
-if (empty($ADODB_SESSION_READONLY))
- register_shutdown_function('session_write_close');
-
-// for backwards compatability only
-function adodb_sess_open($save_path, $session_name, $persist = true) {
- return ADODB_Session::open($save_path, $session_name, $persist);
-}
-
-// for backwards compatability only
-function adodb_sess_gc($t)
-{
- return ADODB_Session::gc($t);
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/adodb-sessions.mysql.sql b/src/adodb512/session/adodb-sessions.mysql.sql
deleted file mode 100644
index f90de449..00000000
--- a/src/adodb512/session/adodb-sessions.mysql.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- $CVSHeader$
-
-CREATE DATABASE /*! IF NOT EXISTS */ adodb_sessions;
-
-USE adodb_sessions;
-
-DROP TABLE /*! IF EXISTS */ sessions;
-
-CREATE TABLE /*! IF NOT EXISTS */ sessions (
- sesskey CHAR(32) /*! BINARY */ NOT NULL DEFAULT '',
- expiry INT(11) /*! UNSIGNED */ NOT NULL DEFAULT 0,
- expireref VARCHAR(64) DEFAULT '',
- data LONGTEXT DEFAULT '',
- PRIMARY KEY (sesskey),
- INDEX expiry (expiry)
-);
diff --git a/src/adodb512/session/adodb-sessions.oracle.clob.sql b/src/adodb512/session/adodb-sessions.oracle.clob.sql
deleted file mode 100644
index c5c4f2d0..00000000
--- a/src/adodb512/session/adodb-sessions.oracle.clob.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- $CVSHeader$
-
-DROP TABLE adodb_sessions;
-
-CREATE TABLE sessions (
- sesskey CHAR(32) DEFAULT '' NOT NULL,
- expiry INT DEFAULT 0 NOT NULL,
- expireref VARCHAR(64) DEFAULT '',
- data CLOB DEFAULT '',
- PRIMARY KEY (sesskey)
-);
-
-CREATE INDEX ix_expiry ON sessions (expiry);
-
-QUIT;
diff --git a/src/adodb512/session/adodb-sessions.oracle.sql b/src/adodb512/session/adodb-sessions.oracle.sql
deleted file mode 100644
index 8fd5a342..00000000
--- a/src/adodb512/session/adodb-sessions.oracle.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--- $CVSHeader$
-
-DROP TABLE adodb_sessions;
-
-CREATE TABLE sessions (
- sesskey CHAR(32) DEFAULT '' NOT NULL,
- expiry INT DEFAULT 0 NOT NULL,
- expireref VARCHAR(64) DEFAULT '',
- data VARCHAR(4000) DEFAULT '',
- PRIMARY KEY (sesskey),
- INDEX expiry (expiry)
-);
-
-CREATE INDEX ix_expiry ON sessions (expiry);
-
-QUIT;
diff --git a/src/adodb512/session/crypt.inc.php b/src/adodb512/session/crypt.inc.php
deleted file mode 100644
index 41cb06a5..00000000
--- a/src/adodb512/session/crypt.inc.php
+++ /dev/null
@@ -1,161 +0,0 @@
-
-class MD5Crypt{
- function keyED($txt,$encrypt_key)
- {
- $encrypt_key = md5($encrypt_key);
- $ctr=0;
- $tmp = "";
- for ($i=0;$ikeyED($tmp,$key));
- }
-
- function Decrypt($txt,$key)
- {
- $txt = $this->keyED(base64_decode($txt),$key);
- $tmp = "";
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
- return $randomPassword;
- }
-
-}
-
-
-class SHA1Crypt{
-
- function keyED($txt,$encrypt_key)
- {
-
- $encrypt_key = sha1($encrypt_key);
- $ctr=0;
- $tmp = "";
-
- for ($i=0;$ikeyED($tmp,$key));
-
- }
-
-
-
- function Decrypt($txt,$key)
- {
-
- $txt = $this->keyED(base64_decode($txt),$key);
-
- $tmp = "";
-
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
-
- return $randomPassword;
-
- }
-
-
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/old/adodb-cryptsession.php b/src/adodb512/session/old/adodb-cryptsession.php
deleted file mode 100644
index 9b9fdb4d..00000000
--- a/src/adodb512/session/old/adodb-cryptsession.php
+++ /dev/null
@@ -1,324 +0,0 @@
-
-
- Set tabs to 4 for best viewing.
-
- Latest version of ADODB is available at http://php.weblogs.com/adodb
- ======================================================================
-
- This file provides PHP4 session management using the ADODB database
-wrapper library.
-
- Example
- =======
-
- include('adodb.inc.php');
- #---------------------------------#
- include('adodb-cryptsession.php');
- #---------------------------------#
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-
-
- Installation
- ============
- 1. Create a new database in MySQL or Access "sessions" like
-so:
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA CLOB,
- primary key (sesskey)
- );
-
- 2. Then define the following parameters. You can either modify
- this file, or define them before this file is included:
-
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
-
- 3. Recommended is PHP 4.0.2 or later. There are documented
-session bugs in earlier versions of PHP.
-
-*/
-
-
-include_once('crypt.inc.php');
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESS_INSERT,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_TBL;
-
- //$ADODB_SESS_DEBUG = true;
-
- /* SET THE FOLLOWING PARAMETERS */
-if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
-}
-
-if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
-}
-
-if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
-}
-
-function ADODB_Session_Key()
-{
-$ADODB_CRYPT_KEY = 'CRYPTED ADODB SESSIONS ROCK!';
-
- /* USE THIS FUNCTION TO CREATE THE ENCRYPTION KEY FOR CRYPTED SESSIONS */
- /* Crypt the used key, $ADODB_CRYPT_KEY as key and session_ID as SALT */
- return crypt($ADODB_CRYPT_KEY, session_ID());
-}
-
-$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
-if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetimenot set: $ADODB_SESS_LIFE
";
- $ADODB_SESS_LIFE=1440;
-}
-
-function adodb_sess_open($save_path, $session_name)
-{
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_DEBUG;
-
- $ADODB_SESS_INSERT = false;
-
- if (isset($ADODB_SESS_CONN)) return true;
-
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- print" conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ";
- }
- return $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
-}
-
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-function adodb_sess_read($key)
-{
-$Crypt = new MD5Crypt;
-global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL;
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $ADODB_SESS_INSERT = true;
- $v = '';
- } else {
- // Decrypt session data
- $v = rawurldecode($Crypt->Decrypt(reset($rs->fields), ADODB_Session_Key()));
- }
- $rs->Close();
- return $v;
- }
- else $ADODB_SESS_INSERT = true;
-
- return '';
-}
-
-function adodb_sess_write($key, $val)
-{
-$Crypt = new MD5Crypt;
- global $ADODB_SESS_INSERT,$ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // encrypt session data..
- $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,
- $arr,
- 'sesskey',$autoQuote = true);
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
-
- if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return isset($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-
-function adodb_sess_gc($maxlifetime) {
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY,$ADODB_SESS_DEBUG;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- //$del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
- $ADODB_SESS_CONN->Execute($qry);
- }
-
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE'))
- {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- }
-
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-/*
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-}
-*/
-?>
diff --git a/src/adodb512/session/old/adodb-session-clob.php b/src/adodb512/session/old/adodb-session-clob.php
deleted file mode 100644
index b4e88e4b..00000000
--- a/src/adodb512/session/old/adodb-session-clob.php
+++ /dev/null
@@ -1,448 +0,0 @@
-";
-
-To force non-persistent connections, call adodb_session_open first before session_start():
-
- include('adodb.inc.php');
- include('adodb-session.php');
- adodb_session_open(false,false,false);
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-
-
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA CLOB,
- primary key (sesskey)
- );
-
-
- 2. Then define the following parameters in this file:
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
- $ADODB_SESSION_USE_LOBS = false; (or, if you wanna use CLOBS (= 'CLOB') or ( = 'BLOB')
-
- 3. Recommended is PHP 4.1.0 or later. There are documented
- session bugs in earlier versions of PHP.
-
- 4. If you want to receive notifications when a session expires, then
- you can tag a session with an EXPIREREF, and before the session
- record is deleted, we can call a function that will pass the EXPIREREF
- as the first parameter, and the session key as the second parameter.
-
- To do this, define a notification function, say NotifyFn:
-
- function NotifyFn($expireref, $sesskey)
- {
- }
-
- Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
- This is an array with 2 elements, the first being the name of the variable
- you would like to store in the EXPIREREF field, and the 2nd is the
- notification function's name.
-
- In this example, we want to be notified when a user's session
- has expired, so we store the user id in the global variable $USERID,
- store this value in the EXPIREREF field:
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
- Then when the NotifyFn is called, we are passed the $USERID as the first
- parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
-/****************************************************************************************\
- Global definitions
-\****************************************************************************************/
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_USE_LOBS,
- $ADODB_SESSION_TBL;
-
- if (!isset($ADODB_SESSION_USE_LOBS)) $ADODB_SESSION_USE_LOBS = 'CLOB';
-
- $ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
- if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetimenot set: $ADODB_SESS_LIFE
";
- $ADODB_SESS_LIFE=1440;
- }
- $ADODB_SESSION_CRC = false;
- //$ADODB_SESS_DEBUG = true;
-
- //////////////////////////////////
- /* SET THE FOLLOWING PARAMETERS */
- //////////////////////////////////
-
- if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
- }
-
- if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
- }
- // Made table name configurable - by David Johnson djohnson@inpro.net
- if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
- }
-
-
- // defaulting $ADODB_SESSION_USE_LOBS
- if (!isset($ADODB_SESSION_USE_LOBS) || empty($ADODB_SESSION_USE_LOBS)) {
- $ADODB_SESSION_USE_LOBS = false;
- }
-
- /*
- $ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
- $ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
- $ADODB_SESS['user'] = $ADODB_SESSION_USER;
- $ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
- $ADODB_SESS['db'] = $ADODB_SESSION_DB;
- $ADODB_SESS['life'] = $ADODB_SESS_LIFE;
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
- $ADODB_SESS['table'] = $ADODB_SESS_TBL;
- */
-
-/****************************************************************************************\
- Create the connection to the database.
-
- If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true)
-{
-GLOBAL $ADODB_SESS_CONN;
- if (isset($ADODB_SESS_CONN)) return true;
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_DEBUG;
-
- // cannot use & below - do not know why...
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
- }
- if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
- else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
- if (!$ok) ADOConnection::outp( "
--- Session: connection failed",false);
-}
-
-/****************************************************************************************\
- Close the connection
-\****************************************************************************************/
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-/****************************************************************************************\
- Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key)
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else
- $v = rawurldecode(reset($rs->fields));
-
- $rs->Close();
-
- // new optimization adodb 2.1
- $ADODB_SESSION_CRC = strlen($v).crc32($v);
-
- return $v;
- }
-
- return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
- Write the serialized data to a database.
-
- If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val)
-{
- global
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESSION_TBL,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_DRIVER, // added
- $ADODB_SESSION_USE_LOBS; // added
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
- if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed";
- $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
- $rs = $ADODB_SESS_CONN->Execute($qry);
- return true;
- }
- $val = rawurlencode($val);
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
-
-
- if ($ADODB_SESSION_USE_LOBS === false) { // no lobs, simply use replace()
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr, 'sesskey',$autoQuote = true);
- if (!$rs) {
- $err = $ADODB_SESS_CONN->ErrorMsg();
- }
- } else {
- // what value shall we insert/update for lob row?
- switch ($ADODB_SESSION_DRIVER) {
- // empty_clob or empty_lob for oracle dbs
- case "oracle":
- case "oci8":
- case "oci8po":
- case "oci805":
- $lob_value = sprintf("empty_%s()", strtolower($ADODB_SESSION_USE_LOBS));
- break;
-
- // null for all other
- default:
- $lob_value = "null";
- break;
- }
-
- // do we insert or update? => as for sesskey
- $res = $ADODB_SESS_CONN->Execute("select count(*) as cnt from $ADODB_SESSION_TBL where sesskey = '$key'");
- if ($res && reset($res->fields) > 0) {
- $qry = sprintf("update %s set expiry = %d, data = %s where sesskey = '%s'", $ADODB_SESSION_TBL, $expiry, $lob_value, $key);
- } else {
- // insert
- $qry = sprintf("insert into %s (sesskey, expiry, data) values ('%s', %d, %s)", $ADODB_SESSION_TBL, $key, $expiry, $lob_value);
- }
-
- $err = "";
- $rs1 = $ADODB_SESS_CONN->Execute($qry);
- if (!$rs1) {
- $err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
- }
- $rs2 = $ADODB_SESS_CONN->UpdateBlob($ADODB_SESSION_TBL, 'data', $val, "sesskey='$key'", strtoupper($ADODB_SESSION_USE_LOBS));
- if (!$rs2) {
- $err .= $ADODB_SESS_CONN->ErrorMsg()."\n";
- }
- $rs = ($rs1 && $rs2) ? true : false;
- }
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.nl2br($err).'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
- if ($ADODB_SESS_CONN->databaseType == 'access')
- $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return !empty($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime)
-{
- global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- //$ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->CommitTrans();
-
- }
- } else {
- $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time());
-
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- Garbage Collection: $qry");
- }
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- if (!empty($opt_qry)) {
- $ADODB_SESS_CONN->Execute($opt_qry);
- }
- }
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}",false);
-}
-
-?>
diff --git a/src/adodb512/session/old/adodb-session.php b/src/adodb512/session/old/adodb-session.php
deleted file mode 100644
index 933db12c..00000000
--- a/src/adodb512/session/old/adodb-session.php
+++ /dev/null
@@ -1,439 +0,0 @@
-";
-
-To force non-persistent connections, call adodb_session_open first before session_start():
-
- include('adodb.inc.php');
- include('adodb-session.php');
- adodb_sess_open(false,false,false);
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- print "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}";
-
-
- Installation
- ============
- 1. Create this table in your database (syntax might vary depending on your db):
-
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY int(11) unsigned not null,
- EXPIREREF varchar(64),
- DATA text not null,
- primary key (sesskey)
- );
-
- For oracle:
- create table sessions (
- SESSKEY char(32) not null,
- EXPIRY DECIMAL(16) not null,
- EXPIREREF varchar(64),
- DATA varchar(4000) not null,
- primary key (sesskey)
- );
-
-
- 2. Then define the following parameters. You can either modify
- this file, or define them before this file is included:
-
- $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';
- $ADODB_SESSION_CONNECT='server to connect to';
- $ADODB_SESSION_USER ='user';
- $ADODB_SESSION_PWD ='password';
- $ADODB_SESSION_DB ='database';
- $ADODB_SESSION_TBL = 'sessions'
-
- 3. Recommended is PHP 4.1.0 or later. There are documented
- session bugs in earlier versions of PHP.
-
- 4. If you want to receive notifications when a session expires, then
- you can tag a session with an EXPIREREF, and before the session
- record is deleted, we can call a function that will pass the EXPIREREF
- as the first parameter, and the session key as the second parameter.
-
- To do this, define a notification function, say NotifyFn:
-
- function NotifyFn($expireref, $sesskey)
- {
- }
-
- Then you need to define a global variable $ADODB_SESSION_EXPIRE_NOTIFY.
- This is an array with 2 elements, the first being the name of the variable
- you would like to store in the EXPIREREF field, and the 2nd is the
- notification function's name.
-
- In this example, we want to be notified when a user's session
- has expired, so we store the user id in the global variable $USERID,
- store this value in the EXPIREREF field:
-
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');
-
- Then when the NotifyFn is called, we are passed the $USERID as the first
- parameter, eg. NotifyFn($userid, $sesskey).
-*/
-
-if (!defined('_ADODB_LAYER')) {
- include (dirname(__FILE__).'/adodb.inc.php');
-}
-
-if (!defined('ADODB_SESSION')) {
-
- define('ADODB_SESSION',1);
-
- /* if database time and system time is difference is greater than this, then give warning */
- define('ADODB_SESSION_SYNCH_SECS',60);
-
- /*
- Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
-*/
-function adodb_session_regenerate_id()
-{
- $conn = ADODB_Session::_conn();
- if (!$conn) return false;
-
- $old_id = session_id();
- if (function_exists('session_regenerate_id')) {
- session_regenerate_id();
- } else {
- session_id(md5(uniqid(rand(), true)));
- $ck = session_get_cookie_params();
- setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
- //@session_start();
- }
- $new_id = session_id();
- $ok = $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
-
- /* it is possible that the update statement fails due to a collision */
- if (!$ok) {
- session_id($old_id);
- if (empty($ck)) $ck = session_get_cookie_params();
- setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
- return false;
- }
-
- return true;
-}
-
-/****************************************************************************************\
- Global definitions
-\****************************************************************************************/
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_EXPIRE_NOTIFY,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_TBL;
-
-
- $ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime');
- if ($ADODB_SESS_LIFE <= 1) {
- // bug in PHP 4.0.3 pl 1 -- how about other versions?
- //print "Session Error: PHP.INI setting session.gc_maxlifetimenot set: $ADODB_SESS_LIFE
";
- $ADODB_SESS_LIFE=1440;
- }
- $ADODB_SESSION_CRC = false;
- //$ADODB_SESS_DEBUG = true;
-
- //////////////////////////////////
- /* SET THE FOLLOWING PARAMETERS */
- //////////////////////////////////
-
- if (empty($ADODB_SESSION_DRIVER)) {
- $ADODB_SESSION_DRIVER='mysql';
- $ADODB_SESSION_CONNECT='localhost';
- $ADODB_SESSION_USER ='root';
- $ADODB_SESSION_PWD ='';
- $ADODB_SESSION_DB ='xphplens_2';
- }
-
- if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) {
- $ADODB_SESSION_EXPIRE_NOTIFY = false;
- }
- // Made table name configurable - by David Johnson djohnson@inpro.net
- if (empty($ADODB_SESSION_TBL)){
- $ADODB_SESSION_TBL = 'sessions';
- }
-
- /*
- $ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER;
- $ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT;
- $ADODB_SESS['user'] = $ADODB_SESSION_USER;
- $ADODB_SESS['pwd'] = $ADODB_SESSION_PWD;
- $ADODB_SESS['db'] = $ADODB_SESSION_DB;
- $ADODB_SESS['life'] = $ADODB_SESS_LIFE;
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
-
- $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG;
- $ADODB_SESS['table'] = $ADODB_SESS_TBL;
- */
-
-/****************************************************************************************\
- Create the connection to the database.
-
- If $ADODB_SESS_CONN already exists, reuse that connection
-\****************************************************************************************/
-function adodb_sess_open($save_path, $session_name,$persist=true)
-{
-GLOBAL $ADODB_SESS_CONN;
- if (isset($ADODB_SESS_CONN)) return true;
-
-GLOBAL $ADODB_SESSION_CONNECT,
- $ADODB_SESSION_DRIVER,
- $ADODB_SESSION_USER,
- $ADODB_SESSION_PWD,
- $ADODB_SESSION_DB,
- $ADODB_SESS_DEBUG;
-
- // cannot use & below - do not know why...
- $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
- if (!empty($ADODB_SESS_DEBUG)) {
- $ADODB_SESS_CONN->debug = true;
- ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB ");
- }
- if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
- else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT,
- $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB);
-
- if (!$ok) ADOConnection::outp( "
--- Session: connection failed",false);
-}
-
-/****************************************************************************************\
- Close the connection
-\****************************************************************************************/
-function adodb_sess_close()
-{
-global $ADODB_SESS_CONN;
-
- if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close();
- return true;
-}
-
-/****************************************************************************************\
- Slurp in the session variables and return the serialized string
-\****************************************************************************************/
-function adodb_sess_read($key)
-{
-global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC;
-
- $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time());
- if ($rs) {
- if ($rs->EOF) {
- $v = '';
- } else
- $v = rawurldecode(reset($rs->fields));
-
- $rs->Close();
-
- // new optimization adodb 2.1
- $ADODB_SESSION_CRC = strlen($v).crc32($v);
-
- return $v;
- }
-
- return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
-}
-
-/****************************************************************************************\
- Write the serialized data to a database.
-
- If the data has not been modified since adodb_sess_read(), we do not write.
-\****************************************************************************************/
-function adodb_sess_write($key, $val)
-{
- global
- $ADODB_SESS_CONN,
- $ADODB_SESS_LIFE,
- $ADODB_SESSION_TBL,
- $ADODB_SESS_DEBUG,
- $ADODB_SESSION_CRC,
- $ADODB_SESSION_EXPIRE_NOTIFY;
-
- $expiry = time() + $ADODB_SESS_LIFE;
-
- // crc32 optimization since adodb 2.1
- // now we only update expiry date, thx to sebastian thom in adodb 2.32
- if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) {
- if ($ADODB_SESS_DEBUG) echo "
--- Session: Only updating date - crc32 not changed";
- $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time();
- $rs = $ADODB_SESS_CONN->Execute($qry);
- return true;
- }
- $val = rawurlencode($val);
-
- $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
- global $$var;
- $arr['expireref'] = $$var;
- }
- $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr,
- 'sesskey',$autoQuote = true);
-
- if (!$rs) {
- ADOConnection::outp( '
--- Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'',false);
- } else {
- // bug in access driver (could be odbc?) means that info is not commited
- // properly unless select statement executed in Win2000
- if ($ADODB_SESS_CONN->databaseType == 'access')
- $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
- }
- return !empty($rs);
-}
-
-function adodb_sess_destroy($key)
-{
- global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $ADODB_SESS_CONN->CommitTrans();
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'";
- $rs = $ADODB_SESS_CONN->Execute($qry);
- }
- return $rs ? true : false;
-}
-
-function adodb_sess_gc($maxlifetime)
-{
- global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY;
-
- if ($ADODB_SESSION_EXPIRE_NOTIFY) {
- reset($ADODB_SESSION_EXPIRE_NOTIFY);
- $fn = next($ADODB_SESSION_EXPIRE_NOTIFY);
- $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM);
- $t = time();
- $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < $t");
- $ADODB_SESS_CONN->SetFetchMode($savem);
- if ($rs) {
- $ADODB_SESS_CONN->BeginTrans();
- while (!$rs->EOF) {
- $ref = $rs->fields[0];
- $key = $rs->fields[1];
- $fn($ref,$key);
- $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'");
- $rs->MoveNext();
- }
- $rs->Close();
-
- $ADODB_SESS_CONN->CommitTrans();
-
- }
- } else {
- $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time();
- $ADODB_SESS_CONN->Execute($qry);
-
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- Garbage Collection: $qry");
- }
- // suggested by Cameron, "GaM3R"
- if (defined('ADODB_SESSION_OPTIMIZE')) {
- global $ADODB_SESSION_DRIVER;
-
- switch( $ADODB_SESSION_DRIVER ) {
- case 'mysql':
- case 'mysqlt':
- $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL;
- break;
- case 'postgresql':
- case 'postgresql7':
- $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL;
- break;
- }
- if (!empty($opt_qry)) {
- $ADODB_SESS_CONN->Execute($opt_qry);
- }
- }
- if ($ADODB_SESS_CONN->dataProvider === 'oci8') $sql = 'select TO_CHAR('.($ADODB_SESS_CONN->sysTimeStamp).', \'RRRR-MM-DD HH24:MI:SS\') from '. $ADODB_SESSION_TBL;
- else $sql = 'select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL;
-
- $rs = $ADODB_SESS_CONN->SelectLimit($sql,1);
- if ($rs && !$rs->EOF) {
-
- $dbts = reset($rs->fields);
- $rs->Close();
- $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbts);
- $t = time();
-
- if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) {
-
- $msg =
- __FILE__.": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: database=$dbt ($dbts), webserver=$t (diff=".(abs($dbt-$t)/3600)." hrs)";
- error_log($msg);
- if ($ADODB_SESS_DEBUG) ADOConnection::outp("
--- $msg");
- }
- }
-
- return true;
-}
-
-session_module_name('user');
-session_set_save_handler(
- "adodb_sess_open",
- "adodb_sess_close",
- "adodb_sess_read",
- "adodb_sess_write",
- "adodb_sess_destroy",
- "adodb_sess_gc");
-}
-
-/* TEST SCRIPT -- UNCOMMENT */
-
-if (0) {
-
- session_start();
- session_register('AVAR');
- $_SESSION['AVAR'] += 1;
- ADOConnection::outp( "
--- \$_SESSION['AVAR']={$_SESSION['AVAR']}",false);
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/old/crypt.inc.php b/src/adodb512/session/old/crypt.inc.php
deleted file mode 100644
index b99bbba5..00000000
--- a/src/adodb512/session/old/crypt.inc.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
-class MD5Crypt{
- function keyED($txt,$encrypt_key)
- {
- $encrypt_key = md5($encrypt_key);
- $ctr=0;
- $tmp = "";
- for ($i=0;$ikeyED($tmp,$key));
- }
-
- function Decrypt($txt,$key)
- {
- $txt = $this->keyED(base64_decode($txt),$key);
- $tmp = "";
- for ($i=0;$i= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
- {
- $randnumber = rand(48,120);
- }
-
- $randomPassword .= chr($randnumber);
- }
- return $randomPassword;
- }
-
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/session/session_schema.xml b/src/adodb512/session/session_schema.xml
deleted file mode 100644
index 3c61ff64..00000000
--- a/src/adodb512/session/session_schema.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/adodb512/session/session_schema2.xml b/src/adodb512/session/session_schema2.xml
deleted file mode 100644
index 22f8dafe..00000000
--- a/src/adodb512/session/session_schema2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- table for ADOdb session-management
-
-
- session key
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/adodb512/tests/benchmark.php b/src/adodb512/tests/benchmark.php
deleted file mode 100644
index 5400f7e8..00000000
--- a/src/adodb512/tests/benchmark.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
- ADODB Benchmarks
-
-
-
-ADODB Version: $ADODB_version Host: $db->host Database: $db->database";
-
- // perform query once to cache results so we are only testing throughput
- $rs = $db->Execute($sql);
- if (!$rs){
- print "Error in recordset";
- return;
- }
- $arr = $rs->GetArray();
- //$db->debug = true;
- global $ADODB_COUNTRECS;
- $ADODB_COUNTRECS = false;
- $start = microtime();
- for ($i=0; $i < $max; $i++) {
- $rs = $db->Execute($sql);
- $arr = $rs->GetArray();
- // print $arr[0][1];
- }
- $end = microtime();
- $start = explode(' ',$start);
- $end = explode(' ',$end);
-
- //print_r($start);
- //print_r($end);
-
- // print_r($arr);
- $total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
- printf ("
seconds = %8.2f for %d iterations each with %d records
",$total,$max, sizeof($arr));
- flush();
-
-
- //$db->Close();
-}
-include("testdatabases.inc.php");
-
-?>
-
-
-
-
diff --git a/src/adodb512/tests/client.php b/src/adodb512/tests/client.php
deleted file mode 100644
index 7bf145e7..00000000
--- a/src/adodb512/tests/client.php
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-';
- var_dump(parse_url('odbc_mssql://userserver/'));
- die();
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
- function send2server($url,$sql)
- {
- $url .= '?sql='.urlencode($sql);
- print "$url
";
- $rs = csv2rs($url,$err);
- if ($err) print $err;
- return $rs;
- }
-
- function print_pre($s)
- {
- print "";print_r($s);print "
";
- }
-
-
-$serverURL = 'http://localhost/php/phplens/adodb/server.php';
-$testhttp = false;
-
-$sql1 = "insertz into products (productname) values ('testprod 1')";
-$sql2 = "insert into products (productname) values ('testprod 1')";
-$sql3 = "insert into products (productname) values ('testprod 2')";
-$sql4 = "delete from products where productid>80";
-$sql5 = 'select * from products';
-
-if ($testhttp) {
- print "Client Driver Tests";
- print "
Test Error
";
- $rs = send2server($serverURL,$sql1);
- print_pre($rs);
- print "
";
-
- print "Test Insert
";
-
- $rs = send2server($serverURL,$sql2);
- print_pre($rs);
- print "
";
-
- print "Test Insert2
";
-
- $rs = send2server($serverURL,$sql3);
- print_pre($rs);
- print "
";
-
- print "Test Delete
";
-
- $rs = send2server($serverURL,$sql4);
- print_pre($rs);
- print "
";
-
-
- print "Test Select
";
- $rs = send2server($serverURL,$sql5);
- if ($rs) rs2html($rs);
-
- print "
";
-}
-
-
-print "CLIENT Driver Tests
";
-$conn = ADONewConnection('csv');
-$conn->Connect($serverURL);
-$conn->debug = true;
-
-print "Bad SQL
";
-
-$rs = $conn->Execute($sql1);
-
-print "Insert SQL 1
";
-$rs = $conn->Execute($sql2);
-
-print "Insert SQL 2
";
-$rs = $conn->Execute($sql3);
-
-print "Select SQL
";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-print "Delete SQL
";
-$rs = $conn->Execute($sql4);
-
-print "Select SQL
";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-
-/* EXPECTED RESULTS FOR HTTP TEST:
-
-Test Insert
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 81
-)
-
-
---------------------------------------------------------------------------------
-
-Test Insert2
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => insert into products (productname) values ('testprod')
- [affectedrows] => 1
- [insertid] => 82
-)
-
-
---------------------------------------------------------------------------------
-
-Test Delete
-http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
-
-adorecordset Object
-(
- [dataProvider] => native
- [fields] =>
- [blobSize] => 64
- [canSeek] =>
- [EOF] => 1
- [emptyTimeStamp] =>
- [emptyDate] =>
- [debug] =>
- [timeToLive] => 0
- [bind] =>
- [_numOfRows] => -1
- [_numOfFields] => 0
- [_queryID] => 1
- [_currentRow] => -1
- [_closed] =>
- [_inited] =>
- [sql] => delete from products where productid>80
- [affectedrows] => 2
- [insertid] => 0
-)
-
-[more stuff deleted]
- .
- .
- .
-*/
-?>
diff --git a/src/adodb512/tests/pdo.php b/src/adodb512/tests/pdo.php
deleted file mode 100644
index b66018f8..00000000
--- a/src/adodb512/tests/pdo.php
+++ /dev/null
@@ -1,94 +0,0 @@
-";
-try {
- echo "New Connection\n";
-
-
- $dsn = 'pdo_mysql://root:@localhost/northwind?persist';
-
- if (!empty($dsn)) {
- $DB = NewADOConnection($dsn) || die("CONNECT FAILED");
- $connstr = $dsn;
- } else {
-
- $DB = NewADOConnection('pdo');
-
- echo "Connect\n";
-
- $u = ''; $p = '';
- /*
- $connstr = 'odbc:nwind';
-
- $connstr = 'oci:';
- $u = 'scott';
- $p = 'natsoft';
-
-
- $connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
- */
-
- $connstr = "mysql:dbname=northwind";
- $u = 'root';
-
- $connstr = "pgsql:dbname=test";
- $u = 'tester';
- $p = 'test';
-
- $DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- }
-
- echo "connection string=$connstr\n Execute\n";
-
- //$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- $rs = $DB->Execute("select * from ADOXYZ where id<3");
- if ($DB->ErrorNo()) echo "*** errno=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
-
-
- //print_r(get_class_methods($DB->_stmt));
-
- if (!$rs) die("NO RS");
-
- echo "Meta\n";
- for ($i=0; $i < $rs->NumCols(); $i++) {
- var_dump($rs->FetchField($i));
- echo "
";
- }
-
- echo "FETCH\n";
- $cnt = 0;
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- if ($cnt++ > 1000) break;
- }
-
- echo "
--------------------------------------------------------
\n\n\n";
-
- $stmt = $DB->PrepareStmt("select * from ADOXYZ");
-
- $rs = $stmt->Execute();
- $cols = $stmt->NumCols(); // execute required
-
- echo "COLS = $cols";
- for($i=1;$i<=$cols;$i++) {
- $v = $stmt->_stmt->getColumnMeta($i);
- var_dump($v);
- }
-
- echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
- while ($arr = $rs->FetchRow()) {
- adodb_pr($arr);
- }
- die("DONE\n");
-
-} catch (exception $e) {
- echo "";
- echo $e;
- echo "
";
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-active-record.php b/src/adodb512/tests/test-active-record.php
deleted file mode 100644
index 85fb71c0..00000000
--- a/src/adodb512/tests/test-active-record.php
+++ /dev/null
@@ -1,141 +0,0 @@
-= 5) {
- include('../adodb-exceptions.inc.php');
- echo "Exceptions included
";
- }
- }
-
- $db = NewADOConnection('mysql://root@localhost/northwind?persist');
- $db->debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- class Person extends ADOdb_Active_Record{ function ret($v) {return $v;} }
- $person = new Person();
- ADOdb_Active_Record::$_quoteNames = '111';
-
- echo "Output of getAttributeNames: ";
- var_dump($person->getAttributeNames());
-
- /**
- * Outputs the following:
- * array(4) {
- * [0]=>
- * string(2) "id"
- * [1]=>
- * string(9) "name_first"
- * [2]=>
- * string(8) "name_last"
- * [3]=>
- * string(13) "favorite_color"
- * }
- */
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->save(); // this save() will fail on INSERT as favorite_color is a must fill...
-
-
- $person = new Person();
- $person->name_first = 'Andi';
- $person->name_last = 'Gutmans';
- $person->favorite_color = 'blue';
- $person->save(); // this save will perform an INSERT successfully
-
- echo "
The Insert ID generated:"; print_r($person->id);
-
- $person->favorite_color = 'red';
- $person->save(); // this save() will perform an UPDATE
-
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- // load record where id=2 into a new ADOdb_Active_Record
- $person2 = new Person();
- $person2->Load('id=2');
-
- $activeArr = $db->GetActiveRecordsClass($class = "Person",$table = "Persons","id=".$db->Param(0),array(2));
- $person2 = $activeArr[0];
- echo "
Name (should be John): ",$person->name_first, "
Class (should be Person): ",get_class($person2),"
";
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (2,'JAMIE','Lim')");
-
- $newperson2 = new Person();
- $person2->HasMany('children','person_id');
- $person2->Load('id=2');
- $person2->name_last='green';
- $c = $person2->children;
- $person2->save();
-
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie
";
- }
-
- class Child extends ADOdb_Active_Record{};
- $ch = new Child('children',array('id'));
- $ch->BelongsTo('person','person_id','id');
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child
";
-
- $p = $ch->person;
- if ($p->name_first != 'John') echo "Error loading belongsTo
";
- else echo "OK loading BelongTo
";
-
- $p->hasMany('children','person_id');
- $p->LoadRelations('children', " Name_first like 'J%' order by id",1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations
";
- else echo "error LoadRelations
";
-
- $db->Execute("CREATE TEMPORARY TABLE `persons2` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $p = new adodb_active_record('persons2');
- $p->name_first = 'James';
-
- $p->name_last = 'James';
-
- $p->HasMany('children','person_id');
- $p->children;
- var_dump($p);
- $p->Save();
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-active-recs2.php b/src/adodb512/tests/test-active-recs2.php
deleted file mode 100644
index d35751e9..00000000
--- a/src/adodb512/tests/test-active-recs2.php
+++ /dev/null
@@ -1,77 +0,0 @@
-Connect("localhost","tester","test","test");
-} else
- $db = NewADOConnection('oci8://scott:natsoft@/');
-
-
-$arr = $db->ServerInfo();
-echo "
$db->dataProvider: {$arr['description']}
";
-
-$arr = $db->GetActiveRecords('products',' productid<10');
-adodb_pr($arr);
-
-ADOdb_Active_Record::SetDatabaseAdapter($db);
-if (!$db) die('failed');
-
-
-
-
-$rec = new ADODB_Active_Record('photos');
-
-$rec = new ADODB_Active_Record('products');
-
-
-adodb_pr($rec->getAttributeNames());
-
-echo "
";
-
-
-$rec->load('productid=2');
-adodb_pr($rec);
-
-$db->debug=1;
-
-
-$rec->productname = 'Changie Chan'.rand();
-
-$rec->insert();
-$rec->update();
-
-$rec->productname = 'Changie Chan 99';
-$rec->replace();
-
-
-$rec2 = new ADODB_Active_Record('products');
-$rec->load('productid=3');
-$rec->save();
-
-$rec = new ADODB_Active_record('products');
-$rec->productname = 'John ActiveRec';
-$rec->notes = 22;
-#$rec->productid=0;
-$rec->discontinued=1;
-$rec->Save();
-$rec->supplierid=33;
-$rec->Save();
-$rec->discontinued=0;
-$rec->Save();
-$rec->Delete();
-
-echo "Affected Rows after delete=".$db->Affected_Rows()."
";
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-active-relations.php b/src/adodb512/tests/test-active-relations.php
deleted file mode 100644
index eb0f636d..00000000
--- a/src/adodb512/tests/test-active-relations.php
+++ /dev/null
@@ -1,87 +0,0 @@
-debug=1;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- $db->Execute("CREATE TEMPORARY TABLE `persons` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TEMPORARY TABLE `children` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
-
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Jill','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- ADODB_Active_Record::TableHasMany('persons', 'children','person_id');
- class person extends ADOdb_Active_Record{}
-
- $person = new person();
-# $person->HasMany('children','person_id'); ## this is affects all other instances of Person
-
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person2 = new person();
- $person2->Load('id=1');
-
- $c = $person2->children;
- if (is_array($c) && sizeof($c) == 3 && $c[0]->name_first=='Jill' && $c[1]->name_first=='Joan'
- && $c[2]->name_first == 'JAMIE') echo "OK Loaded HasMany";
- else {
- var_dump($c);
- echo "error loading hasMany should have 3 array elements Jill Joan Jamie
";
- }
-
- class child extends ADOdb_Active_Record{};
- ADODB_Active_Record::TableBelongsTo('children','person','person_id','id');
- $ch = new Child('children',array('id'));
-
- $ch->Load('id=1');
- if ($ch->name_first !== 'Jill') echo "error in Loading Child
";
-
- $p = $ch->person;
- if (!$p || $p->name_first != 'John') echo "Error loading belongsTo
";
- else echo "OK loading BelongTo
";
-
- if ($p) {
- #$p->HasMany('children','person_id'); ## this is affects all other instances of Person
- $p->LoadRelations('children', 'order by id',1,2);
- if (sizeof($p->children) == 2 && $p->children[1]->name_first == 'JAMIE') echo "OK LoadRelations
";
- else {
- var_dump($p->children);
- echo "error LoadRelations
";
- }
-
- unset($p->children);
- $p->LoadRelations('children', " name_first like 'J%' order by id",1,2);
- }
- if ($p)
- foreach($p->children as $c) {
- echo " Saving $c->name_first
";
- $c->name_first .= ' K.';
- $c->Save();
- }
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-active-relationsx.php b/src/adodb512/tests/test-active-relationsx.php
deleted file mode 100644
index fbfddf66..00000000
--- a/src/adodb512/tests/test-active-relationsx.php
+++ /dev/null
@@ -1,419 +0,0 @@
-\n", $txt);
- echo $txt;
- }
-
- include_once('../adodb.inc.php');
- include_once('../adodb-active-recordx.inc.php');
-
-
- $db = NewADOConnection('mysql://root@localhost/test');
- $db->debug=0;
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Preparing database using SQL queries (creating 'people', 'children')\n");
-
- $db->Execute("DROP TABLE `people`");
- $db->Execute("DROP TABLE `children`");
- $db->Execute("DROP TABLE `artists`");
- $db->Execute("DROP TABLE `songs`");
-
- $db->Execute("CREATE TABLE `people` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_color` varchar(100) NOT NULL default '',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
- $db->Execute("CREATE TABLE `children` (
- `person_id` int(10) unsigned NOT NULL,
- `name_first` varchar(100) NOT NULL default '',
- `name_last` varchar(100) NOT NULL default '',
- `favorite_pet` varchar(100) NOT NULL default '',
- `id` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `artists` (
- `name` varchar(100) NOT NULL default '',
- `artistuniqueid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`artistuniqueid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("CREATE TABLE `songs` (
- `name` varchar(100) NOT NULL default '',
- `artistid` int(10) NOT NULL,
- `recordid` int(10) unsigned NOT NULL auto_increment,
- PRIMARY KEY (`recordid`)
- ) ENGINE=MyISAM;
- ");
-
- $db->Execute("insert into children (person_id,name_first,name_last,favorite_pet) values (1,'Jill','Lim','tortoise')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'Joan','Lim')");
- $db->Execute("insert into children (person_id,name_first,name_last) values (1,'JAMIE','Lim')");
-
- $db->Execute("insert into artists (artistuniqueid, name) values(1,'Elvis Costello')");
- $db->Execute("insert into songs (recordid, name, artistid) values(1,'No Hiding Place', 1)");
- $db->Execute("insert into songs (recordid, name, artistid) values(2,'American Gangster Time', 1)");
-
- // This class _implicitely_ relies on the 'people' table (pluralized form of 'person')
- class Person extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->hasMany('children');
- }
- }
- // This class _implicitely_ relies on the 'children' table
- class Child extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct();
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table and shares its metadata with Child
- class Kid extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children');
- $this->belongsTo('person');
- }
- }
- // This class _explicitely_ relies on the 'children' table but does not share its metadata
- class Rugrat extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('children', false, false, array('new' => true));
- }
- }
-
- class Artist extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('artists', array('artistuniqueid'));
- $this->hasMany('songs', 'artistid');
- }
- }
- class Song extends ADOdb_Active_Record
- {
- function __construct()
- {
- parent::__construct('songs', array('recordid'));
- $this->belongsTo('artist', 'artistid');
- }
- }
-
- ar_echo("Inserting person in 'people' table ('John Lim, he likes lavender')\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $person->name_first = 'John';
- $person->name_last = 'Lim';
- $person->favorite_color = 'lavender';
- $person->save(); // this save will perform an INSERT successfully
-
- $person = new Person();
- $person->name_first = 'Lady';
- $person->name_last = 'Cat';
- $person->favorite_color = 'green';
- $person->save();
-
- $child = new Child();
- $child->name_first = 'Fluffy';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $child = new Child();
- $child->name_first = 'Sun';
- $child->name_last = 'Cat';
- $child->favorite_pet = 'Cat Lady';
- $child->person_id = $person->id;
- $child->save();
-
- $err_count = 0;
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1') [Lazy Method]\n");
- ar_echo("person is loaded but its children will be loaded on-demand later on\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1');
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Children:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("person is loaded, and so are its children\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('id=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("person and its children are loaded using a single query\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // When I specifically ask for a join, I have to specify which table id I am looking up
- // otherwise the SQL parser will wonder which table's id that would be.
- $people = $person->Find('people.id=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Load('people.id=1') [Join Method]\n");
- ar_echo("Load() always uses the join method since it returns only one row\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- // Under the hood, Load(), since it returns only one row, always perform a join
- // Therefore we need to clarify which id we are talking about.
- $person->Load('people.id=1');
- ar_echo((ar_assert(found($person, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($person, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Load('children.id=1') [Join Method]\n");
- ar_echo("We are now loading from the 'children' table, not from 'people'\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $child->Load('children.id=1');
- ar_echo((ar_assert(found($child, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($child, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("child->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $child = new Child();
- $children = $child->Find('id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($children, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($children, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($children, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Where we see that kid shares relationships with child because they are stored\n");
- ar_echo("in the common table's metadata structure.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("Of course, lazy loading also retrieve medata information...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($kids, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading People:\n\n");
- foreach($kids as $akid)
- {
- if($akid->person);
- }
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("In rugrat's constructor it is specified that\nit must forget any existing relation\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($rugrats, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($rugrats, "'favorite_color' => 'lavender'"))) ? "[OK] No relation found\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($rugrats, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("kid->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("Note how only rugrat forgot its relations - kid is fine.\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $kid = new Kid('children');
- $kids = $kid->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($kids, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($kids, "'favorite_color' => 'lavender'"))) ? "[OK] I did not forget relation: person\n" : "[!!] I should not have forgotten relation: person\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($kids, "'name_first' => 'JAMIE'"))) ? "[OK] No JAMIE relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("rugrat->Find('children.id=1' ... ADODB_WORK_AR) [Worker Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $rugrat = new Rugrat('children');
- $rugrats = $rugrat->Find('children.id=1', false, false, array('loading' => ADODB_WORK_AR));
- $arugrat = $rugrats[0];
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n-- Loading relations:\n\n");
- $arugrat->belongsTo('person');
- $arugrat->LoadRelations('person', 'order by id', 0, 2);
- ar_echo((ar_assert(found($arugrat, "'favorite_color' => 'lavender'"))) ? "[OK] Found relation: person\n" : "[!!] Missing relation: person\n");
- ar_echo((ar_assert(found($arugrat, "'name_first' => 'Jill'"))) ? "[OK] Found Jill\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'Joan'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($arugrat, "'name_first' => 'JAMIE'"))) ? "[OK] No Joan relation\n" : "[!!] Found relation when I shouldn't\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("person->Find('1=1') [Lazy Method]\n");
- ar_echo("And now for our finale...\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $person = new Person();
- $people = $person->Find('1=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($people, "'name_first' => 'John'"))) ? "[OK] Found John\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- ar_echo((ar_assert(notfound($people, "'name_first' => 'Fluffy'"))) ? "[OK] No Fluffy yet\n" : "[!!] Found Fluffy relation when I shouldn't\n");
- ar_echo("\n-- Lazily Loading Everybody:\n\n");
- foreach($people as $aperson)
- {
- foreach($aperson->children as $achild)
- {
- if($achild->name_first);
- }
- }
- ar_echo((ar_assert(found($people, "'favorite_pet' => 'tortoise'"))) ? "[OK] Found relation: child\n" : "[!!] Missing relation: child\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Joan'"))) ? "[OK] Found Joan\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'JAMIE'"))) ? "[OK] Found JAMIE\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Lady'"))) ? "[OK] Found Cat Lady\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Fluffy'"))) ? "[OK] Found Fluffy\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($people, "'name_first' => 'Sun'"))) ? "[OK] Found Sun\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Load('artistuniqueid=1') [Join Method]\n");
- ar_echo("Yes, we are dabbling in the musical field now..\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artist->Load('artistuniqueid=1');
- ar_echo((ar_assert(found($artist, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artist, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Load('recordid=1') [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $song->Load('recordid=1');
- ar_echo((ar_assert(found($song, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_JOIN_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_WORK_AR) [Work Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_JOIN_AR) [Join Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_WORK_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("artist->Find('artistuniqueid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $artist = new Artist();
- $artists = $artist->Find('artistuniqueid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($artists, "'name' => 'Elvis Costello'"))) ? "[OK] Found Elvis Costello\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($artists, "'name' => 'No Hiding Place'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($artists as $anartist)
- {
- foreach($anartist->songs as $asong)
- {
- if($asong->name);
- }
- }
- ar_echo((ar_assert(found($artists, "'name' => 'No Hiding Place'"))) ? "[OK] Found relation: song\n" : "[!!] Missing relation: song\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("song->Find('recordid=1' ... ADODB_LAZY_AR) [Lazy Method]\n");
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
- $song = new Song();
- $songs = $song->Find('recordid=1', false, false, array('loading' => ADODB_LAZY_AR));
- ar_echo((ar_assert(found($songs, "'name' => 'No Hiding Place'"))) ? "[OK] Found song\n" : "[!!] Find failed\n");
- ar_echo((ar_assert(notfound($songs, "'name' => 'Elvis Costello'"))) ? "[OK] No relation yet\n" : "[!!] Found relation when I shouldn't\n");
- foreach($songs as $asong)
- {
- if($asong->artist);
- }
- ar_echo((ar_assert(found($songs, "'name' => 'Elvis Costello'"))) ? "[OK] Found relation: artist\n" : "[!!] Missing relation: artist\n");
-
- ar_echo("\n\n-------------------------------------------------------------------------------------------------------------------\n");
- ar_echo("Test suite complete. " . (($err_count > 0) ? "$err_count errors found.\n" : "Success.\n"));
- ar_echo("-------------------------------------------------------------------------------------------------------------------\n");
-?>
diff --git a/src/adodb512/tests/test-datadict.php b/src/adodb512/tests/test-datadict.php
deleted file mode 100644
index 2dbe8177..00000000
--- a/src/adodb512/tests/test-datadict.php
+++ /dev/null
@@ -1,250 +0,0 @@
-$dbType";
- $db = NewADOConnection($dbType);
- $dict = NewDataDictionary($db);
-
- if (!$dict) continue;
- $dict->debug = 1;
-
- $opts = array('REPLACE','mysql' => 'ENGINE=INNODB', 'oci8' => 'TABLESPACE USERS');
-
-/* $flds = array(
- array('id', 'I',
- 'AUTO','KEY'),
-
- array('name' => 'firstname', 'type' => 'varchar','size' => 30,
- 'DEFAULT'=>'Joan'),
-
- array('lastname','varchar',28,
- 'DEFAULT'=>'Chen','key'),
-
- array('averylonglongfieldname','X',1024,
- 'NOTNULL','default' => 'test'),
-
- array('price','N','7.2',
- 'NOTNULL','default' => '0.00'),
-
- array('MYDATE', 'D',
- 'DEFDATE'),
- array('TS','T',
- 'DEFTIMESTAMP')
- );*/
-
- $flds = "
-ID I AUTO KEY,
-FIRSTNAME VARCHAR(30) DEFAULT 'Joan' INDEX idx_name,
-LASTNAME VARCHAR(28) DEFAULT 'Chen' key INDEX idx_name INDEX idx_lastname,
-averylonglongfieldname X(1024) DEFAULT 'test',
-price N(7.2) DEFAULT '0.00',
-MYDATE D DEFDATE INDEX idx_date,
-BIGFELLOW X NOTNULL,
-TS_SECS T DEFTIMESTAMP,
-TS_SUBSEC TS DEFTIMESTAMP
-";
-
-
- $sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
- $dict->SetSchema('KUTU');
-
- $sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
- $sqla = array_merge($sqla,$sqli);
-
- $sqli = $dict->CreateIndexSQL('idx','testtable','price,firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
- $sqla = array_merge($sqla,$sqli);
- $sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
- $sqla = array_merge($sqla,$sqli);
-
- $addflds = array(array('height', 'F'),array('weight','F'));
- $sqli = $dict->AddColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
- $addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
- $sqli = $dict->AlterColumnSQL('testtable',$addflds);
- $sqla = array_merge($sqla,$sqli);
-
-
- printsqla($dbType,$sqla);
-
- if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
- if ($dbType == 'mysqlt') {
- $db->Connect('localhost', "root", "", "test");
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
- if ($dbType == 'postgres') {
- if (@$db->Connect('localhost', "tester", "test", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
- if ($dbType == 'odbc_mssql') {
- $dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
- if (@$db->Connect($dsn, "sa", "natsoft", "test"));
- $dict->SetSchema('');
- $sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
- if ($sqla2) printsqla($dbType,$sqla2);
- }
-
-
-
- adodb_pr($dict->databaseType);
- printsqla($dbType, $dict->DropColumnSQL('table',array('my col','`col2_with_Quotes`','A_col3','col3(10)')));
- printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
-
-}
-
-function printsqla($dbType,$sqla)
-{
- print "
";
- //print_r($dict->MetaTables());
- foreach($sqla as $s) {
- $s = htmlspecialchars($s);
- print "$s;\n";
- if ($dbType == 'oci8') print "/\n";
- }
- print "
";
-}
-
-/***
-
-Generated SQL:
-
-mysql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INTEGER NOT NULL AUTO_INCREMENT,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) NOT NULL DEFAULT 'Chen',
-averylonglongfieldname LONGTEXT NOT NULL,
-price NUMERIC(7,2) NOT NULL DEFAULT 0.00,
-MYDATE DATE DEFAULT CURDATE(),
- PRIMARY KEY (id, lastname)
-)TYPE=ISAM;
-CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height DOUBLE;
-ALTER TABLE KUTU.testtable ADD weight DOUBLE;
-ALTER TABLE KUTU.testtable MODIFY COLUMN height DOUBLE NOT NULL;
-ALTER TABLE KUTU.testtable MODIFY COLUMN weight DOUBLE NOT NULL;
-
-
---------------------------------------------------------------------------------
-
-oci8
-
-CREATE USER KUTU IDENTIFIED BY tiger;
-/
-GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
-/
-DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
-/
-CREATE TABLE KUTU.testtable (
-id NUMBER(16) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname CLOB NOT NULL,
-price NUMBER(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT TRUNC(SYSDATE),
- PRIMARY KEY (id, lastname)
-)TABLESPACE USERS;
-/
-DROP SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE OR REPLACE TRIGGER KUTU.TRIG_SEQ_testtable BEFORE insert ON KUTU.testtable
- FOR EACH ROW
- BEGIN
- select KUTU.SEQ_testtable.nextval into :new.id from dual;
- END;
-/
-CREATE BITMAP INDEX idx ON KUTU.testtable (firstname,lastname);
-/
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-/
-ALTER TABLE testtable ADD (
- height NUMBER,
- weight NUMBER);
-/
-ALTER TABLE testtable MODIFY(
- height NUMBER NOT NULL,
- weight NUMBER NOT NULL);
-/
-
-
---------------------------------------------------------------------------------
-
-postgres
-AlterColumnSQL not supported for PostgreSQL
-
-
-CREATE DATABASE KUTU LOCATION='/u01/postdata';
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id SERIAL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATE DEFAULT CURRENT_DATE,
- PRIMARY KEY (id, lastname)
-);
-CREATE INDEX idx ON KUTU.testtable USING HASH (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD height FLOAT8;
-ALTER TABLE KUTU.testtable ADD weight FLOAT8;
-
-
---------------------------------------------------------------------------------
-
-odbc_mssql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id INT IDENTITY(1,1) NOT NULL,
-firstname VARCHAR(30) DEFAULT 'Joan',
-lastname VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE DATETIME DEFAULT GetDate(),
- PRIMARY KEY (id, lastname)
-);
-CREATE CLUSTERED INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable ADD
- height REAL,
- weight REAL;
-ALTER TABLE KUTU.testtable ALTER COLUMN height REAL NOT NULL;
-ALTER TABLE KUTU.testtable ALTER COLUMN weight REAL NOT NULL;
-
-
---------------------------------------------------------------------------------
-*/
-
-
-echo "Test XML Schema
";
-$ff = file('xmlschema.xml');
-echo "";
-foreach($ff as $xml) echo htmlspecialchars($xml);
-echo "
";
-include_once('test-xmlschema.php');
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-perf.php b/src/adodb512/tests/test-perf.php
deleted file mode 100644
index bdeae281..00000000
--- a/src/adodb512/tests/test-perf.php
+++ /dev/null
@@ -1,50 +0,0 @@
- $v) {
- if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
- }
-}
-
-if (isset($_SESSION['_db'])) {
- $_db = $_SESSION['_db'];
- $_GET[$_db] = 1;
- $$_db = 1;
-}
-
-echo "Performance Monitoring
";
-include_once('testdatabases.inc.php');
-
-
-function testdb($db)
-{
- if (!$db) return;
- echo "";print_r($db->ServerInfo()); echo " user=".$db->user."";
-
- $perf = NewPerfMonitor($db);
-
- # unit tests
- if (0) {
- //$DB->debug=1;
- echo "Data Cache Size=".$perf->DBParameter('data cache size').'';
- echo $perf->HealthCheck();
- echo($perf->SuspiciousSQL());
- echo($perf->ExpensiveSQL());
- echo($perf->InvalidSQL());
- echo $perf->Tables();
-
- echo "
";
- echo $perf->HealthCheckCLI();
- $perf->Poll(3);
- die();
- }
-
- if ($perf) $perf->UI(3);
-}
-
-?>
diff --git a/src/adodb512/tests/test-pgblob.php b/src/adodb512/tests/test-pgblob.php
deleted file mode 100644
index dd4df5bd..00000000
--- a/src/adodb512/tests/test-pgblob.php
+++ /dev/null
@@ -1,88 +0,0 @@
-Param(false);
- $x = (rand() % 10) + 1;
- $db->debug= ($i==1);
- $id = $db->GetOne($sql,
- array('Z%','Z%',$x));
- if($id != $offset+$x) {
- print "Error at $x";
- break;
- }
- }
-}
-
-include_once('../adodb.inc.php');
-$db = NewADOConnection('postgres7');
-$db->PConnect('localhost','tester','test','test') || die("failed connection");
-
-$enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
-$val = rawurldecode($enc);
-
-$MAX = 1000;
-
-adodb_pr($db->ServerInfo());
-
-echo "
Testing PREPARE/EXECUTE PLAN
";
-
-
-$db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, with plan=',getmicrotime() - $t,'
';
-
-
-$db->_bindInputArray = false;
-$t = getmicrotime();
-doloop();
-echo '',$MAX,' times, no plan=',getmicrotime() - $t,'
';
-
-
-
-echo "Testing UPDATEBLOB
";
-$db->debug=1;
-
-### TEST BEGINS
-
-$db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
-$db->UpdateBlob('photos','photo',$val,'id=9999');
-$v = $db->GetOne('select photo from photos where id=9999');
-
-
-### CLEANUP
-
-$db->Execute("delete from photos where id=9999");
-
-### VALIDATION
-
-if ($v !== $val) echo "*** ERROR: Inserted value does not match downloaded val";
-else echo "*** OK: Passed";
-
-echo "";
-echo "INSERTED: ", $enc;
-echo "
";
-echo"RETURNED: ", rawurlencode($v);
-echo "
";
-echo "INSERTED: ", $val;
-echo "
";
-echo "RETURNED: ", $v;
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-php5.php b/src/adodb512/tests/test-php5.php
deleted file mode 100644
index b1173af0..00000000
--- a/src/adodb512/tests/test-php5.php
+++ /dev/null
@@ -1,115 +0,0 @@
-PHP ".PHP_VERSION."\n";
-try {
-
-$dbt = 'oci8po';
-
-try {
-switch($dbt) {
-case 'oci8po':
- $db = NewADOConnection("oci8po");
-
- $db->Connect('localhost','scott','natsoft','sherkhan');
- break;
-default:
-case 'mysql':
- $db = NewADOConnection("mysql");
- $db->Connect('localhost','root','','northwind');
- break;
-
-case 'mysqli':
- $db = NewADOConnection("mysqli://root:@localhost/northwind");
- //$db->Connect('localhost','root','','test');
- break;
-}
-} catch (exception $e){
- echo "Connect Failed";
- adodb_pr($e);
- die();
-}
-
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz where ?Prepare("select * from adoxyz where ?ErrorMsg(),"\n";
-$rs = $db->Execute($stmt,array(10,20));
-
-echo "
Foreach Iterator Test (rand=".rand().")
";
-$i = 0;
-foreach($rs as $v) {
- $i += 1;
- echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields,true);
- if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
- else echo "passed
";
- flush();
-}
-
-$rs = new ADORecordSet_empty();
-foreach($rs as $v) {
- echo "empty ";var_dump($v);
-}
-
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-else echo "Count $i is correct
";
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- echo "
adodb_backtrace:
\n";
- $e = adodb_backtrace($e->gettrace());
-}
-
-$rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
-echo "Result=\n",$rs,"";
-
-echo "Active Record
";
-
- include_once("../adodb-active-record.inc.php");
- ADOdb_Active_Record::SetDatabaseAdapter($db);
-
-try {
- class City extends ADOdb_Active_Record{};
- $a = new City();
-
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-try {
-
- $a = new City();
-
- echo "Successfully created City()
";
- #var_dump($a->GetPrimaryKeys());
- $a->city = 'Kuala Lumpur';
- $a->Save();
- $a->Update();
- #$a->SetPrimaryKeys(array('city'));
- $a->country = "M'sia";
- $a->save();
- $a->Delete();
-} catch(exception $e){
- echo $e->getMessage();
-}
-
-//include_once("test-active-record.php");
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test-xmlschema.php b/src/adodb512/tests/test-xmlschema.php
deleted file mode 100644
index 2d15c111..00000000
--- a/src/adodb512/tests/test-xmlschema.php
+++ /dev/null
@@ -1,54 +0,0 @@
-Connect( 'localhost', 'root', '', 'test' ) || die('fail connect1');
-
-// To create a schema object and build the query array.
-$schema = new adoSchema( $db );
-
-// To upgrade an existing schema object, use the following
-// To upgrade an existing database to the provided schema,
-// uncomment the following line:
-#$schema->upgradeSchema();
-
-print "SQL to build xmlschema.xml:\n
";
-// Build the SQL array
-$sql = $schema->ParseSchema( "xmlschema.xml" );
-
-var_dump( $sql );
-print "
\n";
-
-// Execute the SQL on the database
-//$result = $schema->ExecuteSchema( $sql );
-
-// Finally, clean up after the XML parser
-// (PHP won't do this for you!)
-//$schema->Destroy();
-
-
-
-print "SQL to build xmlschema-mssql.xml:\n";
-
-$db2 = ADONewConnection('mssql');
-$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
-
-$db2->Execute("drop table simple_table");
-
-$schema = new adoSchema( $db2 );
-$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
-
-print_r( $sql );
-print "\n";
-
-$db2->debug=1;
-
-foreach ($sql as $s)
-$db2->Execute($s);
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test.php b/src/adodb512/tests/test.php
deleted file mode 100644
index 5334c443..00000000
--- a/src/adodb512/tests/test.php
+++ /dev/null
@@ -1,1748 +0,0 @@
-$msg
";
- flush();
-}
-
-function CheckWS($conn)
-{
-global $ADODB_EXTENSION;
-
- include_once('../session/adodb-session.php');
- if (defined('CHECKWSFAIL')){ echo " TESTING $conn ";flush();}
- $saved = $ADODB_EXTENSION;
- $db = ADONewConnection($conn);
- $ADODB_EXTENSION = $saved;
- if (headers_sent()) {
- print "White space detected in adodb-$conn.inc.php or include file...
";
- //die();
- }
-}
-
-function do_strtolower(&$arr)
-{
- foreach($arr as $k => $v) {
- if (is_object($v)) $arr[$k] = adodb_pr($v,true);
- else $arr[$k] = strtolower($v);
- }
-}
-
-
-function CountExecs($db, $sql, $inputarray)
-{
-global $EXECS; $EXECS++;
-}
-
-function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
-{
-global $CACHED; $CACHED++;
-}
-
-// the table creation code is specific to the database, so we allow the user
-// to define their own table creation stuff
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE,$ADODB_COUNTRECS;
-
- //adodb_pr($db);
-
-?>
-Close();
- if ($rs2) $rs2->Close();
- if ($rs) $rs->Close();
- $db->Close();
-
- if ($db->transCnt != 0) Err("Error in transCnt=$db->transCnt (should be 0)");
-
-
- printf("Total queries=%d; total cached=%d
",$EXECS+$CACHED, $CACHED);
- flush();
-}
-
-function adodb_test_err($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
-{
-global $TESTERRS,$ERRNO;
-
- $ERRNO = $errno;
- $TESTERRS += 1;
- print "** $dbms ($fn): errno=$errno errmsg=$errmsg ($p1,$p2)
";
-}
-
-//--------------------------------------------------------------------------------------
-
-
-@set_time_limit(240); // increase timeout
-
-include("../tohtml.inc.php");
-include("../adodb.inc.php");
-include("../rsfilter.inc.php");
-
-/* White Space Check */
-
-if (isset($_SERVER['argv'][1])) {
- //print_r($_SERVER['argv']);
- $_GET[$_SERVER['argv'][1]] = 1;
-}
-
-if (@$_SERVER['COMPUTERNAME'] == 'TIGRESS') {
- CheckWS('mysqlt');
- CheckWS('postgres');
- CheckWS('oci8po');
-
- CheckWS('firebird');
- CheckWS('sybase');
- if (!ini_get('safe_mode')) CheckWS('informix');
-
- CheckWS('ado_mssql');
- CheckWS('ado_access');
- CheckWS('mssql');
-
- CheckWS('vfp');
- CheckWS('sqlanywhere');
- CheckWS('db2');
- CheckWS('access');
- CheckWS('odbc_mssql');
- CheckWS('firebird15');
- //
- CheckWS('oracle');
- CheckWS('proxy');
- CheckWS('fbsql');
- print "White Space Check complete";
-}
-if (sizeof($_GET) == 0) $testmysql = true;
-
-
-foreach($_GET as $k=>$v) {
- //global $$k;
- $$k = $v;
-}
-
-?>
-
-
ADODB Testing
-
-ADODB Test
-
-This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO).
-There is also support for Sybase, PostgreSQL.
-For the latest version of ADODB, visit adodb.sourceforge.net.
-
-Test GetInsertSQL/GetUpdateSQL
- Sessions
- Paging
- Perf Monitor
-vers=",ADOConnection::Version();
-
-
-
-?>
-
ADODB Database Library (c) 2000-2010 John Lim. All rights reserved. Released under BSD and LGPL, PHP .
-
-
diff --git a/src/adodb512/tests/test2.php b/src/adodb512/tests/test2.php
deleted file mode 100644
index 7580dcaf..00000000
--- a/src/adodb512/tests/test2.php
+++ /dev/null
@@ -1,26 +0,0 @@
-debug=1;
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
-
- echo "PHP ",PHP_VERSION,"
";
-
- $db->Connect($myDSN) || die('fail');
-
- print_r($db->ServerInfo());
-
- try {
- $rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx");
- print_r($rs->fields);
- } catch(exception $e) {
- print_r($e);
- echo " Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y');
- }
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test3.php b/src/adodb512/tests/test3.php
deleted file mode 100644
index 97d531ac..00000000
--- a/src/adodb512/tests/test3.php
+++ /dev/null
@@ -1,44 +0,0 @@
-Connect('','scott','natsoft');
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz");
-$rs = $db->Execute("select * from adoxyz order by id");
-
-$i = 0;
-foreach($rs as $k => $v) {
- $i += 1;
- echo $k; adodb_pr($v);
- flush();
-}
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-
-
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
- adodb_pr($e);
- $e = adodb_backtrace($e->trace);
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test4.php b/src/adodb512/tests/test4.php
deleted file mode 100644
index 7fcd7c64..00000000
--- a/src/adodb512/tests/test4.php
+++ /dev/null
@@ -1,143 +0,0 @@
-PConnect("", "sa", "natsoft", "northwind"); // connect to MySQL, testdb
-
-$conn = ADONewConnection("mysql"); // create a connection
-$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
-
-
-#$conn = ADONewConnection('oci8po');
-#$conn->Connect('','scott','natsoft');
-
-if (PHP_VERSION >= 5) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $conn = ADONewConnection('pdo');
- $conn->Connect($connstr, $u, $p);
-}
-//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
-
-$conn->debug=1;
-$conn->Execute("delete from adoxyz where lastname like 'Smi%'");
-
-$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
-$record = array(); // Initialize an array to hold the record data to insert
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 751;
-$record["firstname"] = 'Jann';
-$record["lastname"] = "Smitts";
-$record["created"] = time();
-
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-if (strpos($conn->databaseType,'mysql')===false) $record['id'] = 752;
-// Set the values for the fields in the record
-$record["firstname"] = 'anull';
-$record["lastname"] = "Smith\$@//";
-$record["created"] = time();
-
-if (isset($_GET['f'])) $ADODB_FORCE_TYPE = $_GET['f'];
-
-//$record["id"] = -1;
-
-// Pass the empty recordset and the array containing the data to insert
-// into the GetInsertSQL function. The function will process the data and return
-// a fully formatted insert sql statement.
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-
-
-$insertSQL2 = $conn->GetInsertSQL($table='ADOXYZ', $record);
-if ($insertSQL != $insertSQL2) echo "
Walt's new stuff failed: $insertSQL2
";
-//==========================
-// This code tests an update
-
-$sql = "
-SELECT *
-FROM ADOXYZ WHERE lastname=".$conn->Param('var'). " ORDER BY 1";
-// Select a record to update
-
-$varr = array('var'=>$record['lastname'].'');
-$rs = $conn->Execute($sql,$varr); // Execute the query and get the existing record to update
-if (!$rs || $rs->EOF) print "No record found!
";
-
-$record = array(); // Initialize an array to hold the record data to update
-
-
-// Set the values for the fields in the record
-$record["firstName"] = "Caroline".rand();
-//$record["lasTname"] = ""; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = '';
-// Pass the single record recordset and the array containing the data to update
-// into the GetUpdateSQL function. The function will process the data and return
-// a fully formatted update sql statement.
-// If the data has not changed, no recordset is returned
-
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error1 : Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$record["firstName"] = "Caroline".rand();
-$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "Error 2: Rows Affected=".$conn->Affected_Rows().", should be 1
";
-
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-
-$record["firstName"] = "Carol-new-".rand();
-$record["lasTname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-
-$conn->AutoExecute('ADOXYZ',$record,'UPDATE', "lastname like 'Sm%'");
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-}
-
-
-testsql();
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/test5.php b/src/adodb512/tests/test5.php
deleted file mode 100644
index f5df129f..00000000
--- a/src/adodb512/tests/test5.php
+++ /dev/null
@@ -1,47 +0,0 @@
-debug=1;
- $conn->PConnect("localhost","root","","xphplens");
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
-
-if (0) {
- $conn = ADONewConnection("oci8"); // create a connection
- $conn->debug=1;
- $conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID();
-}
-
-if (0) {
- $conn = ADONewConnection("ibase"); // create a connection
- $conn->debug=1;
- $conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\profile.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
-
-if (0) {
- $conn = ADONewConnection('postgres');
- $conn->debug=1;
- @$conn->PConnect("susetikus","tester","test","test");
- print $conn->databaseType.':'.$conn->GenID().'
';
-}
-?>
diff --git a/src/adodb512/tests/test_rs_array.php b/src/adodb512/tests/test_rs_array.php
deleted file mode 100644
index 1de37b22..00000000
--- a/src/adodb512/tests/test_rs_array.php
+++ /dev/null
@@ -1,47 +0,0 @@
-InitArray($array,$typearr);
-
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
1 Seek
";
-$rs->Move(1);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
2 Seek
";
-$rs->Move(2);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-echo "
3 Seek
";
-$rs->Move(3);
-while (!$rs->EOF) {
- print_r($rs->fields);echo "
";
- $rs->MoveNext();
-}
-
-
-
-die();
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testcache.php b/src/adodb512/tests/testcache.php
deleted file mode 100644
index 35c1e77a..00000000
--- a/src/adodb512/tests/testcache.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-PConnect('nwind');
-} else {
- $db = ADONewConnection('mysql');
- $db->PConnect('mangrove','root','','xphplens');
-}
-if (isset($cache)) $rs = $db->CacheExecute(120,'select * from products');
-else $rs = $db->Execute('select * from products');
-
-$arr = $rs->GetArray();
-print sizeof($arr);
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testdatabases.inc.php b/src/adodb512/tests/testdatabases.inc.php
deleted file mode 100644
index a5fc91df..00000000
--- a/src/adodb512/tests/testdatabases.inc.php
+++ /dev/null
@@ -1,454 +0,0 @@
-
-
-
-
-
-
-
-FETCH MODE IS NOT ADODB_FETCH_DEFAULT";
-
-if (isset($nocountrecs)) $ADODB_COUNTRECS = false;
-
-// cannot test databases below, but we include them anyway to check
-// if they parse ok...
-
-if (sizeof($_GET) || !isset($_SERVER['HTTP_HOST'])) {
- echo "
";
- ADOLoadCode2("sybase");
- ADOLoadCode2("postgres");
- ADOLoadCode2("postgres7");
- ADOLoadCode2("firebird");
- ADOLoadCode2("borland_ibase");
- ADOLoadCode2("informix");
- ADOLoadCode2('mysqli');
- if (defined('ODBC_BINMODE_RETURN')) {
- ADOLoadCode2("sqlanywhere");
- ADOLoadCode2("access");
- }
- ADOLoadCode2("mysql");
- ADOLoadCode2("oci8");
-}
-
-function ADOLoadCode2($d)
-{
- ADOLoadCode($d);
- $c = ADONewConnection($d);
- echo "Loaded $d ",($c ? 'ok' : 'extension not installed'),"
";
-}
-
-flush();
-if (!empty($testpostgres)) {
- //ADOLoadCode("postgres");
-
- $db = ADONewConnection('postgres');
- print "Connecting $db->databaseType...
";
- if ($db->Connect("localhost","tester","test","test")) {
- testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
- }else
- print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.
".$db->ErrorMsg();
-}
-
-if (!empty($testpgodbc)) {
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
-
- if ($db->PConnect('Postgresql')) {
- $db->hasTransactions = true;
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- } else print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.
".$db->ErrorMsg();
-}
-
-if (!empty($testibase)) {
- //$_GET['nolog'] = true;
- $db = ADONewConnection('firebird');
- print "Connecting $db->databaseType...
";
- if ($db->PConnect("localhost:d:\\firebird\\151\\examples\\profile.fdb", "sysdba", "masterkey", ""))
- testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),price numeric(12,2),created date)");
- else print "ERROR: Interbase test requires a database called profile.gdb".'
'.$db->ErrorMsg();
-
-}
-
-
-if (!empty($testsqlite)) {
- $path =urlencode('d:\inetpub\adodb\sqlite.db');
- $dsn = "sqlite://$path/";
- $db = ADONewConnection($dsn);
- //echo $dsn;
-
- //$db = ADONewConnection('sqlite');
-
-
- if ($db && $db->PConnect("d:\\inetpub\\adodb\\sqlite.db", "", "", "")) {
- print "Connecting $db->databaseType...
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else
- print "ERROR: SQLite";
-
-}
-
-if (!empty($testpdopgsql)) {
- $connstr = "pgsql:dbname=test";
- $u = 'tester';$p='test';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomysql)) {
- $connstr = "mysql:dbname=northwind";
- $u = 'root';$p='';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomssql)) {
- $connstr = "mssql:dbname=northwind";
- $u = 'sa';$p='natsoft';
- $db = ADONewConnection('pdo');
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdosqlite)) {
- $connstr = "sqlite:d:/inetpub/adodb/sqlite-pdo.db3";
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoaccess)) {
- $connstr = 'odbc:nwind';
- $u = '';$p='';
- $db = ADONewConnection('pdo');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoora)) {
- $connstr = 'oci:';
- $u = 'scott';$p='natsoft';
- $db = ADONewConnection('pdo');
- #$db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- $db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-// REQUIRES ODBC DSN CALLED nwind
-if (!empty($testaccess)) {
- $db = ADONewConnection('access');
- print "Connecting $db->databaseType...
";
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $dsn = "nwind";
- $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$access;Uid=Admin;Pwd=;";
-
- //$dsn = 'Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' . $access . ';';
- if ($db->PConnect($dsn, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
-
-}
-
-if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
-
- $db = ADONewConnection("ado_access");
- print "Connecting $db->databaseType...
";
-
- $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
- $myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
- . 'DATA SOURCE=' . $access . ';';
- //. 'USER ID=;PASSWORD=;';
- $_GET['nolog'] = 1;
- if ($db->PConnect($myDSN, "", "", "")) {
- print "ADO version=".$db->_connectionID->version."
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: Access test requires a Access database $access".'
'.$db->ErrorMsg();
-
-}
-
-if (!empty($testvfp)) { // ODBC
- $db = ADONewConnection('vfp');
- print "Connecting $db->databaseType...
";flush();
-
- if ( $db->PConnect("vfp-adoxyz")) {
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
- echo "
";
- $db = ADONewConnection('odbtp');
-
- if ( $db->PConnect('localhost','DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=d:\inetpub\adodb;EXCLUSIVE=NO;')) {
- print "Connecting $db->databaseType...
";flush();
- testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
- } else print "ERROR: Visual FoxPro odbtp requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysql)) { // MYSQL
-
-
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- $user = 'root'; $password = ''; $database = 'northwind';
- $db = ADONewConnection("mysqlt://$user:$password@$server/$database?persist");
- print "Connecting $db->databaseType...
";
-
- if (true || $db->PConnect($server, "root", "", "northwind")) {
- //$db->Execute("DROP TABLE ADOXYZ") || die('fail drop');
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) Type=InnoDB");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqli)) { // MYSQL
-
- $db = ADONewConnection('mysqli');
- print "Connecting $db->databaseType...
";
- if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect($server, "root", "", "northwind")) {
- //$db->debug=1;$db->Execute('drop table ADOXYZ');
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
- } else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqlodbc)) { // MYSQL
-
- $db = ADONewConnection('odbc');
- $db->hasTransactions = false;
- print "Connecting $db->databaseType...
";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
- else $server = "mangrove";
- if ($db->PConnect('mysql', "root", ""))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-}
-
-if (!empty($testproxy)){
- $db = ADONewConnection('proxy');
- print "Connecting $db->databaseType...
";
- if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-
- if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
- testdb($db,
- "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
- else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode('oci805');
-ADOLoadCode("oci8po");
-
-if (!empty($testoracle)) {
- $dsn = "oci8po";//://scott:natsoft@kk2?persist";
- $db = ADONewConnection($dsn );//'oci8');
-
- //$db->debug=1;
- print "Connecting $db->databaseType...
";
- if ($db->Connect('192.168.0.138', "scott", "natsoft",'SID=natsoft'))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else
- print "ERROR: Oracle test requires an Oracle server setup with scott/natsoft".'
'.$db->ErrorMsg();
-
-}
-ADOLoadCode("oracle"); // no longer supported
-if (false && !empty($testoracle)) {
-
- $db = ADONewConnection();
- print "Connecting $db->databaseType...
";
- if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'
'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode("odbc_db2"); // no longer supported
-if (!empty($testdb2)) {
- if (PHP_VERSION>=5.1) {
- $db = ADONewConnection("db2");
- print "Connecting $db->databaseType...
";
-
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect('localhost','natsoft','guest','test')) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'
'.$db->ErrorMsg();
- } else {
- $db = ADONewConnection("odbc_db2");
- print "Connecting $db->databaseType...
";
-
- $dsn = "db2test";
- #$db->curMode = SQL_CUR_USE_ODBC;
- #$dsn = "driver={IBM db2 odbc DRIVER};Database=test;hostname=localhost;port=50000;protocol=TCPIP; uid=natsoft; pwd=guest";
- if ($db->Connect($dsn)) {
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'
'.$db->ErrorMsg();
- }
-echo "
";
-flush();
- $dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-
- $db = ADONewConnection('odbtp');
- if ($db->Connect('127.0.0.1',$dsn)) {
-
- $db->debug=1;
- $arr = $db->GetArray( "||SQLProcedures" ); adodb_pr($arr);
- $arr = $db->GetArray( "||SQLProcedureColumns|||GET_ROUTINE_SAR" );adodb_pr($arr);
-
- testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
- } else echo ("ERROR Connection");
- echo $db->ErrorMsg();
-}
-
-
-$server = 'localhost';
-
-
-
-ADOLoadCode("mssqlpo");
-if (false && !empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
- $db = ADONewConnection("mssqlpo");
- //$db->debug=1;
- print "Connecting $db->databaseType...
";
-
- $ok = $db->Connect('','sa','natsoft','northwind');
- echo $db->ErrorMsg();
- if ($ok /*or $db->PConnect("mangrove", "sa", "natsoft", "ai")*/) {
- AutoDetect_MSSQL_Date_Order($db);
- // $db->Execute('drop table adoxyz');
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='$server', userid='adodb', password='natsoft', database='ai'".'
'.$db->ErrorMsg();
-
-}
-
-
-ADOLoadCode('odbc_mssql');
-if (!empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection();
-
- print "Connecting $db->databaseType...
";
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;";
- $dsn = 'condor';
- if ($db->PConnect($dsn, "sa", "natsoft", "")) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-ADOLoadCode("ado_mssql");
-if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
-
- $db = ADONewConnection("ado_mssql");
- //$db->debug=1;
- print "Connecting DSN-less $db->databaseType...
";
-
- $myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
- . "SERVER=$server;DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No";
-
-
- if ($db->PConnect($myDSN, "", "", ""))
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- else print "ERROR: MSSQL test 2 requires MS SQL 7";
-
-}
-
-if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
-
- $db = ADONewConnection("ado_mssql");
- print "Connecting DSN-less OLEDB Provider $db->databaseType...
";
- //$db->debug=1;
- $myDSN="SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes";
- if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) {
- testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
- } else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
-
-}
-
-
-if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC
- $db = ADONewConnection('odbtp');
-
- $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;uid=adodb;pwd=natsoft";
-
- if ($db->PConnect('localhost',$dsn, "", "")) {
- print "Connecting $db->databaseType...
";
- testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
- }
- else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-
-print "Tests Completed
";
-
-?>
diff --git a/src/adodb512/tests/testgenid.php b/src/adodb512/tests/testgenid.php
deleted file mode 100644
index bc54adac..00000000
--- a/src/adodb512/tests/testgenid.php
+++ /dev/null
@@ -1,36 +0,0 @@
-Execute("drop table $table");
- //$db->debug=true;
-
- $ctr = 5000;
- $lastnum = 0;
-
- while (--$ctr >= 0) {
- $num = $db->GenID($table);
- if ($num === false) {
- print "GenID returned false";
- break;
- }
- if ($lastnum + 1 == $num) print " $num ";
- else {
- print " $num ";
- flush();
- }
- $lastnum = $num;
- }
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testmssql.php b/src/adodb512/tests/testmssql.php
deleted file mode 100644
index f5026328..00000000
--- a/src/adodb512/tests/testmssql.php
+++ /dev/null
@@ -1,76 +0,0 @@
-Connect('127.0.0.1','adodb','natsoft','northwind') or die('Fail');
-
-$conn->debug =1;
-$query = 'select * from products';
-$conn->SetFetchMode(ADODB_FETCH_ASSOC);
-$rs = $conn->Execute($query);
-echo "";
-while( !$rs->EOF ) {
- $output[] = $rs->fields;
- var_dump($rs->fields);
- $rs->MoveNext();
- print "";
-}
-die();
-
-
-$p = $conn->Prepare('insert into products (productname,unitprice,dcreated) values (?,?,?)');
-echo "
";
-print_r($p);
-
-$conn->debug=1;
-$conn->Execute($p,array('John'.rand(),33.3,$conn->DBDate(time())));
-
-$p = $conn->Prepare('select * from products where productname like ?');
-$arr = $conn->getarray($p,array('V%'));
-print_r($arr);
-die();
-
-//$conn = ADONewConnection("mssql");
-//$conn->Connect('mangrove','sa','natsoft','ai');
-
-//$conn->Connect('mangrove','sa','natsoft','ai');
-$conn->debug=1;
-$conn->Execute('delete from blobtest');
-
-$conn->Execute('insert into blobtest (id) values(1)');
-$conn->UpdateBlobFile('blobtest','b1','../cute_icons_for_site/adodb.gif','id=1');
-$rs = $conn->Execute('select b1 from blobtest where id=1');
-
-$output = "c:\\temp\\test_out-".date('H-i-s').".gif";
-print "Saving file $output, size=".strlen($rs->fields[0])."";
-$fd = fopen($output, "wb");
-fwrite($fd, $rs->fields[0]);
-fclose($fd);
-
-print " View Image";
-//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
-//rs2html($rs);
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testoci8.php b/src/adodb512/tests/testoci8.php
deleted file mode 100644
index dc0663e8..00000000
--- a/src/adodb512/tests/testoci8.php
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-PConnect('','scott','natsoft');
- if (!empty($testblob)) {
- $varHoldingBlob = 'ABC DEF GEF John TEST';
- $num = time()%10240;
- // create table atable (id integer, ablob blob);
- $db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
- $db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
-
- $rs = $db->Execute('select * from atable');
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
- $stmt = $db->Prepare('select * from adoxyz where id=?');
- for ($i = 1; $i <= 10; $i++) {
- $rs = $db->Execute(
- $stmt,
- array($i));
-
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
- }
-}
-if (1) {
- $db = ADONewConnection('oci8');
- $db->PConnect('','scott','natsoft');
- $db->debug = true;
- $db->Execute("delete from emp where ename='John'");
- print $db->Affected_Rows().'
';
- $stmt = $db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- $rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
- // prepare not quite ready for prime time
- //$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
- if (!$rs) die("Empty RS");
-
- $db->setfetchmode(ADODB_FETCH_NUM);
-
- $vv = 'A%';
- $stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
- $db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
- $db->OutParameter($stmt, $vv, 'tt');
- $rs = $db->Execute($stmt);
- while (!$rs->EOF) {
- adodb_pr($rs->fields);
- $rs->MoveNext();
- }
- echo " val = $vv";
-
-}
-
-if (0) {
- $db = ADONewConnection('odbc_oracle');
- if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
- $db->debug = true;
- $rs = $db->Execute(
- 'select * from adoxyz where firstname=? and trim(lastname)=?',
- array('first'=>'Caroline','last'=>'Miranda'));
- if (!$rs) die("Empty RS");
- if ($rs->EOF) die("EOF RS");
- rs2html($rs);
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testoci8cursor.php b/src/adodb512/tests/testoci8cursor.php
deleted file mode 100644
index e88c8b6b..00000000
--- a/src/adodb512/tests/testoci8cursor.php
+++ /dev/null
@@ -1,111 +0,0 @@
-PConnect('','scott','natsoft');
- $db->debug = 99;
-
-
-/*
-*/
-
- define('MYNUM',5);
-
-
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS,'A%'); END;");
-
- if ($rs && !$rs->EOF) {
- print "Test 1 RowCount: ".$rs->RecordCount()."";
- } else {
- print "Error in using Cursor Variables 1
";
- }
-
- print "
Testing Stored Procedures for oci8
";
-
- $stid = $db->PrepareSP('BEGIN adodb.myproc('.MYNUM.', :myov); END;');
- $db->OutParameter($stid, $myov, 'myov');
- $db->Execute($stid);
- if ($myov != MYNUM) print "Error with myproc
";
-
-
- $stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;",true);
- $a1 = 'Malaysia';
- //$a2 = ''; # a2 doesn't even need to be defined!
- $db->InParameter($stmt,$a1,'a1');
- $db->OutParameter($stmt,$a2,'a2');
- $rs = $db->Execute($stmt);
- if ($rs) {
- if ($a2 !== 'Cinta Hati Malaysia') print "Stored Procedure Error: a2 = $a2";
- else echo "OK: a2=$a2
";
- } else {
- print "Error in using Stored Procedure IN/Out Variables
";
- }
-
-
- $tname = 'A%';
-
- $stmt = $db->PrepareSP('select * from tab where tname like :tablename');
- $db->Parameter($stmt,$tname,'tablename');
- $rs = $db->Execute($stmt);
- rs2html($rs);
-
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testpaging.php b/src/adodb512/tests/testpaging.php
deleted file mode 100644
index 534f00b9..00000000
--- a/src/adodb512/tests/testpaging.php
+++ /dev/null
@@ -1,86 +0,0 @@
-PConnect('localhost','tester','test','test');
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->PConnect("nwind", "", "", "");
-}
-
-if ($driver == 'ibase') {
- $db = NewADOConnection('ibase');
- $db->PConnect("localhost:e:\\firebird\\examples\\profile.gdb", "sysdba", "masterkey", "");
- $sql = 'select distinct firstname, lastname from adoxyz order by firstname';
-
-}
-if ($driver == 'mssql') {
- $db = NewADOConnection('mssql');
- $db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-}
-if ($driver == 'oci8') {
- $db = NewADOConnection('oci8');
- $db->Connect('','scott','natsoft');
-
-$sql = "select * from (select ID, firstname as \"First Name\", lastname as \"Last Name\" from adoxyz
- order by 1)";
-}
-
-if ($driver == 'access') {
- $db = NewADOConnection('access');
- $db->Connect('nwind');
-}
-
-if (empty($driver) or $driver == 'mysql') {
- $db = NewADOConnection('mysql');
- $db->Connect('localhost','root','','test');
-}
-
-//$db->pageExecuteCountRows = false;
-
-$db->debug = true;
-
-if (0) {
-$rs = $db->Execute($sql);
-include_once('../toexport.inc.php');
-print "
";
-print rs2csv($rs); # return a string
-
-print '
';
-$rs->MoveFirst(); # note, some databases do not support MoveFirst
-print rs2tab($rs); # return a string
-
-print '
';
-$rs->MoveFirst();
-rs2tabout($rs); # send to stdout directly
-print "
";
-}
-
-$pager = new ADODB_Pager($db,$sql);
-$pager->showPageLinks = true;
-$pager->linksPerPage = 10;
-$pager->cache = 60;
-$pager->Render($rows=7);
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testpear.php b/src/adodb512/tests/testpear.php
deleted file mode 100644
index dd063181..00000000
--- a/src/adodb512/tests/testpear.php
+++ /dev/null
@@ -1,34 +0,0 @@
-setFetchMode(ADODB_FETCH_ASSOC);
-$rs = $db->Query('select firstname,lastname from adoxyz');
-$cnt = 0;
-while ($arr = $rs->FetchRow()) {
- print_r($arr);
- print "
";
- $cnt += 1;
-}
-
-if ($cnt != 50) print "Error in \$cnt = $cnt";
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/testsessions.php b/src/adodb512/tests/testsessions.php
deleted file mode 100644
index 5c2d32d7..00000000
--- a/src/adodb512/tests/testsessions.php
+++ /dev/null
@@ -1,98 +0,0 @@
-Notify Expiring=$ref, sessionkey=$key";
-}
-
-//-------------------------------------------------------------------
-
-error_reporting(E_ALL);
-
-
-ob_start();
-include('../session/adodb-cryptsession2.php');
-
-$options['debug'] = 1;
-$db = 'oci8';
-
-#### CONNECTION
-switch($db) {
-case 'oci8':
- $options['table'] = 'adodb_sessions2';
- ADOdb_Session::config('oci8', '', 'jcollect_bkrm', 'natsoft', '',$options);
- break;
-
-case 'postgres':
- $options['table'] = 'sessions2';
- ADOdb_Session::config('postgres', 'localhost', 'tester', 'test', 'test',$options);
- break;
-
-case 'mysql':
-default:
- $options['table'] = 'sessions2';
- ADOdb_Session::config('mysql', 'localhost', 'root', '', 'xphplens_2',$options);
- break;
-
-
-}
-
-
-
-#### SETUP NOTIFICATION
- $USER = 'JLIM'.rand();
- $ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
-
- adodb_session_create_table();
- session_start();
-
- adodb_session_regenerate_id();
-
-### SETUP SESSION VARIABLES
- if (empty($_SESSION['MONKEY'])) $_SESSION['MONKEY'] = array(1,'abc',44.41);
- else $_SESSION['MONKEY'][0] += 1;
- if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
-
-
-### START DISPLAY
- print "PHP ".PHP_VERSION."
";
- print "\$_SESSION['AVAR']={$_SESSION['AVAR']}
";
-
- print "
Cookies: ";
- print_r($_COOKIE);
-
- var_dump($_SESSION['MONKEY']);
-
-### RANDOMLY PERFORM Garbage Collection
-### In real-production environment, this is done for you
-### by php's session extension, which calls adodb_sess_gc()
-### automatically for you. See php.ini's
-### session.cookie_lifetime and session.gc_probability
-
- if (rand() % 5 == 0) {
-
- print "
Garbage Collection
";
- adodb_sess_gc(10);
-
- if (rand() % 2 == 0) {
- print "Random own session destroy
";
- session_destroy();
- }
- } else {
- $DB = ADODB_Session::_conn();
- $sessk = $DB->qstr('%AZ'.rand().time());
- $olddate = $DB->DBTimeStamp(time()-30*24*3600);
- $rr = $DB->qstr(rand());
- $DB->Execute("insert into {$options['table']} (sesskey,expiry,expireref,sessdata,created,modified) values ($sessk,$olddate, $rr,'',$olddate,$olddate)");
- }
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/time.php b/src/adodb512/tests/time.php
deleted file mode 100644
index 65e9e08f..00000000
--- a/src/adodb512/tests/time.php
+++ /dev/null
@@ -1,18 +0,0 @@
-
-" );
-echo( "Converted: $convertedDate" ); //why is string returned as one day (3 not 4) less for this example??
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/tests/tmssql.php b/src/adodb512/tests/tmssql.php
deleted file mode 100644
index d634f0cc..00000000
--- a/src/adodb512/tests/tmssql.php
+++ /dev/null
@@ -1,80 +0,0 @@
-mssql";
- $db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
- mssql_select_db('northwind',$db);
-
- $rs = mssql_query('select getdate() as date',$db);
- $o = mssql_fetch_row($rs);
- print_r($o);
- mssql_free_result($rs);
-
- print "Delete
"; flush();
- $rs2 = mssql_query('delete from adoxyz',$db);
- $p = mssql_num_rows($rs2);
- mssql_free_result($rs2);
-
-}
-
-function tpear()
-{
-include_once('DB.php');
-
- print "PEAR
";
- $username = 'adodb';
- $password = 'natsoft';
- $hostname = 'JAGUAR\vsdotnet';
- $databasename = 'northwind';
-
- $dsn = "mssql://$username:$password@$hostname/$databasename";
- $conn = DB::connect($dsn);
- print "date=".$conn->GetOne('select getdate()')."
";
- @$conn->query('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->query('delete from tester');
- print "date=".$conn->GetOne('select getdate()')."
";
-}
-
-function tadodb()
-{
-include_once('../adodb.inc.php');
-
- print "ADOdb
";
- $conn = NewADOConnection('mssql');
- $conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-// $conn->debug=1;
- print "date=".$conn->GetOne('select getdate()')."
";
- $conn->Execute('create table tester (id integer)');
- print "Delete
"; flush();
- $rs = $conn->Execute('delete from tester');
- print "date=".$conn->GetOne('select getdate()')."
";
-}
-
-
-$ACCEPTIP = '127.0.0.1';
-
-$remote = $_SERVER["REMOTE_ADDR"];
-
-if (!empty($ACCEPTIP))
- if ($remote != '127.0.0.1' && $remote != $ACCEPTIP)
- die("Unauthorised client: '$remote'");
-
-?>
-mssql
-pear
-adodb
-
\ No newline at end of file
diff --git a/src/adodb512/tests/xmlschema-mssql.xml b/src/adodb512/tests/xmlschema-mssql.xml
deleted file mode 100644
index db2c3432..00000000
--- a/src/adodb512/tests/xmlschema-mssql.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- id
-
-
- id
-
-
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- INSERT into simple_table ( name, description ) values ( '12', 'Microsoft stuff' )
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/tests/xmlschema.xml b/src/adodb512/tests/xmlschema.xml
deleted file mode 100644
index ea48ae2b..00000000
--- a/src/adodb512/tests/xmlschema.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- An integer row that's a primary key and autoincrements
-
-
-
-
- A 16 character varchar row that can't be null
-
-
-
- row1
- row2
-
-
-
- SQL to be executed only on specific platforms
-
- insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-
-
- insert into mytable ( row1, row2 ) values ( 12, 'Microsoft stuff' )
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/toexport.inc.php b/src/adodb512/toexport.inc.php
deleted file mode 100644
index 6975b51a..00000000
--- a/src/adodb512/toexport.inc.php
+++ /dev/null
@@ -1,134 +0,0 @@
-FieldTypesArray();
- reset($fieldTypes);
- $i = 0;
- while(list(,$o) = each($fieldTypes)) {
-
- $v = ($o) ? $o->name : 'Field'.($i++);
- if ($escquote) $v = str_replace($quote,$escquotequote,$v);
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
- $elements[] = $v;
-
- }
- $s .= implode($sep, $elements).$NEWLINE;
- }
- $hasNumIndex = isset($rs->fields[0]);
-
- $line = 0;
- $max = $rs->FieldCount();
-
- while (!$rs->EOF) {
- $elements = array();
- $i = 0;
-
- if ($hasNumIndex) {
- for ($j=0; $j < $max; $j++) {
- $v = $rs->fields[$j];
- if (!is_object($v)) $v = trim($v);
- else $v = 'Object';
- if ($escquote) $v = str_replace($quote,$escquotequote,$v);
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
-
- if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
- else $elements[] = $v;
- }
- } else { // ASSOCIATIVE ARRAY
- foreach($rs->fields as $v) {
- if ($escquote) $v = str_replace($quote,$escquotequote,trim($v));
- $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
-
- if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
- else $elements[] = $v;
- }
- }
- $s .= implode($sep, $elements).$NEWLINE;
- $rs->MoveNext();
- $line += 1;
- if ($fp && ($line % $BUFLINES) == 0) {
- if ($fp === true) echo $s;
- else fwrite($fp,$s);
- $s = '';
- }
- }
-
- if ($fp) {
- if ($fp === true) echo $s;
- else fwrite($fp,$s);
- $s = '';
- }
-
- return $s;
-}
-?>
\ No newline at end of file
diff --git a/src/adodb512/tohtml.inc.php b/src/adodb512/tohtml.inc.php
deleted file mode 100644
index 76245661..00000000
--- a/src/adodb512/tohtml.inc.php
+++ /dev/null
@@ -1,201 +0,0 @@
-
-*/
-
-// specific code for tohtml
-GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
-
-$ADODB_ROUND=4; // rounding
-$gSQLMaxRows = 1000; // max no of rows to download
-$gSQLBlockRows=20; // max no of rows per table block
-
-// RecordSet to HTML Table
-//------------------------------------------------------------
-// Convert a recordset to a html table. Multiple tables are generated
-// if the number of rows is > $gSQLBlockRows. This is because
-// web browsers normally require the whole table to be downloaded
-// before it can be rendered, so we break the output into several
-// smaller faster rendering tables.
-//
-// $rs: the recordset
-// $ztabhtml: the table tag attributes (optional)
-// $zheaderarray: contains the replacement strings for the headers (optional)
-//
-// USAGE:
-// include('adodb.inc.php');
-// $db = ADONewConnection('mysql');
-// $db->Connect('mysql','userid','password','database');
-// $rs = $db->Execute('select col1,col2,col3 from table');
-// rs2html($rs, 'BORDER=2', array('Title1', 'Title2', 'Title3'));
-// $rs->Close();
-//
-// RETURNS: number of rows displayed
-
-
-function rs2html(&$rs,$ztabhtml=false,$zheaderarray=false,$htmlspecialchars=true,$echo = true)
-{
-$s ='';$rows=0;$docnt = false;
-GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
-
- if (!$rs) {
- printf(ADODB_BAD_RS,'rs2html');
- return false;
- }
-
- if (! $ztabhtml) $ztabhtml = "BORDER='1' WIDTH='98%'";
- //else $docnt = true;
- $typearr = array();
- $ncols = $rs->FieldCount();
- $hdr = "\n\n";
- for ($i=0; $i < $ncols; $i++) {
- $field = $rs->FetchField($i);
- if ($field) {
- if ($zheaderarray) $fname = $zheaderarray[$i];
- else $fname = htmlspecialchars($field->name);
- $typearr[$i] = $rs->MetaType($field->type,$field->max_length);
- //print " $field->name $field->type $typearr[$i] ";
- } else {
- $fname = 'Field '.($i+1);
- $typearr[$i] = 'C';
- }
- if (strlen($fname)==0) $fname = ' ';
- $hdr .= "$fname ";
- }
- $hdr .= "\n ";
- if ($echo) print $hdr."\n\n";
- else $html = $hdr;
-
- // smart algorithm - handles ADODB_FETCH_MODE's correctly by probing...
- $numoffset = isset($rs->fields[0]) ||isset($rs->fields[1]) || isset($rs->fields[2]);
- while (!$rs->EOF) {
-
- $s .= "\n";
-
- for ($i=0; $i < $ncols; $i++) {
- if ($i===0) $v=($numoffset) ? $rs->fields[0] : reset($rs->fields);
- else $v = ($numoffset) ? $rs->fields[$i] : next($rs->fields);
-
- $type = $typearr[$i];
- switch($type) {
- case 'D':
- if (strpos($v,':') !== false);
- else {
- if (empty($v)) {
- $s .= " \n";
- } else {
- $s .= " ".$rs->UserDate($v,"D d, M Y") ." \n";
- }
- break;
- }
- case 'T':
- if (empty($v)) $s .= " \n";
- else $s .= " ".$rs->UserTimeStamp($v,"D d, M Y, H:i:s") ." \n";
- break;
-
- case 'N':
- if (abs(abs($v) - round($v,0)) < 0.00000001)
- $v = round($v);
- else
- $v = round($v,$ADODB_ROUND);
- case 'I':
- $vv = stripslashes((trim($v)));
- if (strlen($vv) == 0) $vv .= ' ';
- $s .= " ".$vv ." \n";
-
- break;
- /*
- case 'B':
- if (substr($v,8,2)=="BM" ) $v = substr($v,8);
- $mtime = substr(str_replace(' ','_',microtime()),2);
- $tmpname = "tmp/".uniqid($mtime).getmypid();
- $fd = @fopen($tmpname,'a');
- @ftruncate($fd,0);
- @fwrite($fd,$v);
- @fclose($fd);
- if (!function_exists ("mime_content_type")) {
- function mime_content_type ($file) {
- return exec("file -bi ".escapeshellarg($file));
- }
- }
- $t = mime_content_type($tmpname);
- $s .= (substr($t,0,5)=="image") ? " 
\\n" : " $t \\n";
- break;
- */
-
- default:
- if ($htmlspecialchars) $v = htmlspecialchars(trim($v));
- $v = trim($v);
- if (strlen($v) == 0) $v = ' ';
- $s .= " ". str_replace("\n",'
',stripslashes($v)) ." \n";
-
- }
- } // for
- $s .= " \n\n";
-
- $rows += 1;
- if ($rows >= $gSQLMaxRows) {
- $rows = "Truncated at $gSQLMaxRows
";
- break;
- } // switch
-
- $rs->MoveNext();
-
- // additional EOF check to prevent a widow header
- if (!$rs->EOF && $rows % $gSQLBlockRows == 0) {
-
- //if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP
- if ($echo) print $s . "
\n\n";
- else $html .= $s ."\n\n";
- $s = $hdr;
- }
- } // while
-
- if ($echo) print $s."\n\n";
- else $html .= $s."\n\n";
-
- if ($docnt) if ($echo) print "".$rows." Rows
";
-
- return ($echo) ? $rows : $html;
- }
-
-// pass in 2 dimensional array
-function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
-{
- if (!$ztabhtml) $ztabhtml = 'BORDER=1';
-
- $s = "";//';print_r($arr);
-
- if ($zheaderarray) {
- $s .= '';
- for ($i=0; $i\n";
- } else $s .= " \n";
- $s .= "\n \n";
- }
- $s .= '
';
- print $s;
-}
-
-?>
\ No newline at end of file
diff --git a/src/adodb512/xmlschema.dtd b/src/adodb512/xmlschema.dtd
deleted file mode 100644
index 4a055da4..00000000
--- a/src/adodb512/xmlschema.dtd
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-] >
\ No newline at end of file
diff --git a/src/adodb512/xmlschema03.dtd b/src/adodb512/xmlschema03.dtd
deleted file mode 100644
index 97850bc7..00000000
--- a/src/adodb512/xmlschema03.dtd
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
\ No newline at end of file
diff --git a/src/adodb512/xsl/convert-0.1-0.2.xsl b/src/adodb512/xsl/convert-0.1-0.2.xsl
deleted file mode 100644
index 6cd9e5bf..00000000
--- a/src/adodb512/xsl/convert-0.1-0.2.xsl
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/xsl/convert-0.1-0.3.xsl b/src/adodb512/xsl/convert-0.1-0.3.xsl
deleted file mode 100644
index 381aa4fe..00000000
--- a/src/adodb512/xsl/convert-0.1-0.3.xsl
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/xsl/convert-0.2-0.1.xsl b/src/adodb512/xsl/convert-0.2-0.1.xsl
deleted file mode 100644
index 61841b48..00000000
--- a/src/adodb512/xsl/convert-0.2-0.1.xsl
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/xsl/convert-0.2-0.3.xsl b/src/adodb512/xsl/convert-0.2-0.3.xsl
deleted file mode 100644
index 26bd9e9a..00000000
--- a/src/adodb512/xsl/convert-0.2-0.3.xsl
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/xsl/remove-0.2.xsl b/src/adodb512/xsl/remove-0.2.xsl
deleted file mode 100644
index 9b10a528..00000000
--- a/src/adodb512/xsl/remove-0.2.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
-Uninstallation Schema
-
-
-
- 0.2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/adodb512/xsl/remove-0.3.xsl b/src/adodb512/xsl/remove-0.3.xsl
deleted file mode 100644
index 768e092b..00000000
--- a/src/adodb512/xsl/remove-0.3.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-
-
-
-Uninstallation Schema
-
-
-
- 0.3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/api/AdapterBase.js b/src/api/AdapterBase.js
deleted file mode 100644
index f50fe51f..00000000
--- a/src/api/AdapterBase.js
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*
-This file is part of Ice Framework.
-
-Ice Framework is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Ice Framework is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Ice Framework. If not, see .
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-
-function AdapterBase(endPoint) {
-
-}
-
-this.moduleRelativeURL = null;
-this.tableData = new Array();
-this.sourceData = new Array();
-this.filter = null;
-this.origFilter = null;
-this.orderBy = null;
-this.currentElement = null;
-
-AdapterBase.inherits(IceHRMBase);
-
-AdapterBase.method('initAdapter' , function(endPoint,tab,filter,orderBy) {
- this.moduleRelativeURL = baseUrl;
- this.table = endPoint;
- if(tab == undefined || tab == null){
- this.tab = endPoint;
- }else{
- this.tab = tab;
- }
-
- if(filter == undefined || filter == null){
- this.filter = null;
- }else{
- this.filter = filter;
- }
-
- this.origFilter = this.filter;
-
- if(orderBy == undefined || orderBy == null){
- this.orderBy = null;
- }else{
- this.orderBy = orderBy;
- }
-
- this.trackEvent("initAdapter",tab);
-
- this.requestCache = new RequestCache();
-
-});
-
-AdapterBase.method('setFilter', function(filter) {
- this.filter = filter;
-});
-
-AdapterBase.method('getFilter', function() {
- return this.filter;
-});
-
-AdapterBase.method('setOrderBy', function(orderBy) {
- this.orderBy = orderBy;
-});
-
-AdapterBase.method('getOrderBy', function() {
- return this.orderBy;
-});
-
-/**
- * @method add
- * @param object {Array} object data to be added to database
- * @param getFunctionCallBackData {Array} once a success is returned call get() function for this module with these parameters
- * @param callGetFunction {Boolean} if false the get function of the module will not be called (default: true)
- * @param successCallback {Function} this will get called after success response
- */
-
-AdapterBase.method('add', function(object,getFunctionCallBackData,callGetFunction,successCallback) {
- var that = this;
- if(callGetFunction == undefined || callGetFunction == null){
- callGetFunction = true;
- }
- $(object).attr('a','add');
- $(object).attr('t',this.table);
- that.showLoader();
- $.post(this.moduleRelativeURL, object, function(data) {
- if(data.status == "SUCCESS"){
- that.addSuccessCallBack(getFunctionCallBackData,data.object, callGetFunction, successCallback, that);
- }else{
- that.addFailCallBack(getFunctionCallBackData,data.object);
- }
- },"json").always(function() {that.hideLoader()});
- this.trackEvent("add",this.tab,this.table);
-});
-
-AdapterBase.method('addSuccessCallBack', function(callBackData,serverData, callGetFunction, successCallback, thisObject) {
- if(callGetFunction){
- this.get(callBackData);
- }
- this.initFieldMasterData();
- if(successCallback != undefined && successCallback != null){
- successCallback.apply(thisObject,[serverData]);
- }
- this.trackEvent("addSuccess",this.tab,this.table);
-});
-
-AdapterBase.method('addFailCallBack', function(callBackData,serverData) {
- try{
- this.closePlainMessage();
- }catch(e){}
- this.showMessage("Error saving",serverData);
- this.trackEvent("addFailed",this.tab,this.table);
-});
-
-AdapterBase.method('deleteObj', function(id,callBackData) {
- var that = this;
- that.showLoader();
- $.post(this.moduleRelativeURL, {'t':this.table,'a':'delete','id':id}, function(data) {
- if(data.status == "SUCCESS"){
- that.deleteSuccessCallBack(callBackData,data.object);
- }else{
- that.deleteFailCallBack(callBackData,data.object);
- }
- },"json").always(function() {that.hideLoader()});
- this.trackEvent("delete",this.tab,this.table);
-});
-
-AdapterBase.method('deleteSuccessCallBack', function(callBackData,serverData) {
- this.get(callBackData);
- this.clearDeleteParams();
-});
-
-AdapterBase.method('deleteFailCallBack', function(callBackData,serverData) {
- this.clearDeleteParams();
- this.showMessage("Error Occurred while Deleting Item",serverData);
-});
-
-AdapterBase.method('get', function(callBackData) {
- var that = this;
-
- if(this.getRemoteTable()){
- this.createTableServer(this.getTableName());
- $("#"+this.getTableName()+'Form').hide();
- $("#"+this.getTableName()).show();
- return;
- }
-
- var sourceMappingJson = JSON.stringify(this.getSourceMapping());
-
- var filterJson = "";
- if(this.getFilter() != null){
- filterJson = JSON.stringify(this.getFilter());
- }
-
- var orderBy = "";
- if(this.getOrderBy() != null){
- orderBy = this.getOrderBy();
- }
-
- sourceMappingJson = this.fixJSON(sourceMappingJson);
- filterJson = this.fixJSON(filterJson);
-
- that.showLoader();
- $.post(this.moduleRelativeURL, {'t':this.table,'a':'get','sm':sourceMappingJson,'ft':filterJson,'ob':orderBy}, function(data) {
- if(data.status == "SUCCESS"){
- that.getSuccessCallBack(callBackData,data.object);
- }else{
- that.getFailCallBack(callBackData,data.object);
- }
- },"json").always(function() {that.hideLoader()});
-
- that.initFieldMasterData();
-
- this.trackEvent("get",this.tab,this.table);
- //var url = this.getDataUrl();
- //console.log(url);
-});
-
-
-AdapterBase.method('getDataUrl', function(columns) {
- var that = this;
- var sourceMappingJson = JSON.stringify(this.getSourceMapping());
-
- var columns = JSON.stringify(columns);
-
- var filterJson = "";
- if(this.getFilter() != null){
- filterJson = JSON.stringify(this.getFilter());
- }
-
- var orderBy = "";
- if(this.getOrderBy() != null){
- orderBy = this.getOrderBy();
- }
-
- var url = this.moduleRelativeURL.replace("service.php","data.php");
- url = url+"?"+"t="+this.table;
- url = url+"&"+"sm="+this.fixJSON(sourceMappingJson);
- url = url+"&"+"cl="+this.fixJSON(columns);
- url = url+"&"+"ft="+this.fixJSON(filterJson);
- url = url+"&"+"ob="+orderBy;
-
- if(this.isSubProfileTable()){
- url = url+"&"+"type=sub";
- }
-
- if(this.remoteTableSkipProfileRestriction()){
- url = url+"&"+"skip=1";
- }
-
- return url;
-});
-
-AdapterBase.method('isSubProfileTable', function() {
- return false;
-});
-
-AdapterBase.method('remoteTableSkipProfileRestriction', function() {
- return false;
-});
-
-AdapterBase.method('preProcessTableData', function(row) {
- return row;
-});
-
-AdapterBase.method('getSuccessCallBack', function(callBackData,serverData) {
- var data = [];
- var mapping = this.getDataMapping();
- for(var i=0;i';
- var editButton = '';
-
- var table = $('');
-
- //add Header
- var header = this.getSubHeader();
- table.append(header);
- if(data.length == 0){
- table.append(''+this.getNoDataMessage()+'');
- }else{
- for(var i=0;i'+this.getSubHeaderTitle()+'
');
- return header;
-});
-
-
-
-/**
- * IdNameAdapter
- */
-
-function IdNameAdapter(endPoint) {
- this.initAdapter(endPoint);
-}
-
-IdNameAdapter.inherits(AdapterBase);
-
-
-
-IdNameAdapter.method('getDataMapping', function() {
- return [
- "id",
- "name"
- ];
-});
-
-IdNameAdapter.method('getHeaders', function() {
- return [
- { "sTitle": "ID" ,"bVisible":false},
- { "sTitle": "Name"}
- ];
-});
-
-IdNameAdapter.method('getFormFields', function() {
- return [
- [ "id", {"label":"ID","type":"hidden"}],
- [ "name", {"label":"Name","type":"text","validation":""}]
- ];
-});
-
-
-/**
- * LogViewAdapter
- */
-
-function LogViewAdapter(endPoint,tab,filter,orderBy){
- this.initAdapter(endPoint,tab,filter,orderBy);
-}
-
-LogViewAdapter.inherits(AdapterBase);
-
-LogViewAdapter.method('getLogs', function(id) {
- var that = this;
- var object = {"id":id};
- var reqJson = JSON.stringify(object);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'getLogsSuccessCallBack';
- callBackData['callBackFail'] = 'getLogsFailCallBack';
-
- this.customAction('getLogs','admin='+this.modulePathName,reqJson,callBackData);
-});
-
-LogViewAdapter.method('getLogsSuccessCallBack', function(callBackData) {
-
- var tableLog = 'Notes _days_
';
- var rowLog = '_date_ _status_
_note_ ';
-
- var logs = callBackData.data;
- var html = "";
- var rowsLogs = "";
-
-
- for(var i=0;i "+logs[i].status_to);
- trow = trow.replace(/_note_/g,logs[i].note);
- rowsLogs += trow;
- }
-
- if(rowsLogs != ""){
- tableLog = tableLog.replace('_days_',rowsLogs);
- html+= tableLog;
- }
-
- this.showMessage("Logs",html);
-
- timeUtils.convertToRelativeTime($(".logTime"));
-});
-
-LogViewAdapter.method('getLogsFailCallBack', function(callBackData) {
- this.showMessage("Error","Error occured while getting data");
-});
-
-/**
- * ApproveAdminAdapter
- */
-
-function ApproveAdminAdapter(endPoint,tab,filter,orderBy) {
- this.initAdapter(endPoint,tab,filter,orderBy);
-}
-
-ApproveAdminAdapter.inherits(LogViewAdapter);
-
-ApproveAdminAdapter.method('getStatusFieldPosition', function() {
- var dm = this.getDataMapping();
- return dm.length - 1;
-});
-
-ApproveAdminAdapter.method('openStatus', function(id,status) {
- $('#'+this.itemNameLower+'StatusModel').modal('show');
- $('#'+this.itemNameLower+'_status').html(this.getStatusOptions(status));
- $('#'+this.itemNameLower+'_status').val(status);
- this.statusChangeId = id;
-});
-
-ApproveAdminAdapter.method('closeDialog', function() {
- $('#'+this.itemNameLower+'StatusModel').modal('hide');
-});
-
-ApproveAdminAdapter.method('changeStatus', function() {
- var status = $('#'+this.itemNameLower+'_status').val();
- var reason = $('#'+this.itemNameLower+'_reason').val();
-
- if(status == undefined || status == null || status == ""){
- this.showMessage("Error", "Please select "+this.itemNameLower+" status");
- return;
- }
-
- var object = {"id":this.statusChangeId,"status":status,"reason":reason};
-
- var reqJson = JSON.stringify(object);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'changeStatusSuccessCallBack';
- callBackData['callBackFail'] = 'changeStatusFailCallBack';
-
- this.customAction('changeStatus','admin='+this.modulePathName,reqJson,callBackData);
-
- this.closeDialog();
- this.statusChangeId = null;
-});
-
-ApproveAdminAdapter.method('changeStatusSuccessCallBack', function(callBackData) {
- this.showMessage("Successful", this.itemName + " Request status changed successfully");
- this.get([]);
-});
-
-ApproveAdminAdapter.method('changeStatusFailCallBack', function(callBackData) {
- this.showMessage("Error", "Error occurred while changing "+this.itemName+" request status");
-});
-
-
-
-ApproveAdminAdapter.method('getActionButtonsHtml', function(id,data) {
- var editButton = '
';
- var deleteButton = '
';
- var statusChangeButton = '
';
- var viewLogsButton = '
';
-
- var html = '_edit__delete__status__logs_';
-
- var optiondata = this.getStatusOptionsData(data[this.getStatusFieldPosition()]);
- if(Object.keys(optiondata).length > 0){
- html = html.replace('_status_',statusChangeButton);
- }else{
- html = html.replace('_status_','');
- }
-
- html = html.replace('_logs_',viewLogsButton);
-
- if(this.showDelete){
- html = html.replace('_delete_',deleteButton);
-
- }else{
- html = html.replace('_delete_','');
- }
-
- if(this.showEdit){
- html = html.replace('_edit_',editButton);
- }else{
- html = html.replace('_edit_','');
- }
-
- html = html.replace(/_id_/g,id);
- html = html.replace(/_BASE_/g,this.baseUrl);
- html = html.replace(/_cstatus_/g,data[this.getStatusFieldPosition()]);
- return html;
-});
-
-ApproveAdminAdapter.method('isSubProfileTable', function() {
- if(this.user.user_level == "Admin"){
- return false;
- }else{
- return true;
- }
-});
-
-ApproveAdminAdapter.method('getStatusOptionsData', function(currentStatus) {
- var data = {};
- if(currentStatus == 'Approved'){
-
- }else if(currentStatus == 'Pending'){
- data["Approved"] = "Approved";
- data["Rejected"] = "Rejected";
-
- }else if(currentStatus == 'Rejected'){
-
- }else if(currentStatus == 'Cancelled'){
-
- }else if(currentStatus == 'Processing'){
-
- }else{
- data["Cancellation Requested"] = "Cancellation Requested";
- data["Cancelled"] = "Cancelled";
- }
-
- return data;
-});
-
-ApproveAdminAdapter.method('getStatusOptions', function(currentStatus) {
-
- return this.generateOptions(this.getStatusOptionsData(currentStatus));
-});
-
-
-/**
- * ApproveModuleAdapter
- */
-
-function ApproveModuleAdapter(endPoint,tab,filter,orderBy) {
- this.initAdapter(endPoint,tab,filter,orderBy);
-}
-
-ApproveModuleAdapter.inherits(LogViewAdapter);
-
-ApproveModuleAdapter.method('cancelRequest', function(id) {
- var that = this;
- var object = {};
- object['id'] = id;
-
- var reqJson = JSON.stringify(object);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'cancelSuccessCallBack';
- callBackData['callBackFail'] = 'cancelFailCallBack';
-
- this.customAction('cancel','modules='+this.modulePathName,reqJson,callBackData);
-});
-
-ApproveModuleAdapter.method('cancelSuccessCallBack', function(callBackData) {
- this.showMessage("Successful", this.itemName + " cancellation request sent");
- this.get([]);
-});
-
-ApproveModuleAdapter.method('cancelFailCallBack', function(callBackData) {
- this.showMessage("Error Occurred while cancelling "+this.itemName, callBackData);
-});
-
-ApproveModuleAdapter.method('getActionButtonsHtml', function(id,data) {
- var editButton = '
';
- var deleteButton = '
';
- var requestCancellationButton = '
';
- var viewLogsButton = '
';
-
-
- var html = '_edit__logs__delete_';
-
- html = html.replace('_logs_',viewLogsButton);
-
- if(this.showDelete){
- if(data[7] == "Approved"){
- html = html.replace('_delete_',requestCancellationButton);
- }else{
- html = html.replace('_delete_',deleteButton);
- }
-
- }else{
- html = html.replace('_delete_','');
- }
-
- if(this.showEdit){
- html = html.replace('_edit_',editButton);
- }else{
- html = html.replace('_edit_','');
- }
-
- html = html.replace(/_id_/g,id);
- html = html.replace(/_BASE_/g,this.baseUrl);
- return html;
-});
-
-/**
- * ApproveApproverAdapter
- */
-
-function ApproveApproverAdapter() {
-}
-
-ApproveApproverAdapter.method('getActionButtonsHtml', function(id,data) {
- var statusChangeButton = '
';
- var viewLogsButton = '
';
-
- var html = '_status__logs_';
-
-
- html = html.replace('_logs_',viewLogsButton);
-
-
- if(data[this.getStatusFieldPosition()] == 'Processing'){
- html = html.replace('_status_',statusChangeButton);
-
- }else{
- html = html.replace('_status_','');
- }
-
- html = html.replace(/_id_/g,id);
- html = html.replace(/_BASE_/g,this.baseUrl);
- html = html.replace(/_cstatus_/g,data[this.getStatusFieldPosition()]);
- return html;
-});
-
-ApproveApproverAdapter.method('getStatusOptionsData', function(currentStatus) {
- var data = {};
- if(currentStatus != 'Processing'){
-
- }else{
- data["Approved"] = "Approved";
- data["Rejected"] = "Rejected";
-
- }
-
- return data;
-});
-
-ApproveApproverAdapter.method('getStatusOptions', function(currentStatus) {
- return this.generateOptions(this.getStatusOptionsData(currentStatus));
-});
-
-
-
-
-/**
- * TableEditAdapter
- */
-
-function TableEditAdapter(endPoint) {
- this.initAdapter(endPoint);
- this.cellDataUpdates = {};
- this.modulePath = '';
- this.rowFieldName = '';
- this.columnFieldName = '';
- this.rowTable = '';
- this.columnTable = '';
- this.valueTable = '';
- this.csvData = [];
-}
-
-TableEditAdapter.inherits(AdapterBase);
-
-TableEditAdapter.method('setModulePath', function(path) {
- this.modulePath = path;
-});
-
-TableEditAdapter.method('setRowFieldName', function(name) {
- this.rowFieldName = name;
-});
-
-TableEditAdapter.method('setTables', function(rowTable, columnTable, valueTable) {
- this.rowTable = rowTable;
- this.columnTable = columnTable;
- this.valueTable = valueTable;
-});
-
-TableEditAdapter.method('setColumnFieldName', function(name) {
- this.columnFieldName = name;
-});
-
-TableEditAdapter.method('getDataMapping', function() {
- return [
- ];
-});
-
-
-TableEditAdapter.method('getFormFields', function() {
- return [
- ];
-});
-
-TableEditAdapter.method('get', function() {
- this.getAllData();
-});
-
-TableEditAdapter.method('getAllData', function(save) {
- var req = {};
- req.rowTable = this.rowTable;
- req.columnTable = this.columnTable;
- req.valueTable = this.valueTable;
- req = this.addAdditionalRequestData('getAllData', req);
- req.save = (save == undefined || save == null || save == false)?0:1;
- var reqJson = JSON.stringify(req);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'getAllDataSuccessCallBack';
- callBackData['callBackFail'] = 'getAllDataFailCallBack';
-
- this.customAction('getAllData',this.modulePath,reqJson,callBackData);
-});
-
-TableEditAdapter.method('getDataItem', function(row,column,allData) {
- var columnData = allData[1];
- var rowData = allData[0];
- var serverData = allData[2];
-
- if(column == -1){
- return rowData[row].name;
- }else{
- return this.getDataItemByKeyValues(this.rowFieldName, rowData[row].id, this.columnFieldName, columnData[column].id, serverData);
- }
-});
-
-TableEditAdapter.method('getDataItemByKeyValues', function(rowKeyName, rowKeyVal, colKeyName, colKeyVal, data) {
- for(var i=0;i
';
-
- //Find current page
- var activePage = $('#'+elementId +" .dataTables_paginate .active a").html();
- var start = 0;
- if(activePage != undefined && activePage != null){
- start = parseInt(activePage, 10)*15 - 15;
- }
-
- $('#'+elementId).html(html);
-
- var dataTableParams = {
- "oLanguage": {
- "sLengthMenu": "_MENU_ records per page"
- },
- "aaData": data,
- "aoColumns": headers,
- "bSort": false,
- "iDisplayLength": 15,
- "iDisplayStart": start
- };
-
-
- var customTableParams = this.getCustomTableParams();
-
- $.extend(dataTableParams, customTableParams);
-
- $('#'+elementId+' #grid').dataTable( dataTableParams );
-
- $(".dataTables_paginate ul").addClass("pagination");
- $(".dataTables_length").hide();
- $(".dataTables_filter input").addClass("form-control");
- $(".dataTables_filter input").attr("placeholder","Search");
- $(".dataTables_filter label").contents().filter(function(){
- return (this.nodeType == 3);
- }).remove();
- //$('.tableActionButton').tooltip();
- $('#'+elementId+' #grid').editableTableWidget();
-
- $('#'+elementId+' #grid .editcell').on('validate', function(evt, newValue) {
-
- return modJs.validateCellValue($(this), evt, newValue);
-
- });
-});
-
-TableEditAdapter.method('addCellDataUpdate' , function(colId, rowId, data) {
-
- this.cellDataUpdates[colId+"="+rowId] = [colId, rowId, data];
-});
-
-TableEditAdapter.method('addAdditionalRequestData' , function(type, req) {
- return req;
-});
-
-TableEditAdapter.method('sendCellDataUpdates' , function() {
- var req = this.cellDataUpdates;
- req.rowTable = this.rowTable;
- req.columnTable = this.columnTable;
- req.valueTable = this.valueTable;
- req = this.addAdditionalRequestData('updateData', req);
- var reqJson = JSON.stringify(req);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'updateDataSuccessCallBack';
- callBackData['callBackFail'] = 'updateDataFailCallBack';
- this.showLoader();
- this.customAction('updateData',this.modulePath,reqJson,callBackData);
-});
-
-TableEditAdapter.method('updateDataSuccessCallBack', function(callBackData,serverData) {
- this.hideLoader();
- modJs.cellDataUpdates = {};
- modJs.get();
-});
-
-TableEditAdapter.method('updateDataFailCallBack', function(callBackData,serverData) {
- this.hideLoader();
-});
-
-TableEditAdapter.method('sendAllCellDataUpdates' , function() {
-
- var req = this.cellDataUpdates;
- req.rowTable = this.rowTable;
- req.columnTable = this.columnTable;
- req.valueTable = this.valueTable;
- req = this.addAdditionalRequestData('updateAllData', req);
- var reqJson = JSON.stringify(req);
-
- var callBackData = [];
- callBackData['callBackData'] = [];
- callBackData['callBackSuccess'] = 'updateDataAllSuccessCallBack';
- callBackData['callBackFail'] = 'updateDataAllFailCallBack';
- this.showLoader();
- this.customAction('updateAllData',this.modulePath,reqJson,callBackData);
-});
-
-TableEditAdapter.method('updateDataAllSuccessCallBack', function(callBackData,serverData) {
- this.hideLoader();
- modJs.cellDataUpdates = {};
- modJs.getAllData(true);
-});
-
-TableEditAdapter.method('updateDataAllFailCallBack', function(callBackData,serverData) {
- this.hideLoader();
-});
-
-TableEditAdapter.method('showActionButtons' , function() {
- return false;
-});
-
-
-
-
-
-
-
-/**
- * RequestCache
- */
-
-function RequestCache() {
-
-}
-
-RequestCache.method('getKey', function(url,params) {
- var key = url+"|";
- for(index in params){
- key += index+"="+params[index]+"|";
- }
- return key;
-});
-
-RequestCache.method('getData', function(key) {
- var data;
- if (typeof(Storage) == "undefined") {
- return null;
- }
-
- var strData = localStorage.getItem(key);
- if(strData != undefined && strData != null && strData != ""){
- data = JSON.parse(strData);
- if(data == undefined || data == null){
- return null;
- }
-
- if(data.status != undefined && data.status != null && data.status != "SUCCESS"){
- return null;
- }
-
- return data;
- }
-
- return null;
-});
-
-RequestCache.method('setData', function(key, data) {
-
- if (typeof(Storage) == "undefined") {
- return null;
- }
-
- if(data.status != undefined && data.status != null && data.status != "SUCCESS"){
- return null;
- }
-
- var strData = JSON.stringify(data);
- var strData = localStorage.setItem(key,strData);
- return strData;
-});
diff --git a/src/api/AesCrypt.js b/src/api/AesCrypt.js
deleted file mode 100644
index d5204009..00000000
--- a/src/api/AesCrypt.js
+++ /dev/null
@@ -1,503 +0,0 @@
-/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/* AES implementation in JavaScript (c) Chris Veness 2005-2014 / MIT Licence */
-/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-/* jshint node:true *//* global define */
-'use strict';
-
-
-/**
- * AES (Rijndael cipher) encryption routines,
- *
- * Reference implementation of FIPS-197 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf.
- *
- * @namespace
- */
-var Aes = {};
-
-
-/**
- * AES Cipher function: encrypt 'input' state with Rijndael algorithm [§5.1];
- * applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage.
- *
- * @param {number[]} input - 16-byte (128-bit) input state array.
- * @param {number[][]} w - Key schedule as 2D byte-array (Nr+1 x Nb bytes).
- * @returns {number[]} Encrypted output state array.
- */
-Aes.cipher = function(input, w) {
- var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
- var Nr = w.length/Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys
-
- var state = [[],[],[],[]]; // initialise 4xNb byte-array 'state' with input [§3.4]
- for (var i=0; i<4*Nb; i++) state[i%4][Math.floor(i/4)] = input[i];
-
- state = Aes.addRoundKey(state, w, 0, Nb);
-
- for (var round=1; round 6 && i%Nk == 4) {
- temp = Aes.subWord(temp);
- }
- // xor w[i] with w[i-1] and w[i-Nk]
- for (var t=0; t<4; t++) w[i][t] = w[i-Nk][t] ^ temp[t];
- }
-
- return w;
-};
-
-
-/**
- * Apply SBox to state S [§5.1.1]
- * @private
- */
-Aes.subBytes = function(s, Nb) {
- for (var r=0; r<4; r++) {
- for (var c=0; c>> i*8) & 0xff;
- for (var i=0; i<2; i++) counterBlock[i+2] = (nonceRnd >>> i*8) & 0xff;
- for (var i=0; i<4; i++) counterBlock[i+4] = (nonceSec >>> i*8) & 0xff;
-
- // and convert it to a string to go on the front of the ciphertext
- var ctrTxt = '';
- for (var i=0; i<8; i++) ctrTxt += String.fromCharCode(counterBlock[i]);
-
- // generate key schedule - an expansion of the key into distinct Key Rounds for each round
- var keySchedule = Aes.keyExpansion(key);
-
- var blockCount = Math.ceil(plaintext.length/blockSize);
- var ciphertxt = new Array(blockCount); // ciphertext as array of strings
-
- for (var b=0; b>> c*8) & 0xff;
- for (var c=0; c<4; c++) counterBlock[15-c-4] = (b/0x100000000 >>> c*8);
-
- var cipherCntr = Aes.cipher(counterBlock, keySchedule); // -- encrypt counter block --
-
- // block size is reduced on final block
- var blockLength = b>> c*8) & 0xff;
- for (var c=0; c<4; c++) counterBlock[15-c-4] = (((b+1)/0x100000000-1) >>> c*8) & 0xff;
-
- var cipherCntr = Aes.cipher(counterBlock, keySchedule); // encrypt counter block
-
- var plaintxtByte = new Array(ciphertext[b].length);
- for (var i=0; i .
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-
-
-/**
- * The base class for providing core functions to all module classes.
- * @class Base.js
- */
-function IceHRMBase() {
- this.deleteParams = {};
- this.createRemoteTable = false;
- this.instanceId = "None";
- this.ga = [];
- this.showEdit = true;
- this.showDelete = true;
- this.showSave = true;
- this.showCancel = true;
- this.showFormOnPopup = false;
- this.filtersAlreadySet = false;
- this.currentFilterString = "";
- this.sorting = 0;
- this.settings = {};
- this.translations = {};
-}
-
-this.fieldTemplates = null;
-this.templates = null;
-this.customTemplates = null;
-this.emailTemplates = null;
-this.fieldMasterData = null;
-this.fieldMasterDataKeys = null;
-this.fieldMasterDataCallback = null;
-this.sourceMapping = null;
-this.currentId = null;
-this.currentElement = null;
-this.user = null;
-this.currentProfile = null;
-this.permissions = {};
-
-
-
-this.baseUrl = null;
-
-IceHRMBase.method('init' , function(appName, currentView, dataUrl, permissions) {
-
-});
-
-/**
- * Some browsers do not support sending JSON in get parameters. Set this to true to avoid sending JSON
- * @method setNoJSONRequests
- * @param val {Boolean}
- */
-IceHRMBase.method('setNoJSONRequests' , function(val) {
- this.noJSONRequests = val;
-});
-
-
-IceHRMBase.method('setPermissions' , function(permissions) {
- this.permissions = permissions;
-});
-
-IceHRMBase.method('sortingStarted' , function(val) {
- this.sorting = val;
-});
-
-/**
- * Check if the current user has a permission
- * @method checkPermission
- * @param permission {String}
- * @example
- * this.checkPermission("Upload/Delete Profile Image")
- */
-IceHRMBase.method('checkPermission' , function(permission) {
- if(this.permissions[permission] == undefined || this.permissions[permission] == null || this.permissions[permission] == "Yes"){
- return "Yes";
- }else{
- return this.permissions[permission];
- }
-});
-
-IceHRMBase.method('setBaseUrl' , function(url) {
- this.baseUrl = url;
-});
-
-IceHRMBase.method('setUser' , function(user) {
- this.user = user;
-});
-
-IceHRMBase.method('getUser' , function() {
- return this.user;
-});
-
-IceHRMBase.method('setInstanceId' , function(id) {
- this.instanceId = id;
-});
-
-IceHRMBase.method('setGoogleAnalytics' , function(ga) {
- this.ga = ga;
-});
-
-IceHRMBase.method('scrollToTop' , function() {
- $("html, body").animate({ scrollTop: 0 }, "fast");
-});
-
-
-IceHRMBase.method('setTranslations' , function(txt) {
- this.translations = txt['messages'][''];
-});
-
-IceHRMBase.method('gt' , function(key) {
- if(this.translations[key] == undefined){
- return key;
- }
- return this.translations[key][0];
-});
-
-IceHRMBase.method('addToLangTerms' , function(key) {
- var termsArr;
- var terms = localStorage.getItem("terms");
- if(terms == undefined){
- termsArr = {};
- }else{
- try{
- termsArr = JSON.parse(terms);
- }catch(e){
- termsArr = {};
- }
-
- }
-
- if(this.translations[key] == undefined){
- termsArr[key] = key;
- localStorage.setItem("terms", JSON.stringify(termsArr));
- }
-});
-
-/**
- * If this method returned false the action buttons in data table for modules will not be displayed.
- * Override this method in module lib.js to hide action buttons
- * @method showActionButtons
- * @param permission {String}
- * @example
- * EmployeeLeaveEntitlementAdapter.method('showActionButtons' , function() {
- * return false;
- * });
- */
-IceHRMBase.method('showActionButtons' , function() {
- return true;
-});
-
-IceHRMBase.method('trackEvent' , function(action, label, value) {
- try{
- if(label == undefined || label == null){
- this.ga.push(['_trackEvent', this.instanceId, action]);
- }else if(value == undefined || value == null){
- this.ga.push(['_trackEvent', this.instanceId, action, label]);
- }else{
- this.ga.push(['_trackEvent', this.instanceId, action, label, value]);
- }
- }catch(e){
-
- }
-
-
-});
-
-
-IceHRMBase.method('setCurrentProfile' , function(currentProfile) {
- this.currentProfile = currentProfile;
-});
-
-/**
- * Get the current profile
- * @method getCurrentProfile
- * @returns Profile of the current user if the profile is not switched if not switched profile
- */
-
-IceHRMBase.method('getCurrentProfile' , function() {
- return this.currentProfile;
-});
-
-/**
- * Retrive data required to create select boxes for add new /edit forms for a given module. This is called when loading the module
- * @method initFieldMasterData
- * @param callback {Function} call this once loading completed
- * @param callback {Function} call this once all field loading completed. This indicate that the form can be displayed saftly
- * @example
- * ReportAdapter.method('renderForm', function(object) {
- * var that = this;
- * this.processFormFieldsWithObject(object);
- * var cb = function(){
- * that.uber('renderForm',object);
- * };
- * this.initFieldMasterData(cb);
- * });
- */
-IceHRMBase.method('initFieldMasterData' , function(callback, loadAllCallback, loadAllCallbackData) {
- var values;
- if(this.showAddNew == undefined || this.showAddNew == null){
- this.showAddNew = true;
- }
- this.fieldMasterData = {};
- this.fieldMasterDataKeys = {};
- this.fieldMasterDataCallback = loadAllCallback;
- this.fieldMasterDataCallbackData = loadAllCallbackData;
- this.sourceMapping = {};
- var fields = this.getFormFields();
- var filterFields = this.getFilters();
-
- if(filterFields != null){
- for(var j=0;j';
- }
-
- if(this.getFilters() != null){
- if(html != ""){
- html += " ";
- }
- html+='';
- html += " ";
- if(this.filtersAlreadySet){
- html+='';
- }else{
- html+='';
- }
-
- }
-
- html = html.replace(/__id__/g, this.getTableName());
-
- if(this.currentFilterString != "" && this.currentFilterString != null){
- html = html.replace(/__filterString__/g, this.currentFilterString);
- }else{
- html = html.replace(/__filterString__/g, 'Reset Filters');
- }
-
- if(html != ""){
- html = ''+html+'';
- }
-
- return html;
-});
-
-
-IceHRMBase.method('getActionButtonHeader', function() {
- return { "sTitle": "", "sClass": "center" };
-});
-
-IceHRMBase.method('getTableHTMLTemplate', function() {
- return '
';
-});
-
-IceHRMBase.method('isSortable', function() {
- return true;
-});
-
-/**
- * Create the data table on provided element id
- * @method createTable
- * @param val {Boolean}
- */
-
-IceHRMBase.method('createTable', function(elementId) {
-
-
- var that = this;
-
- if(this.getRemoteTable()){
- this.createTableServer(elementId);
- return;
- }
-
-
- var headers = this.getHeaders();
-
- //add translations
- for(index in headers){
- headers[index].sTitle = this.gt(headers[index].sTitle);
- }
-
- var data = this.getTableData();
-
- if(this.showActionButtons()){
- headers.push(this.getActionButtonHeader());
- }
-
-
- if(this.showActionButtons()){
- for(var i=0;i
';
- }else{
- html = '
';
- }
- */
- //Find current page
- var activePage = $('#'+elementId +" .dataTables_paginate .active a").html();
- var start = 0;
- if(activePage != undefined && activePage != null){
- start = parseInt(activePage, 10)*15 - 15;
- }
-
- $('#'+elementId).html(html);
-
- var dataTableParams = {
- "oLanguage": {
- "sLengthMenu": "_MENU_ records per page"
- },
- "aaData": data,
- "aoColumns": headers,
- "bSort": that.isSortable(),
- "iDisplayLength": 15,
- "iDisplayStart": start
- };
-
-
- var customTableParams = this.getCustomTableParams();
-
- $.extend(dataTableParams, customTableParams);
-
- $('#'+elementId+' #grid').dataTable( dataTableParams );
-
- $(".dataTables_paginate ul").addClass("pagination");
- $(".dataTables_length").hide();
- $(".dataTables_filter input").addClass("form-control");
- $(".dataTables_filter input").attr("placeholder","Search");
- $(".dataTables_filter label").contents().filter(function(){
- return (this.nodeType == 3);
- }).remove();
- $('.tableActionButton').tooltip();
-});
-
-/**
- * Create a data table on provided element id which loads data page by page
- * @method createTableServer
- * @param val {Boolean}
- */
-
-IceHRMBase.method('createTableServer', function(elementId) {
- var that = this;
- var headers = this.getHeaders();
-
- headers.push({ "sTitle": "", "sClass": "center" });
-
- //add translations
- for(index in headers){
- headers[index].sTitle = this.gt(headers[index].sTitle);
- }
-
- var html = "";
- html = this.getTableTopButtonHtml() + this.getTableHTMLTemplate();
- /*
- if(this.getShowAddNew()){
- html = this.getTableTopButtonHtml()+'
';
- }else{
- html = '
';
- }
- */
-
- //Find current page
- var activePage = $('#'+elementId +" .dataTables_paginate .active a").html();
- var start = 0;
- if(activePage != undefined && activePage != null){
- start = parseInt(activePage, 10)*15 - 15;
- }
-
-
- $('#'+elementId).html(html);
-
- var dataTableParams = {
- "oLanguage": {
- "sLengthMenu": "_MENU_ records per page"
- },
- "bProcessing": true,
- "bServerSide": true,
- "sAjaxSource": that.getDataUrl(that.getDataMapping()),
- "aoColumns": headers,
- "bSort": that.isSortable(),
- "parent":that,
- "iDisplayLength": 15,
- "iDisplayStart": start
- };
-
- if(this.showActionButtons()){
- dataTableParams["aoColumnDefs"] = [
- {
- "fnRender": that.getActionButtons,
- "aTargets": [that.getDataMapping().length]
- }
- ];
- }
-
- var customTableParams = this.getCustomTableParams();
-
- $.extend(dataTableParams, customTableParams);
-
- $('#'+elementId+' #grid').dataTable( dataTableParams );
-
- $(".dataTables_paginate ul").addClass("pagination");
- $(".dataTables_length").hide();
- $(".dataTables_filter input").addClass("form-control");
- $(".dataTables_filter input").attr("placeholder","Search");
- $(".dataTables_filter label").contents().filter(function(){
- return (this.nodeType == 3);
- }).remove();
-
- $('.tableActionButton').tooltip();
-});
-
-/**
- * This should be overridden in module lib.js classes to return module headers which are used to create the data table.
- * @method getHeaders
- * @example
- SettingAdapter.method('getHeaders', function() {
- return [
- { "sTitle": "ID" ,"bVisible":false},
- { "sTitle": "Name" },
- { "sTitle": "Value"},
- { "sTitle": "Details"}
- ];
- });
- */
-IceHRMBase.method('getHeaders', function() {
-
-});
-
-
-/**
- * This should be overridden in module lib.js classes to return module field values which are used to create the data table.
- * @method getDataMapping
- * @example
- SettingAdapter.method('getDataMapping', function() {
- return [
- "id",
- "name",
- "value",
- "description"
- ];
- });
- */
-
-IceHRMBase.method('getDataMapping', function() {
-
-});
-
-/**
- * This should be overridden in module lib.js classes to return module from fields which are used to create the add/edit form and also used for initializing select box values in form.
- * @method getFormFields
- * @example
- SettingAdapter.method('getFormFields', function() {
- return [
- [ "id", {"label":"ID","type":"hidden"}],
- [ "value", {"label":"Value","type":"text","validation":"none"}]
- ];
- });
- */
-IceHRMBase.method('getFormFields', function() {
-
-});
-
-IceHRMBase.method('getTableData', function() {
-
-});
-
-/**
- * This can be overridden in module lib.js classes inorder to show a filter form
- * @method getFilters
- * @example
- EmployeeAdapter.method('getFilters', function() {
- return [
- [ "job_title", {"label":"Job Title","type":"select2","allow-null":true,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],
- [ "department", {"label":"Department","type":"select2","allow-null":true,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],
- [ "supervisor", {"label":"Supervisor","type":"select2","allow-null":true,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]
- ];
- });
- */
-IceHRMBase.method('getFilters', function() {
- return null;
-});
-
-/**
- * Show the edit form for an item
- * @method edit
- * @param id {int} id of the item to edit
- */
-IceHRMBase.method('edit', function(id) {
- this.currentId = id;
- this.getElement(id,[]);
-});
-
-IceHRMBase.method('copyRow', function(id) {
- this.getElement(id,[],true);
-});
-
-IceHRMBase.method('renderModel', function(id,header,body) {
- $('#'+id+'ModelBody').html("");
-
- if(body == undefined || body == null){
- body = "";
- }
-
- $('#'+id+'ModelLabel').html(header);
- $('#'+id+'ModelBody').html(body);
-});
-
-
-IceHRMBase.method('renderYesNoModel', function(header,body,yesBtnName,noBtnName,callback, callbackParams) {
- var that = this;
- var modelId = "#yesnoModel";
-
- if(body == undefined || body == null){
- body = "";
- }
-
- $(modelId+'Label').html(header);
- $(modelId+'Body').html(body);
- if(yesBtnName != null){
- $(modelId+'YesBtn').html(yesBtnName);
- }
- if(noBtnName != null){
- $(modelId+'NoBtn').html(noBtnName);
- }
-
- $(modelId+'YesBtn').off().on('click',function(){
- if(callback != undefined && callback != null){
- callback.apply(that,callbackParams);
- that.cancelYesno();
- }
- });
-
- $(modelId).modal({
- backdrop: 'static'
- });
-
-
-});
-
-IceHRMBase.method('renderModelFromDom', function(id,header,element) {
- $('#'+id+'ModelBody').html("");
-
- if(element == undefined || element == null){
- element = $("");
- }
-
- $('#'+id+'ModelLabel').html(header);
- $('#'+id+'ModelBody').html("");
- $('#'+id+'ModelBody').append(element);
-});
-
-/**
- * Delete an item
- * @method deleteRow
- * @param id {int} id of the item to edit
- */
-
-IceHRMBase.method('deleteRow', function(id) {
- this.deleteParams['id'] = id;
- this.renderModel('delete',"Confirm Deletion","Are you sure you want to delete this item ?");
- $('#deleteModel').modal('show');
-
-});
-
-/**
- * Show a popup with message
- * @method showMessage
- * @param title {String} title of the message box
- * @param message {String} message
- * @param closeCallback {Function} this will be called once the dialog is closed (optional)
- * @param closeCallback {Function} data to pass to close callback (optional)
- * @param isPlain {Boolean} if true buttons are not shown (optional / default = true)
- * @example
- * this.showMessage("Error Occured while Applying Leave", callBackData);
- */
-IceHRMBase.method('showMessage', function(title,message,closeCallback,closeCallbackData, isPlain) {
- var that = this;
- var modelId = "";
- if(isPlain){
- modelId = "#plainMessageModel";
- this.renderModel('plainMessage',title,message);
- }else{
- modelId = "#messageModel";
- this.renderModel('message',title,message);
- }
-
- $(modelId).unbind('hide');
- if(closeCallback != null && closeCallback != undefined){
- $(modelId).on('hidden.bs.modal',function(){
- closeCallback.apply(that,closeCallbackData);
- $(modelId).unbind('hidden.bs.modal');
- });
- }
- $(modelId).modal({
- backdrop: 'static'
- });
-});
-
-IceHRMBase.method('showDomElement', function(title,element,closeCallback,closeCallbackData, isPlain) {
- var that = this;
- var modelId = "";
- if(isPlain){
- modelId = "#dataMessageModel";
- this.renderModelFromDom('dataMessage',title,element);
- }else{
- modelId = "#messageModel";
- this.renderModelFromDom('message',title,element);
- }
-
- $(modelId).unbind('hide');
- if(closeCallback != null && closeCallback != undefined){
- $(modelId).on('hidden.bs.modal',function(){
- closeCallback.apply(that,closeCallbackData);
- $(modelId).unbind('hidden.bs.modal');
- });
- }
- $(modelId).modal({
- backdrop: 'static'
- });
-});
-
-IceHRMBase.method('confirmDelete', function() {
- if(this.deleteParams['id'] != undefined || this.deleteParams['id'] != null){
- this.deleteObj(this.deleteParams['id'],[]);
- }
- $('#deleteModel').modal('hide');
-});
-
-IceHRMBase.method('cancelDelete', function() {
- $('#deleteModel').modal('hide');
- this.deleteParams['id'] = null;
-});
-
-IceHRMBase.method('closeMessage', function() {
- $('#messageModel').modal('hide');
-});
-
-IceHRMBase.method('cancelYesno', function() {
- $('#yesnoModel').modal('hide');
-});
-
-IceHRMBase.method('closePlainMessage', function() {
- $('#plainMessageModel').modal('hide');
-});
-
-IceHRMBase.method('closeDataMessage', function() {
- $('#dataMessageModel').modal('hide');
-});
-
-
-/**
- * Create or edit an element
- * @method save
- * @param getFunctionCallBackData {Array} once a success is returned call get() function for this module with these parameters
- * @param successCallback {Function} this will get called after success response
- */
-
-IceHRMBase.method('save', function(callGetFunction, successCallback) {
- var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
- if(validator.checkValues()){
- var params = validator.getFormParameters();
- params = this.forceInjectValuesBeforeSave(params);
- var msg = this.doCustomValidation(params);
- if(msg == null){
- var id = $('#'+this.getTableName()+"_submit #id").val();
- if(id != null && id != undefined && id != ""){
- $(params).attr('id',id);
- }
- this.add(params,[],callGetFunction, successCallback);
- }else{
- $("#"+this.getTableName()+'Form .label').html(msg);
- $("#"+this.getTableName()+'Form .label').show();
- }
-
- }
-});
-
-/**
- * Override this method to inject attitional parameters or modify existing parameters retrived from add/edit form before sending to the server
- * @method forceInjectValuesBeforeSave
- * @param params {Array} keys and values in form
- * @returns {Array} modified parameters
- */
-IceHRMBase.method('forceInjectValuesBeforeSave', function(params) {
- return params;
-});
-
-/**
- * Override this method to do custom validations at client side
- * @method doCustomValidation
- * @param params {Array} keys and values in form
- * @returns {Null or String} return null if validation success, returns error message if unsuccessful
- * @example
- EmployeeLeaveAdapter.method('doCustomValidation', function(params) {
- try{
- if(params['date_start'] != params['date_end']){
- var ds = new Date(params['date_start']);
- var de = new Date(params['date_end']);
- if(de < ds){
- return "Start date should be earlier than end date of the leave period";
- }
- }
- }catch(e){
-
- }
- return null;
-});
- */
-IceHRMBase.method('doCustomValidation', function(params) {
- return null;
-});
-
-IceHRMBase.method('filterQuery', function() {
-
- var validator = new FormValidation(this.getTableName()+"_filter",true,{'ShowPopup':false,"LabelErrorClass":"error"});
- if(validator.checkValues()){
- var params = validator.getFormParameters();
- if(this.doCustomFilterValidation(params)){
-
- //remove null params
- for (var prop in params) {
- if(params.hasOwnProperty(prop)){
- if(params[prop] == "NULL"){
- delete(params[prop]);
- }
- }
- }
-
- this.setFilter(params);
- this.filtersAlreadySet = true;
- $("#"+this.getTableName()+"_resetFilters").show();
- this.currentFilterString = this.getFilterString(params);
-
- this.get([]);
- this.closePlainMessage();
- }
-
- }
-});
-
-
-IceHRMBase.method('getFilterString', function(filters) {
-
- var str = '';
- var rmf, source, values, select2MVal, value, valueOrig;
-
- var filterFields = this.getFilters();
-
-
- if(values == null){
- values = [];
- }
-
- for (var prop in filters) {
- if(filters.hasOwnProperty(prop)){
- values = this.getMetaFieldValues(prop,filterFields);
- value = "";
- valueOrig = null;
-
- if((values['type'] == 'select' || values['type'] == 'select2')){
-
- if(values['remote-source']!= undefined && values['remote-source']!= null){
- rmf = values['remote-source'];
- if(filters[prop] == "NULL"){
- if(values['null-label'] != undefined && values['null-label'] != null){
- value = values['null-label'];
- }else{
- value = "Not Selected";
- }
- }else{
- value = this.fieldMasterData[rmf[0]+"_"+rmf[1]+"_"+rmf[2]][filters[prop]];
- valueOrig = value;
- }
-
-
- }else{
- source = values['source'][0];
- if(filters[prop] == "NULL"){
- if(values['null-label'] != undefined && values['null-label'] != null){
- value = values['null-label'];
- }else{
- value = "Not Selected";
- }
- }else{
- for(var i=0; i');
- $tempDomObj.attr('id',randomFormId);
-
- $tempDomObj.html(formHtml);
-
-
- $tempDomObj.find('.datefield').datepicker({'viewMode':2});
- $tempDomObj.find('.timefield').datetimepicker({
- language: 'en',
- pickDate: false
- });
- $tempDomObj.find('.datetimefield').datetimepicker({
- language: 'en'
- });
-
- $tempDomObj.find('.colorpick').colorpicker();
-
- //$tempDomObj.find('.select2Field').select2();
- $tempDomObj.find('.select2Field').each(function() {
- $(this).select2().select2('val', $(this).find("option:eq(0)").val());
- });
-
- $tempDomObj.find('.select2Multi').each(function() {
- $(this).select2().on("change",function(e){
- var parentRow = $(this).parents(".row");
- var height = parentRow.find(".select2-choices").height();
- parentRow.height(parseInt(height));
- });
- });
-
- /*
- $tempDomObj.find('.signatureField').each(function() {
- $(this).data('signaturePad',new SignaturePad($(this)));
- });
- */
-
- //var tHtml = $tempDomObj.wrap('').parent().html();
- this.showDomElement("Edit",$tempDomObj,null,null,true);
- $(".filterBtn").off();
- $(".filterBtn").on('click',function(e) {
- e.preventDefault();
- e.stopPropagation();
- try{
- modJs.filterQuery();
-
- }catch(e){
- };
- return false;
- });
-
- if(this.filter != undefined && this.filter != null){
- this.fillForm(this.filter,"#"+this.getTableName()+"_filter", this.getFilters());
- }
-
-});
-
-
-/**
- * Override this method in your module class to make changes to data fo the form before showing the form
- * @method preRenderForm
- * @param object {Array} keys value list for populating form
- */
-
-IceHRMBase.method('preRenderForm', function(object) {
-
-});
-
-/**
- * Create the form
- * @method renderForm
- * @param object {Array} keys value list for populating form
- */
-
-IceHRMBase.method('renderForm', function(object) {
-
- var that = this;
- var signatureIds = [];
- if(object == null || object == undefined){
- this.currentId = null;
- }
-
- this.preRenderForm(object);
-
- var formHtml = this.templates['formTemplate'];
- var html = "";
- var fields = this.getFormFields();
-
- for(var i=0;i ');
- $tempDomObj.attr('id',randomFormId);
-
- }
-
- $tempDomObj.html(formHtml);
-
-
- $tempDomObj.find('.datefield').datepicker({'viewMode':2});
- $tempDomObj.find('.timefield').datetimepicker({
- language: 'en',
- pickDate: false
- });
- $tempDomObj.find('.datetimefield').datetimepicker({
- language: 'en'
- });
-
- $tempDomObj.find('.colorpick').colorpicker();
-
- //$tempDomObj.find('.select2Field').select2();
- $tempDomObj.find('.select2Field').each(function() {
- $(this).select2().select2('val', $(this).find("option:eq(0)").val());
-
- });
-
- $tempDomObj.find('.select2Multi').each(function() {
- $(this).select2().on("change",function(e){
- var parentRow = $(this).parents(".row");
- var height = parentRow.find(".select2-choices").height();
- parentRow.height(parseInt(height));
- });
-
- });
-
-
- $tempDomObj.find('.signatureField').each(function() {
- //$(this).data('signaturePad',new SignaturePad($(this)));
- signatureIds.push($(this).attr('id'));
- });
-
- for(var i=0;i').parent().html();
- //this.showMessage("Edit",tHtml,null,null,true);
- this.showMessage("Edit","",null,null,true);
-
- $("#plainMessageModel .modal-body").html("");
- $("#plainMessageModel .modal-body").append($tempDomObj);
-
-
- for(var i=0;i';
- editButton = '';
-
- template = field[1]['html'];
-
- if(data != null && data != undefined && field[1]['sort-function'] != undefined && field[1]['sort-function'] != null){
- data.sort(field[1]['sort-function']);
- }
-
-
- html = $('');
-
-
-
- for(i=0;i ');
- }
- t = t.replace('#_'+key+'_#', itemVal);
- }
-
- if(field[1]['render'] != undefined && field[1]['render'] != null){
- t = t.replace('#_renderFunction_#', field[1]['render'](item));
- }
-
- itemHtml = $(t);
- itemHtml.attr('fieldId',field[0]+"_div");
- html.append(itemHtml);
- }
-
-
-
- return html;
-});
-
-/**
- * Reset the DataGroup for a given field
- * @method resetDataGroup
- * @param field {Array} field meta data
- */
-IceHRMBase.method('resetDataGroup', function(field) {
- $("#"+field[0]).val("");
- $("#"+field[0]+"_div").html("");
-});
-
-IceHRMBase.method('showDataGroup', function(field, object) {
- var formHtml = this.templates['datagroupTemplate'];
- var html = "";
- var fields = field[1]['form'];
-
- if(object != undefined && object != null && object.id != undefined){
- this.currentDataGroupItemId = object.id;
- }else{
- this.currentDataGroupItemId = null;
- }
-
- for(var i=0;i');
- $tempDomObj.attr('id',randomFormId);
-
- $tempDomObj.html(formHtml);
-
-
- $tempDomObj.find('.datefield').datepicker({'viewMode':2});
- $tempDomObj.find('.timefield').datetimepicker({
- language: 'en',
- pickDate: false
- });
- $tempDomObj.find('.datetimefield').datetimepicker({
- language: 'en'
- });
-
- $tempDomObj.find('.colorpick').colorpicker();
-
- $tempDomObj.find('.select2Field').each(function() {
- $(this).select2().select2('val', $(this).find("option:eq(0)").val());
- });
-
-
- $tempDomObj.find('.select2Multi').each(function() {
- $(this).select2().on("change",function(e){
- var parentRow = $(this).parents(".row");
- var height = parentRow.find(".select2-choices").height();
- parentRow.height(parseInt(height));
- });
- });
-
- /*
- $tempDomObj.find('.signatureField').each(function() {
- $(this).data('signaturePad',new SignaturePad($(this)));
- });
- */
-
- this.currentDataGroupField = field;
- this.showDomElement("Add "+field[1]['label'],$tempDomObj,null,null,true);
-
- if(object != undefined && object != null){
- this.fillForm(object,"#"+this.getTableName()+"_field_"+field[0], field[1]['form']);
- }
-
-
- $(".groupAddBtn").off();
- if(object != undefined && object != null && object.id != undefined){
- $(".groupAddBtn").on('click',function(e) {
- e.preventDefault();
- e.stopPropagation();
- try{
- modJs.editDataGroup();
-
- }catch(e){
- };
- return false;
- });
- }else{
- $(".groupAddBtn").on('click',function(e) {
- e.preventDefault();
- e.stopPropagation();
- try{
- modJs.addDataGroup();
-
- }catch(e){
- };
- return false;
- });
- }
-
-
-});
-
-IceHRMBase.method('addDataGroup', function() {
- var field = this.currentDataGroupField, tempParams;
- $("#"+this.getTableName()+"_field_"+field[0]+"_error").html("");
- $("#"+this.getTableName()+"_field_"+field[0]+"_error").hide();
- var validator = new FormValidation(this.getTableName()+"_field_"+field[0],true,{'ShowPopup':false,"LabelErrorClass":"error"});
- if(validator.checkValues()){
- var params = validator.getFormParameters();
- if(field[1]['custom-validate-function'] != undefined && field[1]['custom-validate-function'] != null){
- tempParams = field[1]['custom-validate-function'].apply(this,[params]);
- if(tempParams['valid']){
- params = tempParams['params'];
- }else{
- $("#"+this.getTableName()+"_field_"+field[0]+"_error").html(tempParams['message']);
- $("#"+this.getTableName()+"_field_"+field[0]+"_error").show();
- return false;
- }
- }
-
- var val = $("#"+field[0]).val();
- if(val == ""){
- val = "[]";
- }
- var data = JSON.parse(val);
-
- params['id'] = field[0]+"_"+this.dataGroupGetNextAutoIncrementId(data);
- data.push(params);
-
-
- if(field[1]['sort-function'] != undefined && field[1]['sort-function'] != null){
- data.sort(field[1]['sort-function']);
- }
-
- val = JSON.stringify(data);
-
- var html = this.dataGroupToHtml(val,field);
-
- $("#"+field[0]+"_div").html("");
- $("#"+field[0]+"_div").append(html);
-
- this.makeDataGroupSortable(field, $("#"+field[0]+"_div_inner"));
-
-
- $("#"+field[0]).val(val);
- this.orderDataGroup(field);
-
- this.closeDataMessage();
-
- this.showMessage("Item Added","This change will be effective only when you save the form");
-
-
- }
-});
-
-IceHRMBase.method('makeDataGroupSortable', function(field, obj) {
- obj.data('field',field);
- obj.data('firstSort',true);
- obj.sortable({
-
- create:function(){
- $(this).height($(this).height());
- },
-
- 'ui-floating': false,
- start: function(e, ui) {
- $('#sortable-ul-selector-id').sortable({
- sort: function(event, ui) {
- var $target = $(event.target);
- if (!/html|body/i.test($target.offsetParent()[0].tagName)) {
- var top = event.pageY - $target.offsetParent().offset().top - (ui.helper.outerHeight(true) / 2);
- ui.helper.css({'top' : top + 'px'});
- }
- }
- });
-
- },
- revert: true,
- stop: function() {
- modJs.orderDataGroup($(this).data('field'));
- },
- axis: "y",
- scroll: false,
- placeholder: "sortable-placeholder",
- cursor: "move"
- });
-
-
-});
-
-IceHRMBase.method('orderDataGroup', function(field) {
- var newArr = [], id;
- var list = $("#"+field[0]+"_div_inner [fieldid='"+field[0]+"_div']");
- var val = $("#"+field[0]).val();
- if(val == ""){
- val = "[]";
- }
- var data = JSON.parse(val);
- list.each(function(){
- id = $(this).attr('id');
- for(index in data){
- if(data[index].id == id){
- newArr.push(data[index]);
- break;
- }
- }
- });
-
- $("#"+field[0]).val(JSON.stringify(newArr));
-
-
-});
-
-
-IceHRMBase.method('editDataGroup', function() {
- var field = this.currentDataGroupField;
- var id = this.currentDataGroupItemId;
- var validator = new FormValidation(this.getTableName()+"_field_"+field[0],true,{'ShowPopup':false,"LabelErrorClass":"error"});
- if(validator.checkValues()){
- var params = validator.getFormParameters();
- if(this.doCustomFilterValidation(params)){
-
- var val = $("#"+field[0]).val();
- if(val == ""){
- val = "[]";
- }
- var data = JSON.parse(val);
-
- var editVal = {};
- var editValIndex = -1;
- var newVals = [];
- for(var i=0;i= autoId){
- autoId = parseInt(id) + 1;
- }
- }
-
- return autoId;
-
-});
-
-
-IceHRMBase.method('deleteDataGroupItem', function(id) {
- var fieldId = id.substring(0,id.lastIndexOf("_"));
-
- var val = $("#"+fieldId).val();
- var data = JSON.parse(val);
-
- var newVal = [];
-
- for(var i=0;i ');
- }catch(e){}
-
- }
-
-
-
-
- $(formId + ' #'+fields[i][0]).html(placeHolderVal);
- }else if(fields[i][1].type == 'fileupload'){
- if(object[fields[i][0]] != null && object[fields[i][0]] != undefined && object[fields[i][0]] != ""){
- $(formId + ' #'+fields[i][0]).html(object[fields[i][0]]);
- $(formId + ' #'+fields[i][0]).attr("val",object[fields[i][0]]);
- $(formId + ' #'+fields[i][0]).show();
- $(formId + ' #'+fields[i][0]+"_download").show();
-
- }
- if(fields[i][1].readonly == true){
- $(formId + ' #'+fields[i][0]+"_upload").remove();
- }
- }else if(fields[i][1].type == 'select'){
- if(object[fields[i][0]] == undefined || object[fields[i][0]] == null || object[fields[i][0]] == ""){
- object[fields[i][0]] = "NULL";
- }
- $(formId + ' #'+fields[i][0]).val(object[fields[i][0]]);
-
- }else if(fields[i][1].type == 'select2'){
- if(object[fields[i][0]] == undefined || object[fields[i][0]] == null || object[fields[i][0]] == ""){
- object[fields[i][0]] = "NULL";
- }
- $(formId + ' #'+fields[i][0]).select2('val',object[fields[i][0]]);
-
- }else if(fields[i][1].type == 'select2multi'){
- //TODO - SM
- if(object[fields[i][0]] == undefined || object[fields[i][0]] == null || object[fields[i][0]] == ""){
- object[fields[i][0]] = "NULL";
- }
-
- var msVal = [];
- if(object[fields[i][0]] != undefined && object[fields[i][0]] != null && object[fields[i][0]] != ""){
- try{
- msVal = JSON.parse(object[fields[i][0]]);
- }catch(e){}
- }
-
- $(formId + ' #'+fields[i][0]).select2('val',msVal);
- var select2Height = $(formId + ' #'+fields[i][0]).find(".select2-choices").height();
- $(formId + ' #'+fields[i][0]).find(".controls").css('min-height', select2Height+"px");
- $(formId + ' #'+fields[i][0]).css('min-height', select2Height+"px");
-
- }else if(fields[i][1].type == 'datagroup'){
- try{
- var html = this.dataGroupToHtml(object[fields[i][0]],fields[i]);
- $(formId + ' #'+fields[i][0]).val(object[fields[i][0]]);
- $(formId + ' #'+fields[i][0]+"_div").html("");
- $(formId + ' #'+fields[i][0]+"_div").append(html);
-
- this.makeDataGroupSortable(fields[i], $(formId + ' #'+fields[i][0]+"_div_inner"));
-
-
- }catch(e){}
-
- }else if(fields[i][1].type == 'signature'){
-
- if(object[fields[i][0]] != '' || object[fields[i][0]] != undefined
- || object[fields[i][0]] != null){
- $(formId + ' #'+fields[i][0]).data('signaturePad').fromDataURL(object[fields[i][0]]);
- }
-
- }else{
- $(formId + ' #'+fields[i][0]).val(object[fields[i][0]]);
- }
-
- }
-});
-
-/**
- * Cancel edit or add new on modules
- * @method cancel
- */
-
-IceHRMBase.method('cancel', function() {
- $("#"+this.getTableName()+'Form').hide();
- $("#"+this.getTableName()).show();
-});
-
-IceHRMBase.method('renderFormField', function(field) {
- var userId = 0;
- if(this.fieldTemplates[field[1].type] == undefined || this.fieldTemplates[field[1].type] == null){
- return "";
- }
- var t = this.fieldTemplates[field[1].type];
- field[1].label = this.gt(field[1].label);
- if(field[1].validation != "none" && field[1].validation != "emailOrEmpty" && field[1].validation != "numberOrEmpty" && field[1].type != "placeholder" && field[1].label.indexOf('*') < 0){
- var tempSelectBoxes = ['select','select2'];
- if(tempSelectBoxes.indexOf(field[1].type) >= 0 && field[1]['allow-null'] == true){
-
- }else{
- field[1].label = field[1].label + '*';
- }
-
- }
- if(field[1].type == 'text' || field[1].type == 'textarea' || field[1].type == 'hidden' || field[1].type == 'label' || field[1].type == 'placeholder'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'select' || field[1].type == 'select2' || field[1].type == 'select2multi'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
- if(field[1]['source'] != undefined && field[1]['source'] != null ){
- t = t.replace('_options_',this.renderFormSelectOptions(field[1].source, field));
- }else if(field[1]['remote-source'] != undefined && field[1]['remote-source'] != null ){
- var key = field[1]['remote-source'][0]+"_"+field[1]['remote-source'][1]+"_"+field[1]['remote-source'][2];
- t = t.replace('_options_',this.renderFormSelectOptionsRemote(this.fieldMasterData[key],field));
- }
-
- }else if(field[1].type == 'colorpick'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'date'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'datetime'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'time'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'fileupload'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
- var ce = this.getCurrentProfile();
- if(ce != null && ce != undefined){
- userId = ce.id;
- }else{
- userId = this.getUser().id * -1;
- }
- t = t.replace(/_userId_/g,userId);
- t = t.replace(/_group_/g,this.tab);
-
- /*
- if(object != null && object != undefined && object[field[0]] != null && object[field[0]] != undefined && object[field[0]] != ""){
- t = t.replace(/_id___rand_/g,field[0]);
- }
- */
- t = t.replace(/_rand_/g,this.generateRandom(14));
-
- }else if(field[1].type == 'datagroup'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
-
- }else if(field[1].type == 'signature'){
- t = t.replace(/_id_/g,field[0]);
- t = t.replace(/_label_/g,field[1].label);
- }
-
- if(field[1].validation != undefined && field[1].validation != null && field[1].validation != ""){
- t = t.replace(/_validation_/g,'validation="'+field[1].validation+'"');
- }else{
- t = t.replace(/_validation_/g,'');
- }
- return t;
-});
-
-IceHRMBase.method('renderFormSelectOptions', function(options, field) {
- var html = "";
-
- if(field != null && field != undefined){
- if(field[1]['allow-null'] == true){
- if(field[1]['null-label'] != undefined && field[1]['null-label'] != null){
- html += '';
- }else{
- html += '';
- }
-
- }
- }
-
-
- //Sort options
-
- var tuples = [];
-
- for (var key in options) {
- tuples.push(options[key]);
- }
- if(field[1]['sort'] != 'none'){
- tuples.sort(function(a, b) {
- a = a[1];
- b = b[1];
-
- return a < b ? -1 : (a > b ? 1 : 0);
- });
- }
-
-
- for (var i = 0; i < tuples.length; i++) {
- var prop = tuples[i][0];
- var value = tuples[i][1];
- var t = '';
- t = t.replace('_id_', prop);
- t = t.replace('_val_', value);
- html += t;
-
- }
- return html;
-
-});
-
-IceHRMBase.method('renderFormSelectOptionsRemote', function(options,field) {
- var html = "";
- if(field[1]['allow-null'] == true){
- if(field[1]['null-label'] != undefined && field[1]['null-label'] != null){
- html += '';
- }else{
- html += '';
- }
-
- }
-
- //Sort options
-
- var tuples = [];
-
- for (var key in options) {
- tuples.push([key, options[key]]);
- }
- if(field[1]['sort'] != 'none') {
- tuples.sort(function (a, b) {
- a = a[1];
- b = b[1];
-
- return a < b ? -1 : (a > b ? 1 : 0);
- });
- }
-
- for (var i = 0; i < tuples.length; i++) {
- var prop = tuples[i][0];
- var value = tuples[i][1];
-
- var t = '';
- t = t.replace('_id_', prop);
- t = t.replace('_val_', value);
- html += t;
- }
-
-
- return html;
-
-});
-
-IceHRMBase.method('setTemplates', function(templates) {
- this.templates = templates;
-});
-
-IceHRMBase.method('setCustomTemplates', function(templates) {
- this.customTemplates = templates;
-});
-
-IceHRMBase.method('setEmailTemplates', function(templates) {
- this.emailTemplates = templates;
-});
-
-IceHRMBase.method('getCustomTemplate', function(file) {
- return this.customTemplates[file];
-});
-
-IceHRMBase.method('setFieldTemplates', function(templates) {
- this.fieldTemplates = templates;
-});
-
-
-IceHRMBase.method('getMetaFieldForRendering', function(fieldName) {
- return "";
-});
-
-IceHRMBase.method('clearDeleteParams', function() {
- this.deleteParams = {};
-});
-
-IceHRMBase.method('getShowAddNew', function() {
- return this.showAddNew;
-});
-
-/**
- * Override this method to change add new button label
- * @method getAddNewLabel
- */
-
-IceHRMBase.method('getAddNewLabel', function() {
- return "Add New";
-});
-
-/**
- * Used to set whether to show the add new button for a module
- * @method setShowAddNew
- * @param showAddNew {Boolean} value
- */
-
-IceHRMBase.method('setShowAddNew', function(showAddNew) {
- this.showAddNew = showAddNew;
-});
-
-/**
- * Used to set whether to show delete button for each entry in module
- * @method setShowDelete
- * @param val {Boolean} value
- */
-IceHRMBase.method('setShowDelete', function(val) {
- this.showDelete = val;
-});
-
-
-/**
- * Used to set whether to show edit button for each entry in module
- * @method setShowEdit
- * @param val {Boolean} value
- */
-
-IceHRMBase.method('setShowEdit', function(val) {
- this.showEdit = val;
-});
-
-/**
- * Used to set whether to show save button in form
- * @method setShowSave
- * @param val {Boolean} value
- */
-
-
-IceHRMBase.method('setShowSave', function(val) {
- this.showSave = val;
-});
-
-
-/**
- * Used to set whether to show cancel button in form
- * @method setShowCancel
- * @param val {Boolean} value
- */
-
-IceHRMBase.method('setShowCancel', function(val) {
- this.showCancel = val;
-});
-
-/**
- * Datatable option array will be extended with associative array provided here
- * @method getCustomTableParams
- * @param val {Boolean} value
- */
-
-
-IceHRMBase.method('getCustomTableParams', function() {
- return {};
-});
-
-IceHRMBase.method('getActionButtons', function(obj) {
- return modJs.getActionButtonsHtml(obj.aData[0],obj.aData);
-});
-
-
-/**
- * This return html for action buttons in each row. Override this method if you need to make changes to action buttons.
- * @method getActionButtonsHtml
- * @param id {int} id of the row
- * @param data {Array} data for the row
- * @returns {String} html for action buttons
- */
-
-IceHRMBase.method('getActionButtonsHtml', function(id,data) {
- var editButton = '
';
- var deleteButton = '
';
- var cloneButton = '
';
- var html = '_edit__delete__clone_';
-
- if(this.showAddNew){
- html = html.replace('_clone_',cloneButton);
- }else{
- html = html.replace('_clone_','');
- }
-
- if(this.showDelete){
- html = html.replace('_delete_',deleteButton);
- }else{
- html = html.replace('_delete_','');
- }
-
- if(this.showEdit){
- html = html.replace('_edit_',editButton);
- }else{
- html = html.replace('_edit_','');
- }
-
- html = html.replace(/_id_/g,id);
- html = html.replace(/_BASE_/g,this.baseUrl);
- return html;
-});
-
-
-/**
- * Generates a random string
- * @method generateRandom
- * @param length {int} required length of the string
- * @returns {String} random string
- */
-
-IceHRMBase.method('generateRandom', function(length) {
- var d = new Date();
- var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- var result = '';
- for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
- return result+d.getTime();
-});
-
-
-
-IceHRMBase.method('checkFileType', function (elementName, fileTypes) {
- var fileElement = document.getElementById(elementName);
- var fileExtension = "";
- if (fileElement.value.lastIndexOf(".") > 0) {
- fileExtension = fileElement.value.substring(fileElement.value.lastIndexOf(".") + 1, fileElement.value.length);
- }
-
- fileExtension = fileExtension.toLowerCase();
-
- var allowed = fileTypes.split(",");
-
- if (allowed.indexOf(fileExtension) < 0) {
- fileElement.value = "";
- this.showMessage("File Type Error",'Selected file type is not supported');
- this.clearFileElement(elementName);
- return false;
- }
-
- return true;
-
-});
-
-IceHRMBase.method('clearFileElement', function (elementName) {
-
- var control = $("#"+elementName);
- control.replaceWith( control = control.val('').clone( true ) );
-});
-
-
-IceHRMBase.method('fixJSON', function (json) {
- if(this.noJSONRequests == "1"){
- json = json.replace(/"/g,'|');
- }
- return json;
-});
-
-
-IceHRMBase.method('getClientDate', function (date) {
-
- var offset = this.getClientGMTOffset();
- var tzDate = date.addMinutes(offset*60);
- return tzDate;
-
-});
-
-IceHRMBase.method('getClientGMTOffset', function () {
-
- var rightNow = new Date();
- var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
- var temp = jan1.toGMTString();
- var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
- var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
-
- return std_time_offset;
-
-});
-
-/**
- * Override this method in a module to provide the help link for the module. Help link of the module on frontend will get updated with this.
- * @method getHelpLink
- * @returns {String} help link
- */
-
-IceHRMBase.method('getHelpLink', function () {
-
- return null;
-
-});
-
-IceHRMBase.method('showLoader', function () {
- $('#iceloader').show();
-});
-
-IceHRMBase.method('hideLoader', function () {
- $('#iceloader').hide();
-});
-
-IceHRMBase.method('generateOptions', function (data) {
- var template = '';
- var options = "";
- for(index in data){
- options += template.replace("__val__",index).replace("__text__",data[index]);
- }
-
- return options;
-});
-
-IceHRMBase.method('isModuleInstalled', function (type, name) {
- if(modulesInstalled == undefined || modulesInstalled == null){
- return false;
- }
-
- return (modulesInstalled[type+"_"+name] == 1);
-});
-
diff --git a/src/api/FormValidation.js b/src/api/FormValidation.js
deleted file mode 100644
index b482131f..00000000
--- a/src/api/FormValidation.js
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-This file is part of Ice Framework.
-
-Ice Framework is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Ice Framework is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Ice Framework. If not, see .
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-function FormValidation(formId,validateAll,options) {
- this.tempOptions = {};
- this.formId = formId;
- this.formError = false;
- this.formObject = null;
- this.errorMessages = "";
- this.popupDialog = null;
- this.validateAll = validateAll;
- this.errorMap = new Array();
-
- this.settings = {"thirdPartyPopup":null,"LabelErrorClass":false, "ShowPopup":true};
-
- this.settings = jQuery.extend(this.settings,options);
-
- this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature");
-
- this.validator = {
-
- float: function (str) {
- var floatstr = /^[-+]?[0-9]+(\.[0-9]+)?$/;
- if (str != null && str.match(floatstr)) {
- return true;
- } else {
- return false;
- }
- },
-
- number: function (str) {
- var numstr = /^[0-9]+$/;
- if (str != null && str.match(numstr)) {
- return true;
- } else {
- return false;
- }
- },
-
- numberOrEmpty: function (str) {
- if(str == ""){
- return true;
- }
- var numstr = /^[0-9]+$/;
- if (str != null && str.match(numstr)) {
- return true;
- } else {
- return false;
- }
- },
-
- email: function (str) {
- var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
- return str != null && emailPattern.test(str);
- },
-
- emailOrEmpty: function (str) {
- if(str == ""){
- return true;
- }
- var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
- return str != null && emailPattern.test(str);
- },
-
- username: function (str) {
- var username = /^[a-zA-Z0-9\.-]+$/;
- return str != null && username.test(str);
- },
-
- input: function (str) {
- if (str != null && str.length > 0) {
- return true;
- } else {
- return false;
- }
- }
-
-
- };
-
-}
-
-FormValidation.method('clearError' , function(formInput, overrideMessage) {
- var id = formInput.attr("id");
- $('#'+ this.formId +' #field_'+id).removeClass('error');
- $('#'+ this.formId +' #help_'+id).html('');
-});
-
-FormValidation.method('addError' , function(formInput, overrideMessage) {
- this.formError = true;
- if(formInput.attr("message") != null) {
- this.errorMessages += (formInput.attr("message") + "\n");
- this.errorMap[formInput.attr("name")] = formInput.attr("message");
- }else{
- this.errorMap[formInput.attr("name")] = "";
- }
-
- var id = formInput.attr("id");
- var validation = formInput.attr("validation");
- var message = formInput.attr("validation");
- $('#'+ this.formId +' #field_'+id).addClass('error');
- if(message == undefined || message == null || message == ""){
- $('#'+ this.formId +' #help_'+id).html(message);
- }else{
- if(validation == undefined || validation == null || validation == ""){
- $('#'+ this.formId +' #help_'+id).html("Required");
- }else{
- if(validation == "float" || validation == "number"){
- $('#'+ this.formId +' #help_'+id).html("Number required");
- }else if(validation == "email"){
- $('#'+ this.formId +' #help_'+id).html("Email required");
- }else{
- $('#'+ this.formId +' #help_'+id).html("Required");
- }
- }
- }
-
-
-});
-
-
-FormValidation.method('showErrors' , function() {
- if(this.formError) {
- if(this.settings['thirdPartyPopup'] != undefined && this.settings['thirdPartyPopup'] != null){
- this.settings['thirdPartyPopup'].alert();
- }else{
- if(this.settings['ShowPopup'] == true){
- if(this.tempOptions['popupTop'] != undefined && this.tempOptions['popupTop'] != null){
- this.alert("Errors Found",this.errorMessages,this.tempOptions['popupTop']);
- }else{
- this.alert("Errors Found",this.errorMessages,-1);
- }
-
- }
- }
- }
-});
-
-
-FormValidation.method('checkValues' , function(options) {
- this.tempOptions = options;
- var that = this;
- this.formError = false;
- this.errorMessages = "";
- this.formObject = new Object();
- var validate = function (inputObject) {
- if(that.settings['LabelErrorClass'] != false){
- $("label[for='" + name + "']").removeClass(that.settings['LabelErrorClass']);
- }
- var id = inputObject.attr("id");
- var name = inputObject.attr("name");
- var type = inputObject.attr("type");
-
- if(inputObject.hasClass('select2-focusser') || inputObject.hasClass('select2-input')){
- return true;
- }
-
- if(jQuery.inArray(type, that.inputTypes ) >= 0) {
- if(inputObject.hasClass('uploadInput')){
- inputValue = inputObject.attr("val");
- //}else if(inputObject.hasClass('datetimeInput')){
- //inputValue = inputObject.getDate()+":00";
- }else{
- //inputValue = (type == "radio" || type == "checkbox")?$("input[name='" + name + "']:checked").val():inputObject.val();
-
- inputValue = null;
- if(type == "radio" || type == "checkbox"){
- inputValue = $("input[name='" + name + "']:checked").val();
- }else if(inputObject.hasClass('select2Field')){
- if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
- inputValue = $('#'+id).select2('data').id;
- }else{
- inputValue = "";
- }
-
- }else if(inputObject.hasClass('select2Multi')){
- if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
- inputValueObjects = $('#'+id).select2('data');
- inputValue = [];
- for(var i=0;i .
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-function NotificationManager() {
- this.baseUrl = "";
- this.templates = {};
-}
-
-NotificationManager.method('setBaseUrl' , function(url) {
- this.baseUrl = url;
-});
-
-NotificationManager.method('setTemplates' , function(data) {
- this.templates = data;
-});
-
-NotificationManager.method('setTimeUtils' , function(timeUtils) {
- this.timeUtils = timeUtils;
-});
-
-NotificationManager.method('getNotifications' , function(name, data) {
- var that = this;
- $.getJSON(this.baseUrl, {'a':'getNotifications'}, function(data) {
- if(data.status == "SUCCESS"){
- that.renderNotifications(data.data[1],data.data[0]);
- }
- });
-});
-
-NotificationManager.method('clearPendingNotifications' , function(name, data) {
- var that = this;
- $.getJSON(this.baseUrl, {'a':'clearNotifications'}, function(data) {
-
- });
-});
-
-NotificationManager.method('renderNotifications' , function(notifications, unreadCount) {
-
- if(notifications.length == 0){
- return;
- }
-
- var t = this.templates['notifications'];
- if(unreadCount > 0){
- t = t.replace('#_count_#',unreadCount);
- if(unreadCount > 1){
- t = t.replace('#_header_#',"You have "+unreadCount+" new notifications");
- }else{
- t = t.replace('#_header_#',"You have "+unreadCount+" new notification");
- }
-
- }else{
- t = t.replace('#_count_#',"");
- t = t.replace('#_header_#',"You have no new notifications");
- }
-
- var notificationStr = "";
-
- for (index in notifications){
- notificationStr += this.renderNotification(notifications[index]);
- }
-
- t = t.replace('#_notifications_#',notificationStr);
-
- $obj = $(t);
-
- if(unreadCount == 0){
- $obj.find('.label-danger').remove();
- }
-
- $obj.attr("id","notifications");
- var k = $("#notifications");
- k.replaceWith($obj);
-
- $(".navbar .menu").slimscroll({
- height: "320px",
- alwaysVisible: false,
- size: "3px"
- }).css("width", "100%");
-
- this.timeUtils.convertToRelativeTime($(".notificationTime"));
-});
-
-
-NotificationManager.method('renderNotification' , function(notification) {
- var t = this.templates['notification'];
- t = t.replace('#_image_#',notification.image);
-
- try{
- var json = JSON.parse(notification.action);
- t = t.replace('#_url_#',this.baseUrl.replace('service.php','?')+json['url']);
- }catch(e){
- t = t.replace('#_url_#',"");
- }
-
- t = t.replace('#_time_#',notification.time);
- t = t.replace('#_fromName_#',notification.type);
- t = t.replace('#_message_#',this.getLineBreakString(notification.message,27));
- return t;
-});
-
-
-NotificationManager.method('getLineBreakString' , function(str, len) {
- var t = "";
- try{
- var arr = str.split(" ");
- var count = 0;
- for(var i=0;i len){
- t += arr[i] + "
";
- count = 0;
- }else{
- t += arr[i] + " ";
- }
- }
- }catch(e){}
- return t;
-});
\ No newline at end of file
diff --git a/src/api/SocialShare.js b/src/api/SocialShare.js
deleted file mode 100644
index ea7a42b2..00000000
--- a/src/api/SocialShare.js
+++ /dev/null
@@ -1,47 +0,0 @@
-function SocialShare(){
-};
-
-SocialShare.facebook = function(url) {
- var w = 700;
- var h = 500;
- var left = (screen.width/2)-(w/2);
- var top = (screen.height/2)-(h/2);
-
- var url = "https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(url);
-
- window.open(url, "Share on Facebook", "width="+w+",height="+h+",left="+left+",top="+top);
- return false;
-
-};
-
-SocialShare.google = function(url) {
- var w = 500;
- var h = 500;
- var left = (screen.width/2)-(w/2);
- var top = (screen.height/2)-(h/2);
-
- var url = "https://plus.google.com/share?url="+encodeURIComponent(url);
-
- window.open(url, "Share on Google", "width="+w+",height="+h+",left="+left+",top="+top);
- return false;
-
-};
-
-SocialShare.linkedin = function(url) {
- var w = 500;
- var h = 500;
- var left = (screen.width/2)-(w/2);
- var top = (screen.height/2)-(h/2);
-
- var url = "https://www.linkedin.com/cws/share?url="+encodeURIComponent(url);
-
- window.open(url, "Share on Linked in", "width="+w+",height="+h+",left="+left+",top="+top);
- return false;
-
-};
-
-SocialShare.twitter = function(url, msg) {
- window.open('http://twitter.com/share?text='+escape(msg) + '&url=' + escape(url),'popup','width=550,height=260,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=200,top=200');
- return false;
-
-};
\ No newline at end of file
diff --git a/src/api/TimeUtils.js b/src/api/TimeUtils.js
deleted file mode 100644
index a187b7c2..00000000
--- a/src/api/TimeUtils.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-This file is part of Ice Framework.
-
-Ice Framework is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Ice Framework is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Ice Framework. If not, see .
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-function TimeUtils() {
-
-}
-
-TimeUtils.method('setServerGMToffset' , function(serverGMToffset) {
- this.serverGMToffset = serverGMToffset;
-});
-
-TimeUtils.method('convertToRelativeTime',function(selector) {
-
- var that = this;
-
- var getAmPmTime = function(curHour, curMin) {
- var amPm = "am";
- var amPmHour = curHour;
- if (amPmHour >= 12) {
- amPm = "pm";
- if (amPmHour > 12) {
- amPmHour = amPmHour - 12;
- }
- }
- var prefixCurMin = "";
- if (curMin < 10) {
- prefixCurMin = "0";
- }
-
- var prefixCurHour = "";
- if (curHour == 0) {
- prefixCurHour = "0";
- }
- return " at " + prefixCurHour + amPmHour + ":" + prefixCurMin + curMin + amPm;
- };
-
- var getBrowserTimeZone = function() {
- var current_date = new Date();
- var gmt_offset = current_date.getTimezoneOffset() / 60;
- return -gmt_offset;
- };
-
- var curDate = new Date();
- var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
- var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
-
-
- var timezoneDiff = this.serverGMToffset - getBrowserTimeZone();
- var timezoneTimeDiff = timezoneDiff*60*60*1000;
-
-
- selector.each(function () {
- try{
- var thisValue = $(this).html();
- // Split value into date and time
- var thisValueArray = thisValue.split(" ");
- var thisValueDate = thisValueArray[0];
- var thisValueTime = thisValueArray[1];
-
- // Split date into components
- var thisValueDateArray = thisValueDate.split("-");
- var curYear = thisValueDateArray[0];
- var curMonth = thisValueDateArray[1]-1;
- var curDay = thisValueDateArray[2];
-
- // Split time into components
- var thisValueTimeArray = thisValueTime.split(":");
- var curHour = thisValueTimeArray[0];
- var curMin = thisValueTimeArray[1];
- var curSec = thisValueTimeArray[2];
-
- // Create this date
- var thisDate = new Date(curYear, curMonth, curDay, curHour, curMin, curSec);
- var thisTime = thisDate.getTime();
- var tzDate = new Date(thisTime - timezoneTimeDiff);
- //var tzDay = tzDate.getDay();//getDay will return the day of the week not the month
- //var tzDay = tzDate.getUTCDate(); //getUTCDate will return the day of the month
- var tzDay = tzDate.toString('d'); //
- var tzYear = tzDate.getFullYear();
- var tzHour = tzDate.getHours();
- var tzMin = tzDate.getMinutes();
-
- // Create the full date
- //var fullDate = days[tzDate.getDay()] + ", " + months[tzDate.getMonth()] + " " + tzDay + ", " + tzYear + getAmPmTime(tzHour, tzMin);
- var fullDate = days[tzDate.getDay()] + ", " + months[tzDate.getMonth()] + " " + tzDay + ", " + tzYear + getAmPmTime(tzHour, tzMin);
-
- // Get the time different
- var timeDiff = (curDate.getTime() - tzDate.getTime())/1000;
- var minDiff = Math.abs(timeDiff/60);
- var hourDiff = Math.abs(timeDiff/(60*60));
- var dayDiff = Math.abs(timeDiff/(60*60*24));
- var yearDiff = Math.abs(timeDiff/(60*60*24*365));
-
- // If more than a day old, display the month, day and time (and year, if applicable)
- var fbDate = '';
- if (dayDiff > 1) {
- //fbDate = curDay + " " + months[tzDate.getMonth()].substring(0,3);
- fbDate = tzDay + " " + months[tzDate.getMonth()].substring(0,3);
- // Add the year, if applicable
- if (yearDiff > 1) {
- fbDate = fbDate + " "+ curYear;
- }
-
- // Add the time
- fbDate = fbDate + getAmPmTime(tzHour, tzMin);
- }
- // Less than a day old, and more than an hour old
- else if (hourDiff >= 1) {
- var roundedHour = Math.round(hourDiff);
- if (roundedHour == 1)
- fbDate = "about an hour ago";
- else
- fbDate = roundedHour + " hours ago";
- }
- // Less than an hour, and more than a minute
- else if (minDiff >= 1) {
- var roundedMin = Math.round(minDiff);
- if (roundedMin == 1)
- fbDate = "about a minute ago";
- else
- fbDate = roundedMin + " minutes ago";
- }
- // Less than a minute
- else if (minDiff < 1) {
- fbDate = "less than a minute ago";
- }
-
- // Update this element
- $(this).html(fbDate);
- $(this).attr('title', fullDate);
- }catch(e){}
- });
-});
\ No newline at end of file
diff --git a/src/app/config.sample.php b/src/app/config.sample.php
deleted file mode 100644
index 0decf7da..00000000
--- a/src/app/config.sample.php
+++ /dev/null
@@ -1,26 +0,0 @@
- li {
- margin-left: 30px;
- }
- .row-fluid .thumbnails {
- margin-left: 0;
- }
-}
-
-@media (min-width: 768px) and (max-width: 979px) {
- .row {
- margin-left: -20px;
- *zoom: 1;
- }
- .row:before,
- .row:after {
- display: table;
- line-height: 0;
- content: "";
- }
- .row:after {
- clear: both;
- }
- [class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 20px;
- }
- .container,
- .navbar-static-top .container,
- .navbar-fixed-top .container,
- .navbar-fixed-bottom .container {
- width: 724px;
- }
- .span12 {
- width: 724px;
- }
- .span11 {
- width: 662px;
- }
- .span10 {
- width: 600px;
- }
- .span9 {
- width: 538px;
- }
- .span8 {
- width: 476px;
- }
- .span7 {
- width: 414px;
- }
- .span6 {
- width: 352px;
- }
- .span5 {
- width: 290px;
- }
- .span4 {
- width: 228px;
- }
- .span3 {
- width: 166px;
- }
- .span2 {
- width: 104px;
- }
- .span1 {
- width: 42px;
- }
- .offset12 {
- margin-left: 764px;
- }
- .offset11 {
- margin-left: 702px;
- }
- .offset10 {
- margin-left: 640px;
- }
- .offset9 {
- margin-left: 578px;
- }
- .offset8 {
- margin-left: 516px;
- }
- .offset7 {
- margin-left: 454px;
- }
- .offset6 {
- margin-left: 392px;
- }
- .offset5 {
- margin-left: 330px;
- }
- .offset4 {
- margin-left: 268px;
- }
- .offset3 {
- margin-left: 206px;
- }
- .offset2 {
- margin-left: 144px;
- }
- .offset1 {
- margin-left: 82px;
- }
- .row-fluid {
- width: 100%;
- *zoom: 1;
- }
- .row-fluid:before,
- .row-fluid:after {
- display: table;
- line-height: 0;
- content: "";
- }
- .row-fluid:after {
- clear: both;
- }
- .row-fluid [class*="span"] {
- display: block;
- float: left;
- width: 100%;
- min-height: 30px;
- margin-left: 2.7624309392265194%;
- *margin-left: 2.709239449864817%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .row-fluid [class*="span"]:first-child {
- margin-left: 0;
- }
- .row-fluid .span12 {
- width: 100%;
- *width: 99.94680851063829%;
- }
- .row-fluid .span11 {
- width: 91.43646408839778%;
- *width: 91.38327259903608%;
- }
- .row-fluid .span10 {
- width: 82.87292817679558%;
- *width: 82.81973668743387%;
- }
- .row-fluid .span9 {
- width: 74.30939226519337%;
- *width: 74.25620077583166%;
- }
- .row-fluid .span8 {
- width: 65.74585635359117%;
- *width: 65.69266486422946%;
- }
- .row-fluid .span7 {
- width: 57.18232044198895%;
- *width: 57.12912895262725%;
- }
- .row-fluid .span6 {
- width: 48.61878453038674%;
- *width: 48.56559304102504%;
- }
- .row-fluid .span5 {
- width: 40.05524861878453%;
- *width: 40.00205712942283%;
- }
- .row-fluid .span4 {
- width: 31.491712707182323%;
- *width: 31.43852121782062%;
- }
- .row-fluid .span3 {
- width: 22.92817679558011%;
- *width: 22.87498530621841%;
- }
- .row-fluid .span2 {
- width: 14.3646408839779%;
- *width: 14.311449394616199%;
- }
- .row-fluid .span1 {
- width: 5.801104972375691%;
- *width: 5.747913483013988%;
- }
- .row-fluid .offset12 {
- margin-left: 105.52486187845304%;
- *margin-left: 105.41847889972962%;
- }
- .row-fluid .offset12:first-child {
- margin-left: 102.76243093922652%;
- *margin-left: 102.6560479605031%;
- }
- .row-fluid .offset11 {
- margin-left: 96.96132596685082%;
- *margin-left: 96.8549429881274%;
- }
- .row-fluid .offset11:first-child {
- margin-left: 94.1988950276243%;
- *margin-left: 94.09251204890089%;
- }
- .row-fluid .offset10 {
- margin-left: 88.39779005524862%;
- *margin-left: 88.2914070765252%;
- }
- .row-fluid .offset10:first-child {
- margin-left: 85.6353591160221%;
- *margin-left: 85.52897613729868%;
- }
- .row-fluid .offset9 {
- margin-left: 79.8342541436464%;
- *margin-left: 79.72787116492299%;
- }
- .row-fluid .offset9:first-child {
- margin-left: 77.07182320441989%;
- *margin-left: 76.96544022569647%;
- }
- .row-fluid .offset8 {
- margin-left: 71.2707182320442%;
- *margin-left: 71.16433525332079%;
- }
- .row-fluid .offset8:first-child {
- margin-left: 68.50828729281768%;
- *margin-left: 68.40190431409427%;
- }
- .row-fluid .offset7 {
- margin-left: 62.70718232044199%;
- *margin-left: 62.600799341718584%;
- }
- .row-fluid .offset7:first-child {
- margin-left: 59.94475138121547%;
- *margin-left: 59.838368402492065%;
- }
- .row-fluid .offset6 {
- margin-left: 54.14364640883978%;
- *margin-left: 54.037263430116376%;
- }
- .row-fluid .offset6:first-child {
- margin-left: 51.38121546961326%;
- *margin-left: 51.27483249088986%;
- }
- .row-fluid .offset5 {
- margin-left: 45.58011049723757%;
- *margin-left: 45.47372751851417%;
- }
- .row-fluid .offset5:first-child {
- margin-left: 42.81767955801105%;
- *margin-left: 42.71129657928765%;
- }
- .row-fluid .offset4 {
- margin-left: 37.01657458563536%;
- *margin-left: 36.91019160691196%;
- }
- .row-fluid .offset4:first-child {
- margin-left: 34.25414364640884%;
- *margin-left: 34.14776066768544%;
- }
- .row-fluid .offset3 {
- margin-left: 28.45303867403315%;
- *margin-left: 28.346655695309746%;
- }
- .row-fluid .offset3:first-child {
- margin-left: 25.69060773480663%;
- *margin-left: 25.584224756083227%;
- }
- .row-fluid .offset2 {
- margin-left: 19.88950276243094%;
- *margin-left: 19.783119783707537%;
- }
- .row-fluid .offset2:first-child {
- margin-left: 17.12707182320442%;
- *margin-left: 17.02068884448102%;
- }
- .row-fluid .offset1 {
- margin-left: 11.32596685082873%;
- *margin-left: 11.219583872105325%;
- }
- .row-fluid .offset1:first-child {
- margin-left: 8.56353591160221%;
- *margin-left: 8.457152932878806%;
- }
- input,
- textarea,
- .uneditable-input {
- margin-left: 0;
- }
- .controls-row [class*="span"] + [class*="span"] {
- margin-left: 20px;
- }
- input.span12,
- textarea.span12,
- .uneditable-input.span12 {
- width: 710px;
- }
- input.span11,
- textarea.span11,
- .uneditable-input.span11 {
- width: 648px;
- }
- input.span10,
- textarea.span10,
- .uneditable-input.span10 {
- width: 586px;
- }
- input.span9,
- textarea.span9,
- .uneditable-input.span9 {
- width: 524px;
- }
- input.span8,
- textarea.span8,
- .uneditable-input.span8 {
- width: 462px;
- }
- input.span7,
- textarea.span7,
- .uneditable-input.span7 {
- width: 400px;
- }
- input.span6,
- textarea.span6,
- .uneditable-input.span6 {
- width: 338px;
- }
- input.span5,
- textarea.span5,
- .uneditable-input.span5 {
- width: 276px;
- }
- input.span4,
- textarea.span4,
- .uneditable-input.span4 {
- width: 214px;
- }
- input.span3,
- textarea.span3,
- .uneditable-input.span3 {
- width: 152px;
- }
- input.span2,
- textarea.span2,
- .uneditable-input.span2 {
- width: 90px;
- }
- input.span1,
- textarea.span1,
- .uneditable-input.span1 {
- width: 28px;
- }
-}
-
-@media (max-width: 767px) {
- body {
- padding-right: 20px;
- padding-left: 20px;
- }
- .navbar-fixed-top,
- .navbar-fixed-bottom,
- .navbar-static-top {
- margin-right: -20px;
- margin-left: -20px;
- }
- .container-fluid {
- padding: 0;
- }
- .dl-horizontal dt {
- float: none;
- width: auto;
- clear: none;
- text-align: left;
- }
- .dl-horizontal dd {
- margin-left: 0;
- }
- .container {
- width: auto;
- }
- .row-fluid {
- width: 100%;
- }
- .row,
- .thumbnails {
- margin-left: 0;
- }
- .thumbnails > li {
- float: none;
- margin-left: 0;
- }
- [class*="span"],
- .row-fluid [class*="span"] {
- display: block;
- float: none;
- width: 100%;
- margin-left: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .span12,
- .row-fluid .span12 {
- width: 100%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .input-large,
- .input-xlarge,
- .input-xxlarge,
- input[class*="span"],
- select[class*="span"],
- textarea[class*="span"],
- .uneditable-input {
- display: block;
- width: 100%;
- min-height: 30px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .input-prepend input,
- .input-append input,
- .input-prepend input[class*="span"],
- .input-append input[class*="span"] {
- display: inline-block;
- width: auto;
- }
- .controls-row [class*="span"] + [class*="span"] {
- margin-left: 0;
- }
- .modal {
- position: fixed;
- top: 20px;
- right: 20px;
- left: 20px;
- width: auto;
- margin: 0;
- }
- .modal.fade.in {
- top: auto;
- }
-}
-
-@media (max-width: 480px) {
- .nav-collapse {
- -webkit-transform: translate3d(0, 0, 0);
- }
- .page-header h1 small {
- display: block;
- line-height: 20px;
- }
- input[type="checkbox"],
- input[type="radio"] {
- border: 1px solid #ccc;
- }
- .form-horizontal .control-label {
- float: none;
- width: auto;
- padding-top: 0;
- text-align: left;
- }
- .form-horizontal .controls {
- margin-left: 0;
- }
- .form-horizontal .control-list {
- padding-top: 0;
- }
- .form-horizontal .form-actions {
- padding-right: 10px;
- padding-left: 10px;
- }
- .modal {
- top: 10px;
- right: 10px;
- left: 10px;
- }
- .modal-header .close {
- padding: 10px;
- margin: -10px;
- }
- .carousel-caption {
- position: static;
- }
-}
-
-@media (max-width: 979px) {
- body {
- padding-top: 0;
- }
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- position: static;
- }
- .navbar-fixed-top {
- margin-bottom: 20px;
- }
- .navbar-fixed-bottom {
- margin-top: 20px;
- }
- .navbar-fixed-top .navbar-inner,
- .navbar-fixed-bottom .navbar-inner {
- padding: 5px;
- }
- .navbar .container {
- width: auto;
- padding: 0;
- }
- .navbar .brand {
- padding-right: 10px;
- padding-left: 10px;
- margin: 0 0 0 -5px;
- }
- .nav-collapse {
- clear: both;
- }
- .nav-collapse .nav {
- float: none;
- margin: 0 0 10px;
- }
- .nav-collapse .nav > li {
- float: none;
- }
- .nav-collapse .nav > li > a {
- margin-bottom: 2px;
- }
- .nav-collapse .nav > .divider-vertical {
- display: none;
- }
- .nav-collapse .nav .nav-header {
- color: #777777;
- text-shadow: none;
- }
- .nav-collapse .nav > li > a,
- .nav-collapse .dropdown-menu a {
- padding: 9px 15px;
- font-weight: bold;
- color: #777777;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- }
- .nav-collapse .btn {
- padding: 4px 10px 4px;
- font-weight: normal;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- }
- .nav-collapse .dropdown-menu li + li a {
- margin-bottom: 2px;
- }
- .nav-collapse .nav > li > a:hover,
- .nav-collapse .dropdown-menu a:hover {
- background-color: #f2f2f2;
- }
- .navbar-inverse .nav-collapse .nav > li > a:hover,
- .navbar-inverse .nav-collapse .dropdown-menu a:hover {
- background-color: #111111;
- }
- .nav-collapse.in .btn-group {
- padding: 0;
- margin-top: 5px;
- }
- .nav-collapse .dropdown-menu {
- position: static;
- top: auto;
- left: auto;
- display: block;
- float: none;
- max-width: none;
- padding: 0;
- margin: 0 15px;
- background-color: transparent;
- border: none;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- }
- .nav-collapse .dropdown-menu:before,
- .nav-collapse .dropdown-menu:after {
- display: none;
- }
- .nav-collapse .dropdown-menu .divider {
- display: none;
- }
- .nav-collapse .nav > li > .dropdown-menu:before,
- .nav-collapse .nav > li > .dropdown-menu:after {
- display: none;
- }
- .nav-collapse .navbar-form,
- .nav-collapse .navbar-search {
- float: none;
- padding: 10px 15px;
- margin: 10px 0;
- border-top: 1px solid #f2f2f2;
- border-bottom: 1px solid #f2f2f2;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- }
- .navbar-inverse .nav-collapse .navbar-form,
- .navbar-inverse .nav-collapse .navbar-search {
- border-top-color: #111111;
- border-bottom-color: #111111;
- }
- .navbar .nav-collapse .nav.pull-right {
- float: none;
- margin-left: 0;
- }
- .nav-collapse,
- .nav-collapse.collapse {
- height: 0;
- overflow: hidden;
- }
- .navbar .btn-navbar {
- display: block;
- }
- .navbar-static .navbar-inner {
- padding-right: 10px;
- padding-left: 10px;
- }
-}
-
-@media (min-width: 980px) {
- .nav-collapse.collapse {
- height: auto !important;
- overflow: visible !important;
- }
-}
diff --git a/src/app/install/bootstrap/css/bootstrap-responsive.min.css b/src/app/install/bootstrap/css/bootstrap-responsive.min.css
deleted file mode 100644
index 7b0158da..00000000
--- a/src/app/install/bootstrap/css/bootstrap-responsive.min.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Bootstrap Responsive v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
diff --git a/src/app/install/bootstrap/css/bootstrap.css b/src/app/install/bootstrap/css/bootstrap.css
deleted file mode 100644
index 9fa6f766..00000000
--- a/src/app/install/bootstrap/css/bootstrap.css
+++ /dev/null
@@ -1,5774 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-nav,
-section {
- display: block;
-}
-
-audio,
-canvas,
-video {
- display: inline-block;
- *display: inline;
- *zoom: 1;
-}
-
-audio:not([controls]) {
- display: none;
-}
-
-html {
- font-size: 100%;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-a:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-a:hover,
-a:active {
- outline: 0;
-}
-
-sub,
-sup {
- position: relative;
- font-size: 75%;
- line-height: 0;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-img {
- width: auto\9;
- height: auto;
- max-width: 100%;
- vertical-align: middle;
- border: 0;
- -ms-interpolation-mode: bicubic;
-}
-
-#map_canvas img {
- max-width: none;
-}
-
-button,
-input,
-select,
-textarea {
- margin: 0;
- font-size: 100%;
- vertical-align: middle;
-}
-
-button,
-input {
- *overflow: visible;
- line-height: normal;
-}
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-
-button,
-input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- cursor: pointer;
- -webkit-appearance: button;
-}
-
-input[type="search"] {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- -webkit-appearance: textfield;
-}
-
-input[type="search"]::-webkit-search-decoration,
-input[type="search"]::-webkit-search-cancel-button {
- -webkit-appearance: none;
-}
-
-textarea {
- overflow: auto;
- vertical-align: top;
-}
-
-.clearfix {
- *zoom: 1;
-}
-
-.clearfix:before,
-.clearfix:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.clearfix:after {
- clear: both;
-}
-
-.hide-text {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-
-.input-block-level {
- display: block;
- width: 100%;
- min-height: 30px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-body {
- margin: 0;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 20px;
- color: #333333;
- background-color: #ffffff;
-}
-
-a {
- color: #0088cc;
- text-decoration: none;
-}
-
-a:hover {
- color: #005580;
- text-decoration: underline;
-}
-
-.img-rounded {
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.img-polaroid {
- padding: 4px;
- background-color: #fff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-}
-
-.img-circle {
- -webkit-border-radius: 500px;
- -moz-border-radius: 500px;
- border-radius: 500px;
-}
-
-.row {
- margin-left: -20px;
- *zoom: 1;
-}
-
-.row:before,
-.row:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.row:after {
- clear: both;
-}
-
-[class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 20px;
-}
-
-.container,
-.navbar-static-top .container,
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
- width: 940px;
-}
-
-.span12 {
- width: 940px;
-}
-
-.span11 {
- width: 860px;
-}
-
-.span10 {
- width: 780px;
-}
-
-.span9 {
- width: 700px;
-}
-
-.span8 {
- width: 620px;
-}
-
-.span7 {
- width: 540px;
-}
-
-.span6 {
- width: 460px;
-}
-
-.span5 {
- width: 380px;
-}
-
-.span4 {
- width: 300px;
-}
-
-.span3 {
- width: 220px;
-}
-
-.span2 {
- width: 140px;
-}
-
-.span1 {
- width: 60px;
-}
-
-.offset12 {
- margin-left: 980px;
-}
-
-.offset11 {
- margin-left: 900px;
-}
-
-.offset10 {
- margin-left: 820px;
-}
-
-.offset9 {
- margin-left: 740px;
-}
-
-.offset8 {
- margin-left: 660px;
-}
-
-.offset7 {
- margin-left: 580px;
-}
-
-.offset6 {
- margin-left: 500px;
-}
-
-.offset5 {
- margin-left: 420px;
-}
-
-.offset4 {
- margin-left: 340px;
-}
-
-.offset3 {
- margin-left: 260px;
-}
-
-.offset2 {
- margin-left: 180px;
-}
-
-.offset1 {
- margin-left: 100px;
-}
-
-.row-fluid {
- width: 100%;
- *zoom: 1;
-}
-
-.row-fluid:before,
-.row-fluid:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.row-fluid:after {
- clear: both;
-}
-
-.row-fluid [class*="span"] {
- display: block;
- float: left;
- width: 100%;
- min-height: 30px;
- margin-left: 2.127659574468085%;
- *margin-left: 2.074468085106383%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-.row-fluid [class*="span"]:first-child {
- margin-left: 0;
-}
-
-.row-fluid .span12 {
- width: 100%;
- *width: 99.94680851063829%;
-}
-
-.row-fluid .span11 {
- width: 91.48936170212765%;
- *width: 91.43617021276594%;
-}
-
-.row-fluid .span10 {
- width: 82.97872340425532%;
- *width: 82.92553191489361%;
-}
-
-.row-fluid .span9 {
- width: 74.46808510638297%;
- *width: 74.41489361702126%;
-}
-
-.row-fluid .span8 {
- width: 65.95744680851064%;
- *width: 65.90425531914893%;
-}
-
-.row-fluid .span7 {
- width: 57.44680851063829%;
- *width: 57.39361702127659%;
-}
-
-.row-fluid .span6 {
- width: 48.93617021276595%;
- *width: 48.88297872340425%;
-}
-
-.row-fluid .span5 {
- width: 40.42553191489362%;
- *width: 40.37234042553192%;
-}
-
-.row-fluid .span4 {
- width: 31.914893617021278%;
- *width: 31.861702127659576%;
-}
-
-.row-fluid .span3 {
- width: 23.404255319148934%;
- *width: 23.351063829787233%;
-}
-
-.row-fluid .span2 {
- width: 14.893617021276595%;
- *width: 14.840425531914894%;
-}
-
-.row-fluid .span1 {
- width: 6.382978723404255%;
- *width: 6.329787234042553%;
-}
-
-.row-fluid .offset12 {
- margin-left: 104.25531914893617%;
- *margin-left: 104.14893617021275%;
-}
-
-.row-fluid .offset12:first-child {
- margin-left: 102.12765957446808%;
- *margin-left: 102.02127659574467%;
-}
-
-.row-fluid .offset11 {
- margin-left: 95.74468085106382%;
- *margin-left: 95.6382978723404%;
-}
-
-.row-fluid .offset11:first-child {
- margin-left: 93.61702127659574%;
- *margin-left: 93.51063829787232%;
-}
-
-.row-fluid .offset10 {
- margin-left: 87.23404255319149%;
- *margin-left: 87.12765957446807%;
-}
-
-.row-fluid .offset10:first-child {
- margin-left: 85.1063829787234%;
- *margin-left: 84.99999999999999%;
-}
-
-.row-fluid .offset9 {
- margin-left: 78.72340425531914%;
- *margin-left: 78.61702127659572%;
-}
-
-.row-fluid .offset9:first-child {
- margin-left: 76.59574468085106%;
- *margin-left: 76.48936170212764%;
-}
-
-.row-fluid .offset8 {
- margin-left: 70.2127659574468%;
- *margin-left: 70.10638297872339%;
-}
-
-.row-fluid .offset8:first-child {
- margin-left: 68.08510638297872%;
- *margin-left: 67.9787234042553%;
-}
-
-.row-fluid .offset7 {
- margin-left: 61.70212765957446%;
- *margin-left: 61.59574468085106%;
-}
-
-.row-fluid .offset7:first-child {
- margin-left: 59.574468085106375%;
- *margin-left: 59.46808510638297%;
-}
-
-.row-fluid .offset6 {
- margin-left: 53.191489361702125%;
- *margin-left: 53.085106382978715%;
-}
-
-.row-fluid .offset6:first-child {
- margin-left: 51.063829787234035%;
- *margin-left: 50.95744680851063%;
-}
-
-.row-fluid .offset5 {
- margin-left: 44.68085106382979%;
- *margin-left: 44.57446808510638%;
-}
-
-.row-fluid .offset5:first-child {
- margin-left: 42.5531914893617%;
- *margin-left: 42.4468085106383%;
-}
-
-.row-fluid .offset4 {
- margin-left: 36.170212765957444%;
- *margin-left: 36.06382978723405%;
-}
-
-.row-fluid .offset4:first-child {
- margin-left: 34.04255319148936%;
- *margin-left: 33.93617021276596%;
-}
-
-.row-fluid .offset3 {
- margin-left: 27.659574468085104%;
- *margin-left: 27.5531914893617%;
-}
-
-.row-fluid .offset3:first-child {
- margin-left: 25.53191489361702%;
- *margin-left: 25.425531914893618%;
-}
-
-.row-fluid .offset2 {
- margin-left: 19.148936170212764%;
- *margin-left: 19.04255319148936%;
-}
-
-.row-fluid .offset2:first-child {
- margin-left: 17.02127659574468%;
- *margin-left: 16.914893617021278%;
-}
-
-.row-fluid .offset1 {
- margin-left: 10.638297872340425%;
- *margin-left: 10.53191489361702%;
-}
-
-.row-fluid .offset1:first-child {
- margin-left: 8.51063829787234%;
- *margin-left: 8.404255319148938%;
-}
-
-[class*="span"].hide,
-.row-fluid [class*="span"].hide {
- display: none;
-}
-
-[class*="span"].pull-right,
-.row-fluid [class*="span"].pull-right {
- float: right;
-}
-
-.container {
- margin-right: auto;
- margin-left: auto;
- *zoom: 1;
-}
-
-.container:before,
-.container:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.container:after {
- clear: both;
-}
-
-.container-fluid {
- padding-right: 20px;
- padding-left: 20px;
- *zoom: 1;
-}
-
-.container-fluid:before,
-.container-fluid:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.container-fluid:after {
- clear: both;
-}
-
-p {
- margin: 0 0 10px;
-}
-
-.lead {
- margin-bottom: 20px;
- font-size: 21px;
- font-weight: 200;
- line-height: 30px;
-}
-
-small {
- font-size: 85%;
-}
-
-strong {
- font-weight: bold;
-}
-
-em {
- font-style: italic;
-}
-
-cite {
- font-style: normal;
-}
-
-.muted {
- color: #999999;
-}
-
-.text-warning {
- color: #c09853;
-}
-
-.text-error {
- color: #b94a48;
-}
-
-.text-info {
- color: #3a87ad;
-}
-
-.text-success {
- color: #468847;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin: 10px 0;
- font-family: inherit;
- font-weight: bold;
- line-height: 1;
- color: inherit;
- text-rendering: optimizelegibility;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small {
- font-weight: normal;
- line-height: 1;
- color: #999999;
-}
-
-h1 {
- font-size: 36px;
- line-height: 40px;
-}
-
-h2 {
- font-size: 30px;
- line-height: 40px;
-}
-
-h3 {
- font-size: 24px;
- line-height: 40px;
-}
-
-h4 {
- font-size: 18px;
- line-height: 20px;
-}
-
-h5 {
- font-size: 14px;
- line-height: 20px;
-}
-
-h6 {
- font-size: 12px;
- line-height: 20px;
-}
-
-h1 small {
- font-size: 24px;
-}
-
-h2 small {
- font-size: 18px;
-}
-
-h3 small {
- font-size: 14px;
-}
-
-h4 small {
- font-size: 14px;
-}
-
-.page-header {
- padding-bottom: 9px;
- margin: 20px 0 30px;
- border-bottom: 1px solid #eeeeee;
-}
-
-ul,
-ol {
- padding: 0;
- margin: 0 0 10px 25px;
-}
-
-ul ul,
-ul ol,
-ol ol,
-ol ul {
- margin-bottom: 0;
-}
-
-li {
- line-height: 20px;
-}
-
-ul.unstyled,
-ol.unstyled {
- margin-left: 0;
- list-style: none;
-}
-
-dl {
- margin-bottom: 20px;
-}
-
-dt,
-dd {
- line-height: 20px;
-}
-
-dt {
- font-weight: bold;
-}
-
-dd {
- margin-left: 10px;
-}
-
-.dl-horizontal {
- *zoom: 1;
-}
-
-.dl-horizontal:before,
-.dl-horizontal:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.dl-horizontal:after {
- clear: both;
-}
-
-.dl-horizontal dt {
- float: left;
- width: 160px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.dl-horizontal dd {
- margin-left: 180px;
-}
-
-hr {
- margin: 20px 0;
- border: 0;
- border-top: 1px solid #eeeeee;
- border-bottom: 1px solid #ffffff;
-}
-
-abbr[title] {
- cursor: help;
- border-bottom: 1px dotted #999999;
-}
-
-abbr.initialism {
- font-size: 90%;
- text-transform: uppercase;
-}
-
-blockquote {
- padding: 0 0 0 15px;
- margin: 0 0 20px;
- border-left: 5px solid #eeeeee;
-}
-
-blockquote p {
- margin-bottom: 0;
- font-size: 16px;
- font-weight: 300;
- line-height: 25px;
-}
-
-blockquote small {
- display: block;
- line-height: 20px;
- color: #999999;
-}
-
-blockquote small:before {
- content: '\2014 \00A0';
-}
-
-blockquote.pull-right {
- float: right;
- padding-right: 15px;
- padding-left: 0;
- border-right: 5px solid #eeeeee;
- border-left: 0;
-}
-
-blockquote.pull-right p,
-blockquote.pull-right small {
- text-align: right;
-}
-
-blockquote.pull-right small:before {
- content: '';
-}
-
-blockquote.pull-right small:after {
- content: '\00A0 \2014';
-}
-
-q:before,
-q:after,
-blockquote:before,
-blockquote:after {
- content: "";
-}
-
-address {
- display: block;
- margin-bottom: 20px;
- font-style: normal;
- line-height: 20px;
-}
-
-code,
-pre {
- padding: 0 3px 2px;
- font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
- font-size: 12px;
- color: #333333;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-code {
- padding: 2px 4px;
- color: #d14;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
-}
-
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 20px;
- word-break: break-all;
- word-wrap: break-word;
- white-space: pre;
- white-space: pre-wrap;
- background-color: #f5f5f5;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.15);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-pre.prettyprint {
- margin-bottom: 20px;
-}
-
-pre code {
- padding: 0;
- color: inherit;
- background-color: transparent;
- border: 0;
-}
-
-.pre-scrollable {
- max-height: 340px;
- overflow-y: scroll;
-}
-
-form {
- margin: 0 0 20px;
-}
-
-fieldset {
- padding: 0;
- margin: 0;
- border: 0;
-}
-
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: 40px;
- color: #333333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-
-legend small {
- font-size: 15px;
- color: #999999;
-}
-
-label,
-input,
-button,
-select,
-textarea {
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
-}
-
-input,
-button,
-select,
-textarea {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-label {
- display: block;
- margin-bottom: 5px;
-}
-
-select,
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
- display: inline-block;
- height: 20px;
- padding: 4px 6px;
- margin-bottom: 9px;
- font-size: 14px;
- line-height: 20px;
- color: #555555;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-input,
-textarea,
-.uneditable-input {
- width: 206px;
-}
-
-textarea {
- height: auto;
-}
-
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
- background-color: #ffffff;
- border: 1px solid #cccccc;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
- -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
- -o-transition: border linear 0.2s, box-shadow linear 0.2s;
- transition: border linear 0.2s, box-shadow linear 0.2s;
-}
-
-textarea:focus,
-input[type="text"]:focus,
-input[type="password"]:focus,
-input[type="datetime"]:focus,
-input[type="datetime-local"]:focus,
-input[type="date"]:focus,
-input[type="month"]:focus,
-input[type="time"]:focus,
-input[type="week"]:focus,
-input[type="number"]:focus,
-input[type="email"]:focus,
-input[type="url"]:focus,
-input[type="search"]:focus,
-input[type="tel"]:focus,
-input[type="color"]:focus,
-.uneditable-input:focus {
- border-color: rgba(82, 168, 236, 0.8);
- outline: 0;
- outline: thin dotted \9;
- /* IE6-9 */
-
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-}
-
-input[type="radio"],
-input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px \9;
- *margin-top: 0;
- line-height: normal;
- cursor: pointer;
-}
-
-input[type="file"],
-input[type="image"],
-input[type="submit"],
-input[type="reset"],
-input[type="button"],
-input[type="radio"],
-input[type="checkbox"] {
- width: auto;
-}
-
-select,
-input[type="file"] {
- height: 30px;
- /* In IE7, the height of the select element cannot be changed by height, only font-size */
-
- *margin-top: 4px;
- /* For IE7, add top margin to align select with labels */
-
- line-height: 30px;
-}
-
-select {
- width: 220px;
- background-color: #ffffff;
- border: 1px solid #cccccc;
-}
-
-select[multiple],
-select[size] {
- height: auto;
-}
-
-select:focus,
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-.uneditable-input,
-.uneditable-textarea {
- color: #999999;
- cursor: not-allowed;
- background-color: #fcfcfc;
- border-color: #cccccc;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-}
-
-.uneditable-input {
- overflow: hidden;
- white-space: nowrap;
-}
-
-.uneditable-textarea {
- width: auto;
- height: auto;
-}
-
-input:-moz-placeholder,
-textarea:-moz-placeholder {
- color: #999999;
-}
-
-input:-ms-input-placeholder,
-textarea:-ms-input-placeholder {
- color: #999999;
-}
-
-input::-webkit-input-placeholder,
-textarea::-webkit-input-placeholder {
- color: #999999;
-}
-
-.radio,
-.checkbox {
- min-height: 18px;
- padding-left: 18px;
-}
-
-.radio input[type="radio"],
-.checkbox input[type="checkbox"] {
- float: left;
- margin-left: -18px;
-}
-
-.controls > .radio:first-child,
-.controls > .checkbox:first-child {
- padding-top: 5px;
-}
-
-.radio.inline,
-.checkbox.inline {
- display: inline-block;
- padding-top: 5px;
- margin-bottom: 0;
- vertical-align: middle;
-}
-
-.radio.inline + .radio.inline,
-.checkbox.inline + .checkbox.inline {
- margin-left: 10px;
-}
-
-.input-mini {
- width: 60px;
-}
-
-.input-small {
- width: 90px;
-}
-
-.input-medium {
- width: 150px;
-}
-
-.input-large {
- width: 210px;
-}
-
-.input-xlarge {
- width: 270px;
-}
-
-.input-xxlarge {
- width: 530px;
-}
-
-input[class*="span"],
-select[class*="span"],
-textarea[class*="span"],
-.uneditable-input[class*="span"],
-.row-fluid input[class*="span"],
-.row-fluid select[class*="span"],
-.row-fluid textarea[class*="span"],
-.row-fluid .uneditable-input[class*="span"] {
- float: none;
- margin-left: 0;
-}
-
-.input-append input[class*="span"],
-.input-append .uneditable-input[class*="span"],
-.input-prepend input[class*="span"],
-.input-prepend .uneditable-input[class*="span"],
-.row-fluid input[class*="span"],
-.row-fluid select[class*="span"],
-.row-fluid textarea[class*="span"],
-.row-fluid .uneditable-input[class*="span"],
-.row-fluid .input-prepend [class*="span"],
-.row-fluid .input-append [class*="span"] {
- display: inline-block;
-}
-
-input,
-textarea,
-.uneditable-input {
- margin-left: 0;
-}
-
-.controls-row [class*="span"] + [class*="span"] {
- margin-left: 20px;
-}
-
-input.span12,
-textarea.span12,
-.uneditable-input.span12 {
- width: 926px;
-}
-
-input.span11,
-textarea.span11,
-.uneditable-input.span11 {
- width: 846px;
-}
-
-input.span10,
-textarea.span10,
-.uneditable-input.span10 {
- width: 766px;
-}
-
-input.span9,
-textarea.span9,
-.uneditable-input.span9 {
- width: 686px;
-}
-
-input.span8,
-textarea.span8,
-.uneditable-input.span8 {
- width: 606px;
-}
-
-input.span7,
-textarea.span7,
-.uneditable-input.span7 {
- width: 526px;
-}
-
-input.span6,
-textarea.span6,
-.uneditable-input.span6 {
- width: 446px;
-}
-
-input.span5,
-textarea.span5,
-.uneditable-input.span5 {
- width: 366px;
-}
-
-input.span4,
-textarea.span4,
-.uneditable-input.span4 {
- width: 286px;
-}
-
-input.span3,
-textarea.span3,
-.uneditable-input.span3 {
- width: 206px;
-}
-
-input.span2,
-textarea.span2,
-.uneditable-input.span2 {
- width: 126px;
-}
-
-input.span1,
-textarea.span1,
-.uneditable-input.span1 {
- width: 46px;
-}
-
-.controls-row {
- *zoom: 1;
-}
-
-.controls-row:before,
-.controls-row:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.controls-row:after {
- clear: both;
-}
-
-.controls-row [class*="span"] {
- float: left;
-}
-
-input[disabled],
-select[disabled],
-textarea[disabled],
-input[readonly],
-select[readonly],
-textarea[readonly] {
- cursor: not-allowed;
- background-color: #eeeeee;
-}
-
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"][readonly],
-input[type="checkbox"][readonly] {
- background-color: transparent;
-}
-
-.control-group.warning > label,
-.control-group.warning .help-block,
-.control-group.warning .help-inline {
- color: #c09853;
-}
-
-.control-group.warning .checkbox,
-.control-group.warning .radio,
-.control-group.warning input,
-.control-group.warning select,
-.control-group.warning textarea {
- color: #c09853;
-}
-
-.control-group.warning input,
-.control-group.warning select,
-.control-group.warning textarea {
- border-color: #c09853;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.warning input:focus,
-.control-group.warning select:focus,
-.control-group.warning textarea:focus {
- border-color: #a47e3c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-}
-
-.control-group.warning .input-prepend .add-on,
-.control-group.warning .input-append .add-on {
- color: #c09853;
- background-color: #fcf8e3;
- border-color: #c09853;
-}
-
-.control-group.error > label,
-.control-group.error .help-block,
-.control-group.error .help-inline {
- color: #b94a48;
-}
-
-.control-group.error .checkbox,
-.control-group.error .radio,
-.control-group.error input,
-.control-group.error select,
-.control-group.error textarea {
- color: #b94a48;
-}
-
-.control-group.error input,
-.control-group.error select,
-.control-group.error textarea {
- border-color: #b94a48;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.error input:focus,
-.control-group.error select:focus,
-.control-group.error textarea:focus {
- border-color: #953b39;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-}
-
-.control-group.error .input-prepend .add-on,
-.control-group.error .input-append .add-on {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #b94a48;
-}
-
-.control-group.success > label,
-.control-group.success .help-block,
-.control-group.success .help-inline {
- color: #468847;
-}
-
-.control-group.success .checkbox,
-.control-group.success .radio,
-.control-group.success input,
-.control-group.success select,
-.control-group.success textarea {
- color: #468847;
-}
-
-.control-group.success input,
-.control-group.success select,
-.control-group.success textarea {
- border-color: #468847;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.success input:focus,
-.control-group.success select:focus,
-.control-group.success textarea:focus {
- border-color: #356635;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-}
-
-.control-group.success .input-prepend .add-on,
-.control-group.success .input-append .add-on {
- color: #468847;
- background-color: #dff0d8;
- border-color: #468847;
-}
-
-.control-group.info > label,
-.control-group.info .help-block,
-.control-group.info .help-inline {
- color: #3a87ad;
-}
-
-.control-group.info .checkbox,
-.control-group.info .radio,
-.control-group.info input,
-.control-group.info select,
-.control-group.info textarea {
- color: #3a87ad;
-}
-
-.control-group.info input,
-.control-group.info select,
-.control-group.info textarea {
- border-color: #3a87ad;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.info input:focus,
-.control-group.info select:focus,
-.control-group.info textarea:focus {
- border-color: #2d6987;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
-}
-
-.control-group.info .input-prepend .add-on,
-.control-group.info .input-append .add-on {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #3a87ad;
-}
-
-input:focus:required:invalid,
-textarea:focus:required:invalid,
-select:focus:required:invalid {
- color: #b94a48;
- border-color: #ee5f5b;
-}
-
-input:focus:required:invalid:focus,
-textarea:focus:required:invalid:focus,
-select:focus:required:invalid:focus {
- border-color: #e9322d;
- -webkit-box-shadow: 0 0 6px #f8b9b7;
- -moz-box-shadow: 0 0 6px #f8b9b7;
- box-shadow: 0 0 6px #f8b9b7;
-}
-
-.form-actions {
- padding: 19px 20px 20px;
- margin-top: 20px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border-top: 1px solid #e5e5e5;
- *zoom: 1;
-}
-
-.form-actions:before,
-.form-actions:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.form-actions:after {
- clear: both;
-}
-
-.help-block,
-.help-inline {
- color: #595959;
-}
-
-.help-block {
- display: block;
- margin-bottom: 10px;
-}
-
-.help-inline {
- display: inline-block;
- *display: inline;
- padding-left: 5px;
- vertical-align: middle;
- *zoom: 1;
-}
-
-.input-append,
-.input-prepend {
- margin-bottom: 5px;
- font-size: 0;
- white-space: nowrap;
-}
-
-.input-append input,
-.input-prepend input,
-.input-append select,
-.input-prepend select,
-.input-append .uneditable-input,
-.input-prepend .uneditable-input {
- position: relative;
- margin-bottom: 0;
- *margin-left: 0;
- font-size: 14px;
- vertical-align: top;
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.input-append input:focus,
-.input-prepend input:focus,
-.input-append select:focus,
-.input-prepend select:focus,
-.input-append .uneditable-input:focus,
-.input-prepend .uneditable-input:focus {
- z-index: 2;
-}
-
-.input-append .add-on,
-.input-prepend .add-on {
- display: inline-block;
- width: auto;
- height: 20px;
- min-width: 16px;
- padding: 4px 5px;
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
- text-align: center;
- text-shadow: 0 1px 0 #ffffff;
- background-color: #eeeeee;
- border: 1px solid #ccc;
-}
-
-.input-append .add-on,
-.input-prepend .add-on,
-.input-append .btn,
-.input-prepend .btn {
- vertical-align: top;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.input-append .active,
-.input-prepend .active {
- background-color: #a9dba9;
- border-color: #46a546;
-}
-
-.input-prepend .add-on,
-.input-prepend .btn {
- margin-right: -1px;
-}
-
-.input-prepend .add-on:first-child,
-.input-prepend .btn:first-child {
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-append input,
-.input-append select,
-.input-append .uneditable-input {
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-append .add-on,
-.input-append .btn {
- margin-left: -1px;
-}
-
-.input-append .add-on:last-child,
-.input-append .btn:last-child {
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.input-prepend.input-append input,
-.input-prepend.input-append select,
-.input-prepend.input-append .uneditable-input {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.input-prepend.input-append .add-on:first-child,
-.input-prepend.input-append .btn:first-child {
- margin-right: -1px;
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-prepend.input-append .add-on:last-child,
-.input-prepend.input-append .btn:last-child {
- margin-left: -1px;
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-input.search-query {
- padding-right: 14px;
- padding-right: 4px \9;
- padding-left: 14px;
- padding-left: 4px \9;
- /* IE7-8 doesn't have border-radius, so don't indent the padding */
-
- margin-bottom: 0;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-/* Allow for input prepend/append in search forms */
-
-.form-search .input-append .search-query,
-.form-search .input-prepend .search-query {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.form-search .input-append .search-query {
- -webkit-border-radius: 14px 0 0 14px;
- -moz-border-radius: 14px 0 0 14px;
- border-radius: 14px 0 0 14px;
-}
-
-.form-search .input-append .btn {
- -webkit-border-radius: 0 14px 14px 0;
- -moz-border-radius: 0 14px 14px 0;
- border-radius: 0 14px 14px 0;
-}
-
-.form-search .input-prepend .search-query {
- -webkit-border-radius: 0 14px 14px 0;
- -moz-border-radius: 0 14px 14px 0;
- border-radius: 0 14px 14px 0;
-}
-
-.form-search .input-prepend .btn {
- -webkit-border-radius: 14px 0 0 14px;
- -moz-border-radius: 14px 0 0 14px;
- border-radius: 14px 0 0 14px;
-}
-
-.form-search input,
-.form-inline input,
-.form-horizontal input,
-.form-search textarea,
-.form-inline textarea,
-.form-horizontal textarea,
-.form-search select,
-.form-inline select,
-.form-horizontal select,
-.form-search .help-inline,
-.form-inline .help-inline,
-.form-horizontal .help-inline,
-.form-search .uneditable-input,
-.form-inline .uneditable-input,
-.form-horizontal .uneditable-input,
-.form-search .input-prepend,
-.form-inline .input-prepend,
-.form-horizontal .input-prepend,
-.form-search .input-append,
-.form-inline .input-append,
-.form-horizontal .input-append {
- display: inline-block;
- *display: inline;
- margin-bottom: 0;
- vertical-align: middle;
- *zoom: 1;
-}
-
-.form-search .hide,
-.form-inline .hide,
-.form-horizontal .hide {
- display: none;
-}
-
-.form-search label,
-.form-inline label,
-.form-search .btn-group,
-.form-inline .btn-group {
- display: inline-block;
-}
-
-.form-search .input-append,
-.form-inline .input-append,
-.form-search .input-prepend,
-.form-inline .input-prepend {
- margin-bottom: 0;
-}
-
-.form-search .radio,
-.form-search .checkbox,
-.form-inline .radio,
-.form-inline .checkbox {
- padding-left: 0;
- margin-bottom: 0;
- vertical-align: middle;
-}
-
-.form-search .radio input[type="radio"],
-.form-search .checkbox input[type="checkbox"],
-.form-inline .radio input[type="radio"],
-.form-inline .checkbox input[type="checkbox"] {
- float: left;
- margin-right: 3px;
- margin-left: 0;
-}
-
-.control-group {
- margin-bottom: 10px;
-}
-
-legend + .control-group {
- margin-top: 20px;
- -webkit-margin-top-collapse: separate;
-}
-
-.form-horizontal .control-group {
- margin-bottom: 20px;
- *zoom: 1;
-}
-
-.form-horizontal .control-group:before,
-.form-horizontal .control-group:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.form-horizontal .control-group:after {
- clear: both;
-}
-
-.form-horizontal .control-label {
- float: left;
- width: 160px;
- padding-top: 5px;
- text-align: right;
-}
-
-.form-horizontal .controls {
- *display: inline-block;
- *padding-left: 20px;
- margin-left: 180px;
- *margin-left: 0;
-}
-
-.form-horizontal .controls:first-child {
- *padding-left: 180px;
-}
-
-.form-horizontal .help-block {
- margin-bottom: 0;
-}
-
-.form-horizontal input + .help-block,
-.form-horizontal select + .help-block,
-.form-horizontal textarea + .help-block {
- margin-top: 10px;
-}
-
-.form-horizontal .form-actions {
- padding-left: 180px;
-}
-
-table {
- max-width: 100%;
- background-color: transparent;
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-.table {
- width: 100%;
- margin-bottom: 20px;
-}
-
-.table th,
-.table td {
- padding: 8px;
- line-height: 20px;
- text-align: left;
- vertical-align: top;
- border-top: 1px solid #dddddd;
-}
-
-.table th {
- font-weight: bold;
-}
-
-.table thead th {
- vertical-align: bottom;
-}
-
-.table caption + thead tr:first-child th,
-.table caption + thead tr:first-child td,
-.table colgroup + thead tr:first-child th,
-.table colgroup + thead tr:first-child td,
-.table thead:first-child tr:first-child th,
-.table thead:first-child tr:first-child td {
- border-top: 0;
-}
-
-.table tbody + tbody {
- border-top: 2px solid #dddddd;
-}
-
-.table-condensed th,
-.table-condensed td {
- padding: 4px 5px;
-}
-
-.table-bordered {
- border: 1px solid #dddddd;
- border-collapse: separate;
- *border-collapse: collapse;
- border-left: 0;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.table-bordered th,
-.table-bordered td {
- border-left: 1px solid #dddddd;
-}
-
-.table-bordered caption + thead tr:first-child th,
-.table-bordered caption + tbody tr:first-child th,
-.table-bordered caption + tbody tr:first-child td,
-.table-bordered colgroup + thead tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child td,
-.table-bordered thead:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child td {
- border-top: 0;
-}
-
-.table-bordered thead:first-child tr:first-child th:first-child,
-.table-bordered tbody:first-child tr:first-child td:first-child {
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-bordered thead:first-child tr:first-child th:last-child,
-.table-bordered tbody:first-child tr:first-child td:last-child {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -moz-border-radius-topright: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:first-child,
-.table-bordered tbody:last-child tr:last-child td:first-child,
-.table-bordered tfoot:last-child tr:last-child td:first-child {
- -webkit-border-radius: 0 0 0 4px;
- -moz-border-radius: 0 0 0 4px;
- border-radius: 0 0 0 4px;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:last-child,
-.table-bordered tbody:last-child tr:last-child td:last-child,
-.table-bordered tfoot:last-child tr:last-child td:last-child {
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-border-radius-bottomright: 4px;
-}
-
-.table-bordered caption + thead tr:first-child th:first-child,
-.table-bordered caption + tbody tr:first-child td:first-child,
-.table-bordered colgroup + thead tr:first-child th:first-child,
-.table-bordered colgroup + tbody tr:first-child td:first-child {
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-bordered caption + thead tr:first-child th:last-child,
-.table-bordered caption + tbody tr:first-child td:last-child,
-.table-bordered colgroup + thead tr:first-child th:last-child,
-.table-bordered colgroup + tbody tr:first-child td:last-child {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-striped tbody tr:nth-child(odd) td,
-.table-striped tbody tr:nth-child(odd) th {
- background-color: #f9f9f9;
-}
-
-.table-hover tbody tr:hover td,
-.table-hover tbody tr:hover th {
- background-color: #f5f5f5;
-}
-
-table [class*=span],
-.row-fluid table [class*=span] {
- display: table-cell;
- float: none;
- margin-left: 0;
-}
-
-.table .span1 {
- float: none;
- width: 44px;
- margin-left: 0;
-}
-
-.table .span2 {
- float: none;
- width: 124px;
- margin-left: 0;
-}
-
-.table .span3 {
- float: none;
- width: 204px;
- margin-left: 0;
-}
-
-.table .span4 {
- float: none;
- width: 284px;
- margin-left: 0;
-}
-
-.table .span5 {
- float: none;
- width: 364px;
- margin-left: 0;
-}
-
-.table .span6 {
- float: none;
- width: 444px;
- margin-left: 0;
-}
-
-.table .span7 {
- float: none;
- width: 524px;
- margin-left: 0;
-}
-
-.table .span8 {
- float: none;
- width: 604px;
- margin-left: 0;
-}
-
-.table .span9 {
- float: none;
- width: 684px;
- margin-left: 0;
-}
-
-.table .span10 {
- float: none;
- width: 764px;
- margin-left: 0;
-}
-
-.table .span11 {
- float: none;
- width: 844px;
- margin-left: 0;
-}
-
-.table .span12 {
- float: none;
- width: 924px;
- margin-left: 0;
-}
-
-.table .span13 {
- float: none;
- width: 1004px;
- margin-left: 0;
-}
-
-.table .span14 {
- float: none;
- width: 1084px;
- margin-left: 0;
-}
-
-.table .span15 {
- float: none;
- width: 1164px;
- margin-left: 0;
-}
-
-.table .span16 {
- float: none;
- width: 1244px;
- margin-left: 0;
-}
-
-.table .span17 {
- float: none;
- width: 1324px;
- margin-left: 0;
-}
-
-.table .span18 {
- float: none;
- width: 1404px;
- margin-left: 0;
-}
-
-.table .span19 {
- float: none;
- width: 1484px;
- margin-left: 0;
-}
-
-.table .span20 {
- float: none;
- width: 1564px;
- margin-left: 0;
-}
-
-.table .span21 {
- float: none;
- width: 1644px;
- margin-left: 0;
-}
-
-.table .span22 {
- float: none;
- width: 1724px;
- margin-left: 0;
-}
-
-.table .span23 {
- float: none;
- width: 1804px;
- margin-left: 0;
-}
-
-.table .span24 {
- float: none;
- width: 1884px;
- margin-left: 0;
-}
-
-.table tbody tr.success td {
- background-color: #dff0d8;
-}
-
-.table tbody tr.error td {
- background-color: #f2dede;
-}
-
-.table tbody tr.warning td {
- background-color: #fcf8e3;
-}
-
-.table tbody tr.info td {
- background-color: #d9edf7;
-}
-
-.table-hover tbody tr.success:hover td {
- background-color: #d0e9c6;
-}
-
-.table-hover tbody tr.error:hover td {
- background-color: #ebcccc;
-}
-
-.table-hover tbody tr.warning:hover td {
- background-color: #faf2cc;
-}
-
-.table-hover tbody tr.info:hover td {
- background-color: #c4e3f3;
-}
-
-[class^="icon-"],
-[class*=" icon-"] {
- display: inline-block;
- width: 14px;
- height: 14px;
- margin-top: 1px;
- *margin-right: .3em;
- line-height: 14px;
- vertical-align: text-top;
- background-image: url("../img/glyphicons-halflings.png");
- background-position: 14px 14px;
- background-repeat: no-repeat;
-}
-
-/* White icons with optional class, or on hover/active states of certain elements */
-
-.icon-white,
-.nav-tabs > .active > a > [class^="icon-"],
-.nav-tabs > .active > a > [class*=" icon-"],
-.nav-pills > .active > a > [class^="icon-"],
-.nav-pills > .active > a > [class*=" icon-"],
-.nav-list > .active > a > [class^="icon-"],
-.nav-list > .active > a > [class*=" icon-"],
-.navbar-inverse .nav > .active > a > [class^="icon-"],
-.navbar-inverse .nav > .active > a > [class*=" icon-"],
-.dropdown-menu > li > a:hover > [class^="icon-"],
-.dropdown-menu > li > a:hover > [class*=" icon-"],
-.dropdown-menu > .active > a > [class^="icon-"],
-.dropdown-menu > .active > a > [class*=" icon-"] {
- background-image: url("../img/glyphicons-halflings-white.png");
-}
-
-.icon-glass {
- background-position: 0 0;
-}
-
-.icon-music {
- background-position: -24px 0;
-}
-
-.icon-search {
- background-position: -48px 0;
-}
-
-.icon-envelope {
- background-position: -72px 0;
-}
-
-.icon-heart {
- background-position: -96px 0;
-}
-
-.icon-star {
- background-position: -120px 0;
-}
-
-.icon-star-empty {
- background-position: -144px 0;
-}
-
-.icon-user {
- background-position: -168px 0;
-}
-
-.icon-film {
- background-position: -192px 0;
-}
-
-.icon-th-large {
- background-position: -216px 0;
-}
-
-.icon-th {
- background-position: -240px 0;
-}
-
-.icon-th-list {
- background-position: -264px 0;
-}
-
-.icon-ok {
- background-position: -288px 0;
-}
-
-.icon-remove {
- background-position: -312px 0;
-}
-
-.icon-zoom-in {
- background-position: -336px 0;
-}
-
-.icon-zoom-out {
- background-position: -360px 0;
-}
-
-.icon-off {
- background-position: -384px 0;
-}
-
-.icon-signal {
- background-position: -408px 0;
-}
-
-.icon-cog {
- background-position: -432px 0;
-}
-
-.icon-trash {
- background-position: -456px 0;
-}
-
-.icon-home {
- background-position: 0 -24px;
-}
-
-.icon-file {
- background-position: -24px -24px;
-}
-
-.icon-time {
- background-position: -48px -24px;
-}
-
-.icon-road {
- background-position: -72px -24px;
-}
-
-.icon-download-alt {
- background-position: -96px -24px;
-}
-
-.icon-download {
- background-position: -120px -24px;
-}
-
-.icon-upload {
- background-position: -144px -24px;
-}
-
-.icon-inbox {
- background-position: -168px -24px;
-}
-
-.icon-play-circle {
- background-position: -192px -24px;
-}
-
-.icon-repeat {
- background-position: -216px -24px;
-}
-
-.icon-refresh {
- background-position: -240px -24px;
-}
-
-.icon-list-alt {
- background-position: -264px -24px;
-}
-
-.icon-lock {
- background-position: -287px -24px;
-}
-
-.icon-flag {
- background-position: -312px -24px;
-}
-
-.icon-headphones {
- background-position: -336px -24px;
-}
-
-.icon-volume-off {
- background-position: -360px -24px;
-}
-
-.icon-volume-down {
- background-position: -384px -24px;
-}
-
-.icon-volume-up {
- background-position: -408px -24px;
-}
-
-.icon-qrcode {
- background-position: -432px -24px;
-}
-
-.icon-barcode {
- background-position: -456px -24px;
-}
-
-.icon-tag {
- background-position: 0 -48px;
-}
-
-.icon-tags {
- background-position: -25px -48px;
-}
-
-.icon-book {
- background-position: -48px -48px;
-}
-
-.icon-bookmark {
- background-position: -72px -48px;
-}
-
-.icon-print {
- background-position: -96px -48px;
-}
-
-.icon-camera {
- background-position: -120px -48px;
-}
-
-.icon-font {
- background-position: -144px -48px;
-}
-
-.icon-bold {
- background-position: -167px -48px;
-}
-
-.icon-italic {
- background-position: -192px -48px;
-}
-
-.icon-text-height {
- background-position: -216px -48px;
-}
-
-.icon-text-width {
- background-position: -240px -48px;
-}
-
-.icon-align-left {
- background-position: -264px -48px;
-}
-
-.icon-align-center {
- background-position: -288px -48px;
-}
-
-.icon-align-right {
- background-position: -312px -48px;
-}
-
-.icon-align-justify {
- background-position: -336px -48px;
-}
-
-.icon-list {
- background-position: -360px -48px;
-}
-
-.icon-indent-left {
- background-position: -384px -48px;
-}
-
-.icon-indent-right {
- background-position: -408px -48px;
-}
-
-.icon-facetime-video {
- background-position: -432px -48px;
-}
-
-.icon-picture {
- background-position: -456px -48px;
-}
-
-.icon-pencil {
- background-position: 0 -72px;
-}
-
-.icon-map-marker {
- background-position: -24px -72px;
-}
-
-.icon-adjust {
- background-position: -48px -72px;
-}
-
-.icon-tint {
- background-position: -72px -72px;
-}
-
-.icon-edit {
- background-position: -96px -72px;
-}
-
-.icon-share {
- background-position: -120px -72px;
-}
-
-.icon-check {
- background-position: -144px -72px;
-}
-
-.icon-move {
- background-position: -168px -72px;
-}
-
-.icon-step-backward {
- background-position: -192px -72px;
-}
-
-.icon-fast-backward {
- background-position: -216px -72px;
-}
-
-.icon-backward {
- background-position: -240px -72px;
-}
-
-.icon-play {
- background-position: -264px -72px;
-}
-
-.icon-pause {
- background-position: -288px -72px;
-}
-
-.icon-stop {
- background-position: -312px -72px;
-}
-
-.icon-forward {
- background-position: -336px -72px;
-}
-
-.icon-fast-forward {
- background-position: -360px -72px;
-}
-
-.icon-step-forward {
- background-position: -384px -72px;
-}
-
-.icon-eject {
- background-position: -408px -72px;
-}
-
-.icon-chevron-left {
- background-position: -432px -72px;
-}
-
-.icon-chevron-right {
- background-position: -456px -72px;
-}
-
-.icon-plus-sign {
- background-position: 0 -96px;
-}
-
-.icon-minus-sign {
- background-position: -24px -96px;
-}
-
-.icon-remove-sign {
- background-position: -48px -96px;
-}
-
-.icon-ok-sign {
- background-position: -72px -96px;
-}
-
-.icon-question-sign {
- background-position: -96px -96px;
-}
-
-.icon-info-sign {
- background-position: -120px -96px;
-}
-
-.icon-screenshot {
- background-position: -144px -96px;
-}
-
-.icon-remove-circle {
- background-position: -168px -96px;
-}
-
-.icon-ok-circle {
- background-position: -192px -96px;
-}
-
-.icon-ban-circle {
- background-position: -216px -96px;
-}
-
-.icon-arrow-left {
- background-position: -240px -96px;
-}
-
-.icon-arrow-right {
- background-position: -264px -96px;
-}
-
-.icon-arrow-up {
- background-position: -289px -96px;
-}
-
-.icon-arrow-down {
- background-position: -312px -96px;
-}
-
-.icon-share-alt {
- background-position: -336px -96px;
-}
-
-.icon-resize-full {
- background-position: -360px -96px;
-}
-
-.icon-resize-small {
- background-position: -384px -96px;
-}
-
-.icon-plus {
- background-position: -408px -96px;
-}
-
-.icon-minus {
- background-position: -433px -96px;
-}
-
-.icon-asterisk {
- background-position: -456px -96px;
-}
-
-.icon-exclamation-sign {
- background-position: 0 -120px;
-}
-
-.icon-gift {
- background-position: -24px -120px;
-}
-
-.icon-leaf {
- background-position: -48px -120px;
-}
-
-.icon-fire {
- background-position: -72px -120px;
-}
-
-.icon-eye-open {
- background-position: -96px -120px;
-}
-
-.icon-eye-close {
- background-position: -120px -120px;
-}
-
-.icon-warning-sign {
- background-position: -144px -120px;
-}
-
-.icon-plane {
- background-position: -168px -120px;
-}
-
-.icon-calendar {
- background-position: -192px -120px;
-}
-
-.icon-random {
- width: 16px;
- background-position: -216px -120px;
-}
-
-.icon-comment {
- background-position: -240px -120px;
-}
-
-.icon-magnet {
- background-position: -264px -120px;
-}
-
-.icon-chevron-up {
- background-position: -288px -120px;
-}
-
-.icon-chevron-down {
- background-position: -313px -119px;
-}
-
-.icon-retweet {
- background-position: -336px -120px;
-}
-
-.icon-shopping-cart {
- background-position: -360px -120px;
-}
-
-.icon-folder-close {
- background-position: -384px -120px;
-}
-
-.icon-folder-open {
- width: 16px;
- background-position: -408px -120px;
-}
-
-.icon-resize-vertical {
- background-position: -432px -119px;
-}
-
-.icon-resize-horizontal {
- background-position: -456px -118px;
-}
-
-.icon-hdd {
- background-position: 0 -144px;
-}
-
-.icon-bullhorn {
- background-position: -24px -144px;
-}
-
-.icon-bell {
- background-position: -48px -144px;
-}
-
-.icon-certificate {
- background-position: -72px -144px;
-}
-
-.icon-thumbs-up {
- background-position: -96px -144px;
-}
-
-.icon-thumbs-down {
- background-position: -120px -144px;
-}
-
-.icon-hand-right {
- background-position: -144px -144px;
-}
-
-.icon-hand-left {
- background-position: -168px -144px;
-}
-
-.icon-hand-up {
- background-position: -192px -144px;
-}
-
-.icon-hand-down {
- background-position: -216px -144px;
-}
-
-.icon-circle-arrow-right {
- background-position: -240px -144px;
-}
-
-.icon-circle-arrow-left {
- background-position: -264px -144px;
-}
-
-.icon-circle-arrow-up {
- background-position: -288px -144px;
-}
-
-.icon-circle-arrow-down {
- background-position: -312px -144px;
-}
-
-.icon-globe {
- background-position: -336px -144px;
-}
-
-.icon-wrench {
- background-position: -360px -144px;
-}
-
-.icon-tasks {
- background-position: -384px -144px;
-}
-
-.icon-filter {
- background-position: -408px -144px;
-}
-
-.icon-briefcase {
- background-position: -432px -144px;
-}
-
-.icon-fullscreen {
- background-position: -456px -144px;
-}
-
-.dropup,
-.dropdown {
- position: relative;
-}
-
-.dropdown-toggle {
- *margin-bottom: -3px;
-}
-
-.dropdown-toggle:active,
-.open .dropdown-toggle {
- outline: 0;
-}
-
-.caret {
- display: inline-block;
- width: 0;
- height: 0;
- vertical-align: top;
- border-top: 4px solid #000000;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
- content: "";
-}
-
-.dropdown .caret {
- margin-top: 8px;
- margin-left: 2px;
-}
-
-.dropdown-menu {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- display: none;
- float: left;
- min-width: 160px;
- padding: 5px 0;
- margin: 2px 0 0;
- list-style: none;
- background-color: #ffffff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- *border-right-width: 2px;
- *border-bottom-width: 2px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
-}
-
-.dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.dropdown-menu .divider {
- *width: 100%;
- height: 1px;
- margin: 9px 1px;
- *margin: -5px 0 5px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #ffffff;
-}
-
-.dropdown-menu a {
- display: block;
- padding: 3px 20px;
- clear: both;
- font-weight: normal;
- line-height: 20px;
- color: #333333;
- white-space: nowrap;
-}
-
-.dropdown-menu li > a:hover,
-.dropdown-menu li > a:focus,
-.dropdown-submenu:hover > a {
- color: #ffffff;
- text-decoration: none;
- background-color: #0088cc;
- background-color: #0081c2;
- background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
- background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
- background-image: -o-linear-gradient(top, #0088cc, #0077b3);
- background-image: linear-gradient(to bottom, #0088cc, #0077b3);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
-}
-
-.dropdown-menu .active > a,
-.dropdown-menu .active > a:hover {
- color: #ffffff;
- text-decoration: none;
- background-color: #0088cc;
- background-color: #0081c2;
- background-image: linear-gradient(to bottom, #0088cc, #0077b3);
- background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
- background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
- background-image: -o-linear-gradient(top, #0088cc, #0077b3);
- background-repeat: repeat-x;
- outline: 0;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
-}
-
-.dropdown-menu .disabled > a,
-.dropdown-menu .disabled > a:hover {
- color: #999999;
-}
-
-.dropdown-menu .disabled > a:hover {
- text-decoration: none;
- cursor: default;
- background-color: transparent;
-}
-
-.open {
- *z-index: 1000;
-}
-
-.open > .dropdown-menu {
- display: block;
-}
-
-.pull-right > .dropdown-menu {
- right: 0;
- left: auto;
-}
-
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
- border-top: 0;
- border-bottom: 4px solid #000000;
- content: "";
-}
-
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
- top: auto;
- bottom: 100%;
- margin-bottom: 1px;
-}
-
-.dropdown-submenu {
- position: relative;
-}
-
-.dropdown-submenu > .dropdown-menu {
- top: 0;
- left: 100%;
- margin-top: -6px;
- margin-left: -1px;
- -webkit-border-radius: 0 6px 6px 6px;
- -moz-border-radius: 0 6px 6px 6px;
- border-radius: 0 6px 6px 6px;
-}
-
-.dropdown-submenu:hover > .dropdown-menu {
- display: block;
-}
-
-.dropdown-submenu > a:after {
- display: block;
- float: right;
- width: 0;
- height: 0;
- margin-top: 5px;
- margin-right: -10px;
- border-color: transparent;
- border-left-color: #cccccc;
- border-style: solid;
- border-width: 5px 0 5px 5px;
- content: " ";
-}
-
-.dropdown-submenu:hover > a:after {
- border-left-color: #ffffff;
-}
-
-.dropdown .dropdown-menu .nav-header {
- padding-right: 20px;
- padding-left: 20px;
-}
-
-.typeahead {
- margin-top: 2px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #e3e3e3;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.well blockquote {
- border-color: #ddd;
- border-color: rgba(0, 0, 0, 0.15);
-}
-
-.well-large {
- padding: 24px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.well-small {
- padding: 9px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-.fade {
- opacity: 0;
- -webkit-transition: opacity 0.15s linear;
- -moz-transition: opacity 0.15s linear;
- -o-transition: opacity 0.15s linear;
- transition: opacity 0.15s linear;
-}
-
-.fade.in {
- opacity: 1;
-}
-
-.collapse {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition: height 0.35s ease;
- -moz-transition: height 0.35s ease;
- -o-transition: height 0.35s ease;
- transition: height 0.35s ease;
-}
-
-.collapse.in {
- height: auto;
-}
-
-.close {
- float: right;
- font-size: 20px;
- font-weight: bold;
- line-height: 20px;
- color: #000000;
- text-shadow: 0 1px 0 #ffffff;
- opacity: 0.2;
- filter: alpha(opacity=20);
-}
-
-.close:hover {
- color: #000000;
- text-decoration: none;
- cursor: pointer;
- opacity: 0.4;
- filter: alpha(opacity=40);
-}
-
-button.close {
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: 0;
- -webkit-appearance: none;
-}
-
-.btn {
- display: inline-block;
- *display: inline;
- padding: 4px 14px;
- margin-bottom: 0;
- *margin-left: .3em;
- font-size: 14px;
- line-height: 20px;
- *line-height: 20px;
- color: #333333;
- text-align: center;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- vertical-align: middle;
- cursor: pointer;
- background-color: #f5f5f5;
- *background-color: #e6e6e6;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- border: 1px solid #bbbbbb;
- *border: 0;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-bottom-color: #a2a2a2;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
- *zoom: 1;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn:hover,
-.btn:active,
-.btn.active,
-.btn.disabled,
-.btn[disabled] {
- color: #333333;
- background-color: #e6e6e6;
- *background-color: #d9d9d9;
-}
-
-.btn:active,
-.btn.active {
- background-color: #cccccc \9;
-}
-
-.btn:first-child {
- *margin-left: 0;
-}
-
-.btn:hover {
- color: #333333;
- text-decoration: none;
- background-color: #e6e6e6;
- *background-color: #d9d9d9;
- /* Buttons in IE7 don't get borders, so darken on hover */
-
- background-position: 0 -15px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
-}
-
-.btn:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-.btn.active,
-.btn:active {
- background-color: #e6e6e6;
- background-color: #d9d9d9 \9;
- background-image: none;
- outline: 0;
- -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn.disabled,
-.btn[disabled] {
- cursor: default;
- background-color: #e6e6e6;
- background-image: none;
- opacity: 0.65;
- filter: alpha(opacity=65);
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-large {
- padding: 9px 14px;
- font-size: 16px;
- line-height: normal;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.btn-large [class^="icon-"] {
- margin-top: 2px;
-}
-
-.btn-small {
- padding: 3px 9px;
- font-size: 12px;
- line-height: 18px;
-}
-
-.btn-small [class^="icon-"] {
- margin-top: 0;
-}
-
-.btn-mini {
- padding: 2px 6px;
- font-size: 11px;
- line-height: 17px;
-}
-
-.btn-block {
- display: block;
- width: 100%;
- padding-right: 0;
- padding-left: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-.btn-block + .btn-block {
- margin-top: 5px;
-}
-
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
- width: 100%;
-}
-
-.btn-primary.active,
-.btn-warning.active,
-.btn-danger.active,
-.btn-success.active,
-.btn-info.active,
-.btn-inverse.active {
- color: rgba(255, 255, 255, 0.75);
-}
-
-.btn {
- border-color: #c5c5c5;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
-}
-
-.btn-primary {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #006dcc;
- *background-color: #0044cc;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
- background-image: linear-gradient(to bottom, #0088cc, #0044cc);
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
- background-repeat: repeat-x;
- border-color: #0044cc #0044cc #002a80;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-primary:hover,
-.btn-primary:active,
-.btn-primary.active,
-.btn-primary.disabled,
-.btn-primary[disabled] {
- color: #ffffff;
- background-color: #0044cc;
- *background-color: #003bb3;
-}
-
-.btn-primary:active,
-.btn-primary.active {
- background-color: #003399 \9;
-}
-
-.btn-warning {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #faa732;
- *background-color: #f89406;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
- background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
- background-image: -o-linear-gradient(top, #fbb450, #f89406);
- background-image: linear-gradient(to bottom, #fbb450, #f89406);
- background-image: -moz-linear-gradient(top, #fbb450, #f89406);
- background-repeat: repeat-x;
- border-color: #f89406 #f89406 #ad6704;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-warning:hover,
-.btn-warning:active,
-.btn-warning.active,
-.btn-warning.disabled,
-.btn-warning[disabled] {
- color: #ffffff;
- background-color: #f89406;
- *background-color: #df8505;
-}
-
-.btn-warning:active,
-.btn-warning.active {
- background-color: #c67605 \9;
-}
-
-.btn-danger {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #da4f49;
- *background-color: #bd362f;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
- background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
- background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
- background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
- background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
- background-repeat: repeat-x;
- border-color: #bd362f #bd362f #802420;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-danger:hover,
-.btn-danger:active,
-.btn-danger.active,
-.btn-danger.disabled,
-.btn-danger[disabled] {
- color: #ffffff;
- background-color: #bd362f;
- *background-color: #a9302a;
-}
-
-.btn-danger:active,
-.btn-danger.active {
- background-color: #942a25 \9;
-}
-
-.btn-success {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #5bb75b;
- *background-color: #51a351;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
- background-image: -webkit-linear-gradient(top, #62c462, #51a351);
- background-image: -o-linear-gradient(top, #62c462, #51a351);
- background-image: linear-gradient(to bottom, #62c462, #51a351);
- background-image: -moz-linear-gradient(top, #62c462, #51a351);
- background-repeat: repeat-x;
- border-color: #51a351 #51a351 #387038;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-success:hover,
-.btn-success:active,
-.btn-success.active,
-.btn-success.disabled,
-.btn-success[disabled] {
- color: #ffffff;
- background-color: #51a351;
- *background-color: #499249;
-}
-
-.btn-success:active,
-.btn-success.active {
- background-color: #408140 \9;
-}
-
-.btn-info {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #49afcd;
- *background-color: #2f96b4;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
- background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
- background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
- background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
- background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
- background-repeat: repeat-x;
- border-color: #2f96b4 #2f96b4 #1f6377;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-info:hover,
-.btn-info:active,
-.btn-info.active,
-.btn-info.disabled,
-.btn-info[disabled] {
- color: #ffffff;
- background-color: #2f96b4;
- *background-color: #2a85a0;
-}
-
-.btn-info:active,
-.btn-info.active {
- background-color: #24748c \9;
-}
-
-.btn-inverse {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #363636;
- *background-color: #222222;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
- background-image: -webkit-linear-gradient(top, #444444, #222222);
- background-image: -o-linear-gradient(top, #444444, #222222);
- background-image: linear-gradient(to bottom, #444444, #222222);
- background-image: -moz-linear-gradient(top, #444444, #222222);
- background-repeat: repeat-x;
- border-color: #222222 #222222 #000000;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-inverse:hover,
-.btn-inverse:active,
-.btn-inverse.active,
-.btn-inverse.disabled,
-.btn-inverse[disabled] {
- color: #ffffff;
- background-color: #222222;
- *background-color: #151515;
-}
-
-.btn-inverse:active,
-.btn-inverse.active {
- background-color: #080808 \9;
-}
-
-button.btn,
-input[type="submit"].btn {
- *padding-top: 3px;
- *padding-bottom: 3px;
-}
-
-button.btn::-moz-focus-inner,
-input[type="submit"].btn::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-
-button.btn.btn-large,
-input[type="submit"].btn.btn-large {
- *padding-top: 7px;
- *padding-bottom: 7px;
-}
-
-button.btn.btn-small,
-input[type="submit"].btn.btn-small {
- *padding-top: 3px;
- *padding-bottom: 3px;
-}
-
-button.btn.btn-mini,
-input[type="submit"].btn.btn-mini {
- *padding-top: 1px;
- *padding-bottom: 1px;
-}
-
-.btn-link,
-.btn-link:active,
-.btn-link[disabled] {
- background-color: transparent;
- background-image: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-link {
- color: #0088cc;
- cursor: pointer;
- border-color: transparent;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-link:hover {
- color: #005580;
- text-decoration: underline;
- background-color: transparent;
-}
-
-.btn-link[disabled]:hover {
- color: #333333;
- text-decoration: none;
-}
-
-.btn-group {
- position: relative;
- *margin-left: .3em;
- font-size: 0;
- white-space: nowrap;
- vertical-align: middle;
-}
-
-.btn-group:first-child {
- *margin-left: 0;
-}
-
-.btn-group + .btn-group {
- margin-left: 5px;
-}
-
-.btn-toolbar {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 0;
-}
-
-.btn-toolbar .btn-group {
- display: inline-block;
- *display: inline;
- /* IE7 inline-block hack */
-
- *zoom: 1;
-}
-
-.btn-toolbar .btn + .btn,
-.btn-toolbar .btn-group + .btn,
-.btn-toolbar .btn + .btn-group {
- margin-left: 5px;
-}
-
-.btn-group > .btn {
- position: relative;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-group > .btn + .btn {
- margin-left: -1px;
-}
-
-.btn-group > .btn,
-.btn-group > .dropdown-menu {
- font-size: 14px;
-}
-
-.btn-group > .btn-mini {
- font-size: 11px;
-}
-
-.btn-group > .btn-small {
- font-size: 12px;
-}
-
-.btn-group > .btn-large {
- font-size: 16px;
-}
-
-.btn-group > .btn:first-child {
- margin-left: 0;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.btn-group > .btn:last-child,
-.btn-group > .dropdown-toggle {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-bottomright: 4px;
-}
-
-.btn-group > .btn.large:first-child {
- margin-left: 0;
- -webkit-border-bottom-left-radius: 6px;
- border-bottom-left-radius: 6px;
- -webkit-border-top-left-radius: 6px;
- border-top-left-radius: 6px;
- -moz-border-radius-bottomleft: 6px;
- -moz-border-radius-topleft: 6px;
-}
-
-.btn-group > .btn.large:last-child,
-.btn-group > .large.dropdown-toggle {
- -webkit-border-top-right-radius: 6px;
- border-top-right-radius: 6px;
- -webkit-border-bottom-right-radius: 6px;
- border-bottom-right-radius: 6px;
- -moz-border-radius-topright: 6px;
- -moz-border-radius-bottomright: 6px;
-}
-
-.btn-group > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group > .btn:active,
-.btn-group > .btn.active {
- z-index: 2;
-}
-
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
- outline: 0;
-}
-
-.btn-group > .btn + .dropdown-toggle {
- *padding-top: 5px;
- padding-right: 8px;
- *padding-bottom: 5px;
- padding-left: 8px;
- -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group > .btn-mini + .dropdown-toggle {
- *padding-top: 2px;
- padding-right: 5px;
- *padding-bottom: 2px;
- padding-left: 5px;
-}
-
-.btn-group > .btn-small + .dropdown-toggle {
- *padding-top: 5px;
- *padding-bottom: 4px;
-}
-
-.btn-group > .btn-large + .dropdown-toggle {
- *padding-top: 7px;
- padding-right: 12px;
- *padding-bottom: 7px;
- padding-left: 12px;
-}
-
-.btn-group.open .dropdown-toggle {
- background-image: none;
- -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group.open .btn.dropdown-toggle {
- background-color: #e6e6e6;
-}
-
-.btn-group.open .btn-primary.dropdown-toggle {
- background-color: #0044cc;
-}
-
-.btn-group.open .btn-warning.dropdown-toggle {
- background-color: #f89406;
-}
-
-.btn-group.open .btn-danger.dropdown-toggle {
- background-color: #bd362f;
-}
-
-.btn-group.open .btn-success.dropdown-toggle {
- background-color: #51a351;
-}
-
-.btn-group.open .btn-info.dropdown-toggle {
- background-color: #2f96b4;
-}
-
-.btn-group.open .btn-inverse.dropdown-toggle {
- background-color: #222222;
-}
-
-.btn .caret {
- margin-top: 8px;
- margin-left: 0;
-}
-
-.btn-mini .caret,
-.btn-small .caret,
-.btn-large .caret {
- margin-top: 6px;
-}
-
-.btn-large .caret {
- border-top-width: 5px;
- border-right-width: 5px;
- border-left-width: 5px;
-}
-
-.dropup .btn-large .caret {
- border-top: 0;
- border-bottom: 5px solid #000000;
-}
-
-.btn-primary .caret,
-.btn-warning .caret,
-.btn-danger .caret,
-.btn-info .caret,
-.btn-success .caret,
-.btn-inverse .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-.btn-group-vertical {
- display: inline-block;
- *display: inline;
- /* IE7 inline-block hack */
-
- *zoom: 1;
-}
-
-.btn-group-vertical .btn {
- display: block;
- float: none;
- width: 100%;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-group-vertical .btn + .btn {
- margin-top: -1px;
- margin-left: 0;
-}
-
-.btn-group-vertical .btn:first-child {
- -webkit-border-radius: 4px 4px 0 0;
- -moz-border-radius: 4px 4px 0 0;
- border-radius: 4px 4px 0 0;
-}
-
-.btn-group-vertical .btn:last-child {
- -webkit-border-radius: 0 0 4px 4px;
- -moz-border-radius: 0 0 4px 4px;
- border-radius: 0 0 4px 4px;
-}
-
-.btn-group-vertical .btn-large:first-child {
- -webkit-border-radius: 6px 6px 0 0;
- -moz-border-radius: 6px 6px 0 0;
- border-radius: 6px 6px 0 0;
-}
-
-.btn-group-vertical .btn-large:last-child {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-
-.alert {
- padding: 8px 35px 8px 14px;
- margin-bottom: 20px;
- color: #c09853;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- background-color: #fcf8e3;
- border: 1px solid #fbeed5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.alert h4 {
- margin: 0;
-}
-
-.alert .close {
- position: relative;
- top: -2px;
- right: -21px;
- line-height: 20px;
-}
-
-.alert-success {
- color: #468847;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-
-.alert-danger,
-.alert-error {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #eed3d7;
-}
-
-.alert-info {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-
-.alert-block {
- padding-top: 14px;
- padding-bottom: 14px;
-}
-
-.alert-block > p,
-.alert-block > ul {
- margin-bottom: 0;
-}
-
-.alert-block p + p {
- margin-top: 5px;
-}
-
-.nav {
- margin-bottom: 20px;
- margin-left: 0;
- list-style: none;
-}
-
-.nav > li > a {
- display: block;
-}
-
-.nav > li > a:hover {
- text-decoration: none;
- background-color: #eeeeee;
-}
-
-.nav > .pull-right {
- float: right;
-}
-
-.nav-header {
- display: block;
- padding: 3px 15px;
- font-size: 11px;
- font-weight: bold;
- line-height: 20px;
- color: #999999;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- text-transform: uppercase;
-}
-
-.nav li + .nav-header {
- margin-top: 9px;
-}
-
-.nav-list {
- padding-right: 15px;
- padding-left: 15px;
- margin-bottom: 0;
-}
-
-.nav-list > li > a,
-.nav-list .nav-header {
- margin-right: -15px;
- margin-left: -15px;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-}
-
-.nav-list > li > a {
- padding: 3px 15px;
-}
-
-.nav-list > .active > a,
-.nav-list > .active > a:hover {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
- background-color: #0088cc;
-}
-
-.nav-list [class^="icon-"] {
- margin-right: 2px;
-}
-
-.nav-list .divider {
- *width: 100%;
- height: 1px;
- margin: 9px 1px;
- *margin: -5px 0 5px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #ffffff;
-}
-
-.nav-tabs,
-.nav-pills {
- *zoom: 1;
-}
-
-.nav-tabs:before,
-.nav-pills:before,
-.nav-tabs:after,
-.nav-pills:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.nav-tabs:after,
-.nav-pills:after {
- clear: both;
-}
-
-.nav-tabs > li,
-.nav-pills > li {
- float: left;
-}
-
-.nav-tabs > li > a,
-.nav-pills > li > a {
- padding-right: 12px;
- padding-left: 12px;
- margin-right: 2px;
- line-height: 14px;
-}
-
-.nav-tabs {
- border-bottom: 1px solid #ddd;
-}
-
-.nav-tabs > li {
- margin-bottom: -1px;
-}
-
-.nav-tabs > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- line-height: 20px;
- border: 1px solid transparent;
- -webkit-border-radius: 4px 4px 0 0;
- -moz-border-radius: 4px 4px 0 0;
- border-radius: 4px 4px 0 0;
-}
-
-.nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #dddddd;
-}
-
-.nav-tabs > .active > a,
-.nav-tabs > .active > a:hover {
- color: #555555;
- cursor: default;
- background-color: #ffffff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
-}
-
-.nav-pills > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- margin-top: 2px;
- margin-bottom: 2px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.nav-pills > .active > a,
-.nav-pills > .active > a:hover {
- color: #ffffff;
- background-color: #0088cc;
-}
-
-.nav-stacked > li {
- float: none;
-}
-
-.nav-stacked > li > a {
- margin-right: 0;
-}
-
-.nav-tabs.nav-stacked {
- border-bottom: 0;
-}
-
-.nav-tabs.nav-stacked > li > a {
- border: 1px solid #ddd;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.nav-tabs.nav-stacked > li:first-child > a {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.nav-tabs.nav-stacked > li:last-child > a {
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -moz-border-radius-bottomright: 4px;
- -moz-border-radius-bottomleft: 4px;
-}
-
-.nav-tabs.nav-stacked > li > a:hover {
- z-index: 2;
- border-color: #ddd;
-}
-
-.nav-pills.nav-stacked > li > a {
- margin-bottom: 3px;
-}
-
-.nav-pills.nav-stacked > li:last-child > a {
- margin-bottom: 1px;
-}
-
-.nav-tabs .dropdown-menu {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-
-.nav-pills .dropdown-menu {
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.nav .dropdown-toggle .caret {
- margin-top: 6px;
- border-top-color: #0088cc;
- border-bottom-color: #0088cc;
-}
-
-.nav .dropdown-toggle:hover .caret {
- border-top-color: #005580;
- border-bottom-color: #005580;
-}
-
-/* move down carets for tabs */
-
-.nav-tabs .dropdown-toggle .caret {
- margin-top: 8px;
-}
-
-.nav .active .dropdown-toggle .caret {
- border-top-color: #fff;
- border-bottom-color: #fff;
-}
-
-.nav-tabs .active .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-
-.nav > .dropdown.active > a:hover {
- cursor: pointer;
-}
-
-.nav-tabs .open .dropdown-toggle,
-.nav-pills .open .dropdown-toggle,
-.nav > li.dropdown.open.active > a:hover {
- color: #ffffff;
- background-color: #999999;
- border-color: #999999;
-}
-
-.nav li.dropdown.open .caret,
-.nav li.dropdown.open.active .caret,
-.nav li.dropdown.open a:hover .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
- opacity: 1;
- filter: alpha(opacity=100);
-}
-
-.tabs-stacked .open > a:hover {
- border-color: #999999;
-}
-
-.tabbable {
- *zoom: 1;
-}
-
-.tabbable:before,
-.tabbable:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.tabbable:after {
- clear: both;
-}
-
-.tab-content {
- overflow: auto;
-}
-
-.tabs-below > .nav-tabs,
-.tabs-right > .nav-tabs,
-.tabs-left > .nav-tabs {
- border-bottom: 0;
-}
-
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
- display: none;
-}
-
-.tab-content > .active,
-.pill-content > .active {
- display: block;
-}
-
-.tabs-below > .nav-tabs {
- border-top: 1px solid #ddd;
-}
-
-.tabs-below > .nav-tabs > li {
- margin-top: -1px;
- margin-bottom: 0;
-}
-
-.tabs-below > .nav-tabs > li > a {
- -webkit-border-radius: 0 0 4px 4px;
- -moz-border-radius: 0 0 4px 4px;
- border-radius: 0 0 4px 4px;
-}
-
-.tabs-below > .nav-tabs > li > a:hover {
- border-top-color: #ddd;
- border-bottom-color: transparent;
-}
-
-.tabs-below > .nav-tabs > .active > a,
-.tabs-below > .nav-tabs > .active > a:hover {
- border-color: transparent #ddd #ddd #ddd;
-}
-
-.tabs-left > .nav-tabs > li,
-.tabs-right > .nav-tabs > li {
- float: none;
-}
-
-.tabs-left > .nav-tabs > li > a,
-.tabs-right > .nav-tabs > li > a {
- min-width: 74px;
- margin-right: 0;
- margin-bottom: 3px;
-}
-
-.tabs-left > .nav-tabs {
- float: left;
- margin-right: 19px;
- border-right: 1px solid #ddd;
-}
-
-.tabs-left > .nav-tabs > li > a {
- margin-right: -1px;
- -webkit-border-radius: 4px 0 0 4px;
- -moz-border-radius: 4px 0 0 4px;
- border-radius: 4px 0 0 4px;
-}
-
-.tabs-left > .nav-tabs > li > a:hover {
- border-color: #eeeeee #dddddd #eeeeee #eeeeee;
-}
-
-.tabs-left > .nav-tabs .active > a,
-.tabs-left > .nav-tabs .active > a:hover {
- border-color: #ddd transparent #ddd #ddd;
- *border-right-color: #ffffff;
-}
-
-.tabs-right > .nav-tabs {
- float: right;
- margin-left: 19px;
- border-left: 1px solid #ddd;
-}
-
-.tabs-right > .nav-tabs > li > a {
- margin-left: -1px;
- -webkit-border-radius: 0 4px 4px 0;
- -moz-border-radius: 0 4px 4px 0;
- border-radius: 0 4px 4px 0;
-}
-
-.tabs-right > .nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #eeeeee #dddddd;
-}
-
-.tabs-right > .nav-tabs .active > a,
-.tabs-right > .nav-tabs .active > a:hover {
- border-color: #ddd #ddd #ddd transparent;
- *border-left-color: #ffffff;
-}
-
-.nav > .disabled > a {
- color: #999999;
-}
-
-.nav > .disabled > a:hover {
- text-decoration: none;
- cursor: default;
- background-color: transparent;
-}
-
-.navbar {
- *position: relative;
- *z-index: 2;
- margin-bottom: 20px;
- overflow: visible;
- color: #777777;
-}
-
-.navbar-inner {
- min-height: 40px;
- padding-right: 20px;
- padding-left: 20px;
- background-color: #fafafa;
- background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
- background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
- background-repeat: repeat-x;
- border: 1px solid #d4d4d4;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
- *zoom: 1;
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-}
-
-.navbar-inner:before,
-.navbar-inner:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.navbar-inner:after {
- clear: both;
-}
-
-.navbar .container {
- width: auto;
-}
-
-.nav-collapse.collapse {
- height: auto;
-}
-
-.navbar .brand {
- display: block;
- float: left;
- padding: 10px 20px 10px;
- margin-left: -20px;
- font-size: 20px;
- font-weight: 200;
- color: #777777;
- text-shadow: 0 1px 0 #ffffff;
-}
-
-.navbar .brand:hover {
- text-decoration: none;
-}
-
-.navbar-text {
- margin-bottom: 0;
- line-height: 40px;
-}
-
-.navbar-link {
- color: #777777;
-}
-
-.navbar-link:hover {
- color: #333333;
-}
-
-.navbar .divider-vertical {
- height: 40px;
- margin: 0 9px;
- border-right: 1px solid #ffffff;
- border-left: 1px solid #f2f2f2;
-}
-
-.navbar .btn,
-.navbar .btn-group {
- margin-top: 5px;
-}
-
-.navbar .btn-group .btn,
-.navbar .input-prepend .btn,
-.navbar .input-append .btn {
- margin-top: 0;
-}
-
-.navbar-form {
- margin-bottom: 0;
- *zoom: 1;
-}
-
-.navbar-form:before,
-.navbar-form:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.navbar-form:after {
- clear: both;
-}
-
-.navbar-form input,
-.navbar-form select,
-.navbar-form .radio,
-.navbar-form .checkbox {
- margin-top: 5px;
-}
-
-.navbar-form input,
-.navbar-form select,
-.navbar-form .btn {
- display: inline-block;
- margin-bottom: 0;
-}
-
-.navbar-form input[type="image"],
-.navbar-form input[type="checkbox"],
-.navbar-form input[type="radio"] {
- margin-top: 3px;
-}
-
-.navbar-form .input-append,
-.navbar-form .input-prepend {
- margin-top: 6px;
- white-space: nowrap;
-}
-
-.navbar-form .input-append input,
-.navbar-form .input-prepend input {
- margin-top: 0;
-}
-
-.navbar-search {
- position: relative;
- float: left;
- margin-top: 5px;
- margin-bottom: 0;
-}
-
-.navbar-search .search-query {
- padding: 4px 14px;
- margin-bottom: 0;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 13px;
- font-weight: normal;
- line-height: 1;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-.navbar-static-top {
- position: static;
- width: 100%;
- margin-bottom: 0;
-}
-
-.navbar-static-top .navbar-inner {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- z-index: 1030;
- margin-bottom: 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-static-top .navbar-inner {
- border-width: 0 0 1px;
-}
-
-.navbar-fixed-bottom .navbar-inner {
- border-width: 1px 0 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-fixed-bottom .navbar-inner {
- padding-right: 0;
- padding-left: 0;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.navbar-static-top .container,
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
- width: 940px;
-}
-
-.navbar-fixed-top {
- top: 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-static-top .navbar-inner {
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
-}
-
-.navbar-fixed-bottom {
- bottom: 0;
-}
-
-.navbar-fixed-bottom .navbar-inner {
- -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
-}
-
-.navbar .nav {
- position: relative;
- left: 0;
- display: block;
- float: left;
- margin: 0 10px 0 0;
-}
-
-.navbar .nav.pull-right {
- float: right;
- margin-right: 0;
-}
-
-.navbar .nav > li {
- float: left;
-}
-
-.navbar .nav > li > a {
- float: none;
- padding: 10px 15px 10px;
- color: #777777;
- text-decoration: none;
- text-shadow: 0 1px 0 #ffffff;
-}
-
-.navbar .nav .dropdown-toggle .caret {
- margin-top: 8px;
-}
-
-.navbar .nav > li > a:focus,
-.navbar .nav > li > a:hover {
- color: #333333;
- text-decoration: none;
- background-color: transparent;
-}
-
-.navbar .nav > .active > a,
-.navbar .nav > .active > a:hover,
-.navbar .nav > .active > a:focus {
- color: #555555;
- text-decoration: none;
- background-color: #e5e5e5;
- -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-}
-
-.navbar .btn-navbar {
- display: none;
- float: right;
- padding: 7px 10px;
- margin-right: 5px;
- margin-left: 5px;
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #ededed;
- *background-color: #e5e5e5;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));
- background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5);
- background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-repeat: repeat-x;
- border-color: #e5e5e5 #e5e5e5 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-}
-
-.navbar .btn-navbar:hover,
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active,
-.navbar .btn-navbar.disabled,
-.navbar .btn-navbar[disabled] {
- color: #ffffff;
- background-color: #e5e5e5;
- *background-color: #d9d9d9;
-}
-
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active {
- background-color: #cccccc \9;
-}
-
-.navbar .btn-navbar .icon-bar {
- display: block;
- width: 18px;
- height: 2px;
- background-color: #f5f5f5;
- -webkit-border-radius: 1px;
- -moz-border-radius: 1px;
- border-radius: 1px;
- -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
- -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.btn-navbar .icon-bar + .icon-bar {
- margin-top: 3px;
-}
-
-.navbar .nav > li > .dropdown-menu:before {
- position: absolute;
- top: -7px;
- left: 9px;
- display: inline-block;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-left: 7px solid transparent;
- border-bottom-color: rgba(0, 0, 0, 0.2);
- content: '';
-}
-
-.navbar .nav > li > .dropdown-menu:after {
- position: absolute;
- top: -6px;
- left: 10px;
- display: inline-block;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #ffffff;
- border-left: 6px solid transparent;
- content: '';
-}
-
-.navbar-fixed-bottom .nav > li > .dropdown-menu:before {
- top: auto;
- bottom: -7px;
- border-top: 7px solid #ccc;
- border-bottom: 0;
- border-top-color: rgba(0, 0, 0, 0.2);
-}
-
-.navbar-fixed-bottom .nav > li > .dropdown-menu:after {
- top: auto;
- bottom: -6px;
- border-top: 6px solid #ffffff;
- border-bottom: 0;
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle,
-.navbar .nav li.dropdown.active > .dropdown-toggle,
-.navbar .nav li.dropdown.open.active > .dropdown-toggle {
- color: #555555;
- background-color: #e5e5e5;
-}
-
-.navbar .nav li.dropdown > .dropdown-toggle .caret {
- border-top-color: #777777;
- border-bottom-color: #777777;
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle .caret,
-.navbar .nav li.dropdown.active > .dropdown-toggle .caret,
-.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-
-.navbar .pull-right > li > .dropdown-menu,
-.navbar .nav > li > .dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu:before,
-.navbar .nav > li > .dropdown-menu.pull-right:before {
- right: 12px;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu:after,
-.navbar .nav > li > .dropdown-menu.pull-right:after {
- right: 13px;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu .dropdown-menu,
-.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu {
- right: 100%;
- left: auto;
- margin-right: -1px;
- margin-left: 0;
- -webkit-border-radius: 6px 0 6px 6px;
- -moz-border-radius: 6px 0 6px 6px;
- border-radius: 6px 0 6px 6px;
-}
-
-.navbar-inverse {
- color: #999999;
-}
-
-.navbar-inverse .navbar-inner {
- background-color: #1b1b1b;
- background-image: -moz-linear-gradient(top, #222222, #111111);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));
- background-image: -webkit-linear-gradient(top, #222222, #111111);
- background-image: -o-linear-gradient(top, #222222, #111111);
- background-image: linear-gradient(to bottom, #222222, #111111);
- background-repeat: repeat-x;
- border-color: #252525;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);
-}
-
-.navbar-inverse .brand,
-.navbar-inverse .nav > li > a {
- color: #999999;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.navbar-inverse .brand:hover,
-.navbar-inverse .nav > li > a:hover {
- color: #ffffff;
-}
-
-.navbar-inverse .nav > li > a:focus,
-.navbar-inverse .nav > li > a:hover {
- color: #ffffff;
- background-color: transparent;
-}
-
-.navbar-inverse .nav .active > a,
-.navbar-inverse .nav .active > a:hover,
-.navbar-inverse .nav .active > a:focus {
- color: #ffffff;
- background-color: #111111;
-}
-
-.navbar-inverse .navbar-link {
- color: #999999;
-}
-
-.navbar-inverse .navbar-link:hover {
- color: #ffffff;
-}
-
-.navbar-inverse .divider-vertical {
- border-right-color: #222222;
- border-left-color: #111111;
-}
-
-.navbar-inverse .nav li.dropdown.open > .dropdown-toggle,
-.navbar-inverse .nav li.dropdown.active > .dropdown-toggle,
-.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle {
- color: #ffffff;
- background-color: #111111;
-}
-
-.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret {
- border-top-color: #999999;
- border-bottom-color: #999999;
-}
-
-.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret,
-.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret,
-.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-.navbar-inverse .navbar-search .search-query {
- color: #ffffff;
- background-color: #515151;
- border-color: #111111;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- -webkit-transition: none;
- -moz-transition: none;
- -o-transition: none;
- transition: none;
-}
-
-.navbar-inverse .navbar-search .search-query:-moz-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query:-ms-input-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query:focus,
-.navbar-inverse .navbar-search .search-query.focused {
- padding: 5px 15px;
- color: #333333;
- text-shadow: 0 1px 0 #ffffff;
- background-color: #ffffff;
- border: 0;
- outline: 0;
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
- -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-}
-
-.navbar-inverse .btn-navbar {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #0e0e0e;
- *background-color: #040404;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));
- background-image: -webkit-linear-gradient(top, #151515, #040404);
- background-image: -o-linear-gradient(top, #151515, #040404);
- background-image: linear-gradient(to bottom, #151515, #040404);
- background-image: -moz-linear-gradient(top, #151515, #040404);
- background-repeat: repeat-x;
- border-color: #040404 #040404 #000000;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.navbar-inverse .btn-navbar:hover,
-.navbar-inverse .btn-navbar:active,
-.navbar-inverse .btn-navbar.active,
-.navbar-inverse .btn-navbar.disabled,
-.navbar-inverse .btn-navbar[disabled] {
- color: #ffffff;
- background-color: #040404;
- *background-color: #000000;
-}
-
-.navbar-inverse .btn-navbar:active,
-.navbar-inverse .btn-navbar.active {
- background-color: #000000 \9;
-}
-
-.breadcrumb {
- padding: 8px 15px;
- margin: 0 0 20px;
- list-style: none;
- background-color: #f5f5f5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.breadcrumb li {
- display: inline-block;
- *display: inline;
- text-shadow: 0 1px 0 #ffffff;
- *zoom: 1;
-}
-
-.breadcrumb .divider {
- padding: 0 5px;
- color: #ccc;
-}
-
-.breadcrumb .active {
- color: #999999;
-}
-
-.pagination {
- height: 40px;
- margin: 20px 0;
-}
-
-.pagination ul {
- display: inline-block;
- *display: inline;
- margin-bottom: 0;
- margin-left: 0;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- *zoom: 1;
- -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.pagination ul > li {
- display: inline;
-}
-
-.pagination ul > li > a,
-.pagination ul > li > span {
- float: left;
- padding: 0 14px;
- line-height: 38px;
- text-decoration: none;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-left-width: 0;
-}
-
-.pagination ul > li > a:hover,
-.pagination ul > .active > a,
-.pagination ul > .active > span {
- background-color: #f5f5f5;
-}
-
-.pagination ul > .active > a,
-.pagination ul > .active > span {
- color: #999999;
- cursor: default;
-}
-
-.pagination ul > .disabled > span,
-.pagination ul > .disabled > a,
-.pagination ul > .disabled > a:hover {
- color: #999999;
- cursor: default;
- background-color: transparent;
-}
-
-.pagination ul > li:first-child > a,
-.pagination ul > li:first-child > span {
- border-left-width: 1px;
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.pagination ul > li:last-child > a,
-.pagination ul > li:last-child > span {
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.pagination-centered {
- text-align: center;
-}
-
-.pagination-right {
- text-align: right;
-}
-
-.pager {
- margin: 20px 0;
- text-align: center;
- list-style: none;
- *zoom: 1;
-}
-
-.pager:before,
-.pager:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.pager:after {
- clear: both;
-}
-
-.pager li {
- display: inline;
-}
-
-.pager a,
-.pager span {
- display: inline-block;
- padding: 5px 14px;
- background-color: #fff;
- border: 1px solid #ddd;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-.pager a:hover {
- text-decoration: none;
- background-color: #f5f5f5;
-}
-
-.pager .next a,
-.pager .next span {
- float: right;
-}
-
-.pager .previous a {
- float: left;
-}
-
-.pager .disabled a,
-.pager .disabled a:hover,
-.pager .disabled span {
- color: #999999;
- cursor: default;
- background-color: #fff;
-}
-
-.modal-open .modal .dropdown-menu {
- z-index: 2050;
-}
-
-.modal-open .modal .dropdown.open {
- *z-index: 2050;
-}
-
-.modal-open .modal .popover {
- z-index: 2060;
-}
-
-.modal-open .modal .tooltip {
- z-index: 2080;
-}
-
-.modal-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1040;
- background-color: #000000;
-}
-
-.modal-backdrop.fade {
- opacity: 0;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in {
- opacity: 0.8;
- filter: alpha(opacity=80);
-}
-
-.modal {
- position: fixed;
- top: 50%;
- left: 50%;
- z-index: 1050;
- width: 560px;
- margin: -250px 0 0 -280px;
- overflow: auto;
- background-color: #ffffff;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, 0.3);
- *border: 1px solid #999;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding-box;
- background-clip: padding-box;
-}
-
-.modal.fade {
- top: -25%;
- -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
- -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
- -o-transition: opacity 0.3s linear, top 0.3s ease-out;
- transition: opacity 0.3s linear, top 0.3s ease-out;
-}
-
-.modal.fade.in {
- top: 50%;
-}
-
-.modal-header {
- padding: 9px 15px;
- border-bottom: 1px solid #eee;
-}
-
-.modal-header .close {
- margin-top: 2px;
-}
-
-.modal-header h3 {
- margin: 0;
- line-height: 30px;
-}
-
-.modal-body {
- max-height: 400px;
- padding: 15px;
- overflow-y: auto;
-}
-
-.modal-form {
- margin-bottom: 0;
-}
-
-.modal-footer {
- padding: 14px 15px 15px;
- margin-bottom: 0;
- text-align: right;
- background-color: #f5f5f5;
- border-top: 1px solid #ddd;
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
- *zoom: 1;
- -webkit-box-shadow: inset 0 1px 0 #ffffff;
- -moz-box-shadow: inset 0 1px 0 #ffffff;
- box-shadow: inset 0 1px 0 #ffffff;
-}
-
-.modal-footer:before,
-.modal-footer:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.modal-footer:after {
- clear: both;
-}
-
-.modal-footer .btn + .btn {
- margin-bottom: 0;
- margin-left: 5px;
-}
-
-.modal-footer .btn-group .btn + .btn {
- margin-left: -1px;
-}
-
-.tooltip {
- position: absolute;
- z-index: 1030;
- display: block;
- padding: 5px;
- font-size: 11px;
- opacity: 0;
- filter: alpha(opacity=0);
- visibility: visible;
-}
-
-.tooltip.in {
- opacity: 0.8;
- filter: alpha(opacity=80);
-}
-
-.tooltip.top {
- margin-top: -3px;
-}
-
-.tooltip.right {
- margin-left: 3px;
-}
-
-.tooltip.bottom {
- margin-top: 3px;
-}
-
-.tooltip.left {
- margin-left: -3px;
-}
-
-.tooltip-inner {
- max-width: 200px;
- padding: 3px 8px;
- color: #ffffff;
- text-align: center;
- text-decoration: none;
- background-color: #000000;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.tooltip-arrow {
- position: absolute;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.tooltip.top .tooltip-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-top-color: #000000;
- border-width: 5px 5px 0;
-}
-
-.tooltip.right .tooltip-arrow {
- top: 50%;
- left: 0;
- margin-top: -5px;
- border-right-color: #000000;
- border-width: 5px 5px 5px 0;
-}
-
-.tooltip.left .tooltip-arrow {
- top: 50%;
- right: 0;
- margin-top: -5px;
- border-left-color: #000000;
- border-width: 5px 0 5px 5px;
-}
-
-.tooltip.bottom .tooltip-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-bottom-color: #000000;
- border-width: 0 5px 5px;
-}
-
-.popover {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1010;
- display: none;
- width: 236px;
- padding: 1px;
- background-color: #ffffff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
-}
-
-.popover.top {
- margin-bottom: 10px;
-}
-
-.popover.right {
- margin-left: 10px;
-}
-
-.popover.bottom {
- margin-top: 10px;
-}
-
-.popover.left {
- margin-right: 10px;
-}
-
-.popover-title {
- padding: 8px 14px;
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 18px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #ebebeb;
- -webkit-border-radius: 5px 5px 0 0;
- -moz-border-radius: 5px 5px 0 0;
- border-radius: 5px 5px 0 0;
-}
-
-.popover-content {
- padding: 9px 14px;
-}
-
-.popover-content p,
-.popover-content ul,
-.popover-content ol {
- margin-bottom: 0;
-}
-
-.popover .arrow,
-.popover .arrow:after {
- position: absolute;
- display: inline-block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.popover .arrow:after {
- z-index: -1;
- content: "";
-}
-
-.popover.top .arrow {
- bottom: -10px;
- left: 50%;
- margin-left: -10px;
- border-top-color: #ffffff;
- border-width: 10px 10px 0;
-}
-
-.popover.top .arrow:after {
- bottom: -1px;
- left: -11px;
- border-top-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 11px 0;
-}
-
-.popover.right .arrow {
- top: 50%;
- left: -10px;
- margin-top: -10px;
- border-right-color: #ffffff;
- border-width: 10px 10px 10px 0;
-}
-
-.popover.right .arrow:after {
- bottom: -11px;
- left: -1px;
- border-right-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 11px 11px 0;
-}
-
-.popover.bottom .arrow {
- top: -10px;
- left: 50%;
- margin-left: -10px;
- border-bottom-color: #ffffff;
- border-width: 0 10px 10px;
-}
-
-.popover.bottom .arrow:after {
- top: -1px;
- left: -11px;
- border-bottom-color: rgba(0, 0, 0, 0.25);
- border-width: 0 11px 11px;
-}
-
-.popover.left .arrow {
- top: 50%;
- right: -10px;
- margin-top: -10px;
- border-left-color: #ffffff;
- border-width: 10px 0 10px 10px;
-}
-
-.popover.left .arrow:after {
- right: -1px;
- bottom: -11px;
- border-left-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 0 11px 11px;
-}
-
-.thumbnails {
- margin-left: -20px;
- list-style: none;
- *zoom: 1;
-}
-
-.thumbnails:before,
-.thumbnails:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.thumbnails:after {
- clear: both;
-}
-
-.row-fluid .thumbnails {
- margin-left: 0;
-}
-
-.thumbnails > li {
- float: left;
- margin-bottom: 20px;
- margin-left: 20px;
-}
-
-.thumbnail {
- display: block;
- padding: 4px;
- line-height: 20px;
- border: 1px solid #ddd;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- -webkit-transition: all 0.2s ease-in-out;
- -moz-transition: all 0.2s ease-in-out;
- -o-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
-}
-
-a.thumbnail:hover {
- border-color: #0088cc;
- -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
- -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
- box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-}
-
-.thumbnail > img {
- display: block;
- max-width: 100%;
- margin-right: auto;
- margin-left: auto;
-}
-
-.thumbnail .caption {
- padding: 9px;
- color: #555555;
-}
-
-.label,
-.badge {
- font-size: 11.844px;
- font-weight: bold;
- line-height: 14px;
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- white-space: nowrap;
- vertical-align: baseline;
- background-color: #999999;
-}
-
-.label {
- padding: 1px 4px 2px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-.badge {
- padding: 1px 9px 2px;
- -webkit-border-radius: 9px;
- -moz-border-radius: 9px;
- border-radius: 9px;
-}
-
-a.label:hover,
-a.badge:hover {
- color: #ffffff;
- text-decoration: none;
- cursor: pointer;
-}
-
-.label-important,
-.badge-important {
- background-color: #b94a48;
-}
-
-.label-important[href],
-.badge-important[href] {
- background-color: #953b39;
-}
-
-.label-warning,
-.badge-warning {
- background-color: #f89406;
-}
-
-.label-warning[href],
-.badge-warning[href] {
- background-color: #c67605;
-}
-
-.label-success,
-.badge-success {
- background-color: #468847;
-}
-
-.label-success[href],
-.badge-success[href] {
- background-color: #356635;
-}
-
-.label-info,
-.badge-info {
- background-color: #3a87ad;
-}
-
-.label-info[href],
-.badge-info[href] {
- background-color: #2d6987;
-}
-
-.label-inverse,
-.badge-inverse {
- background-color: #333333;
-}
-
-.label-inverse[href],
-.badge-inverse[href] {
- background-color: #1a1a1a;
-}
-
-.btn .label,
-.btn .badge {
- position: relative;
- top: -1px;
-}
-
-.btn-mini .label,
-.btn-mini .badge {
- top: 0;
-}
-
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-moz-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-ms-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-o-keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
- to {
- background-position: 40px 0;
- }
-}
-
-@keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-.progress {
- height: 20px;
- margin-bottom: 20px;
- overflow: hidden;
- background-color: #f7f7f7;
- background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
- background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
- background-repeat: repeat-x;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-}
-
-.progress .bar {
- float: left;
- width: 0;
- height: 100%;
- font-size: 12px;
- color: #ffffff;
- text-align: center;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #0e90d2;
- background-image: -moz-linear-gradient(top, #149bdf, #0480be);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
- background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
- background-image: -o-linear-gradient(top, #149bdf, #0480be);
- background-image: linear-gradient(to bottom, #149bdf, #0480be);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-transition: width 0.6s ease;
- -moz-transition: width 0.6s ease;
- -o-transition: width 0.6s ease;
- transition: width 0.6s ease;
-}
-
-.progress .bar + .bar {
- -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-}
-
-.progress-striped .bar {
- background-color: #149bdf;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- -webkit-background-size: 40px 40px;
- -moz-background-size: 40px 40px;
- -o-background-size: 40px 40px;
- background-size: 40px 40px;
-}
-
-.progress.active .bar {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -moz-animation: progress-bar-stripes 2s linear infinite;
- -ms-animation: progress-bar-stripes 2s linear infinite;
- -o-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-
-.progress-danger .bar,
-.progress .bar-danger {
- background-color: #dd514c;
- background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));
- background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: linear-gradient(to bottom, #ee5f5b, #c43c35);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);
-}
-
-.progress-danger.progress-striped .bar,
-.progress-striped .bar-danger {
- background-color: #ee5f5b;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-success .bar,
-.progress .bar-success {
- background-color: #5eb95e;
- background-image: -moz-linear-gradient(top, #62c462, #57a957);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));
- background-image: -webkit-linear-gradient(top, #62c462, #57a957);
- background-image: -o-linear-gradient(top, #62c462, #57a957);
- background-image: linear-gradient(to bottom, #62c462, #57a957);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);
-}
-
-.progress-success.progress-striped .bar,
-.progress-striped .bar-success {
- background-color: #62c462;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-info .bar,
-.progress .bar-info {
- background-color: #4bb1cf;
- background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));
- background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
- background-image: linear-gradient(to bottom, #5bc0de, #339bb9);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);
-}
-
-.progress-info.progress-striped .bar,
-.progress-striped .bar-info {
- background-color: #5bc0de;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-warning .bar,
-.progress .bar-warning {
- background-color: #faa732;
- background-image: -moz-linear-gradient(top, #fbb450, #f89406);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
- background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
- background-image: -o-linear-gradient(top, #fbb450, #f89406);
- background-image: linear-gradient(to bottom, #fbb450, #f89406);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
-}
-
-.progress-warning.progress-striped .bar,
-.progress-striped .bar-warning {
- background-color: #fbb450;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.accordion {
- margin-bottom: 20px;
-}
-
-.accordion-group {
- margin-bottom: 2px;
- border: 1px solid #e5e5e5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.accordion-heading {
- border-bottom: 0;
-}
-
-.accordion-heading .accordion-toggle {
- display: block;
- padding: 8px 15px;
-}
-
-.accordion-toggle {
- cursor: pointer;
-}
-
-.accordion-inner {
- padding: 9px 15px;
- border-top: 1px solid #e5e5e5;
-}
-
-.carousel {
- position: relative;
- margin-bottom: 20px;
- line-height: 1;
-}
-
-.carousel-inner {
- position: relative;
- width: 100%;
- overflow: hidden;
-}
-
-.carousel .item {
- position: relative;
- display: none;
- -webkit-transition: 0.6s ease-in-out left;
- -moz-transition: 0.6s ease-in-out left;
- -o-transition: 0.6s ease-in-out left;
- transition: 0.6s ease-in-out left;
-}
-
-.carousel .item > img {
- display: block;
- line-height: 1;
-}
-
-.carousel .active,
-.carousel .next,
-.carousel .prev {
- display: block;
-}
-
-.carousel .active {
- left: 0;
-}
-
-.carousel .next,
-.carousel .prev {
- position: absolute;
- top: 0;
- width: 100%;
-}
-
-.carousel .next {
- left: 100%;
-}
-
-.carousel .prev {
- left: -100%;
-}
-
-.carousel .next.left,
-.carousel .prev.right {
- left: 0;
-}
-
-.carousel .active.left {
- left: -100%;
-}
-
-.carousel .active.right {
- left: 100%;
-}
-
-.carousel-control {
- position: absolute;
- top: 40%;
- left: 15px;
- width: 40px;
- height: 40px;
- margin-top: -20px;
- font-size: 60px;
- font-weight: 100;
- line-height: 30px;
- color: #ffffff;
- text-align: center;
- background: #222222;
- border: 3px solid #ffffff;
- -webkit-border-radius: 23px;
- -moz-border-radius: 23px;
- border-radius: 23px;
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-
-.carousel-control.right {
- right: 15px;
- left: auto;
-}
-
-.carousel-control:hover {
- color: #ffffff;
- text-decoration: none;
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-
-.carousel-caption {
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- padding: 15px;
- background: #333333;
- background: rgba(0, 0, 0, 0.75);
-}
-
-.carousel-caption h4,
-.carousel-caption p {
- line-height: 20px;
- color: #ffffff;
-}
-
-.carousel-caption h4 {
- margin: 0 0 5px;
-}
-
-.carousel-caption p {
- margin-bottom: 0;
-}
-
-.hero-unit {
- padding: 60px;
- margin-bottom: 30px;
- background-color: #eeeeee;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.hero-unit h1 {
- margin-bottom: 0;
- font-size: 60px;
- line-height: 1;
- letter-spacing: -1px;
- color: inherit;
-}
-
-.hero-unit p {
- font-size: 18px;
- font-weight: 200;
- line-height: 30px;
- color: inherit;
-}
-
-.pull-right {
- float: right;
-}
-
-.pull-left {
- float: left;
-}
-
-.hide {
- display: none;
-}
-
-.show {
- display: block;
-}
-
-.invisible {
- visibility: hidden;
-}
-
-.affix {
- position: fixed;
-}
diff --git a/src/app/install/bootstrap/css/bootstrap.min.css b/src/app/install/bootstrap/css/bootstrap.min.css
deleted file mode 100644
index 31d8b960..00000000
--- a/src/app/install/bootstrap/css/bootstrap.min.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}.text-warning{color:#c09853}.text-error{color:#b94a48}.text-info{color:#3a87ad}.text-success{color:#468847}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:1;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1{font-size:36px;line-height:40px}h2{font-size:30px;line-height:40px}h3{font-size:24px;line-height:40px}h4{font-size:18px;line-height:20px}h5{font-size:14px;line-height:20px}h6{font-size:12px;line-height:20px}h1 small{font-size:24px}h2 small{font-size:18px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:9px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal;cursor:pointer}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:18px;padding-left:18px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"]{float:left}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info>label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;font-size:14px;vertical-align:top;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append .add-on,.input-append .btn{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topleft:4px}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table [class*=span],.row-fluid table [class*=span]{display:table-cell;float:none;margin-left:0}.table .span1{float:none;width:44px;margin-left:0}.table .span2{float:none;width:124px;margin-left:0}.table .span3{float:none;width:204px;margin-left:0}.table .span4{float:none;width:284px;margin-left:0}.table .span5{float:none;width:364px;margin-left:0}.table .span6{float:none;width:444px;margin-left:0}.table .span7{float:none;width:524px;margin-left:0}.table .span8{float:none;width:604px;margin-left:0}.table .span9{float:none;width:684px;margin-left:0}.table .span10{float:none;width:764px;margin-left:0}.table .span11{float:none;width:844px;margin-left:0}.table .span12{float:none;width:924px;margin-left:0}.table .span13{float:none;width:1004px;margin-left:0}.table .span14{float:none;width:1084px;margin-left:0}.table .span15{float:none;width:1164px;margin-left:0}.table .span16{float:none;width:1244px;margin-left:0}.table .span17{float:none;width:1324px;margin-left:0}.table .span18{float:none;width:1404px;margin-left:0}.table .span19{float:none;width:1484px;margin-left:0}.table .span20{float:none;width:1564px;margin-left:0}.table .span21{float:none;width:1644px;margin-left:0}.table .span22{float:none;width:1724px;margin-left:0}.table .span23{float:none;width:1804px;margin-left:0}.table .span24{float:none;width:1884px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-tabs>.active>a>[class^="icon-"],.nav-tabs>.active>a>[class*=" icon-"],.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:linear-gradient(to bottom,#08c,#0077b3);background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 14px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.btn-large [class^="icon-"]{margin-top:2px}.btn-small{padding:3px 9px;font-size:12px;line-height:18px}.btn-small [class^="icon-"]{margin-top:0}.btn-mini{padding:2px 6px;font-size:11px;line-height:17px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-image:-moz-linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-image:-moz-linear-gradient(top,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-image:-moz-linear-gradient(top,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-top:0;border-bottom:5px solid #000}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#777}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;width:100%;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-image:-moz-linear-gradient(top,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{height:40px;margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:0 14px;line-height:38px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager a,.pager span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next a,.pager .next span{float:right}.pager .previous a{float:left}.pager .disabled a,.pager .disabled a:hover,.pager .disabled span{color:#999;cursor:default;background-color:#fff}.modal-open .modal .dropdown-menu{z-index:2050}.modal-open .modal .dropdown.open{*z-index:2050}.modal-open .modal .popover{z-index:2060}.modal-open .modal .tooltip{z-index:2080}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;overflow:auto;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-bottom:10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-right:10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.label,.badge{font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel .item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel .item>img{display:block;line-height:1}.carousel .active,.carousel .next,.carousel .prev{display:block}.carousel .active{left:0}.carousel .next,.carousel .prev{position:absolute;top:0;width:100%}.carousel .next{left:100%}.carousel .prev{left:-100%}.carousel .next.left,.carousel .prev.right{left:0}.carousel .active.left{left:-100%}.carousel .active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit p{font-size:18px;font-weight:200;line-height:30px;color:inherit}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}
diff --git a/src/app/install/bootstrap/img/glyphicons-halflings-white.png b/src/app/install/bootstrap/img/glyphicons-halflings-white.png
deleted file mode 100644
index 3bf6484a..00000000
Binary files a/src/app/install/bootstrap/img/glyphicons-halflings-white.png and /dev/null differ
diff --git a/src/app/install/bootstrap/img/glyphicons-halflings.png b/src/app/install/bootstrap/img/glyphicons-halflings.png
deleted file mode 100644
index a9969993..00000000
Binary files a/src/app/install/bootstrap/img/glyphicons-halflings.png and /dev/null differ
diff --git a/src/app/install/bootstrap/js/bootstrap.js b/src/app/install/bootstrap/js/bootstrap.js
deleted file mode 100644
index f73fcb8e..00000000
--- a/src/app/install/bootstrap/js/bootstrap.js
+++ /dev/null
@@ -1,2027 +0,0 @@
-/* ===================================================
- * bootstrap-transition.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#transitions
- * ===================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- $(function () {
-
- "use strict"; // jshint ;_;
-
-
- /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
- * ======================================================= */
-
- $.support.transition = (function () {
-
- var transitionEnd = (function () {
-
- var el = document.createElement('bootstrap')
- , transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd'
- , 'MozTransition' : 'transitionend'
- , 'OTransition' : 'oTransitionEnd otransitionend'
- , 'transition' : 'transitionend'
- }
- , name
-
- for (name in transEndEventNames){
- if (el.style[name] !== undefined) {
- return transEndEventNames[name]
- }
- }
-
- }())
-
- return transitionEnd && {
- end: transitionEnd
- }
-
- })()
-
- })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-alert.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#alerts
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* ALERT CLASS DEFINITION
- * ====================== */
-
- var dismiss = '[data-dismiss="alert"]'
- , Alert = function (el) {
- $(el).on('click', dismiss, this.close)
- }
-
- Alert.prototype.close = function (e) {
- var $this = $(this)
- , selector = $this.attr('data-target')
- , $parent
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- $parent = $(selector)
-
- e && e.preventDefault()
-
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
-
- $parent.trigger(e = $.Event('close'))
-
- if (e.isDefaultPrevented()) return
-
- $parent.removeClass('in')
-
- function removeElement() {
- $parent
- .trigger('closed')
- .remove()
- }
-
- $.support.transition && $parent.hasClass('fade') ?
- $parent.on($.support.transition.end, removeElement) :
- removeElement()
- }
-
-
- /* ALERT PLUGIN DEFINITION
- * ======================= */
-
- $.fn.alert = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('alert')
- if (!data) $this.data('alert', (data = new Alert(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.alert.Constructor = Alert
-
-
- /* ALERT DATA-API
- * ============== */
-
- $(function () {
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
- })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-button.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#buttons
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* BUTTON PUBLIC CLASS DEFINITION
- * ============================== */
-
- var Button = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.button.defaults, options)
- }
-
- Button.prototype.setState = function (state) {
- var d = 'disabled'
- , $el = this.$element
- , data = $el.data()
- , val = $el.is('input') ? 'val' : 'html'
-
- state = state + 'Text'
- data.resetText || $el.data('resetText', $el[val]())
-
- $el[val](data[state] || this.options[state])
-
- // push to event loop to allow forms to submit
- setTimeout(function () {
- state == 'loadingText' ?
- $el.addClass(d).attr(d, d) :
- $el.removeClass(d).removeAttr(d)
- }, 0)
- }
-
- Button.prototype.toggle = function () {
- var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
-
- $parent && $parent
- .find('.active')
- .removeClass('active')
-
- this.$element.toggleClass('active')
- }
-
-
- /* BUTTON PLUGIN DEFINITION
- * ======================== */
-
- $.fn.button = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('button')
- , options = typeof option == 'object' && option
- if (!data) $this.data('button', (data = new Button(this, options)))
- if (option == 'toggle') data.toggle()
- else if (option) data.setState(option)
- })
- }
-
- $.fn.button.defaults = {
- loadingText: 'loading...'
- }
-
- $.fn.button.Constructor = Button
-
-
- /* BUTTON DATA-API
- * =============== */
-
- $(function () {
- $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
- var $btn = $(e.target)
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
- $btn.button('toggle')
- })
- })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-carousel.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#carousel
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* CAROUSEL CLASS DEFINITION
- * ========================= */
-
- var Carousel = function (element, options) {
- this.$element = $(element)
- this.options = options
- this.options.slide && this.slide(this.options.slide)
- this.options.pause == 'hover' && this.$element
- .on('mouseenter', $.proxy(this.pause, this))
- .on('mouseleave', $.proxy(this.cycle, this))
- }
-
- Carousel.prototype = {
-
- cycle: function (e) {
- if (!e) this.paused = false
- this.options.interval
- && !this.paused
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
- return this
- }
-
- , to: function (pos) {
- var $active = this.$element.find('.item.active')
- , children = $active.parent().children()
- , activePos = children.index($active)
- , that = this
-
- if (pos > (children.length - 1) || pos < 0) return
-
- if (this.sliding) {
- return this.$element.one('slid', function () {
- that.to(pos)
- })
- }
-
- if (activePos == pos) {
- return this.pause().cycle()
- }
-
- return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
- }
-
- , pause: function (e) {
- if (!e) this.paused = true
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
- this.$element.trigger($.support.transition.end)
- this.cycle()
- }
- clearInterval(this.interval)
- this.interval = null
- return this
- }
-
- , next: function () {
- if (this.sliding) return
- return this.slide('next')
- }
-
- , prev: function () {
- if (this.sliding) return
- return this.slide('prev')
- }
-
- , slide: function (type, next) {
- var $active = this.$element.find('.item.active')
- , $next = next || $active[type]()
- , isCycling = this.interval
- , direction = type == 'next' ? 'left' : 'right'
- , fallback = type == 'next' ? 'first' : 'last'
- , that = this
- , e = $.Event('slide', {
- relatedTarget: $next[0]
- })
-
- this.sliding = true
-
- isCycling && this.pause()
-
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
-
- if ($next.hasClass('active')) return
-
- if ($.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $next.addClass(type)
- $next[0].offsetWidth // force reflow
- $active.addClass(direction)
- $next.addClass(direction)
- this.$element.one($.support.transition.end, function () {
- $next.removeClass([type, direction].join(' ')).addClass('active')
- $active.removeClass(['active', direction].join(' '))
- that.sliding = false
- setTimeout(function () { that.$element.trigger('slid') }, 0)
- })
- } else {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $active.removeClass('active')
- $next.addClass('active')
- this.sliding = false
- this.$element.trigger('slid')
- }
-
- isCycling && this.cycle()
-
- return this
- }
-
- }
-
-
- /* CAROUSEL PLUGIN DEFINITION
- * ========================== */
-
- $.fn.carousel = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('carousel')
- , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
- , action = typeof option == 'string' ? option : options.slide
- if (!data) $this.data('carousel', (data = new Carousel(this, options)))
- if (typeof option == 'number') data.to(option)
- else if (action) data[action]()
- else if (options.interval) data.cycle()
- })
- }
-
- $.fn.carousel.defaults = {
- interval: 5000
- , pause: 'hover'
- }
-
- $.fn.carousel.Constructor = Carousel
-
-
- /* CAROUSEL DATA-API
- * ================= */
-
- $(function () {
- $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
- var $this = $(this), href
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
- $target.carousel(options)
- e.preventDefault()
- })
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-collapse.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#collapse
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* COLLAPSE PUBLIC CLASS DEFINITION
- * ================================ */
-
- var Collapse = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.collapse.defaults, options)
-
- if (this.options.parent) {
- this.$parent = $(this.options.parent)
- }
-
- this.options.toggle && this.toggle()
- }
-
- Collapse.prototype = {
-
- constructor: Collapse
-
- , dimension: function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
-
- , show: function () {
- var dimension
- , scroll
- , actives
- , hasData
-
- if (this.transitioning) return
-
- dimension = this.dimension()
- scroll = $.camelCase(['scroll', dimension].join('-'))
- actives = this.$parent && this.$parent.find('> .accordion-group > .in')
-
- if (actives && actives.length) {
- hasData = actives.data('collapse')
- if (hasData && hasData.transitioning) return
- actives.collapse('hide')
- hasData || actives.data('collapse', null)
- }
-
- this.$element[dimension](0)
- this.transition('addClass', $.Event('show'), 'shown')
- $.support.transition && this.$element[dimension](this.$element[0][scroll])
- }
-
- , hide: function () {
- var dimension
- if (this.transitioning) return
- dimension = this.dimension()
- this.reset(this.$element[dimension]())
- this.transition('removeClass', $.Event('hide'), 'hidden')
- this.$element[dimension](0)
- }
-
- , reset: function (size) {
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- [dimension](size || 'auto')
- [0].offsetWidth
-
- this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
-
- return this
- }
-
- , transition: function (method, startEvent, completeEvent) {
- var that = this
- , complete = function () {
- if (startEvent.type == 'show') that.reset()
- that.transitioning = 0
- that.$element.trigger(completeEvent)
- }
-
- this.$element.trigger(startEvent)
-
- if (startEvent.isDefaultPrevented()) return
-
- this.transitioning = 1
-
- this.$element[method]('in')
-
- $.support.transition && this.$element.hasClass('collapse') ?
- this.$element.one($.support.transition.end, complete) :
- complete()
- }
-
- , toggle: function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
- }
-
-
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
-
- $.fn.collapse = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('collapse')
- , options = typeof option == 'object' && option
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.collapse.defaults = {
- toggle: true
- }
-
- $.fn.collapse.Constructor = Collapse
-
-
- /* COLLAPSIBLE DATA-API
- * ==================== */
-
- $(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
- $(target).collapse(option)
- })
- })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-dropdown.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* DROPDOWN CLASS DEFINITION
- * ========================= */
-
- var toggle = '[data-toggle=dropdown]'
- , Dropdown = function (element) {
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
- $('html').on('click.dropdown.data-api', function () {
- $el.parent().removeClass('open')
- })
- }
-
- Dropdown.prototype = {
-
- constructor: Dropdown
-
- , toggle: function (e) {
- var $this = $(this)
- , $parent
- , isActive
-
- if ($this.is('.disabled, :disabled')) return
-
- $parent = getParent($this)
-
- isActive = $parent.hasClass('open')
-
- clearMenus()
-
- if (!isActive) {
- $parent.toggleClass('open')
- $this.focus()
- }
-
- return false
- }
-
- , keydown: function (e) {
- var $this
- , $items
- , $active
- , $parent
- , isActive
- , index
-
- if (!/(38|40|27)/.test(e.keyCode)) return
-
- $this = $(this)
-
- e.preventDefault()
- e.stopPropagation()
-
- if ($this.is('.disabled, :disabled')) return
-
- $parent = getParent($this)
-
- isActive = $parent.hasClass('open')
-
- if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
-
- $items = $('[role=menu] li:not(.divider) a', $parent)
-
- if (!$items.length) return
-
- index = $items.index($items.filter(':focus'))
-
- if (e.keyCode == 38 && index > 0) index-- // up
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
- if (!~index) index = 0
-
- $items
- .eq(index)
- .focus()
- }
-
- }
-
- function clearMenus() {
- getParent($(toggle))
- .removeClass('open')
- }
-
- function getParent($this) {
- var selector = $this.attr('data-target')
- , $parent
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- $parent = $(selector)
- $parent.length || ($parent = $this.parent())
-
- return $parent
- }
-
-
- /* DROPDOWN PLUGIN DEFINITION
- * ========================== */
-
- $.fn.dropdown = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('dropdown')
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.dropdown.Constructor = Dropdown
-
-
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
- * =================================== */
-
- $(function () {
- $('html')
- .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
- $('body')
- .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
- .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
- .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
- })
-
-}(window.jQuery);/* =========================================================
- * bootstrap-modal.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#modals
- * =========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* MODAL CLASS DEFINITION
- * ====================== */
-
- var Modal = function (element, options) {
- this.options = options
- this.$element = $(element)
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
- }
-
- Modal.prototype = {
-
- constructor: Modal
-
- , toggle: function () {
- return this[!this.isShown ? 'show' : 'hide']()
- }
-
- , show: function () {
- var that = this
- , e = $.Event('show')
-
- this.$element.trigger(e)
-
- if (this.isShown || e.isDefaultPrevented()) return
-
- $('body').addClass('modal-open')
-
- this.isShown = true
-
- this.escape()
-
- this.backdrop(function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
-
- if (!that.$element.parent().length) {
- that.$element.appendTo(document.body) //don't move modals dom position
- }
-
- that.$element
- .show()
-
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
-
- that.$element
- .addClass('in')
- .attr('aria-hidden', false)
- .focus()
-
- that.enforceFocus()
-
- transition ?
- that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
- that.$element.trigger('shown')
-
- })
- }
-
- , hide: function (e) {
- e && e.preventDefault()
-
- var that = this
-
- e = $.Event('hide')
-
- this.$element.trigger(e)
-
- if (!this.isShown || e.isDefaultPrevented()) return
-
- this.isShown = false
-
- $('body').removeClass('modal-open')
-
- this.escape()
-
- $(document).off('focusin.modal')
-
- this.$element
- .removeClass('in')
- .attr('aria-hidden', true)
-
- $.support.transition && this.$element.hasClass('fade') ?
- this.hideWithTransition() :
- this.hideModal()
- }
-
- , enforceFocus: function () {
- var that = this
- $(document).on('focusin.modal', function (e) {
- if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
- that.$element.focus()
- }
- })
- }
-
- , escape: function () {
- var that = this
- if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.modal', function ( e ) {
- e.which == 27 && that.hide()
- })
- } else if (!this.isShown) {
- this.$element.off('keyup.dismiss.modal')
- }
- }
-
- , hideWithTransition: function () {
- var that = this
- , timeout = setTimeout(function () {
- that.$element.off($.support.transition.end)
- that.hideModal()
- }, 500)
-
- this.$element.one($.support.transition.end, function () {
- clearTimeout(timeout)
- that.hideModal()
- })
- }
-
- , hideModal: function (that) {
- this.$element
- .hide()
- .trigger('hidden')
-
- this.backdrop()
- }
-
- , removeBackdrop: function () {
- this.$backdrop.remove()
- this.$backdrop = null
- }
-
- , backdrop: function (callback) {
- var that = this
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
-
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
-
- this.$backdrop = $('')
- .appendTo(document.body)
-
- if (this.options.backdrop != 'static') {
- this.$backdrop.click($.proxy(this.hide, this))
- }
-
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
- this.$backdrop.addClass('in')
-
- doAnimate ?
- this.$backdrop.one($.support.transition.end, callback) :
- callback()
-
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
-
- $.support.transition && this.$element.hasClass('fade')?
- this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
- this.removeBackdrop()
-
- } else if (callback) {
- callback()
- }
- }
- }
-
-
- /* MODAL PLUGIN DEFINITION
- * ======================= */
-
- $.fn.modal = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('modal')
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
- if (!data) $this.data('modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
- })
- }
-
- $.fn.modal.defaults = {
- backdrop: true
- , keyboard: true
- , show: true
- }
-
- $.fn.modal.Constructor = Modal
-
-
- /* MODAL DATA-API
- * ============== */
-
- $(function () {
- $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
- var $this = $(this)
- , href = $this.attr('href')
- , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
- e.preventDefault()
-
- $target
- .modal(option)
- .one('hide', function () {
- $this.focus()
- })
- })
- })
-
-}(window.jQuery);/* ===========================================================
- * bootstrap-tooltip.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* TOOLTIP PUBLIC CLASS DEFINITION
- * =============================== */
-
- var Tooltip = function (element, options) {
- this.init('tooltip', element, options)
- }
-
- Tooltip.prototype = {
-
- constructor: Tooltip
-
- , init: function (type, element, options) {
- var eventIn
- , eventOut
-
- this.type = type
- this.$element = $(element)
- this.options = this.getOptions(options)
- this.enabled = true
-
- if (this.options.trigger == 'click') {
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
- } else if (this.options.trigger != 'manual') {
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
- eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
- }
-
- this.options.selector ?
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
- this.fixTitle()
- }
-
- , getOptions: function (options) {
- options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
-
- if (options.delay && typeof options.delay == 'number') {
- options.delay = {
- show: options.delay
- , hide: options.delay
- }
- }
-
- return options
- }
-
- , enter: function (e) {
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
- if (!self.options.delay || !self.options.delay.show) return self.show()
-
- clearTimeout(this.timeout)
- self.hoverState = 'in'
- this.timeout = setTimeout(function() {
- if (self.hoverState == 'in') self.show()
- }, self.options.delay.show)
- }
-
- , leave: function (e) {
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
- if (this.timeout) clearTimeout(this.timeout)
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
- self.hoverState = 'out'
- this.timeout = setTimeout(function() {
- if (self.hoverState == 'out') self.hide()
- }, self.options.delay.hide)
- }
-
- , show: function () {
- var $tip
- , inside
- , pos
- , actualWidth
- , actualHeight
- , placement
- , tp
-
- if (this.hasContent() && this.enabled) {
- $tip = this.tip()
- this.setContent()
-
- if (this.options.animation) {
- $tip.addClass('fade')
- }
-
- placement = typeof this.options.placement == 'function' ?
- this.options.placement.call(this, $tip[0], this.$element[0]) :
- this.options.placement
-
- inside = /in/.test(placement)
-
- $tip
- .remove()
- .css({ top: 0, left: 0, display: 'block' })
- .appendTo(inside ? this.$element : document.body)
-
- pos = this.getPosition(inside)
-
- actualWidth = $tip[0].offsetWidth
- actualHeight = $tip[0].offsetHeight
-
- switch (inside ? placement.split(' ')[1] : placement) {
- case 'bottom':
- tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
- break
- case 'top':
- tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
- break
- case 'left':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
- break
- case 'right':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
- break
- }
-
- $tip
- .css(tp)
- .addClass(placement)
- .addClass('in')
- }
- }
-
- , setContent: function () {
- var $tip = this.tip()
- , title = this.getTitle()
-
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
- $tip.removeClass('fade in top bottom left right')
- }
-
- , hide: function () {
- var that = this
- , $tip = this.tip()
-
- $tip.removeClass('in')
-
- function removeWithAnimation() {
- var timeout = setTimeout(function () {
- $tip.off($.support.transition.end).remove()
- }, 500)
-
- $tip.one($.support.transition.end, function () {
- clearTimeout(timeout)
- $tip.remove()
- })
- }
-
- $.support.transition && this.$tip.hasClass('fade') ?
- removeWithAnimation() :
- $tip.remove()
-
- return this
- }
-
- , fixTitle: function () {
- var $e = this.$element
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
- }
- }
-
- , hasContent: function () {
- return this.getTitle()
- }
-
- , getPosition: function (inside) {
- return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
- width: this.$element[0].offsetWidth
- , height: this.$element[0].offsetHeight
- })
- }
-
- , getTitle: function () {
- var title
- , $e = this.$element
- , o = this.options
-
- title = $e.attr('data-original-title')
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
-
- return title
- }
-
- , tip: function () {
- return this.$tip = this.$tip || $(this.options.template)
- }
-
- , validate: function () {
- if (!this.$element[0].parentNode) {
- this.hide()
- this.$element = null
- this.options = null
- }
- }
-
- , enable: function () {
- this.enabled = true
- }
-
- , disable: function () {
- this.enabled = false
- }
-
- , toggleEnabled: function () {
- this.enabled = !this.enabled
- }
-
- , toggle: function () {
- this[this.tip().hasClass('in') ? 'hide' : 'show']()
- }
-
- , destroy: function () {
- this.hide().$element.off('.' + this.type).removeData(this.type)
- }
-
- }
-
-
- /* TOOLTIP PLUGIN DEFINITION
- * ========================= */
-
- $.fn.tooltip = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tooltip')
- , options = typeof option == 'object' && option
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tooltip.Constructor = Tooltip
-
- $.fn.tooltip.defaults = {
- animation: true
- , placement: 'top'
- , selector: false
- , template: ''
- , trigger: 'hover'
- , title: ''
- , delay: 0
- , html: true
- }
-
-}(window.jQuery);
-/* ===========================================================
- * bootstrap-popover.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#popovers
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* POPOVER PUBLIC CLASS DEFINITION
- * =============================== */
-
- var Popover = function (element, options) {
- this.init('popover', element, options)
- }
-
-
- /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
- ========================================== */
-
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
-
- constructor: Popover
-
- , setContent: function () {
- var $tip = this.tip()
- , title = this.getTitle()
- , content = this.getContent()
-
- $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
- $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
-
- $tip.removeClass('fade top bottom left right in')
- }
-
- , hasContent: function () {
- return this.getTitle() || this.getContent()
- }
-
- , getContent: function () {
- var content
- , $e = this.$element
- , o = this.options
-
- content = $e.attr('data-content')
- || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
-
- return content
- }
-
- , tip: function () {
- if (!this.$tip) {
- this.$tip = $(this.options.template)
- }
- return this.$tip
- }
-
- , destroy: function () {
- this.hide().$element.off('.' + this.type).removeData(this.type)
- }
-
- })
-
-
- /* POPOVER PLUGIN DEFINITION
- * ======================= */
-
- $.fn.popover = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('popover')
- , options = typeof option == 'object' && option
- if (!data) $this.data('popover', (data = new Popover(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.popover.Constructor = Popover
-
- $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
- placement: 'right'
- , trigger: 'click'
- , content: ''
- , template: ''
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-scrollspy.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#scrollspy
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* SCROLLSPY CLASS DEFINITION
- * ========================== */
-
- function ScrollSpy(element, options) {
- var process = $.proxy(this.process, this)
- , $element = $(element).is('body') ? $(window) : $(element)
- , href
- this.options = $.extend({}, $.fn.scrollspy.defaults, options)
- this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.$body = $('body')
- this.refresh()
- this.process()
- }
-
- ScrollSpy.prototype = {
-
- constructor: ScrollSpy
-
- , refresh: function () {
- var self = this
- , $targets
-
- this.offsets = $([])
- this.targets = $([])
-
- $targets = this.$body
- .find(this.selector)
- .map(function () {
- var $el = $(this)
- , href = $el.data('target') || $el.attr('href')
- , $href = /^#\w/.test(href) && $(href)
- return ( $href
- && $href.length
- && [[ $href.position().top, href ]] ) || null
- })
- .sort(function (a, b) { return a[0] - b[0] })
- .each(function () {
- self.offsets.push(this[0])
- self.targets.push(this[1])
- })
- }
-
- , process: function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
- , maxScroll = scrollHeight - this.$scrollElement.height()
- , offsets = this.offsets
- , targets = this.targets
- , activeTarget = this.activeTarget
- , i
-
- if (scrollTop >= maxScroll) {
- return activeTarget != (i = targets.last()[0])
- && this.activate ( i )
- }
-
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
- }
-
- , activate: function (target) {
- var active
- , selector
-
- this.activeTarget = target
-
- $(this.selector)
- .parent('.active')
- .removeClass('active')
-
- selector = this.selector
- + '[data-target="' + target + '"],'
- + this.selector + '[href="' + target + '"]'
-
- active = $(selector)
- .parent('li')
- .addClass('active')
-
- if (active.parent('.dropdown-menu').length) {
- active = active.closest('li.dropdown').addClass('active')
- }
-
- active.trigger('activate')
- }
-
- }
-
-
- /* SCROLLSPY PLUGIN DEFINITION
- * =========================== */
-
- $.fn.scrollspy = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('scrollspy')
- , options = typeof option == 'object' && option
- if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.scrollspy.Constructor = ScrollSpy
-
- $.fn.scrollspy.defaults = {
- offset: 10
- }
-
-
- /* SCROLLSPY DATA-API
- * ================== */
-
- $(window).on('load', function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
- })
-
-}(window.jQuery);/* ========================================================
- * bootstrap-tab.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* TAB CLASS DEFINITION
- * ==================== */
-
- var Tab = function (element) {
- this.element = $(element)
- }
-
- Tab.prototype = {
-
- constructor: Tab
-
- , show: function () {
- var $this = this.element
- , $ul = $this.closest('ul:not(.dropdown-menu)')
- , selector = $this.attr('data-target')
- , previous
- , $target
- , e
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- if ( $this.parent('li').hasClass('active') ) return
-
- previous = $ul.find('.active a').last()[0]
-
- e = $.Event('show', {
- relatedTarget: previous
- })
-
- $this.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown'
- , relatedTarget: previous
- })
- })
- }
-
- , activate: function ( element, container, callback) {
- var $active = container.find('> .active')
- , transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if ( element.parent('.dropdown-menu') ) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active.one($.support.transition.end, next) :
- next()
-
- $active.removeClass('in')
- }
- }
-
-
- /* TAB PLUGIN DEFINITION
- * ===================== */
-
- $.fn.tab = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tab')
- if (!data) $this.data('tab', (data = new Tab(this)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- /* TAB DATA-API
- * ============ */
-
- $(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-typeahead.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#typeahead
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function($){
-
- "use strict"; // jshint ;_;
-
-
- /* TYPEAHEAD PUBLIC CLASS DEFINITION
- * ================================= */
-
- var Typeahead = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.typeahead.defaults, options)
- this.matcher = this.options.matcher || this.matcher
- this.sorter = this.options.sorter || this.sorter
- this.highlighter = this.options.highlighter || this.highlighter
- this.updater = this.options.updater || this.updater
- this.$menu = $(this.options.menu).appendTo('body')
- this.source = this.options.source
- this.shown = false
- this.listen()
- }
-
- Typeahead.prototype = {
-
- constructor: Typeahead
-
- , select: function () {
- var val = this.$menu.find('.active').attr('data-value')
- this.$element
- .val(this.updater(val))
- .change()
- return this.hide()
- }
-
- , updater: function (item) {
- return item
- }
-
- , show: function () {
- var pos = $.extend({}, this.$element.offset(), {
- height: this.$element[0].offsetHeight
- })
-
- this.$menu.css({
- top: pos.top + pos.height
- , left: pos.left
- })
-
- this.$menu.show()
- this.shown = true
- return this
- }
-
- , hide: function () {
- this.$menu.hide()
- this.shown = false
- return this
- }
-
- , lookup: function (event) {
- var items
-
- this.query = this.$element.val()
-
- if (!this.query || this.query.length < this.options.minLength) {
- return this.shown ? this.hide() : this
- }
-
- items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
-
- return items ? this.process(items) : this
- }
-
- , process: function (items) {
- var that = this
-
- items = $.grep(items, function (item) {
- return that.matcher(item)
- })
-
- items = this.sorter(items)
-
- if (!items.length) {
- return this.shown ? this.hide() : this
- }
-
- return this.render(items.slice(0, this.options.items)).show()
- }
-
- , matcher: function (item) {
- return ~item.toLowerCase().indexOf(this.query.toLowerCase())
- }
-
- , sorter: function (items) {
- var beginswith = []
- , caseSensitive = []
- , caseInsensitive = []
- , item
-
- while (item = items.shift()) {
- if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
- else if (~item.indexOf(this.query)) caseSensitive.push(item)
- else caseInsensitive.push(item)
- }
-
- return beginswith.concat(caseSensitive, caseInsensitive)
- }
-
- , highlighter: function (item) {
- var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
- return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
- return '' + match + ''
- })
- }
-
- , render: function (items) {
- var that = this
-
- items = $(items).map(function (i, item) {
- i = $(that.options.item).attr('data-value', item)
- i.find('a').html(that.highlighter(item))
- return i[0]
- })
-
- items.first().addClass('active')
- this.$menu.html(items)
- return this
- }
-
- , next: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , next = active.next()
-
- if (!next.length) {
- next = $(this.$menu.find('li')[0])
- }
-
- next.addClass('active')
- }
-
- , prev: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , prev = active.prev()
-
- if (!prev.length) {
- prev = this.$menu.find('li').last()
- }
-
- prev.addClass('active')
- }
-
- , listen: function () {
- this.$element
- .on('blur', $.proxy(this.blur, this))
- .on('keypress', $.proxy(this.keypress, this))
- .on('keyup', $.proxy(this.keyup, this))
-
- if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
- this.$element.on('keydown', $.proxy(this.keydown, this))
- }
-
- this.$menu
- .on('click', $.proxy(this.click, this))
- .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
- }
-
- , move: function (e) {
- if (!this.shown) return
-
- switch(e.keyCode) {
- case 9: // tab
- case 13: // enter
- case 27: // escape
- e.preventDefault()
- break
-
- case 38: // up arrow
- e.preventDefault()
- this.prev()
- break
-
- case 40: // down arrow
- e.preventDefault()
- this.next()
- break
- }
-
- e.stopPropagation()
- }
-
- , keydown: function (e) {
- this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
- this.move(e)
- }
-
- , keypress: function (e) {
- if (this.suppressKeyPressRepeat) return
- this.move(e)
- }
-
- , keyup: function (e) {
- switch(e.keyCode) {
- case 40: // down arrow
- case 38: // up arrow
- break
-
- case 9: // tab
- case 13: // enter
- if (!this.shown) return
- this.select()
- break
-
- case 27: // escape
- if (!this.shown) return
- this.hide()
- break
-
- default:
- this.lookup()
- }
-
- e.stopPropagation()
- e.preventDefault()
- }
-
- , blur: function (e) {
- var that = this
- setTimeout(function () { that.hide() }, 150)
- }
-
- , click: function (e) {
- e.stopPropagation()
- e.preventDefault()
- this.select()
- }
-
- , mouseenter: function (e) {
- this.$menu.find('.active').removeClass('active')
- $(e.currentTarget).addClass('active')
- }
-
- }
-
-
- /* TYPEAHEAD PLUGIN DEFINITION
- * =========================== */
-
- $.fn.typeahead = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('typeahead')
- , options = typeof option == 'object' && option
- if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.typeahead.defaults = {
- source: []
- , items: 8
- , menu: ''
- , item: ' '
- , minLength: 1
- }
-
- $.fn.typeahead.Constructor = Typeahead
-
-
- /* TYPEAHEAD DATA-API
- * ================== */
-
- $(function () {
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
- var $this = $(this)
- if ($this.data('typeahead')) return
- e.preventDefault()
- $this.typeahead($this.data())
- })
- })
-
-}(window.jQuery);
-/* ==========================================================
- * bootstrap-affix.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#affix
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* AFFIX CLASS DEFINITION
- * ====================== */
-
- var Affix = function (element, options) {
- this.options = $.extend({}, $.fn.affix.defaults, options)
- this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
- this.$element = $(element)
- this.checkPosition()
- }
-
- Affix.prototype.checkPosition = function () {
- if (!this.$element.is(':visible')) return
-
- var scrollHeight = $(document).height()
- , scrollTop = this.$window.scrollTop()
- , position = this.$element.offset()
- , offset = this.options.offset
- , offsetBottom = offset.bottom
- , offsetTop = offset.top
- , reset = 'affix affix-top affix-bottom'
- , affix
-
- if (typeof offset != 'object') offsetBottom = offsetTop = offset
- if (typeof offsetTop == 'function') offsetTop = offset.top()
- if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
-
- affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
- false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
- 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
- 'top' : false
-
- if (this.affixed === affix) return
-
- this.affixed = affix
- this.unpin = affix == 'bottom' ? position.top - scrollTop : null
-
- this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
- }
-
-
- /* AFFIX PLUGIN DEFINITION
- * ======================= */
-
- $.fn.affix = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('affix')
- , options = typeof option == 'object' && option
- if (!data) $this.data('affix', (data = new Affix(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.affix.Constructor = Affix
-
- $.fn.affix.defaults = {
- offset: 0
- }
-
-
- /* AFFIX DATA-API
- * ============== */
-
- $(window).on('load', function () {
- $('[data-spy="affix"]').each(function () {
- var $spy = $(this)
- , data = $spy.data()
-
- data.offset = data.offset || {}
-
- data.offsetBottom && (data.offset.bottom = data.offsetBottom)
- data.offsetTop && (data.offset.top = data.offsetTop)
-
- $spy.affix(data)
- })
- })
-
-
-}(window.jQuery);
\ No newline at end of file
diff --git a/src/app/install/bootstrap/js/bootstrap.min.js b/src/app/install/bootstrap/js/bootstrap.min.js
deleted file mode 100644
index 0e33fb16..00000000
--- a/src/app/install/bootstrap/js/bootstrap.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
-* Bootstrap.js by @fat & @mdo
-* Copyright 2012 Twitter, Inc.
-* http://www.apache.org/licenses/LICENSE-2.0.txt
-*/
-!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){i(e(t)).removeClass("open")}function i(t){var n=t.attr("data-target"),r;return n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=e(n),r.length||(r=t.parent()),r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||(s.toggleClass("open"),n.focus()),!1},keydown:function(t){var n,r,s,o,u,a;if(!/(38|40|27)/.test(t.keyCode))return;n=e(this),t.preventDefault(),t.stopPropagation();if(n.is(".disabled, :disabled"))return;o=i(n),u=o.hasClass("open");if(!u||u&&t.keyCode==27)return n.click();r=e("[role=menu] li:not(.divider) a",o);if(!r.length)return;a=r.index(r.filter(":focus")),t.keyCode==38&&a>0&&a--,t.keyCode==40&&a ').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''})}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var t=e(this),n=t.data("target")||t.attr("href"),r=/^#\w/.test(n)&&e(n);return r&&r.length&&[[r.position().top,n]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}},e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=e(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),(e.browser.chrome||e.browser.webkit||e.browser.msie)&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this))},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=!~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(e){var t=this;setTimeout(function(){t.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")}},e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:' ',minLength:1},e.fn.typeahead.Constructor=t,e(function(){e("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
\ No newline at end of file
diff --git a/src/app/install/config.php b/src/app/install/config.php
deleted file mode 100644
index c25e3022..00000000
--- a/src/app/install/config.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IceHRM
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IceHRM Installation
-
- Please do not install this application if you have already installed (this could currupt existing instalation)
-
- 0){?>
-
-
-
- =$error[1]?>
- =$error[2]?>
-
-
-
-
- =$command?>
-
-
-
-
-
-
- Once above errors are corrected, please reload the page
-
-
-
-
-
-
-
-
-
-
- =APP_NAME?> All rights reserved.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/app/install/styles.css b/src/app/install/styles.css
deleted file mode 100644
index 5b7e64a2..00000000
--- a/src/app/install/styles.css
+++ /dev/null
@@ -1,9 +0,0 @@
-@CHARSET "ISO-8859-1";
-
-.p1{
- font-size:11px;
-}
-
-.p2{
- font-size:12px;
-}
\ No newline at end of file
diff --git a/src/app/install/submit.php b/src/app/install/submit.php
deleted file mode 100644
index 0ae4820c..00000000
--- a/src/app/install/submit.php
+++ /dev/null
@@ -1,134 +0,0 @@
-Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]);
-
- if (!$res){
- error_log('Could not connect: ' . $db->ErrorMsg());
- $ret["status"] = "ERROR";
- $ret["msg"] = "Incorrect credentials or incorrect DB host :".$db->ErrorMsg();
- echo json_encode($ret);
- exit();
- }
-
- $result = $db->Execute("Show tables");
- error_log(print_r("Number of tables:".$result->RecordCount(),true));
- $num_rows = $result->RecordCount();
- if($num_rows != 0){
- $ret["status"] = "ERROR";
- $ret["msg"] = "Database is not empty";
- echo json_encode($ret);
- exit();
- }
-
- $ret["status"] = "SUCCESS";
- $ret["msg"] = "Successfully connected to the database";
- echo json_encode($ret);
-
-}else if($action == "INS"){
-
- $config = file_get_contents(CLIENT_APP_PATH."config.sample.php");
-
- if(empty($config)){
- error_log('Sample config file is empty');
- $ret["status"] = "ERROR";
- $ret["msg"] = "Sample config file not found";
- echo json_encode($ret);
- exit();
- }
-
- $config = str_replace("_LOG_", $_REQUEST['LOG'], $config);
- $config = str_replace("_APP_BASE_PATH_", APP_PATH, $config);
- $config = str_replace("_CLIENT_BASE_PATH_", CLIENT_APP_PATH, $config);
- $config = str_replace("_BASE_URL_", $_REQUEST['BASE_URL'], $config);
- $config = str_replace("_CLIENTBASE_URL_", $_REQUEST['BASE_URL']."app/", $config);
- $config = str_replace("_APP_DB_", $_REQUEST['APP_DB'], $config);
- $config = str_replace("_APP_USERNAME_", $_REQUEST['APP_USERNAME'], $config);
- $config = str_replace("_APP_PASSWORD_", $_REQUEST['APP_PASSWORD'], $config);
- $config = str_replace("_APP_HOST_", $_REQUEST['APP_HOST'], $config);
- $config = str_replace("_CLIENT_", 'app', $config);
-
-
- $db = NewADOConnection('mysqli');
- $res = $db->Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]);
-
-
- if (!$res){
- error_log('Could not connect: ' . $db->ErrorMsg());
- $ret["status"] = "ERROR";
- $ret["msg"] = "Incorrect credentials or incorrect DB host. ".'Could not connect: ' . $db->ErrorMsg();
- echo json_encode($ret);
- exit();
- }
-
- $result = $db->Execute("Show tables");
- error_log(print_r("Number of tables:".$result->RecordCount(),true));
- $num_rows = $result->RecordCount();
- if($num_rows != 0){
- $ret["status"] = "ERROR";
- $ret["msg"] = "Database is not empty";
- echo json_encode($ret);
- exit();
- }
-
-
- //Run create table script
- $insql = file_get_contents(CLIENT_APP_PATH."../scripts/".APP_ID."db.sql");
- $sql_list = preg_split('/;/',$insql);
- foreach($sql_list as $sql){
- if (preg_match('/^\s+$/', $sql) || $sql == '') { # skip empty lines
- continue;
- }
- $db->Execute($sql);
- }
-
- //Run create table script
- $insql = file_get_contents(CLIENT_APP_PATH."../scripts/".APP_ID."_master_data.sql");
- $sql_list = preg_split('/;/',$insql);
- foreach($sql_list as $sql){
- if (preg_match('/^\s+$/', $sql) || $sql == '') { # skip empty lines
- continue;
- }
- $db->Execute($sql);
- }
-
-
- //Write config file
-
- $file = fopen(CLIENT_APP_PATH."config.php","w");
- if($file){
- fwrite($file,$config);
- fclose($file);
- }else{
- error_log('Unable to write configurations to file');
- $ret["status"] = "ERROR";
- $ret["msg"] = "Unable to write configurations to file";
- echo json_encode($ret);
- exit();
- }
-
- $ret["status"] = "SUCCESS";
- $ret["msg"] = "Successfully installed. Please rename or delete install folder";
- echo json_encode($ret);
-}
\ No newline at end of file
diff --git a/src/app/login.php b/src/app/login.php
deleted file mode 100644
index aff65524..00000000
--- a/src/app/login.php
+++ /dev/null
@@ -1,3 +0,0 @@
- li {
- margin-left: 30px;
- }
- .row-fluid .thumbnails {
- margin-left: 0;
- }
-}
-
-@media (min-width: 768px) and (max-width: 979px) {
- .row {
- margin-left: -20px;
- *zoom: 1;
- }
- .row:before,
- .row:after {
- display: table;
- line-height: 0;
- content: "";
- }
- .row:after {
- clear: both;
- }
- [class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 20px;
- }
- .container,
- .navbar-static-top .container,
- .navbar-fixed-top .container,
- .navbar-fixed-bottom .container {
- width: 724px;
- }
- .span12 {
- width: 724px;
- }
- .span11 {
- width: 662px;
- }
- .span10 {
- width: 600px;
- }
- .span9 {
- width: 538px;
- }
- .span8 {
- width: 476px;
- }
- .span7 {
- width: 414px;
- }
- .span6 {
- width: 352px;
- }
- .span5 {
- width: 290px;
- }
- .span4 {
- width: 228px;
- }
- .span3 {
- width: 166px;
- }
- .span2 {
- width: 104px;
- }
- .span1 {
- width: 42px;
- }
- .offset12 {
- margin-left: 764px;
- }
- .offset11 {
- margin-left: 702px;
- }
- .offset10 {
- margin-left: 640px;
- }
- .offset9 {
- margin-left: 578px;
- }
- .offset8 {
- margin-left: 516px;
- }
- .offset7 {
- margin-left: 454px;
- }
- .offset6 {
- margin-left: 392px;
- }
- .offset5 {
- margin-left: 330px;
- }
- .offset4 {
- margin-left: 268px;
- }
- .offset3 {
- margin-left: 206px;
- }
- .offset2 {
- margin-left: 144px;
- }
- .offset1 {
- margin-left: 82px;
- }
- .row-fluid {
- width: 100%;
- *zoom: 1;
- }
- .row-fluid:before,
- .row-fluid:after {
- display: table;
- line-height: 0;
- content: "";
- }
- .row-fluid:after {
- clear: both;
- }
- .row-fluid [class*="span"] {
- display: block;
- float: left;
- width: 100%;
- min-height: 30px;
- margin-left: 2.7624309392265194%;
- *margin-left: 2.709239449864817%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .row-fluid [class*="span"]:first-child {
- margin-left: 0;
- }
- .row-fluid .span12 {
- width: 100%;
- *width: 99.94680851063829%;
- }
- .row-fluid .span11 {
- width: 91.43646408839778%;
- *width: 91.38327259903608%;
- }
- .row-fluid .span10 {
- width: 82.87292817679558%;
- *width: 82.81973668743387%;
- }
- .row-fluid .span9 {
- width: 74.30939226519337%;
- *width: 74.25620077583166%;
- }
- .row-fluid .span8 {
- width: 65.74585635359117%;
- *width: 65.69266486422946%;
- }
- .row-fluid .span7 {
- width: 57.18232044198895%;
- *width: 57.12912895262725%;
- }
- .row-fluid .span6 {
- width: 48.61878453038674%;
- *width: 48.56559304102504%;
- }
- .row-fluid .span5 {
- width: 40.05524861878453%;
- *width: 40.00205712942283%;
- }
- .row-fluid .span4 {
- width: 31.491712707182323%;
- *width: 31.43852121782062%;
- }
- .row-fluid .span3 {
- width: 22.92817679558011%;
- *width: 22.87498530621841%;
- }
- .row-fluid .span2 {
- width: 14.3646408839779%;
- *width: 14.311449394616199%;
- }
- .row-fluid .span1 {
- width: 5.801104972375691%;
- *width: 5.747913483013988%;
- }
- .row-fluid .offset12 {
- margin-left: 105.52486187845304%;
- *margin-left: 105.41847889972962%;
- }
- .row-fluid .offset12:first-child {
- margin-left: 102.76243093922652%;
- *margin-left: 102.6560479605031%;
- }
- .row-fluid .offset11 {
- margin-left: 96.96132596685082%;
- *margin-left: 96.8549429881274%;
- }
- .row-fluid .offset11:first-child {
- margin-left: 94.1988950276243%;
- *margin-left: 94.09251204890089%;
- }
- .row-fluid .offset10 {
- margin-left: 88.39779005524862%;
- *margin-left: 88.2914070765252%;
- }
- .row-fluid .offset10:first-child {
- margin-left: 85.6353591160221%;
- *margin-left: 85.52897613729868%;
- }
- .row-fluid .offset9 {
- margin-left: 79.8342541436464%;
- *margin-left: 79.72787116492299%;
- }
- .row-fluid .offset9:first-child {
- margin-left: 77.07182320441989%;
- *margin-left: 76.96544022569647%;
- }
- .row-fluid .offset8 {
- margin-left: 71.2707182320442%;
- *margin-left: 71.16433525332079%;
- }
- .row-fluid .offset8:first-child {
- margin-left: 68.50828729281768%;
- *margin-left: 68.40190431409427%;
- }
- .row-fluid .offset7 {
- margin-left: 62.70718232044199%;
- *margin-left: 62.600799341718584%;
- }
- .row-fluid .offset7:first-child {
- margin-left: 59.94475138121547%;
- *margin-left: 59.838368402492065%;
- }
- .row-fluid .offset6 {
- margin-left: 54.14364640883978%;
- *margin-left: 54.037263430116376%;
- }
- .row-fluid .offset6:first-child {
- margin-left: 51.38121546961326%;
- *margin-left: 51.27483249088986%;
- }
- .row-fluid .offset5 {
- margin-left: 45.58011049723757%;
- *margin-left: 45.47372751851417%;
- }
- .row-fluid .offset5:first-child {
- margin-left: 42.81767955801105%;
- *margin-left: 42.71129657928765%;
- }
- .row-fluid .offset4 {
- margin-left: 37.01657458563536%;
- *margin-left: 36.91019160691196%;
- }
- .row-fluid .offset4:first-child {
- margin-left: 34.25414364640884%;
- *margin-left: 34.14776066768544%;
- }
- .row-fluid .offset3 {
- margin-left: 28.45303867403315%;
- *margin-left: 28.346655695309746%;
- }
- .row-fluid .offset3:first-child {
- margin-left: 25.69060773480663%;
- *margin-left: 25.584224756083227%;
- }
- .row-fluid .offset2 {
- margin-left: 19.88950276243094%;
- *margin-left: 19.783119783707537%;
- }
- .row-fluid .offset2:first-child {
- margin-left: 17.12707182320442%;
- *margin-left: 17.02068884448102%;
- }
- .row-fluid .offset1 {
- margin-left: 11.32596685082873%;
- *margin-left: 11.219583872105325%;
- }
- .row-fluid .offset1:first-child {
- margin-left: 8.56353591160221%;
- *margin-left: 8.457152932878806%;
- }
- input,
- textarea,
- .uneditable-input {
- margin-left: 0;
- }
- .controls-row [class*="span"] + [class*="span"] {
- margin-left: 20px;
- }
- input.span12,
- textarea.span12,
- .uneditable-input.span12 {
- width: 710px;
- }
- input.span11,
- textarea.span11,
- .uneditable-input.span11 {
- width: 648px;
- }
- input.span10,
- textarea.span10,
- .uneditable-input.span10 {
- width: 586px;
- }
- input.span9,
- textarea.span9,
- .uneditable-input.span9 {
- width: 524px;
- }
- input.span8,
- textarea.span8,
- .uneditable-input.span8 {
- width: 462px;
- }
- input.span7,
- textarea.span7,
- .uneditable-input.span7 {
- width: 400px;
- }
- input.span6,
- textarea.span6,
- .uneditable-input.span6 {
- width: 338px;
- }
- input.span5,
- textarea.span5,
- .uneditable-input.span5 {
- width: 276px;
- }
- input.span4,
- textarea.span4,
- .uneditable-input.span4 {
- width: 214px;
- }
- input.span3,
- textarea.span3,
- .uneditable-input.span3 {
- width: 152px;
- }
- input.span2,
- textarea.span2,
- .uneditable-input.span2 {
- width: 90px;
- }
- input.span1,
- textarea.span1,
- .uneditable-input.span1 {
- width: 28px;
- }
-}
-
-@media (max-width: 767px) {
- body {
- padding-right: 20px;
- padding-left: 20px;
- }
- .navbar-fixed-top,
- .navbar-fixed-bottom,
- .navbar-static-top {
- margin-right: -20px;
- margin-left: -20px;
- }
- .container-fluid {
- padding: 0;
- }
- .dl-horizontal dt {
- float: none;
- width: auto;
- clear: none;
- text-align: left;
- }
- .dl-horizontal dd {
- margin-left: 0;
- }
- .container {
- width: auto;
- }
- .row-fluid {
- width: 100%;
- }
- .row,
- .thumbnails {
- margin-left: 0;
- }
- .thumbnails > li {
- float: none;
- margin-left: 0;
- }
- [class*="span"],
- .row-fluid [class*="span"] {
- display: block;
- float: none;
- width: 100%;
- margin-left: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .span12,
- .row-fluid .span12 {
- width: 100%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .input-large,
- .input-xlarge,
- .input-xxlarge,
- input[class*="span"],
- select[class*="span"],
- textarea[class*="span"],
- .uneditable-input {
- display: block;
- width: 100%;
- min-height: 30px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .input-prepend input,
- .input-append input,
- .input-prepend input[class*="span"],
- .input-append input[class*="span"] {
- display: inline-block;
- width: auto;
- }
- .controls-row [class*="span"] + [class*="span"] {
- margin-left: 0;
- }
- .modal {
- position: fixed;
- top: 20px;
- right: 20px;
- left: 20px;
- width: auto;
- margin: 0;
- }
- .modal.fade.in {
- top: auto;
- }
-}
-
-@media (max-width: 480px) {
- .nav-collapse {
- -webkit-transform: translate3d(0, 0, 0);
- }
- .page-header h1 small {
- display: block;
- line-height: 20px;
- }
- input[type="checkbox"],
- input[type="radio"] {
- border: 1px solid #ccc;
- }
- .form-horizontal .control-label {
- float: none;
- width: auto;
- padding-top: 0;
- text-align: left;
- }
- .form-horizontal .controls {
- margin-left: 0;
- }
- .form-horizontal .control-list {
- padding-top: 0;
- }
- .form-horizontal .form-actions {
- padding-right: 10px;
- padding-left: 10px;
- }
- .modal {
- top: 10px;
- right: 10px;
- left: 10px;
- }
- .modal-header .close {
- padding: 10px;
- margin: -10px;
- }
- .carousel-caption {
- position: static;
- }
-}
-
-@media (max-width: 979px) {
- body {
- padding-top: 0;
- }
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- position: static;
- }
- .navbar-fixed-top {
- margin-bottom: 20px;
- }
- .navbar-fixed-bottom {
- margin-top: 20px;
- }
- .navbar-fixed-top .navbar-inner,
- .navbar-fixed-bottom .navbar-inner {
- padding: 5px;
- }
- .navbar .container {
- width: auto;
- padding: 0;
- }
- .navbar .brand {
- padding-right: 10px;
- padding-left: 10px;
- margin: 0 0 0 -5px;
- }
- .nav-collapse {
- clear: both;
- }
- .nav-collapse .nav {
- float: none;
- margin: 0 0 10px;
- }
- .nav-collapse .nav > li {
- float: none;
- }
- .nav-collapse .nav > li > a {
- margin-bottom: 2px;
- }
- .nav-collapse .nav > .divider-vertical {
- display: none;
- }
- .nav-collapse .nav .nav-header {
- color: #777777;
- text-shadow: none;
- }
- .nav-collapse .nav > li > a,
- .nav-collapse .dropdown-menu a {
- padding: 9px 15px;
- font-weight: bold;
- color: #777777;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- }
- .nav-collapse .btn {
- padding: 4px 10px 4px;
- font-weight: normal;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- }
- .nav-collapse .dropdown-menu li + li a {
- margin-bottom: 2px;
- }
- .nav-collapse .nav > li > a:hover,
- .nav-collapse .dropdown-menu a:hover {
- background-color: #f2f2f2;
- }
- .navbar-inverse .nav-collapse .nav > li > a:hover,
- .navbar-inverse .nav-collapse .dropdown-menu a:hover {
- background-color: #111111;
- }
- .nav-collapse.in .btn-group {
- padding: 0;
- margin-top: 5px;
- }
- .nav-collapse .dropdown-menu {
- position: static;
- top: auto;
- left: auto;
- display: block;
- float: none;
- max-width: none;
- padding: 0;
- margin: 0 15px;
- background-color: transparent;
- border: none;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- }
- .nav-collapse .dropdown-menu:before,
- .nav-collapse .dropdown-menu:after {
- display: none;
- }
- .nav-collapse .dropdown-menu .divider {
- display: none;
- }
- .nav-collapse .nav > li > .dropdown-menu:before,
- .nav-collapse .nav > li > .dropdown-menu:after {
- display: none;
- }
- .nav-collapse .navbar-form,
- .nav-collapse .navbar-search {
- float: none;
- padding: 10px 15px;
- margin: 10px 0;
- border-top: 1px solid #f2f2f2;
- border-bottom: 1px solid #f2f2f2;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- }
- .navbar-inverse .nav-collapse .navbar-form,
- .navbar-inverse .nav-collapse .navbar-search {
- border-top-color: #111111;
- border-bottom-color: #111111;
- }
- .navbar .nav-collapse .nav.pull-right {
- float: none;
- margin-left: 0;
- }
- .nav-collapse,
- .nav-collapse.collapse {
- height: 0;
- overflow: hidden;
- }
- .navbar .btn-navbar {
- display: block;
- }
- .navbar-static .navbar-inner {
- padding-right: 10px;
- padding-left: 10px;
- }
-}
-
-@media (min-width: 980px) {
- .nav-collapse.collapse {
- height: auto !important;
- overflow: visible !important;
- }
-}
diff --git a/src/bootstrap/css/bootstrap-responsive.min.css b/src/bootstrap/css/bootstrap-responsive.min.css
deleted file mode 100644
index 7b0158da..00000000
--- a/src/bootstrap/css/bootstrap-responsive.min.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Bootstrap Responsive v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
diff --git a/src/bootstrap/css/bootstrap.css b/src/bootstrap/css/bootstrap.css
deleted file mode 100644
index 9fa6f766..00000000
--- a/src/bootstrap/css/bootstrap.css
+++ /dev/null
@@ -1,5774 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-nav,
-section {
- display: block;
-}
-
-audio,
-canvas,
-video {
- display: inline-block;
- *display: inline;
- *zoom: 1;
-}
-
-audio:not([controls]) {
- display: none;
-}
-
-html {
- font-size: 100%;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-a:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-a:hover,
-a:active {
- outline: 0;
-}
-
-sub,
-sup {
- position: relative;
- font-size: 75%;
- line-height: 0;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-img {
- width: auto\9;
- height: auto;
- max-width: 100%;
- vertical-align: middle;
- border: 0;
- -ms-interpolation-mode: bicubic;
-}
-
-#map_canvas img {
- max-width: none;
-}
-
-button,
-input,
-select,
-textarea {
- margin: 0;
- font-size: 100%;
- vertical-align: middle;
-}
-
-button,
-input {
- *overflow: visible;
- line-height: normal;
-}
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-
-button,
-input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- cursor: pointer;
- -webkit-appearance: button;
-}
-
-input[type="search"] {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- -webkit-appearance: textfield;
-}
-
-input[type="search"]::-webkit-search-decoration,
-input[type="search"]::-webkit-search-cancel-button {
- -webkit-appearance: none;
-}
-
-textarea {
- overflow: auto;
- vertical-align: top;
-}
-
-.clearfix {
- *zoom: 1;
-}
-
-.clearfix:before,
-.clearfix:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.clearfix:after {
- clear: both;
-}
-
-.hide-text {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-
-.input-block-level {
- display: block;
- width: 100%;
- min-height: 30px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-body {
- margin: 0;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 20px;
- color: #333333;
- background-color: #ffffff;
-}
-
-a {
- color: #0088cc;
- text-decoration: none;
-}
-
-a:hover {
- color: #005580;
- text-decoration: underline;
-}
-
-.img-rounded {
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.img-polaroid {
- padding: 4px;
- background-color: #fff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-}
-
-.img-circle {
- -webkit-border-radius: 500px;
- -moz-border-radius: 500px;
- border-radius: 500px;
-}
-
-.row {
- margin-left: -20px;
- *zoom: 1;
-}
-
-.row:before,
-.row:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.row:after {
- clear: both;
-}
-
-[class*="span"] {
- float: left;
- min-height: 1px;
- margin-left: 20px;
-}
-
-.container,
-.navbar-static-top .container,
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
- width: 940px;
-}
-
-.span12 {
- width: 940px;
-}
-
-.span11 {
- width: 860px;
-}
-
-.span10 {
- width: 780px;
-}
-
-.span9 {
- width: 700px;
-}
-
-.span8 {
- width: 620px;
-}
-
-.span7 {
- width: 540px;
-}
-
-.span6 {
- width: 460px;
-}
-
-.span5 {
- width: 380px;
-}
-
-.span4 {
- width: 300px;
-}
-
-.span3 {
- width: 220px;
-}
-
-.span2 {
- width: 140px;
-}
-
-.span1 {
- width: 60px;
-}
-
-.offset12 {
- margin-left: 980px;
-}
-
-.offset11 {
- margin-left: 900px;
-}
-
-.offset10 {
- margin-left: 820px;
-}
-
-.offset9 {
- margin-left: 740px;
-}
-
-.offset8 {
- margin-left: 660px;
-}
-
-.offset7 {
- margin-left: 580px;
-}
-
-.offset6 {
- margin-left: 500px;
-}
-
-.offset5 {
- margin-left: 420px;
-}
-
-.offset4 {
- margin-left: 340px;
-}
-
-.offset3 {
- margin-left: 260px;
-}
-
-.offset2 {
- margin-left: 180px;
-}
-
-.offset1 {
- margin-left: 100px;
-}
-
-.row-fluid {
- width: 100%;
- *zoom: 1;
-}
-
-.row-fluid:before,
-.row-fluid:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.row-fluid:after {
- clear: both;
-}
-
-.row-fluid [class*="span"] {
- display: block;
- float: left;
- width: 100%;
- min-height: 30px;
- margin-left: 2.127659574468085%;
- *margin-left: 2.074468085106383%;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-.row-fluid [class*="span"]:first-child {
- margin-left: 0;
-}
-
-.row-fluid .span12 {
- width: 100%;
- *width: 99.94680851063829%;
-}
-
-.row-fluid .span11 {
- width: 91.48936170212765%;
- *width: 91.43617021276594%;
-}
-
-.row-fluid .span10 {
- width: 82.97872340425532%;
- *width: 82.92553191489361%;
-}
-
-.row-fluid .span9 {
- width: 74.46808510638297%;
- *width: 74.41489361702126%;
-}
-
-.row-fluid .span8 {
- width: 65.95744680851064%;
- *width: 65.90425531914893%;
-}
-
-.row-fluid .span7 {
- width: 57.44680851063829%;
- *width: 57.39361702127659%;
-}
-
-.row-fluid .span6 {
- width: 48.93617021276595%;
- *width: 48.88297872340425%;
-}
-
-.row-fluid .span5 {
- width: 40.42553191489362%;
- *width: 40.37234042553192%;
-}
-
-.row-fluid .span4 {
- width: 31.914893617021278%;
- *width: 31.861702127659576%;
-}
-
-.row-fluid .span3 {
- width: 23.404255319148934%;
- *width: 23.351063829787233%;
-}
-
-.row-fluid .span2 {
- width: 14.893617021276595%;
- *width: 14.840425531914894%;
-}
-
-.row-fluid .span1 {
- width: 6.382978723404255%;
- *width: 6.329787234042553%;
-}
-
-.row-fluid .offset12 {
- margin-left: 104.25531914893617%;
- *margin-left: 104.14893617021275%;
-}
-
-.row-fluid .offset12:first-child {
- margin-left: 102.12765957446808%;
- *margin-left: 102.02127659574467%;
-}
-
-.row-fluid .offset11 {
- margin-left: 95.74468085106382%;
- *margin-left: 95.6382978723404%;
-}
-
-.row-fluid .offset11:first-child {
- margin-left: 93.61702127659574%;
- *margin-left: 93.51063829787232%;
-}
-
-.row-fluid .offset10 {
- margin-left: 87.23404255319149%;
- *margin-left: 87.12765957446807%;
-}
-
-.row-fluid .offset10:first-child {
- margin-left: 85.1063829787234%;
- *margin-left: 84.99999999999999%;
-}
-
-.row-fluid .offset9 {
- margin-left: 78.72340425531914%;
- *margin-left: 78.61702127659572%;
-}
-
-.row-fluid .offset9:first-child {
- margin-left: 76.59574468085106%;
- *margin-left: 76.48936170212764%;
-}
-
-.row-fluid .offset8 {
- margin-left: 70.2127659574468%;
- *margin-left: 70.10638297872339%;
-}
-
-.row-fluid .offset8:first-child {
- margin-left: 68.08510638297872%;
- *margin-left: 67.9787234042553%;
-}
-
-.row-fluid .offset7 {
- margin-left: 61.70212765957446%;
- *margin-left: 61.59574468085106%;
-}
-
-.row-fluid .offset7:first-child {
- margin-left: 59.574468085106375%;
- *margin-left: 59.46808510638297%;
-}
-
-.row-fluid .offset6 {
- margin-left: 53.191489361702125%;
- *margin-left: 53.085106382978715%;
-}
-
-.row-fluid .offset6:first-child {
- margin-left: 51.063829787234035%;
- *margin-left: 50.95744680851063%;
-}
-
-.row-fluid .offset5 {
- margin-left: 44.68085106382979%;
- *margin-left: 44.57446808510638%;
-}
-
-.row-fluid .offset5:first-child {
- margin-left: 42.5531914893617%;
- *margin-left: 42.4468085106383%;
-}
-
-.row-fluid .offset4 {
- margin-left: 36.170212765957444%;
- *margin-left: 36.06382978723405%;
-}
-
-.row-fluid .offset4:first-child {
- margin-left: 34.04255319148936%;
- *margin-left: 33.93617021276596%;
-}
-
-.row-fluid .offset3 {
- margin-left: 27.659574468085104%;
- *margin-left: 27.5531914893617%;
-}
-
-.row-fluid .offset3:first-child {
- margin-left: 25.53191489361702%;
- *margin-left: 25.425531914893618%;
-}
-
-.row-fluid .offset2 {
- margin-left: 19.148936170212764%;
- *margin-left: 19.04255319148936%;
-}
-
-.row-fluid .offset2:first-child {
- margin-left: 17.02127659574468%;
- *margin-left: 16.914893617021278%;
-}
-
-.row-fluid .offset1 {
- margin-left: 10.638297872340425%;
- *margin-left: 10.53191489361702%;
-}
-
-.row-fluid .offset1:first-child {
- margin-left: 8.51063829787234%;
- *margin-left: 8.404255319148938%;
-}
-
-[class*="span"].hide,
-.row-fluid [class*="span"].hide {
- display: none;
-}
-
-[class*="span"].pull-right,
-.row-fluid [class*="span"].pull-right {
- float: right;
-}
-
-.container {
- margin-right: auto;
- margin-left: auto;
- *zoom: 1;
-}
-
-.container:before,
-.container:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.container:after {
- clear: both;
-}
-
-.container-fluid {
- padding-right: 20px;
- padding-left: 20px;
- *zoom: 1;
-}
-
-.container-fluid:before,
-.container-fluid:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.container-fluid:after {
- clear: both;
-}
-
-p {
- margin: 0 0 10px;
-}
-
-.lead {
- margin-bottom: 20px;
- font-size: 21px;
- font-weight: 200;
- line-height: 30px;
-}
-
-small {
- font-size: 85%;
-}
-
-strong {
- font-weight: bold;
-}
-
-em {
- font-style: italic;
-}
-
-cite {
- font-style: normal;
-}
-
-.muted {
- color: #999999;
-}
-
-.text-warning {
- color: #c09853;
-}
-
-.text-error {
- color: #b94a48;
-}
-
-.text-info {
- color: #3a87ad;
-}
-
-.text-success {
- color: #468847;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6 {
- margin: 10px 0;
- font-family: inherit;
- font-weight: bold;
- line-height: 1;
- color: inherit;
- text-rendering: optimizelegibility;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small {
- font-weight: normal;
- line-height: 1;
- color: #999999;
-}
-
-h1 {
- font-size: 36px;
- line-height: 40px;
-}
-
-h2 {
- font-size: 30px;
- line-height: 40px;
-}
-
-h3 {
- font-size: 24px;
- line-height: 40px;
-}
-
-h4 {
- font-size: 18px;
- line-height: 20px;
-}
-
-h5 {
- font-size: 14px;
- line-height: 20px;
-}
-
-h6 {
- font-size: 12px;
- line-height: 20px;
-}
-
-h1 small {
- font-size: 24px;
-}
-
-h2 small {
- font-size: 18px;
-}
-
-h3 small {
- font-size: 14px;
-}
-
-h4 small {
- font-size: 14px;
-}
-
-.page-header {
- padding-bottom: 9px;
- margin: 20px 0 30px;
- border-bottom: 1px solid #eeeeee;
-}
-
-ul,
-ol {
- padding: 0;
- margin: 0 0 10px 25px;
-}
-
-ul ul,
-ul ol,
-ol ol,
-ol ul {
- margin-bottom: 0;
-}
-
-li {
- line-height: 20px;
-}
-
-ul.unstyled,
-ol.unstyled {
- margin-left: 0;
- list-style: none;
-}
-
-dl {
- margin-bottom: 20px;
-}
-
-dt,
-dd {
- line-height: 20px;
-}
-
-dt {
- font-weight: bold;
-}
-
-dd {
- margin-left: 10px;
-}
-
-.dl-horizontal {
- *zoom: 1;
-}
-
-.dl-horizontal:before,
-.dl-horizontal:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.dl-horizontal:after {
- clear: both;
-}
-
-.dl-horizontal dt {
- float: left;
- width: 160px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.dl-horizontal dd {
- margin-left: 180px;
-}
-
-hr {
- margin: 20px 0;
- border: 0;
- border-top: 1px solid #eeeeee;
- border-bottom: 1px solid #ffffff;
-}
-
-abbr[title] {
- cursor: help;
- border-bottom: 1px dotted #999999;
-}
-
-abbr.initialism {
- font-size: 90%;
- text-transform: uppercase;
-}
-
-blockquote {
- padding: 0 0 0 15px;
- margin: 0 0 20px;
- border-left: 5px solid #eeeeee;
-}
-
-blockquote p {
- margin-bottom: 0;
- font-size: 16px;
- font-weight: 300;
- line-height: 25px;
-}
-
-blockquote small {
- display: block;
- line-height: 20px;
- color: #999999;
-}
-
-blockquote small:before {
- content: '\2014 \00A0';
-}
-
-blockquote.pull-right {
- float: right;
- padding-right: 15px;
- padding-left: 0;
- border-right: 5px solid #eeeeee;
- border-left: 0;
-}
-
-blockquote.pull-right p,
-blockquote.pull-right small {
- text-align: right;
-}
-
-blockquote.pull-right small:before {
- content: '';
-}
-
-blockquote.pull-right small:after {
- content: '\00A0 \2014';
-}
-
-q:before,
-q:after,
-blockquote:before,
-blockquote:after {
- content: "";
-}
-
-address {
- display: block;
- margin-bottom: 20px;
- font-style: normal;
- line-height: 20px;
-}
-
-code,
-pre {
- padding: 0 3px 2px;
- font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
- font-size: 12px;
- color: #333333;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-code {
- padding: 2px 4px;
- color: #d14;
- background-color: #f7f7f9;
- border: 1px solid #e1e1e8;
-}
-
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 20px;
- word-break: break-all;
- word-wrap: break-word;
- white-space: pre;
- white-space: pre-wrap;
- background-color: #f5f5f5;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.15);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-pre.prettyprint {
- margin-bottom: 20px;
-}
-
-pre code {
- padding: 0;
- color: inherit;
- background-color: transparent;
- border: 0;
-}
-
-.pre-scrollable {
- max-height: 340px;
- overflow-y: scroll;
-}
-
-form {
- margin: 0 0 20px;
-}
-
-fieldset {
- padding: 0;
- margin: 0;
- border: 0;
-}
-
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: 40px;
- color: #333333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-
-legend small {
- font-size: 15px;
- color: #999999;
-}
-
-label,
-input,
-button,
-select,
-textarea {
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
-}
-
-input,
-button,
-select,
-textarea {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-label {
- display: block;
- margin-bottom: 5px;
-}
-
-select,
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
- display: inline-block;
- height: 20px;
- padding: 4px 6px;
- margin-bottom: 9px;
- font-size: 14px;
- line-height: 20px;
- color: #555555;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-input,
-textarea,
-.uneditable-input {
- width: 206px;
-}
-
-textarea {
- height: auto;
-}
-
-textarea,
-input[type="text"],
-input[type="password"],
-input[type="datetime"],
-input[type="datetime-local"],
-input[type="date"],
-input[type="month"],
-input[type="time"],
-input[type="week"],
-input[type="number"],
-input[type="email"],
-input[type="url"],
-input[type="search"],
-input[type="tel"],
-input[type="color"],
-.uneditable-input {
- background-color: #ffffff;
- border: 1px solid #cccccc;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
- -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
- -o-transition: border linear 0.2s, box-shadow linear 0.2s;
- transition: border linear 0.2s, box-shadow linear 0.2s;
-}
-
-textarea:focus,
-input[type="text"]:focus,
-input[type="password"]:focus,
-input[type="datetime"]:focus,
-input[type="datetime-local"]:focus,
-input[type="date"]:focus,
-input[type="month"]:focus,
-input[type="time"]:focus,
-input[type="week"]:focus,
-input[type="number"]:focus,
-input[type="email"]:focus,
-input[type="url"]:focus,
-input[type="search"]:focus,
-input[type="tel"]:focus,
-input[type="color"]:focus,
-.uneditable-input:focus {
- border-color: rgba(82, 168, 236, 0.8);
- outline: 0;
- outline: thin dotted \9;
- /* IE6-9 */
-
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-}
-
-input[type="radio"],
-input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px \9;
- *margin-top: 0;
- line-height: normal;
- cursor: pointer;
-}
-
-input[type="file"],
-input[type="image"],
-input[type="submit"],
-input[type="reset"],
-input[type="button"],
-input[type="radio"],
-input[type="checkbox"] {
- width: auto;
-}
-
-select,
-input[type="file"] {
- height: 30px;
- /* In IE7, the height of the select element cannot be changed by height, only font-size */
-
- *margin-top: 4px;
- /* For IE7, add top margin to align select with labels */
-
- line-height: 30px;
-}
-
-select {
- width: 220px;
- background-color: #ffffff;
- border: 1px solid #cccccc;
-}
-
-select[multiple],
-select[size] {
- height: auto;
-}
-
-select:focus,
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-.uneditable-input,
-.uneditable-textarea {
- color: #999999;
- cursor: not-allowed;
- background-color: #fcfcfc;
- border-color: #cccccc;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
-}
-
-.uneditable-input {
- overflow: hidden;
- white-space: nowrap;
-}
-
-.uneditable-textarea {
- width: auto;
- height: auto;
-}
-
-input:-moz-placeholder,
-textarea:-moz-placeholder {
- color: #999999;
-}
-
-input:-ms-input-placeholder,
-textarea:-ms-input-placeholder {
- color: #999999;
-}
-
-input::-webkit-input-placeholder,
-textarea::-webkit-input-placeholder {
- color: #999999;
-}
-
-.radio,
-.checkbox {
- min-height: 18px;
- padding-left: 18px;
-}
-
-.radio input[type="radio"],
-.checkbox input[type="checkbox"] {
- float: left;
- margin-left: -18px;
-}
-
-.controls > .radio:first-child,
-.controls > .checkbox:first-child {
- padding-top: 5px;
-}
-
-.radio.inline,
-.checkbox.inline {
- display: inline-block;
- padding-top: 5px;
- margin-bottom: 0;
- vertical-align: middle;
-}
-
-.radio.inline + .radio.inline,
-.checkbox.inline + .checkbox.inline {
- margin-left: 10px;
-}
-
-.input-mini {
- width: 60px;
-}
-
-.input-small {
- width: 90px;
-}
-
-.input-medium {
- width: 150px;
-}
-
-.input-large {
- width: 210px;
-}
-
-.input-xlarge {
- width: 270px;
-}
-
-.input-xxlarge {
- width: 530px;
-}
-
-input[class*="span"],
-select[class*="span"],
-textarea[class*="span"],
-.uneditable-input[class*="span"],
-.row-fluid input[class*="span"],
-.row-fluid select[class*="span"],
-.row-fluid textarea[class*="span"],
-.row-fluid .uneditable-input[class*="span"] {
- float: none;
- margin-left: 0;
-}
-
-.input-append input[class*="span"],
-.input-append .uneditable-input[class*="span"],
-.input-prepend input[class*="span"],
-.input-prepend .uneditable-input[class*="span"],
-.row-fluid input[class*="span"],
-.row-fluid select[class*="span"],
-.row-fluid textarea[class*="span"],
-.row-fluid .uneditable-input[class*="span"],
-.row-fluid .input-prepend [class*="span"],
-.row-fluid .input-append [class*="span"] {
- display: inline-block;
-}
-
-input,
-textarea,
-.uneditable-input {
- margin-left: 0;
-}
-
-.controls-row [class*="span"] + [class*="span"] {
- margin-left: 20px;
-}
-
-input.span12,
-textarea.span12,
-.uneditable-input.span12 {
- width: 926px;
-}
-
-input.span11,
-textarea.span11,
-.uneditable-input.span11 {
- width: 846px;
-}
-
-input.span10,
-textarea.span10,
-.uneditable-input.span10 {
- width: 766px;
-}
-
-input.span9,
-textarea.span9,
-.uneditable-input.span9 {
- width: 686px;
-}
-
-input.span8,
-textarea.span8,
-.uneditable-input.span8 {
- width: 606px;
-}
-
-input.span7,
-textarea.span7,
-.uneditable-input.span7 {
- width: 526px;
-}
-
-input.span6,
-textarea.span6,
-.uneditable-input.span6 {
- width: 446px;
-}
-
-input.span5,
-textarea.span5,
-.uneditable-input.span5 {
- width: 366px;
-}
-
-input.span4,
-textarea.span4,
-.uneditable-input.span4 {
- width: 286px;
-}
-
-input.span3,
-textarea.span3,
-.uneditable-input.span3 {
- width: 206px;
-}
-
-input.span2,
-textarea.span2,
-.uneditable-input.span2 {
- width: 126px;
-}
-
-input.span1,
-textarea.span1,
-.uneditable-input.span1 {
- width: 46px;
-}
-
-.controls-row {
- *zoom: 1;
-}
-
-.controls-row:before,
-.controls-row:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.controls-row:after {
- clear: both;
-}
-
-.controls-row [class*="span"] {
- float: left;
-}
-
-input[disabled],
-select[disabled],
-textarea[disabled],
-input[readonly],
-select[readonly],
-textarea[readonly] {
- cursor: not-allowed;
- background-color: #eeeeee;
-}
-
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"][readonly],
-input[type="checkbox"][readonly] {
- background-color: transparent;
-}
-
-.control-group.warning > label,
-.control-group.warning .help-block,
-.control-group.warning .help-inline {
- color: #c09853;
-}
-
-.control-group.warning .checkbox,
-.control-group.warning .radio,
-.control-group.warning input,
-.control-group.warning select,
-.control-group.warning textarea {
- color: #c09853;
-}
-
-.control-group.warning input,
-.control-group.warning select,
-.control-group.warning textarea {
- border-color: #c09853;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.warning input:focus,
-.control-group.warning select:focus,
-.control-group.warning textarea:focus {
- border-color: #a47e3c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-}
-
-.control-group.warning .input-prepend .add-on,
-.control-group.warning .input-append .add-on {
- color: #c09853;
- background-color: #fcf8e3;
- border-color: #c09853;
-}
-
-.control-group.error > label,
-.control-group.error .help-block,
-.control-group.error .help-inline {
- color: #b94a48;
-}
-
-.control-group.error .checkbox,
-.control-group.error .radio,
-.control-group.error input,
-.control-group.error select,
-.control-group.error textarea {
- color: #b94a48;
-}
-
-.control-group.error input,
-.control-group.error select,
-.control-group.error textarea {
- border-color: #b94a48;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.error input:focus,
-.control-group.error select:focus,
-.control-group.error textarea:focus {
- border-color: #953b39;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-}
-
-.control-group.error .input-prepend .add-on,
-.control-group.error .input-append .add-on {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #b94a48;
-}
-
-.control-group.success > label,
-.control-group.success .help-block,
-.control-group.success .help-inline {
- color: #468847;
-}
-
-.control-group.success .checkbox,
-.control-group.success .radio,
-.control-group.success input,
-.control-group.success select,
-.control-group.success textarea {
- color: #468847;
-}
-
-.control-group.success input,
-.control-group.success select,
-.control-group.success textarea {
- border-color: #468847;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.success input:focus,
-.control-group.success select:focus,
-.control-group.success textarea:focus {
- border-color: #356635;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-}
-
-.control-group.success .input-prepend .add-on,
-.control-group.success .input-append .add-on {
- color: #468847;
- background-color: #dff0d8;
- border-color: #468847;
-}
-
-.control-group.info > label,
-.control-group.info .help-block,
-.control-group.info .help-inline {
- color: #3a87ad;
-}
-
-.control-group.info .checkbox,
-.control-group.info .radio,
-.control-group.info input,
-.control-group.info select,
-.control-group.info textarea {
- color: #3a87ad;
-}
-
-.control-group.info input,
-.control-group.info select,
-.control-group.info textarea {
- border-color: #3a87ad;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.control-group.info input:focus,
-.control-group.info select:focus,
-.control-group.info textarea:focus {
- border-color: #2d6987;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
-}
-
-.control-group.info .input-prepend .add-on,
-.control-group.info .input-append .add-on {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #3a87ad;
-}
-
-input:focus:required:invalid,
-textarea:focus:required:invalid,
-select:focus:required:invalid {
- color: #b94a48;
- border-color: #ee5f5b;
-}
-
-input:focus:required:invalid:focus,
-textarea:focus:required:invalid:focus,
-select:focus:required:invalid:focus {
- border-color: #e9322d;
- -webkit-box-shadow: 0 0 6px #f8b9b7;
- -moz-box-shadow: 0 0 6px #f8b9b7;
- box-shadow: 0 0 6px #f8b9b7;
-}
-
-.form-actions {
- padding: 19px 20px 20px;
- margin-top: 20px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border-top: 1px solid #e5e5e5;
- *zoom: 1;
-}
-
-.form-actions:before,
-.form-actions:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.form-actions:after {
- clear: both;
-}
-
-.help-block,
-.help-inline {
- color: #595959;
-}
-
-.help-block {
- display: block;
- margin-bottom: 10px;
-}
-
-.help-inline {
- display: inline-block;
- *display: inline;
- padding-left: 5px;
- vertical-align: middle;
- *zoom: 1;
-}
-
-.input-append,
-.input-prepend {
- margin-bottom: 5px;
- font-size: 0;
- white-space: nowrap;
-}
-
-.input-append input,
-.input-prepend input,
-.input-append select,
-.input-prepend select,
-.input-append .uneditable-input,
-.input-prepend .uneditable-input {
- position: relative;
- margin-bottom: 0;
- *margin-left: 0;
- font-size: 14px;
- vertical-align: top;
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.input-append input:focus,
-.input-prepend input:focus,
-.input-append select:focus,
-.input-prepend select:focus,
-.input-append .uneditable-input:focus,
-.input-prepend .uneditable-input:focus {
- z-index: 2;
-}
-
-.input-append .add-on,
-.input-prepend .add-on {
- display: inline-block;
- width: auto;
- height: 20px;
- min-width: 16px;
- padding: 4px 5px;
- font-size: 14px;
- font-weight: normal;
- line-height: 20px;
- text-align: center;
- text-shadow: 0 1px 0 #ffffff;
- background-color: #eeeeee;
- border: 1px solid #ccc;
-}
-
-.input-append .add-on,
-.input-prepend .add-on,
-.input-append .btn,
-.input-prepend .btn {
- vertical-align: top;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.input-append .active,
-.input-prepend .active {
- background-color: #a9dba9;
- border-color: #46a546;
-}
-
-.input-prepend .add-on,
-.input-prepend .btn {
- margin-right: -1px;
-}
-
-.input-prepend .add-on:first-child,
-.input-prepend .btn:first-child {
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-append input,
-.input-append select,
-.input-append .uneditable-input {
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-append .add-on,
-.input-append .btn {
- margin-left: -1px;
-}
-
-.input-append .add-on:last-child,
-.input-append .btn:last-child {
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.input-prepend.input-append input,
-.input-prepend.input-append select,
-.input-prepend.input-append .uneditable-input {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.input-prepend.input-append .add-on:first-child,
-.input-prepend.input-append .btn:first-child {
- margin-right: -1px;
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.input-prepend.input-append .add-on:last-child,
-.input-prepend.input-append .btn:last-child {
- margin-left: -1px;
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-input.search-query {
- padding-right: 14px;
- padding-right: 4px \9;
- padding-left: 14px;
- padding-left: 4px \9;
- /* IE7-8 doesn't have border-radius, so don't indent the padding */
-
- margin-bottom: 0;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-/* Allow for input prepend/append in search forms */
-
-.form-search .input-append .search-query,
-.form-search .input-prepend .search-query {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.form-search .input-append .search-query {
- -webkit-border-radius: 14px 0 0 14px;
- -moz-border-radius: 14px 0 0 14px;
- border-radius: 14px 0 0 14px;
-}
-
-.form-search .input-append .btn {
- -webkit-border-radius: 0 14px 14px 0;
- -moz-border-radius: 0 14px 14px 0;
- border-radius: 0 14px 14px 0;
-}
-
-.form-search .input-prepend .search-query {
- -webkit-border-radius: 0 14px 14px 0;
- -moz-border-radius: 0 14px 14px 0;
- border-radius: 0 14px 14px 0;
-}
-
-.form-search .input-prepend .btn {
- -webkit-border-radius: 14px 0 0 14px;
- -moz-border-radius: 14px 0 0 14px;
- border-radius: 14px 0 0 14px;
-}
-
-.form-search input,
-.form-inline input,
-.form-horizontal input,
-.form-search textarea,
-.form-inline textarea,
-.form-horizontal textarea,
-.form-search select,
-.form-inline select,
-.form-horizontal select,
-.form-search .help-inline,
-.form-inline .help-inline,
-.form-horizontal .help-inline,
-.form-search .uneditable-input,
-.form-inline .uneditable-input,
-.form-horizontal .uneditable-input,
-.form-search .input-prepend,
-.form-inline .input-prepend,
-.form-horizontal .input-prepend,
-.form-search .input-append,
-.form-inline .input-append,
-.form-horizontal .input-append {
- display: inline-block;
- *display: inline;
- margin-bottom: 0;
- vertical-align: middle;
- *zoom: 1;
-}
-
-.form-search .hide,
-.form-inline .hide,
-.form-horizontal .hide {
- display: none;
-}
-
-.form-search label,
-.form-inline label,
-.form-search .btn-group,
-.form-inline .btn-group {
- display: inline-block;
-}
-
-.form-search .input-append,
-.form-inline .input-append,
-.form-search .input-prepend,
-.form-inline .input-prepend {
- margin-bottom: 0;
-}
-
-.form-search .radio,
-.form-search .checkbox,
-.form-inline .radio,
-.form-inline .checkbox {
- padding-left: 0;
- margin-bottom: 0;
- vertical-align: middle;
-}
-
-.form-search .radio input[type="radio"],
-.form-search .checkbox input[type="checkbox"],
-.form-inline .radio input[type="radio"],
-.form-inline .checkbox input[type="checkbox"] {
- float: left;
- margin-right: 3px;
- margin-left: 0;
-}
-
-.control-group {
- margin-bottom: 10px;
-}
-
-legend + .control-group {
- margin-top: 20px;
- -webkit-margin-top-collapse: separate;
-}
-
-.form-horizontal .control-group {
- margin-bottom: 20px;
- *zoom: 1;
-}
-
-.form-horizontal .control-group:before,
-.form-horizontal .control-group:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.form-horizontal .control-group:after {
- clear: both;
-}
-
-.form-horizontal .control-label {
- float: left;
- width: 160px;
- padding-top: 5px;
- text-align: right;
-}
-
-.form-horizontal .controls {
- *display: inline-block;
- *padding-left: 20px;
- margin-left: 180px;
- *margin-left: 0;
-}
-
-.form-horizontal .controls:first-child {
- *padding-left: 180px;
-}
-
-.form-horizontal .help-block {
- margin-bottom: 0;
-}
-
-.form-horizontal input + .help-block,
-.form-horizontal select + .help-block,
-.form-horizontal textarea + .help-block {
- margin-top: 10px;
-}
-
-.form-horizontal .form-actions {
- padding-left: 180px;
-}
-
-table {
- max-width: 100%;
- background-color: transparent;
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-.table {
- width: 100%;
- margin-bottom: 20px;
-}
-
-.table th,
-.table td {
- padding: 8px;
- line-height: 20px;
- text-align: left;
- vertical-align: top;
- border-top: 1px solid #dddddd;
-}
-
-.table th {
- font-weight: bold;
-}
-
-.table thead th {
- vertical-align: bottom;
-}
-
-.table caption + thead tr:first-child th,
-.table caption + thead tr:first-child td,
-.table colgroup + thead tr:first-child th,
-.table colgroup + thead tr:first-child td,
-.table thead:first-child tr:first-child th,
-.table thead:first-child tr:first-child td {
- border-top: 0;
-}
-
-.table tbody + tbody {
- border-top: 2px solid #dddddd;
-}
-
-.table-condensed th,
-.table-condensed td {
- padding: 4px 5px;
-}
-
-.table-bordered {
- border: 1px solid #dddddd;
- border-collapse: separate;
- *border-collapse: collapse;
- border-left: 0;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.table-bordered th,
-.table-bordered td {
- border-left: 1px solid #dddddd;
-}
-
-.table-bordered caption + thead tr:first-child th,
-.table-bordered caption + tbody tr:first-child th,
-.table-bordered caption + tbody tr:first-child td,
-.table-bordered colgroup + thead tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child th,
-.table-bordered colgroup + tbody tr:first-child td,
-.table-bordered thead:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child th,
-.table-bordered tbody:first-child tr:first-child td {
- border-top: 0;
-}
-
-.table-bordered thead:first-child tr:first-child th:first-child,
-.table-bordered tbody:first-child tr:first-child td:first-child {
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-bordered thead:first-child tr:first-child th:last-child,
-.table-bordered tbody:first-child tr:first-child td:last-child {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -moz-border-radius-topright: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:first-child,
-.table-bordered tbody:last-child tr:last-child td:first-child,
-.table-bordered tfoot:last-child tr:last-child td:first-child {
- -webkit-border-radius: 0 0 0 4px;
- -moz-border-radius: 0 0 0 4px;
- border-radius: 0 0 0 4px;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
-}
-
-.table-bordered thead:last-child tr:last-child th:last-child,
-.table-bordered tbody:last-child tr:last-child td:last-child,
-.table-bordered tfoot:last-child tr:last-child td:last-child {
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-border-radius-bottomright: 4px;
-}
-
-.table-bordered caption + thead tr:first-child th:first-child,
-.table-bordered caption + tbody tr:first-child td:first-child,
-.table-bordered colgroup + thead tr:first-child th:first-child,
-.table-bordered colgroup + tbody tr:first-child td:first-child {
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-bordered caption + thead tr:first-child th:last-child,
-.table-bordered caption + tbody tr:first-child td:last-child,
-.table-bordered colgroup + thead tr:first-child th:last-child,
-.table-bordered colgroup + tbody tr:first-child td:last-child {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.table-striped tbody tr:nth-child(odd) td,
-.table-striped tbody tr:nth-child(odd) th {
- background-color: #f9f9f9;
-}
-
-.table-hover tbody tr:hover td,
-.table-hover tbody tr:hover th {
- background-color: #f5f5f5;
-}
-
-table [class*=span],
-.row-fluid table [class*=span] {
- display: table-cell;
- float: none;
- margin-left: 0;
-}
-
-.table .span1 {
- float: none;
- width: 44px;
- margin-left: 0;
-}
-
-.table .span2 {
- float: none;
- width: 124px;
- margin-left: 0;
-}
-
-.table .span3 {
- float: none;
- width: 204px;
- margin-left: 0;
-}
-
-.table .span4 {
- float: none;
- width: 284px;
- margin-left: 0;
-}
-
-.table .span5 {
- float: none;
- width: 364px;
- margin-left: 0;
-}
-
-.table .span6 {
- float: none;
- width: 444px;
- margin-left: 0;
-}
-
-.table .span7 {
- float: none;
- width: 524px;
- margin-left: 0;
-}
-
-.table .span8 {
- float: none;
- width: 604px;
- margin-left: 0;
-}
-
-.table .span9 {
- float: none;
- width: 684px;
- margin-left: 0;
-}
-
-.table .span10 {
- float: none;
- width: 764px;
- margin-left: 0;
-}
-
-.table .span11 {
- float: none;
- width: 844px;
- margin-left: 0;
-}
-
-.table .span12 {
- float: none;
- width: 924px;
- margin-left: 0;
-}
-
-.table .span13 {
- float: none;
- width: 1004px;
- margin-left: 0;
-}
-
-.table .span14 {
- float: none;
- width: 1084px;
- margin-left: 0;
-}
-
-.table .span15 {
- float: none;
- width: 1164px;
- margin-left: 0;
-}
-
-.table .span16 {
- float: none;
- width: 1244px;
- margin-left: 0;
-}
-
-.table .span17 {
- float: none;
- width: 1324px;
- margin-left: 0;
-}
-
-.table .span18 {
- float: none;
- width: 1404px;
- margin-left: 0;
-}
-
-.table .span19 {
- float: none;
- width: 1484px;
- margin-left: 0;
-}
-
-.table .span20 {
- float: none;
- width: 1564px;
- margin-left: 0;
-}
-
-.table .span21 {
- float: none;
- width: 1644px;
- margin-left: 0;
-}
-
-.table .span22 {
- float: none;
- width: 1724px;
- margin-left: 0;
-}
-
-.table .span23 {
- float: none;
- width: 1804px;
- margin-left: 0;
-}
-
-.table .span24 {
- float: none;
- width: 1884px;
- margin-left: 0;
-}
-
-.table tbody tr.success td {
- background-color: #dff0d8;
-}
-
-.table tbody tr.error td {
- background-color: #f2dede;
-}
-
-.table tbody tr.warning td {
- background-color: #fcf8e3;
-}
-
-.table tbody tr.info td {
- background-color: #d9edf7;
-}
-
-.table-hover tbody tr.success:hover td {
- background-color: #d0e9c6;
-}
-
-.table-hover tbody tr.error:hover td {
- background-color: #ebcccc;
-}
-
-.table-hover tbody tr.warning:hover td {
- background-color: #faf2cc;
-}
-
-.table-hover tbody tr.info:hover td {
- background-color: #c4e3f3;
-}
-
-[class^="icon-"],
-[class*=" icon-"] {
- display: inline-block;
- width: 14px;
- height: 14px;
- margin-top: 1px;
- *margin-right: .3em;
- line-height: 14px;
- vertical-align: text-top;
- background-image: url("../img/glyphicons-halflings.png");
- background-position: 14px 14px;
- background-repeat: no-repeat;
-}
-
-/* White icons with optional class, or on hover/active states of certain elements */
-
-.icon-white,
-.nav-tabs > .active > a > [class^="icon-"],
-.nav-tabs > .active > a > [class*=" icon-"],
-.nav-pills > .active > a > [class^="icon-"],
-.nav-pills > .active > a > [class*=" icon-"],
-.nav-list > .active > a > [class^="icon-"],
-.nav-list > .active > a > [class*=" icon-"],
-.navbar-inverse .nav > .active > a > [class^="icon-"],
-.navbar-inverse .nav > .active > a > [class*=" icon-"],
-.dropdown-menu > li > a:hover > [class^="icon-"],
-.dropdown-menu > li > a:hover > [class*=" icon-"],
-.dropdown-menu > .active > a > [class^="icon-"],
-.dropdown-menu > .active > a > [class*=" icon-"] {
- background-image: url("../img/glyphicons-halflings-white.png");
-}
-
-.icon-glass {
- background-position: 0 0;
-}
-
-.icon-music {
- background-position: -24px 0;
-}
-
-.icon-search {
- background-position: -48px 0;
-}
-
-.icon-envelope {
- background-position: -72px 0;
-}
-
-.icon-heart {
- background-position: -96px 0;
-}
-
-.icon-star {
- background-position: -120px 0;
-}
-
-.icon-star-empty {
- background-position: -144px 0;
-}
-
-.icon-user {
- background-position: -168px 0;
-}
-
-.icon-film {
- background-position: -192px 0;
-}
-
-.icon-th-large {
- background-position: -216px 0;
-}
-
-.icon-th {
- background-position: -240px 0;
-}
-
-.icon-th-list {
- background-position: -264px 0;
-}
-
-.icon-ok {
- background-position: -288px 0;
-}
-
-.icon-remove {
- background-position: -312px 0;
-}
-
-.icon-zoom-in {
- background-position: -336px 0;
-}
-
-.icon-zoom-out {
- background-position: -360px 0;
-}
-
-.icon-off {
- background-position: -384px 0;
-}
-
-.icon-signal {
- background-position: -408px 0;
-}
-
-.icon-cog {
- background-position: -432px 0;
-}
-
-.icon-trash {
- background-position: -456px 0;
-}
-
-.icon-home {
- background-position: 0 -24px;
-}
-
-.icon-file {
- background-position: -24px -24px;
-}
-
-.icon-time {
- background-position: -48px -24px;
-}
-
-.icon-road {
- background-position: -72px -24px;
-}
-
-.icon-download-alt {
- background-position: -96px -24px;
-}
-
-.icon-download {
- background-position: -120px -24px;
-}
-
-.icon-upload {
- background-position: -144px -24px;
-}
-
-.icon-inbox {
- background-position: -168px -24px;
-}
-
-.icon-play-circle {
- background-position: -192px -24px;
-}
-
-.icon-repeat {
- background-position: -216px -24px;
-}
-
-.icon-refresh {
- background-position: -240px -24px;
-}
-
-.icon-list-alt {
- background-position: -264px -24px;
-}
-
-.icon-lock {
- background-position: -287px -24px;
-}
-
-.icon-flag {
- background-position: -312px -24px;
-}
-
-.icon-headphones {
- background-position: -336px -24px;
-}
-
-.icon-volume-off {
- background-position: -360px -24px;
-}
-
-.icon-volume-down {
- background-position: -384px -24px;
-}
-
-.icon-volume-up {
- background-position: -408px -24px;
-}
-
-.icon-qrcode {
- background-position: -432px -24px;
-}
-
-.icon-barcode {
- background-position: -456px -24px;
-}
-
-.icon-tag {
- background-position: 0 -48px;
-}
-
-.icon-tags {
- background-position: -25px -48px;
-}
-
-.icon-book {
- background-position: -48px -48px;
-}
-
-.icon-bookmark {
- background-position: -72px -48px;
-}
-
-.icon-print {
- background-position: -96px -48px;
-}
-
-.icon-camera {
- background-position: -120px -48px;
-}
-
-.icon-font {
- background-position: -144px -48px;
-}
-
-.icon-bold {
- background-position: -167px -48px;
-}
-
-.icon-italic {
- background-position: -192px -48px;
-}
-
-.icon-text-height {
- background-position: -216px -48px;
-}
-
-.icon-text-width {
- background-position: -240px -48px;
-}
-
-.icon-align-left {
- background-position: -264px -48px;
-}
-
-.icon-align-center {
- background-position: -288px -48px;
-}
-
-.icon-align-right {
- background-position: -312px -48px;
-}
-
-.icon-align-justify {
- background-position: -336px -48px;
-}
-
-.icon-list {
- background-position: -360px -48px;
-}
-
-.icon-indent-left {
- background-position: -384px -48px;
-}
-
-.icon-indent-right {
- background-position: -408px -48px;
-}
-
-.icon-facetime-video {
- background-position: -432px -48px;
-}
-
-.icon-picture {
- background-position: -456px -48px;
-}
-
-.icon-pencil {
- background-position: 0 -72px;
-}
-
-.icon-map-marker {
- background-position: -24px -72px;
-}
-
-.icon-adjust {
- background-position: -48px -72px;
-}
-
-.icon-tint {
- background-position: -72px -72px;
-}
-
-.icon-edit {
- background-position: -96px -72px;
-}
-
-.icon-share {
- background-position: -120px -72px;
-}
-
-.icon-check {
- background-position: -144px -72px;
-}
-
-.icon-move {
- background-position: -168px -72px;
-}
-
-.icon-step-backward {
- background-position: -192px -72px;
-}
-
-.icon-fast-backward {
- background-position: -216px -72px;
-}
-
-.icon-backward {
- background-position: -240px -72px;
-}
-
-.icon-play {
- background-position: -264px -72px;
-}
-
-.icon-pause {
- background-position: -288px -72px;
-}
-
-.icon-stop {
- background-position: -312px -72px;
-}
-
-.icon-forward {
- background-position: -336px -72px;
-}
-
-.icon-fast-forward {
- background-position: -360px -72px;
-}
-
-.icon-step-forward {
- background-position: -384px -72px;
-}
-
-.icon-eject {
- background-position: -408px -72px;
-}
-
-.icon-chevron-left {
- background-position: -432px -72px;
-}
-
-.icon-chevron-right {
- background-position: -456px -72px;
-}
-
-.icon-plus-sign {
- background-position: 0 -96px;
-}
-
-.icon-minus-sign {
- background-position: -24px -96px;
-}
-
-.icon-remove-sign {
- background-position: -48px -96px;
-}
-
-.icon-ok-sign {
- background-position: -72px -96px;
-}
-
-.icon-question-sign {
- background-position: -96px -96px;
-}
-
-.icon-info-sign {
- background-position: -120px -96px;
-}
-
-.icon-screenshot {
- background-position: -144px -96px;
-}
-
-.icon-remove-circle {
- background-position: -168px -96px;
-}
-
-.icon-ok-circle {
- background-position: -192px -96px;
-}
-
-.icon-ban-circle {
- background-position: -216px -96px;
-}
-
-.icon-arrow-left {
- background-position: -240px -96px;
-}
-
-.icon-arrow-right {
- background-position: -264px -96px;
-}
-
-.icon-arrow-up {
- background-position: -289px -96px;
-}
-
-.icon-arrow-down {
- background-position: -312px -96px;
-}
-
-.icon-share-alt {
- background-position: -336px -96px;
-}
-
-.icon-resize-full {
- background-position: -360px -96px;
-}
-
-.icon-resize-small {
- background-position: -384px -96px;
-}
-
-.icon-plus {
- background-position: -408px -96px;
-}
-
-.icon-minus {
- background-position: -433px -96px;
-}
-
-.icon-asterisk {
- background-position: -456px -96px;
-}
-
-.icon-exclamation-sign {
- background-position: 0 -120px;
-}
-
-.icon-gift {
- background-position: -24px -120px;
-}
-
-.icon-leaf {
- background-position: -48px -120px;
-}
-
-.icon-fire {
- background-position: -72px -120px;
-}
-
-.icon-eye-open {
- background-position: -96px -120px;
-}
-
-.icon-eye-close {
- background-position: -120px -120px;
-}
-
-.icon-warning-sign {
- background-position: -144px -120px;
-}
-
-.icon-plane {
- background-position: -168px -120px;
-}
-
-.icon-calendar {
- background-position: -192px -120px;
-}
-
-.icon-random {
- width: 16px;
- background-position: -216px -120px;
-}
-
-.icon-comment {
- background-position: -240px -120px;
-}
-
-.icon-magnet {
- background-position: -264px -120px;
-}
-
-.icon-chevron-up {
- background-position: -288px -120px;
-}
-
-.icon-chevron-down {
- background-position: -313px -119px;
-}
-
-.icon-retweet {
- background-position: -336px -120px;
-}
-
-.icon-shopping-cart {
- background-position: -360px -120px;
-}
-
-.icon-folder-close {
- background-position: -384px -120px;
-}
-
-.icon-folder-open {
- width: 16px;
- background-position: -408px -120px;
-}
-
-.icon-resize-vertical {
- background-position: -432px -119px;
-}
-
-.icon-resize-horizontal {
- background-position: -456px -118px;
-}
-
-.icon-hdd {
- background-position: 0 -144px;
-}
-
-.icon-bullhorn {
- background-position: -24px -144px;
-}
-
-.icon-bell {
- background-position: -48px -144px;
-}
-
-.icon-certificate {
- background-position: -72px -144px;
-}
-
-.icon-thumbs-up {
- background-position: -96px -144px;
-}
-
-.icon-thumbs-down {
- background-position: -120px -144px;
-}
-
-.icon-hand-right {
- background-position: -144px -144px;
-}
-
-.icon-hand-left {
- background-position: -168px -144px;
-}
-
-.icon-hand-up {
- background-position: -192px -144px;
-}
-
-.icon-hand-down {
- background-position: -216px -144px;
-}
-
-.icon-circle-arrow-right {
- background-position: -240px -144px;
-}
-
-.icon-circle-arrow-left {
- background-position: -264px -144px;
-}
-
-.icon-circle-arrow-up {
- background-position: -288px -144px;
-}
-
-.icon-circle-arrow-down {
- background-position: -312px -144px;
-}
-
-.icon-globe {
- background-position: -336px -144px;
-}
-
-.icon-wrench {
- background-position: -360px -144px;
-}
-
-.icon-tasks {
- background-position: -384px -144px;
-}
-
-.icon-filter {
- background-position: -408px -144px;
-}
-
-.icon-briefcase {
- background-position: -432px -144px;
-}
-
-.icon-fullscreen {
- background-position: -456px -144px;
-}
-
-.dropup,
-.dropdown {
- position: relative;
-}
-
-.dropdown-toggle {
- *margin-bottom: -3px;
-}
-
-.dropdown-toggle:active,
-.open .dropdown-toggle {
- outline: 0;
-}
-
-.caret {
- display: inline-block;
- width: 0;
- height: 0;
- vertical-align: top;
- border-top: 4px solid #000000;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
- content: "";
-}
-
-.dropdown .caret {
- margin-top: 8px;
- margin-left: 2px;
-}
-
-.dropdown-menu {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- display: none;
- float: left;
- min-width: 160px;
- padding: 5px 0;
- margin: 2px 0 0;
- list-style: none;
- background-color: #ffffff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- *border-right-width: 2px;
- *border-bottom-width: 2px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
-}
-
-.dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.dropdown-menu .divider {
- *width: 100%;
- height: 1px;
- margin: 9px 1px;
- *margin: -5px 0 5px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #ffffff;
-}
-
-.dropdown-menu a {
- display: block;
- padding: 3px 20px;
- clear: both;
- font-weight: normal;
- line-height: 20px;
- color: #333333;
- white-space: nowrap;
-}
-
-.dropdown-menu li > a:hover,
-.dropdown-menu li > a:focus,
-.dropdown-submenu:hover > a {
- color: #ffffff;
- text-decoration: none;
- background-color: #0088cc;
- background-color: #0081c2;
- background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
- background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
- background-image: -o-linear-gradient(top, #0088cc, #0077b3);
- background-image: linear-gradient(to bottom, #0088cc, #0077b3);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
-}
-
-.dropdown-menu .active > a,
-.dropdown-menu .active > a:hover {
- color: #ffffff;
- text-decoration: none;
- background-color: #0088cc;
- background-color: #0081c2;
- background-image: linear-gradient(to bottom, #0088cc, #0077b3);
- background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
- background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
- background-image: -o-linear-gradient(top, #0088cc, #0077b3);
- background-repeat: repeat-x;
- outline: 0;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
-}
-
-.dropdown-menu .disabled > a,
-.dropdown-menu .disabled > a:hover {
- color: #999999;
-}
-
-.dropdown-menu .disabled > a:hover {
- text-decoration: none;
- cursor: default;
- background-color: transparent;
-}
-
-.open {
- *z-index: 1000;
-}
-
-.open > .dropdown-menu {
- display: block;
-}
-
-.pull-right > .dropdown-menu {
- right: 0;
- left: auto;
-}
-
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
- border-top: 0;
- border-bottom: 4px solid #000000;
- content: "";
-}
-
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
- top: auto;
- bottom: 100%;
- margin-bottom: 1px;
-}
-
-.dropdown-submenu {
- position: relative;
-}
-
-.dropdown-submenu > .dropdown-menu {
- top: 0;
- left: 100%;
- margin-top: -6px;
- margin-left: -1px;
- -webkit-border-radius: 0 6px 6px 6px;
- -moz-border-radius: 0 6px 6px 6px;
- border-radius: 0 6px 6px 6px;
-}
-
-.dropdown-submenu:hover > .dropdown-menu {
- display: block;
-}
-
-.dropdown-submenu > a:after {
- display: block;
- float: right;
- width: 0;
- height: 0;
- margin-top: 5px;
- margin-right: -10px;
- border-color: transparent;
- border-left-color: #cccccc;
- border-style: solid;
- border-width: 5px 0 5px 5px;
- content: " ";
-}
-
-.dropdown-submenu:hover > a:after {
- border-left-color: #ffffff;
-}
-
-.dropdown .dropdown-menu .nav-header {
- padding-right: 20px;
- padding-left: 20px;
-}
-
-.typeahead {
- margin-top: 2px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #e3e3e3;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.well blockquote {
- border-color: #ddd;
- border-color: rgba(0, 0, 0, 0.15);
-}
-
-.well-large {
- padding: 24px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.well-small {
- padding: 9px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-.fade {
- opacity: 0;
- -webkit-transition: opacity 0.15s linear;
- -moz-transition: opacity 0.15s linear;
- -o-transition: opacity 0.15s linear;
- transition: opacity 0.15s linear;
-}
-
-.fade.in {
- opacity: 1;
-}
-
-.collapse {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition: height 0.35s ease;
- -moz-transition: height 0.35s ease;
- -o-transition: height 0.35s ease;
- transition: height 0.35s ease;
-}
-
-.collapse.in {
- height: auto;
-}
-
-.close {
- float: right;
- font-size: 20px;
- font-weight: bold;
- line-height: 20px;
- color: #000000;
- text-shadow: 0 1px 0 #ffffff;
- opacity: 0.2;
- filter: alpha(opacity=20);
-}
-
-.close:hover {
- color: #000000;
- text-decoration: none;
- cursor: pointer;
- opacity: 0.4;
- filter: alpha(opacity=40);
-}
-
-button.close {
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: 0;
- -webkit-appearance: none;
-}
-
-.btn {
- display: inline-block;
- *display: inline;
- padding: 4px 14px;
- margin-bottom: 0;
- *margin-left: .3em;
- font-size: 14px;
- line-height: 20px;
- *line-height: 20px;
- color: #333333;
- text-align: center;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- vertical-align: middle;
- cursor: pointer;
- background-color: #f5f5f5;
- *background-color: #e6e6e6;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- border: 1px solid #bbbbbb;
- *border: 0;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-bottom-color: #a2a2a2;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
- *zoom: 1;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn:hover,
-.btn:active,
-.btn.active,
-.btn.disabled,
-.btn[disabled] {
- color: #333333;
- background-color: #e6e6e6;
- *background-color: #d9d9d9;
-}
-
-.btn:active,
-.btn.active {
- background-color: #cccccc \9;
-}
-
-.btn:first-child {
- *margin-left: 0;
-}
-
-.btn:hover {
- color: #333333;
- text-decoration: none;
- background-color: #e6e6e6;
- *background-color: #d9d9d9;
- /* Buttons in IE7 don't get borders, so darken on hover */
-
- background-position: 0 -15px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
-}
-
-.btn:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-.btn.active,
-.btn:active {
- background-color: #e6e6e6;
- background-color: #d9d9d9 \9;
- background-image: none;
- outline: 0;
- -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn.disabled,
-.btn[disabled] {
- cursor: default;
- background-color: #e6e6e6;
- background-image: none;
- opacity: 0.65;
- filter: alpha(opacity=65);
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-large {
- padding: 9px 14px;
- font-size: 16px;
- line-height: normal;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.btn-large [class^="icon-"] {
- margin-top: 2px;
-}
-
-.btn-small {
- padding: 3px 9px;
- font-size: 12px;
- line-height: 18px;
-}
-
-.btn-small [class^="icon-"] {
- margin-top: 0;
-}
-
-.btn-mini {
- padding: 2px 6px;
- font-size: 11px;
- line-height: 17px;
-}
-
-.btn-block {
- display: block;
- width: 100%;
- padding-right: 0;
- padding-left: 0;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-.btn-block + .btn-block {
- margin-top: 5px;
-}
-
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
- width: 100%;
-}
-
-.btn-primary.active,
-.btn-warning.active,
-.btn-danger.active,
-.btn-success.active,
-.btn-info.active,
-.btn-inverse.active {
- color: rgba(255, 255, 255, 0.75);
-}
-
-.btn {
- border-color: #c5c5c5;
- border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
-}
-
-.btn-primary {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #006dcc;
- *background-color: #0044cc;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
- background-image: linear-gradient(to bottom, #0088cc, #0044cc);
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
- background-repeat: repeat-x;
- border-color: #0044cc #0044cc #002a80;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-primary:hover,
-.btn-primary:active,
-.btn-primary.active,
-.btn-primary.disabled,
-.btn-primary[disabled] {
- color: #ffffff;
- background-color: #0044cc;
- *background-color: #003bb3;
-}
-
-.btn-primary:active,
-.btn-primary.active {
- background-color: #003399 \9;
-}
-
-.btn-warning {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #faa732;
- *background-color: #f89406;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
- background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
- background-image: -o-linear-gradient(top, #fbb450, #f89406);
- background-image: linear-gradient(to bottom, #fbb450, #f89406);
- background-image: -moz-linear-gradient(top, #fbb450, #f89406);
- background-repeat: repeat-x;
- border-color: #f89406 #f89406 #ad6704;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-warning:hover,
-.btn-warning:active,
-.btn-warning.active,
-.btn-warning.disabled,
-.btn-warning[disabled] {
- color: #ffffff;
- background-color: #f89406;
- *background-color: #df8505;
-}
-
-.btn-warning:active,
-.btn-warning.active {
- background-color: #c67605 \9;
-}
-
-.btn-danger {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #da4f49;
- *background-color: #bd362f;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
- background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
- background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
- background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
- background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
- background-repeat: repeat-x;
- border-color: #bd362f #bd362f #802420;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-danger:hover,
-.btn-danger:active,
-.btn-danger.active,
-.btn-danger.disabled,
-.btn-danger[disabled] {
- color: #ffffff;
- background-color: #bd362f;
- *background-color: #a9302a;
-}
-
-.btn-danger:active,
-.btn-danger.active {
- background-color: #942a25 \9;
-}
-
-.btn-success {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #5bb75b;
- *background-color: #51a351;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
- background-image: -webkit-linear-gradient(top, #62c462, #51a351);
- background-image: -o-linear-gradient(top, #62c462, #51a351);
- background-image: linear-gradient(to bottom, #62c462, #51a351);
- background-image: -moz-linear-gradient(top, #62c462, #51a351);
- background-repeat: repeat-x;
- border-color: #51a351 #51a351 #387038;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-success:hover,
-.btn-success:active,
-.btn-success.active,
-.btn-success.disabled,
-.btn-success[disabled] {
- color: #ffffff;
- background-color: #51a351;
- *background-color: #499249;
-}
-
-.btn-success:active,
-.btn-success.active {
- background-color: #408140 \9;
-}
-
-.btn-info {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #49afcd;
- *background-color: #2f96b4;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
- background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
- background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
- background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
- background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
- background-repeat: repeat-x;
- border-color: #2f96b4 #2f96b4 #1f6377;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-info:hover,
-.btn-info:active,
-.btn-info.active,
-.btn-info.disabled,
-.btn-info[disabled] {
- color: #ffffff;
- background-color: #2f96b4;
- *background-color: #2a85a0;
-}
-
-.btn-info:active,
-.btn-info.active {
- background-color: #24748c \9;
-}
-
-.btn-inverse {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #363636;
- *background-color: #222222;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
- background-image: -webkit-linear-gradient(top, #444444, #222222);
- background-image: -o-linear-gradient(top, #444444, #222222);
- background-image: linear-gradient(to bottom, #444444, #222222);
- background-image: -moz-linear-gradient(top, #444444, #222222);
- background-repeat: repeat-x;
- border-color: #222222 #222222 #000000;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.btn-inverse:hover,
-.btn-inverse:active,
-.btn-inverse.active,
-.btn-inverse.disabled,
-.btn-inverse[disabled] {
- color: #ffffff;
- background-color: #222222;
- *background-color: #151515;
-}
-
-.btn-inverse:active,
-.btn-inverse.active {
- background-color: #080808 \9;
-}
-
-button.btn,
-input[type="submit"].btn {
- *padding-top: 3px;
- *padding-bottom: 3px;
-}
-
-button.btn::-moz-focus-inner,
-input[type="submit"].btn::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-
-button.btn.btn-large,
-input[type="submit"].btn.btn-large {
- *padding-top: 7px;
- *padding-bottom: 7px;
-}
-
-button.btn.btn-small,
-input[type="submit"].btn.btn-small {
- *padding-top: 3px;
- *padding-bottom: 3px;
-}
-
-button.btn.btn-mini,
-input[type="submit"].btn.btn-mini {
- *padding-top: 1px;
- *padding-bottom: 1px;
-}
-
-.btn-link,
-.btn-link:active,
-.btn-link[disabled] {
- background-color: transparent;
- background-image: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-link {
- color: #0088cc;
- cursor: pointer;
- border-color: transparent;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-link:hover {
- color: #005580;
- text-decoration: underline;
- background-color: transparent;
-}
-
-.btn-link[disabled]:hover {
- color: #333333;
- text-decoration: none;
-}
-
-.btn-group {
- position: relative;
- *margin-left: .3em;
- font-size: 0;
- white-space: nowrap;
- vertical-align: middle;
-}
-
-.btn-group:first-child {
- *margin-left: 0;
-}
-
-.btn-group + .btn-group {
- margin-left: 5px;
-}
-
-.btn-toolbar {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 0;
-}
-
-.btn-toolbar .btn-group {
- display: inline-block;
- *display: inline;
- /* IE7 inline-block hack */
-
- *zoom: 1;
-}
-
-.btn-toolbar .btn + .btn,
-.btn-toolbar .btn-group + .btn,
-.btn-toolbar .btn + .btn-group {
- margin-left: 5px;
-}
-
-.btn-group > .btn {
- position: relative;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-group > .btn + .btn {
- margin-left: -1px;
-}
-
-.btn-group > .btn,
-.btn-group > .dropdown-menu {
- font-size: 14px;
-}
-
-.btn-group > .btn-mini {
- font-size: 11px;
-}
-
-.btn-group > .btn-small {
- font-size: 12px;
-}
-
-.btn-group > .btn-large {
- font-size: 16px;
-}
-
-.btn-group > .btn:first-child {
- margin-left: 0;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.btn-group > .btn:last-child,
-.btn-group > .dropdown-toggle {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-bottomright: 4px;
-}
-
-.btn-group > .btn.large:first-child {
- margin-left: 0;
- -webkit-border-bottom-left-radius: 6px;
- border-bottom-left-radius: 6px;
- -webkit-border-top-left-radius: 6px;
- border-top-left-radius: 6px;
- -moz-border-radius-bottomleft: 6px;
- -moz-border-radius-topleft: 6px;
-}
-
-.btn-group > .btn.large:last-child,
-.btn-group > .large.dropdown-toggle {
- -webkit-border-top-right-radius: 6px;
- border-top-right-radius: 6px;
- -webkit-border-bottom-right-radius: 6px;
- border-bottom-right-radius: 6px;
- -moz-border-radius-topright: 6px;
- -moz-border-radius-bottomright: 6px;
-}
-
-.btn-group > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group > .btn:active,
-.btn-group > .btn.active {
- z-index: 2;
-}
-
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
- outline: 0;
-}
-
-.btn-group > .btn + .dropdown-toggle {
- *padding-top: 5px;
- padding-right: 8px;
- *padding-bottom: 5px;
- padding-left: 8px;
- -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group > .btn-mini + .dropdown-toggle {
- *padding-top: 2px;
- padding-right: 5px;
- *padding-bottom: 2px;
- padding-left: 5px;
-}
-
-.btn-group > .btn-small + .dropdown-toggle {
- *padding-top: 5px;
- *padding-bottom: 4px;
-}
-
-.btn-group > .btn-large + .dropdown-toggle {
- *padding-top: 7px;
- padding-right: 12px;
- *padding-bottom: 7px;
- padding-left: 12px;
-}
-
-.btn-group.open .dropdown-toggle {
- background-image: none;
- -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.btn-group.open .btn.dropdown-toggle {
- background-color: #e6e6e6;
-}
-
-.btn-group.open .btn-primary.dropdown-toggle {
- background-color: #0044cc;
-}
-
-.btn-group.open .btn-warning.dropdown-toggle {
- background-color: #f89406;
-}
-
-.btn-group.open .btn-danger.dropdown-toggle {
- background-color: #bd362f;
-}
-
-.btn-group.open .btn-success.dropdown-toggle {
- background-color: #51a351;
-}
-
-.btn-group.open .btn-info.dropdown-toggle {
- background-color: #2f96b4;
-}
-
-.btn-group.open .btn-inverse.dropdown-toggle {
- background-color: #222222;
-}
-
-.btn .caret {
- margin-top: 8px;
- margin-left: 0;
-}
-
-.btn-mini .caret,
-.btn-small .caret,
-.btn-large .caret {
- margin-top: 6px;
-}
-
-.btn-large .caret {
- border-top-width: 5px;
- border-right-width: 5px;
- border-left-width: 5px;
-}
-
-.dropup .btn-large .caret {
- border-top: 0;
- border-bottom: 5px solid #000000;
-}
-
-.btn-primary .caret,
-.btn-warning .caret,
-.btn-danger .caret,
-.btn-info .caret,
-.btn-success .caret,
-.btn-inverse .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-.btn-group-vertical {
- display: inline-block;
- *display: inline;
- /* IE7 inline-block hack */
-
- *zoom: 1;
-}
-
-.btn-group-vertical .btn {
- display: block;
- float: none;
- width: 100%;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.btn-group-vertical .btn + .btn {
- margin-top: -1px;
- margin-left: 0;
-}
-
-.btn-group-vertical .btn:first-child {
- -webkit-border-radius: 4px 4px 0 0;
- -moz-border-radius: 4px 4px 0 0;
- border-radius: 4px 4px 0 0;
-}
-
-.btn-group-vertical .btn:last-child {
- -webkit-border-radius: 0 0 4px 4px;
- -moz-border-radius: 0 0 4px 4px;
- border-radius: 0 0 4px 4px;
-}
-
-.btn-group-vertical .btn-large:first-child {
- -webkit-border-radius: 6px 6px 0 0;
- -moz-border-radius: 6px 6px 0 0;
- border-radius: 6px 6px 0 0;
-}
-
-.btn-group-vertical .btn-large:last-child {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-
-.alert {
- padding: 8px 35px 8px 14px;
- margin-bottom: 20px;
- color: #c09853;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- background-color: #fcf8e3;
- border: 1px solid #fbeed5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.alert h4 {
- margin: 0;
-}
-
-.alert .close {
- position: relative;
- top: -2px;
- right: -21px;
- line-height: 20px;
-}
-
-.alert-success {
- color: #468847;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-
-.alert-danger,
-.alert-error {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #eed3d7;
-}
-
-.alert-info {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-
-.alert-block {
- padding-top: 14px;
- padding-bottom: 14px;
-}
-
-.alert-block > p,
-.alert-block > ul {
- margin-bottom: 0;
-}
-
-.alert-block p + p {
- margin-top: 5px;
-}
-
-.nav {
- margin-bottom: 20px;
- margin-left: 0;
- list-style: none;
-}
-
-.nav > li > a {
- display: block;
-}
-
-.nav > li > a:hover {
- text-decoration: none;
- background-color: #eeeeee;
-}
-
-.nav > .pull-right {
- float: right;
-}
-
-.nav-header {
- display: block;
- padding: 3px 15px;
- font-size: 11px;
- font-weight: bold;
- line-height: 20px;
- color: #999999;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- text-transform: uppercase;
-}
-
-.nav li + .nav-header {
- margin-top: 9px;
-}
-
-.nav-list {
- padding-right: 15px;
- padding-left: 15px;
- margin-bottom: 0;
-}
-
-.nav-list > li > a,
-.nav-list .nav-header {
- margin-right: -15px;
- margin-left: -15px;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
-}
-
-.nav-list > li > a {
- padding: 3px 15px;
-}
-
-.nav-list > .active > a,
-.nav-list > .active > a:hover {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
- background-color: #0088cc;
-}
-
-.nav-list [class^="icon-"] {
- margin-right: 2px;
-}
-
-.nav-list .divider {
- *width: 100%;
- height: 1px;
- margin: 9px 1px;
- *margin: -5px 0 5px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #ffffff;
-}
-
-.nav-tabs,
-.nav-pills {
- *zoom: 1;
-}
-
-.nav-tabs:before,
-.nav-pills:before,
-.nav-tabs:after,
-.nav-pills:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.nav-tabs:after,
-.nav-pills:after {
- clear: both;
-}
-
-.nav-tabs > li,
-.nav-pills > li {
- float: left;
-}
-
-.nav-tabs > li > a,
-.nav-pills > li > a {
- padding-right: 12px;
- padding-left: 12px;
- margin-right: 2px;
- line-height: 14px;
-}
-
-.nav-tabs {
- border-bottom: 1px solid #ddd;
-}
-
-.nav-tabs > li {
- margin-bottom: -1px;
-}
-
-.nav-tabs > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- line-height: 20px;
- border: 1px solid transparent;
- -webkit-border-radius: 4px 4px 0 0;
- -moz-border-radius: 4px 4px 0 0;
- border-radius: 4px 4px 0 0;
-}
-
-.nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #dddddd;
-}
-
-.nav-tabs > .active > a,
-.nav-tabs > .active > a:hover {
- color: #555555;
- cursor: default;
- background-color: #ffffff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
-}
-
-.nav-pills > li > a {
- padding-top: 8px;
- padding-bottom: 8px;
- margin-top: 2px;
- margin-bottom: 2px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.nav-pills > .active > a,
-.nav-pills > .active > a:hover {
- color: #ffffff;
- background-color: #0088cc;
-}
-
-.nav-stacked > li {
- float: none;
-}
-
-.nav-stacked > li > a {
- margin-right: 0;
-}
-
-.nav-tabs.nav-stacked {
- border-bottom: 0;
-}
-
-.nav-tabs.nav-stacked > li > a {
- border: 1px solid #ddd;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.nav-tabs.nav-stacked > li:first-child > a {
- -webkit-border-top-right-radius: 4px;
- border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
-}
-
-.nav-tabs.nav-stacked > li:last-child > a {
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
- -webkit-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -moz-border-radius-bottomright: 4px;
- -moz-border-radius-bottomleft: 4px;
-}
-
-.nav-tabs.nav-stacked > li > a:hover {
- z-index: 2;
- border-color: #ddd;
-}
-
-.nav-pills.nav-stacked > li > a {
- margin-bottom: 3px;
-}
-
-.nav-pills.nav-stacked > li:last-child > a {
- margin-bottom: 1px;
-}
-
-.nav-tabs .dropdown-menu {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-
-.nav-pills .dropdown-menu {
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.nav .dropdown-toggle .caret {
- margin-top: 6px;
- border-top-color: #0088cc;
- border-bottom-color: #0088cc;
-}
-
-.nav .dropdown-toggle:hover .caret {
- border-top-color: #005580;
- border-bottom-color: #005580;
-}
-
-/* move down carets for tabs */
-
-.nav-tabs .dropdown-toggle .caret {
- margin-top: 8px;
-}
-
-.nav .active .dropdown-toggle .caret {
- border-top-color: #fff;
- border-bottom-color: #fff;
-}
-
-.nav-tabs .active .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-
-.nav > .dropdown.active > a:hover {
- cursor: pointer;
-}
-
-.nav-tabs .open .dropdown-toggle,
-.nav-pills .open .dropdown-toggle,
-.nav > li.dropdown.open.active > a:hover {
- color: #ffffff;
- background-color: #999999;
- border-color: #999999;
-}
-
-.nav li.dropdown.open .caret,
-.nav li.dropdown.open.active .caret,
-.nav li.dropdown.open a:hover .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
- opacity: 1;
- filter: alpha(opacity=100);
-}
-
-.tabs-stacked .open > a:hover {
- border-color: #999999;
-}
-
-.tabbable {
- *zoom: 1;
-}
-
-.tabbable:before,
-.tabbable:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.tabbable:after {
- clear: both;
-}
-
-.tab-content {
- overflow: auto;
-}
-
-.tabs-below > .nav-tabs,
-.tabs-right > .nav-tabs,
-.tabs-left > .nav-tabs {
- border-bottom: 0;
-}
-
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
- display: none;
-}
-
-.tab-content > .active,
-.pill-content > .active {
- display: block;
-}
-
-.tabs-below > .nav-tabs {
- border-top: 1px solid #ddd;
-}
-
-.tabs-below > .nav-tabs > li {
- margin-top: -1px;
- margin-bottom: 0;
-}
-
-.tabs-below > .nav-tabs > li > a {
- -webkit-border-radius: 0 0 4px 4px;
- -moz-border-radius: 0 0 4px 4px;
- border-radius: 0 0 4px 4px;
-}
-
-.tabs-below > .nav-tabs > li > a:hover {
- border-top-color: #ddd;
- border-bottom-color: transparent;
-}
-
-.tabs-below > .nav-tabs > .active > a,
-.tabs-below > .nav-tabs > .active > a:hover {
- border-color: transparent #ddd #ddd #ddd;
-}
-
-.tabs-left > .nav-tabs > li,
-.tabs-right > .nav-tabs > li {
- float: none;
-}
-
-.tabs-left > .nav-tabs > li > a,
-.tabs-right > .nav-tabs > li > a {
- min-width: 74px;
- margin-right: 0;
- margin-bottom: 3px;
-}
-
-.tabs-left > .nav-tabs {
- float: left;
- margin-right: 19px;
- border-right: 1px solid #ddd;
-}
-
-.tabs-left > .nav-tabs > li > a {
- margin-right: -1px;
- -webkit-border-radius: 4px 0 0 4px;
- -moz-border-radius: 4px 0 0 4px;
- border-radius: 4px 0 0 4px;
-}
-
-.tabs-left > .nav-tabs > li > a:hover {
- border-color: #eeeeee #dddddd #eeeeee #eeeeee;
-}
-
-.tabs-left > .nav-tabs .active > a,
-.tabs-left > .nav-tabs .active > a:hover {
- border-color: #ddd transparent #ddd #ddd;
- *border-right-color: #ffffff;
-}
-
-.tabs-right > .nav-tabs {
- float: right;
- margin-left: 19px;
- border-left: 1px solid #ddd;
-}
-
-.tabs-right > .nav-tabs > li > a {
- margin-left: -1px;
- -webkit-border-radius: 0 4px 4px 0;
- -moz-border-radius: 0 4px 4px 0;
- border-radius: 0 4px 4px 0;
-}
-
-.tabs-right > .nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #eeeeee #dddddd;
-}
-
-.tabs-right > .nav-tabs .active > a,
-.tabs-right > .nav-tabs .active > a:hover {
- border-color: #ddd #ddd #ddd transparent;
- *border-left-color: #ffffff;
-}
-
-.nav > .disabled > a {
- color: #999999;
-}
-
-.nav > .disabled > a:hover {
- text-decoration: none;
- cursor: default;
- background-color: transparent;
-}
-
-.navbar {
- *position: relative;
- *z-index: 2;
- margin-bottom: 20px;
- overflow: visible;
- color: #777777;
-}
-
-.navbar-inner {
- min-height: 40px;
- padding-right: 20px;
- padding-left: 20px;
- background-color: #fafafa;
- background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
- background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
- background-repeat: repeat-x;
- border: 1px solid #d4d4d4;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
- *zoom: 1;
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-}
-
-.navbar-inner:before,
-.navbar-inner:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.navbar-inner:after {
- clear: both;
-}
-
-.navbar .container {
- width: auto;
-}
-
-.nav-collapse.collapse {
- height: auto;
-}
-
-.navbar .brand {
- display: block;
- float: left;
- padding: 10px 20px 10px;
- margin-left: -20px;
- font-size: 20px;
- font-weight: 200;
- color: #777777;
- text-shadow: 0 1px 0 #ffffff;
-}
-
-.navbar .brand:hover {
- text-decoration: none;
-}
-
-.navbar-text {
- margin-bottom: 0;
- line-height: 40px;
-}
-
-.navbar-link {
- color: #777777;
-}
-
-.navbar-link:hover {
- color: #333333;
-}
-
-.navbar .divider-vertical {
- height: 40px;
- margin: 0 9px;
- border-right: 1px solid #ffffff;
- border-left: 1px solid #f2f2f2;
-}
-
-.navbar .btn,
-.navbar .btn-group {
- margin-top: 5px;
-}
-
-.navbar .btn-group .btn,
-.navbar .input-prepend .btn,
-.navbar .input-append .btn {
- margin-top: 0;
-}
-
-.navbar-form {
- margin-bottom: 0;
- *zoom: 1;
-}
-
-.navbar-form:before,
-.navbar-form:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.navbar-form:after {
- clear: both;
-}
-
-.navbar-form input,
-.navbar-form select,
-.navbar-form .radio,
-.navbar-form .checkbox {
- margin-top: 5px;
-}
-
-.navbar-form input,
-.navbar-form select,
-.navbar-form .btn {
- display: inline-block;
- margin-bottom: 0;
-}
-
-.navbar-form input[type="image"],
-.navbar-form input[type="checkbox"],
-.navbar-form input[type="radio"] {
- margin-top: 3px;
-}
-
-.navbar-form .input-append,
-.navbar-form .input-prepend {
- margin-top: 6px;
- white-space: nowrap;
-}
-
-.navbar-form .input-append input,
-.navbar-form .input-prepend input {
- margin-top: 0;
-}
-
-.navbar-search {
- position: relative;
- float: left;
- margin-top: 5px;
- margin-bottom: 0;
-}
-
-.navbar-search .search-query {
- padding: 4px 14px;
- margin-bottom: 0;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 13px;
- font-weight: normal;
- line-height: 1;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-.navbar-static-top {
- position: static;
- width: 100%;
- margin-bottom: 0;
-}
-
-.navbar-static-top .navbar-inner {
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- z-index: 1030;
- margin-bottom: 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-static-top .navbar-inner {
- border-width: 0 0 1px;
-}
-
-.navbar-fixed-bottom .navbar-inner {
- border-width: 1px 0 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-fixed-bottom .navbar-inner {
- padding-right: 0;
- padding-left: 0;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
-}
-
-.navbar-static-top .container,
-.navbar-fixed-top .container,
-.navbar-fixed-bottom .container {
- width: 940px;
-}
-
-.navbar-fixed-top {
- top: 0;
-}
-
-.navbar-fixed-top .navbar-inner,
-.navbar-static-top .navbar-inner {
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
-}
-
-.navbar-fixed-bottom {
- bottom: 0;
-}
-
-.navbar-fixed-bottom .navbar-inner {
- -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 10px rgba(0, 0, 0, 0.1);
-}
-
-.navbar .nav {
- position: relative;
- left: 0;
- display: block;
- float: left;
- margin: 0 10px 0 0;
-}
-
-.navbar .nav.pull-right {
- float: right;
- margin-right: 0;
-}
-
-.navbar .nav > li {
- float: left;
-}
-
-.navbar .nav > li > a {
- float: none;
- padding: 10px 15px 10px;
- color: #777777;
- text-decoration: none;
- text-shadow: 0 1px 0 #ffffff;
-}
-
-.navbar .nav .dropdown-toggle .caret {
- margin-top: 8px;
-}
-
-.navbar .nav > li > a:focus,
-.navbar .nav > li > a:hover {
- color: #333333;
- text-decoration: none;
- background-color: transparent;
-}
-
-.navbar .nav > .active > a,
-.navbar .nav > .active > a:hover,
-.navbar .nav > .active > a:focus {
- color: #555555;
- text-decoration: none;
- background-color: #e5e5e5;
- -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-}
-
-.navbar .btn-navbar {
- display: none;
- float: right;
- padding: 7px 10px;
- margin-right: 5px;
- margin-left: 5px;
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #ededed;
- *background-color: #e5e5e5;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));
- background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5);
- background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5);
- background-repeat: repeat-x;
- border-color: #e5e5e5 #e5e5e5 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075);
-}
-
-.navbar .btn-navbar:hover,
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active,
-.navbar .btn-navbar.disabled,
-.navbar .btn-navbar[disabled] {
- color: #ffffff;
- background-color: #e5e5e5;
- *background-color: #d9d9d9;
-}
-
-.navbar .btn-navbar:active,
-.navbar .btn-navbar.active {
- background-color: #cccccc \9;
-}
-
-.navbar .btn-navbar .icon-bar {
- display: block;
- width: 18px;
- height: 2px;
- background-color: #f5f5f5;
- -webkit-border-radius: 1px;
- -moz-border-radius: 1px;
- border-radius: 1px;
- -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
- -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.btn-navbar .icon-bar + .icon-bar {
- margin-top: 3px;
-}
-
-.navbar .nav > li > .dropdown-menu:before {
- position: absolute;
- top: -7px;
- left: 9px;
- display: inline-block;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-left: 7px solid transparent;
- border-bottom-color: rgba(0, 0, 0, 0.2);
- content: '';
-}
-
-.navbar .nav > li > .dropdown-menu:after {
- position: absolute;
- top: -6px;
- left: 10px;
- display: inline-block;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #ffffff;
- border-left: 6px solid transparent;
- content: '';
-}
-
-.navbar-fixed-bottom .nav > li > .dropdown-menu:before {
- top: auto;
- bottom: -7px;
- border-top: 7px solid #ccc;
- border-bottom: 0;
- border-top-color: rgba(0, 0, 0, 0.2);
-}
-
-.navbar-fixed-bottom .nav > li > .dropdown-menu:after {
- top: auto;
- bottom: -6px;
- border-top: 6px solid #ffffff;
- border-bottom: 0;
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle,
-.navbar .nav li.dropdown.active > .dropdown-toggle,
-.navbar .nav li.dropdown.open.active > .dropdown-toggle {
- color: #555555;
- background-color: #e5e5e5;
-}
-
-.navbar .nav li.dropdown > .dropdown-toggle .caret {
- border-top-color: #777777;
- border-bottom-color: #777777;
-}
-
-.navbar .nav li.dropdown.open > .dropdown-toggle .caret,
-.navbar .nav li.dropdown.active > .dropdown-toggle .caret,
-.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-
-.navbar .pull-right > li > .dropdown-menu,
-.navbar .nav > li > .dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu:before,
-.navbar .nav > li > .dropdown-menu.pull-right:before {
- right: 12px;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu:after,
-.navbar .nav > li > .dropdown-menu.pull-right:after {
- right: 13px;
- left: auto;
-}
-
-.navbar .pull-right > li > .dropdown-menu .dropdown-menu,
-.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu {
- right: 100%;
- left: auto;
- margin-right: -1px;
- margin-left: 0;
- -webkit-border-radius: 6px 0 6px 6px;
- -moz-border-radius: 6px 0 6px 6px;
- border-radius: 6px 0 6px 6px;
-}
-
-.navbar-inverse {
- color: #999999;
-}
-
-.navbar-inverse .navbar-inner {
- background-color: #1b1b1b;
- background-image: -moz-linear-gradient(top, #222222, #111111);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));
- background-image: -webkit-linear-gradient(top, #222222, #111111);
- background-image: -o-linear-gradient(top, #222222, #111111);
- background-image: linear-gradient(to bottom, #222222, #111111);
- background-repeat: repeat-x;
- border-color: #252525;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);
-}
-
-.navbar-inverse .brand,
-.navbar-inverse .nav > li > a {
- color: #999999;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.navbar-inverse .brand:hover,
-.navbar-inverse .nav > li > a:hover {
- color: #ffffff;
-}
-
-.navbar-inverse .nav > li > a:focus,
-.navbar-inverse .nav > li > a:hover {
- color: #ffffff;
- background-color: transparent;
-}
-
-.navbar-inverse .nav .active > a,
-.navbar-inverse .nav .active > a:hover,
-.navbar-inverse .nav .active > a:focus {
- color: #ffffff;
- background-color: #111111;
-}
-
-.navbar-inverse .navbar-link {
- color: #999999;
-}
-
-.navbar-inverse .navbar-link:hover {
- color: #ffffff;
-}
-
-.navbar-inverse .divider-vertical {
- border-right-color: #222222;
- border-left-color: #111111;
-}
-
-.navbar-inverse .nav li.dropdown.open > .dropdown-toggle,
-.navbar-inverse .nav li.dropdown.active > .dropdown-toggle,
-.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle {
- color: #ffffff;
- background-color: #111111;
-}
-
-.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret {
- border-top-color: #999999;
- border-bottom-color: #999999;
-}
-
-.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret,
-.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret,
-.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-.navbar-inverse .navbar-search .search-query {
- color: #ffffff;
- background-color: #515151;
- border-color: #111111;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15);
- -webkit-transition: none;
- -moz-transition: none;
- -o-transition: none;
- transition: none;
-}
-
-.navbar-inverse .navbar-search .search-query:-moz-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query:-ms-input-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder {
- color: #cccccc;
-}
-
-.navbar-inverse .navbar-search .search-query:focus,
-.navbar-inverse .navbar-search .search-query.focused {
- padding: 5px 15px;
- color: #333333;
- text-shadow: 0 1px 0 #ffffff;
- background-color: #ffffff;
- border: 0;
- outline: 0;
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
- -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
-}
-
-.navbar-inverse .btn-navbar {
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #0e0e0e;
- *background-color: #040404;
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));
- background-image: -webkit-linear-gradient(top, #151515, #040404);
- background-image: -o-linear-gradient(top, #151515, #040404);
- background-image: linear-gradient(to bottom, #151515, #040404);
- background-image: -moz-linear-gradient(top, #151515, #040404);
- background-repeat: repeat-x;
- border-color: #040404 #040404 #000000;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-}
-
-.navbar-inverse .btn-navbar:hover,
-.navbar-inverse .btn-navbar:active,
-.navbar-inverse .btn-navbar.active,
-.navbar-inverse .btn-navbar.disabled,
-.navbar-inverse .btn-navbar[disabled] {
- color: #ffffff;
- background-color: #040404;
- *background-color: #000000;
-}
-
-.navbar-inverse .btn-navbar:active,
-.navbar-inverse .btn-navbar.active {
- background-color: #000000 \9;
-}
-
-.breadcrumb {
- padding: 8px 15px;
- margin: 0 0 20px;
- list-style: none;
- background-color: #f5f5f5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.breadcrumb li {
- display: inline-block;
- *display: inline;
- text-shadow: 0 1px 0 #ffffff;
- *zoom: 1;
-}
-
-.breadcrumb .divider {
- padding: 0 5px;
- color: #ccc;
-}
-
-.breadcrumb .active {
- color: #999999;
-}
-
-.pagination {
- height: 40px;
- margin: 20px 0;
-}
-
-.pagination ul {
- display: inline-block;
- *display: inline;
- margin-bottom: 0;
- margin-left: 0;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- *zoom: 1;
- -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.pagination ul > li {
- display: inline;
-}
-
-.pagination ul > li > a,
-.pagination ul > li > span {
- float: left;
- padding: 0 14px;
- line-height: 38px;
- text-decoration: none;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-left-width: 0;
-}
-
-.pagination ul > li > a:hover,
-.pagination ul > .active > a,
-.pagination ul > .active > span {
- background-color: #f5f5f5;
-}
-
-.pagination ul > .active > a,
-.pagination ul > .active > span {
- color: #999999;
- cursor: default;
-}
-
-.pagination ul > .disabled > span,
-.pagination ul > .disabled > a,
-.pagination ul > .disabled > a:hover {
- color: #999999;
- cursor: default;
- background-color: transparent;
-}
-
-.pagination ul > li:first-child > a,
-.pagination ul > li:first-child > span {
- border-left-width: 1px;
- -webkit-border-radius: 3px 0 0 3px;
- -moz-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-.pagination ul > li:last-child > a,
-.pagination ul > li:last-child > span {
- -webkit-border-radius: 0 3px 3px 0;
- -moz-border-radius: 0 3px 3px 0;
- border-radius: 0 3px 3px 0;
-}
-
-.pagination-centered {
- text-align: center;
-}
-
-.pagination-right {
- text-align: right;
-}
-
-.pager {
- margin: 20px 0;
- text-align: center;
- list-style: none;
- *zoom: 1;
-}
-
-.pager:before,
-.pager:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.pager:after {
- clear: both;
-}
-
-.pager li {
- display: inline;
-}
-
-.pager a,
-.pager span {
- display: inline-block;
- padding: 5px 14px;
- background-color: #fff;
- border: 1px solid #ddd;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
-}
-
-.pager a:hover {
- text-decoration: none;
- background-color: #f5f5f5;
-}
-
-.pager .next a,
-.pager .next span {
- float: right;
-}
-
-.pager .previous a {
- float: left;
-}
-
-.pager .disabled a,
-.pager .disabled a:hover,
-.pager .disabled span {
- color: #999999;
- cursor: default;
- background-color: #fff;
-}
-
-.modal-open .modal .dropdown-menu {
- z-index: 2050;
-}
-
-.modal-open .modal .dropdown.open {
- *z-index: 2050;
-}
-
-.modal-open .modal .popover {
- z-index: 2060;
-}
-
-.modal-open .modal .tooltip {
- z-index: 2080;
-}
-
-.modal-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1040;
- background-color: #000000;
-}
-
-.modal-backdrop.fade {
- opacity: 0;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in {
- opacity: 0.8;
- filter: alpha(opacity=80);
-}
-
-.modal {
- position: fixed;
- top: 50%;
- left: 50%;
- z-index: 1050;
- width: 560px;
- margin: -250px 0 0 -280px;
- overflow: auto;
- background-color: #ffffff;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, 0.3);
- *border: 1px solid #999;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding-box;
- background-clip: padding-box;
-}
-
-.modal.fade {
- top: -25%;
- -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
- -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
- -o-transition: opacity 0.3s linear, top 0.3s ease-out;
- transition: opacity 0.3s linear, top 0.3s ease-out;
-}
-
-.modal.fade.in {
- top: 50%;
-}
-
-.modal-header {
- padding: 9px 15px;
- border-bottom: 1px solid #eee;
-}
-
-.modal-header .close {
- margin-top: 2px;
-}
-
-.modal-header h3 {
- margin: 0;
- line-height: 30px;
-}
-
-.modal-body {
- max-height: 400px;
- padding: 15px;
- overflow-y: auto;
-}
-
-.modal-form {
- margin-bottom: 0;
-}
-
-.modal-footer {
- padding: 14px 15px 15px;
- margin-bottom: 0;
- text-align: right;
- background-color: #f5f5f5;
- border-top: 1px solid #ddd;
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
- *zoom: 1;
- -webkit-box-shadow: inset 0 1px 0 #ffffff;
- -moz-box-shadow: inset 0 1px 0 #ffffff;
- box-shadow: inset 0 1px 0 #ffffff;
-}
-
-.modal-footer:before,
-.modal-footer:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.modal-footer:after {
- clear: both;
-}
-
-.modal-footer .btn + .btn {
- margin-bottom: 0;
- margin-left: 5px;
-}
-
-.modal-footer .btn-group .btn + .btn {
- margin-left: -1px;
-}
-
-.tooltip {
- position: absolute;
- z-index: 1030;
- display: block;
- padding: 5px;
- font-size: 11px;
- opacity: 0;
- filter: alpha(opacity=0);
- visibility: visible;
-}
-
-.tooltip.in {
- opacity: 0.8;
- filter: alpha(opacity=80);
-}
-
-.tooltip.top {
- margin-top: -3px;
-}
-
-.tooltip.right {
- margin-left: 3px;
-}
-
-.tooltip.bottom {
- margin-top: 3px;
-}
-
-.tooltip.left {
- margin-left: -3px;
-}
-
-.tooltip-inner {
- max-width: 200px;
- padding: 3px 8px;
- color: #ffffff;
- text-align: center;
- text-decoration: none;
- background-color: #000000;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.tooltip-arrow {
- position: absolute;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.tooltip.top .tooltip-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-top-color: #000000;
- border-width: 5px 5px 0;
-}
-
-.tooltip.right .tooltip-arrow {
- top: 50%;
- left: 0;
- margin-top: -5px;
- border-right-color: #000000;
- border-width: 5px 5px 5px 0;
-}
-
-.tooltip.left .tooltip-arrow {
- top: 50%;
- right: 0;
- margin-top: -5px;
- border-left-color: #000000;
- border-width: 5px 0 5px 5px;
-}
-
-.tooltip.bottom .tooltip-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-bottom-color: #000000;
- border-width: 0 5px 5px;
-}
-
-.popover {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1010;
- display: none;
- width: 236px;
- padding: 1px;
- background-color: #ffffff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
-}
-
-.popover.top {
- margin-bottom: 10px;
-}
-
-.popover.right {
- margin-left: 10px;
-}
-
-.popover.bottom {
- margin-top: 10px;
-}
-
-.popover.left {
- margin-right: 10px;
-}
-
-.popover-title {
- padding: 8px 14px;
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 18px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #ebebeb;
- -webkit-border-radius: 5px 5px 0 0;
- -moz-border-radius: 5px 5px 0 0;
- border-radius: 5px 5px 0 0;
-}
-
-.popover-content {
- padding: 9px 14px;
-}
-
-.popover-content p,
-.popover-content ul,
-.popover-content ol {
- margin-bottom: 0;
-}
-
-.popover .arrow,
-.popover .arrow:after {
- position: absolute;
- display: inline-block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.popover .arrow:after {
- z-index: -1;
- content: "";
-}
-
-.popover.top .arrow {
- bottom: -10px;
- left: 50%;
- margin-left: -10px;
- border-top-color: #ffffff;
- border-width: 10px 10px 0;
-}
-
-.popover.top .arrow:after {
- bottom: -1px;
- left: -11px;
- border-top-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 11px 0;
-}
-
-.popover.right .arrow {
- top: 50%;
- left: -10px;
- margin-top: -10px;
- border-right-color: #ffffff;
- border-width: 10px 10px 10px 0;
-}
-
-.popover.right .arrow:after {
- bottom: -11px;
- left: -1px;
- border-right-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 11px 11px 0;
-}
-
-.popover.bottom .arrow {
- top: -10px;
- left: 50%;
- margin-left: -10px;
- border-bottom-color: #ffffff;
- border-width: 0 10px 10px;
-}
-
-.popover.bottom .arrow:after {
- top: -1px;
- left: -11px;
- border-bottom-color: rgba(0, 0, 0, 0.25);
- border-width: 0 11px 11px;
-}
-
-.popover.left .arrow {
- top: 50%;
- right: -10px;
- margin-top: -10px;
- border-left-color: #ffffff;
- border-width: 10px 0 10px 10px;
-}
-
-.popover.left .arrow:after {
- right: -1px;
- bottom: -11px;
- border-left-color: rgba(0, 0, 0, 0.25);
- border-width: 11px 0 11px 11px;
-}
-
-.thumbnails {
- margin-left: -20px;
- list-style: none;
- *zoom: 1;
-}
-
-.thumbnails:before,
-.thumbnails:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.thumbnails:after {
- clear: both;
-}
-
-.row-fluid .thumbnails {
- margin-left: 0;
-}
-
-.thumbnails > li {
- float: left;
- margin-bottom: 20px;
- margin-left: 20px;
-}
-
-.thumbnail {
- display: block;
- padding: 4px;
- line-height: 20px;
- border: 1px solid #ddd;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
- -webkit-transition: all 0.2s ease-in-out;
- -moz-transition: all 0.2s ease-in-out;
- -o-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
-}
-
-a.thumbnail:hover {
- border-color: #0088cc;
- -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
- -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
- box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
-}
-
-.thumbnail > img {
- display: block;
- max-width: 100%;
- margin-right: auto;
- margin-left: auto;
-}
-
-.thumbnail .caption {
- padding: 9px;
- color: #555555;
-}
-
-.label,
-.badge {
- font-size: 11.844px;
- font-weight: bold;
- line-height: 14px;
- color: #ffffff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- white-space: nowrap;
- vertical-align: baseline;
- background-color: #999999;
-}
-
-.label {
- padding: 1px 4px 2px;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-.badge {
- padding: 1px 9px 2px;
- -webkit-border-radius: 9px;
- -moz-border-radius: 9px;
- border-radius: 9px;
-}
-
-a.label:hover,
-a.badge:hover {
- color: #ffffff;
- text-decoration: none;
- cursor: pointer;
-}
-
-.label-important,
-.badge-important {
- background-color: #b94a48;
-}
-
-.label-important[href],
-.badge-important[href] {
- background-color: #953b39;
-}
-
-.label-warning,
-.badge-warning {
- background-color: #f89406;
-}
-
-.label-warning[href],
-.badge-warning[href] {
- background-color: #c67605;
-}
-
-.label-success,
-.badge-success {
- background-color: #468847;
-}
-
-.label-success[href],
-.badge-success[href] {
- background-color: #356635;
-}
-
-.label-info,
-.badge-info {
- background-color: #3a87ad;
-}
-
-.label-info[href],
-.badge-info[href] {
- background-color: #2d6987;
-}
-
-.label-inverse,
-.badge-inverse {
- background-color: #333333;
-}
-
-.label-inverse[href],
-.badge-inverse[href] {
- background-color: #1a1a1a;
-}
-
-.btn .label,
-.btn .badge {
- position: relative;
- top: -1px;
-}
-
-.btn-mini .label,
-.btn-mini .badge {
- top: 0;
-}
-
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-moz-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-ms-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-o-keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
- to {
- background-position: 40px 0;
- }
-}
-
-@keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-.progress {
- height: 20px;
- margin-bottom: 20px;
- overflow: hidden;
- background-color: #f7f7f7;
- background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
- background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9);
- background-repeat: repeat-x;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-}
-
-.progress .bar {
- float: left;
- width: 0;
- height: 100%;
- font-size: 12px;
- color: #ffffff;
- text-align: center;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #0e90d2;
- background-image: -moz-linear-gradient(top, #149bdf, #0480be);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));
- background-image: -webkit-linear-gradient(top, #149bdf, #0480be);
- background-image: -o-linear-gradient(top, #149bdf, #0480be);
- background-image: linear-gradient(to bottom, #149bdf, #0480be);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-transition: width 0.6s ease;
- -moz-transition: width 0.6s ease;
- -o-transition: width 0.6s ease;
- transition: width 0.6s ease;
-}
-
-.progress .bar + .bar {
- -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-}
-
-.progress-striped .bar {
- background-color: #149bdf;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- -webkit-background-size: 40px 40px;
- -moz-background-size: 40px 40px;
- -o-background-size: 40px 40px;
- background-size: 40px 40px;
-}
-
-.progress.active .bar {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -moz-animation: progress-bar-stripes 2s linear infinite;
- -ms-animation: progress-bar-stripes 2s linear infinite;
- -o-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-
-.progress-danger .bar,
-.progress .bar-danger {
- background-color: #dd514c;
- background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));
- background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: linear-gradient(to bottom, #ee5f5b, #c43c35);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);
-}
-
-.progress-danger.progress-striped .bar,
-.progress-striped .bar-danger {
- background-color: #ee5f5b;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-success .bar,
-.progress .bar-success {
- background-color: #5eb95e;
- background-image: -moz-linear-gradient(top, #62c462, #57a957);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));
- background-image: -webkit-linear-gradient(top, #62c462, #57a957);
- background-image: -o-linear-gradient(top, #62c462, #57a957);
- background-image: linear-gradient(to bottom, #62c462, #57a957);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);
-}
-
-.progress-success.progress-striped .bar,
-.progress-striped .bar-success {
- background-color: #62c462;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-info .bar,
-.progress .bar-info {
- background-color: #4bb1cf;
- background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));
- background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
- background-image: linear-gradient(to bottom, #5bc0de, #339bb9);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);
-}
-
-.progress-info.progress-striped .bar,
-.progress-striped .bar-info {
- background-color: #5bc0de;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-warning .bar,
-.progress .bar-warning {
- background-color: #faa732;
- background-image: -moz-linear-gradient(top, #fbb450, #f89406);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
- background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
- background-image: -o-linear-gradient(top, #fbb450, #f89406);
- background-image: linear-gradient(to bottom, #fbb450, #f89406);
- background-repeat: repeat-x;
- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
-}
-
-.progress-warning.progress-striped .bar,
-.progress-striped .bar-warning {
- background-color: #fbb450;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.accordion {
- margin-bottom: 20px;
-}
-
-.accordion-group {
- margin-bottom: 2px;
- border: 1px solid #e5e5e5;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.accordion-heading {
- border-bottom: 0;
-}
-
-.accordion-heading .accordion-toggle {
- display: block;
- padding: 8px 15px;
-}
-
-.accordion-toggle {
- cursor: pointer;
-}
-
-.accordion-inner {
- padding: 9px 15px;
- border-top: 1px solid #e5e5e5;
-}
-
-.carousel {
- position: relative;
- margin-bottom: 20px;
- line-height: 1;
-}
-
-.carousel-inner {
- position: relative;
- width: 100%;
- overflow: hidden;
-}
-
-.carousel .item {
- position: relative;
- display: none;
- -webkit-transition: 0.6s ease-in-out left;
- -moz-transition: 0.6s ease-in-out left;
- -o-transition: 0.6s ease-in-out left;
- transition: 0.6s ease-in-out left;
-}
-
-.carousel .item > img {
- display: block;
- line-height: 1;
-}
-
-.carousel .active,
-.carousel .next,
-.carousel .prev {
- display: block;
-}
-
-.carousel .active {
- left: 0;
-}
-
-.carousel .next,
-.carousel .prev {
- position: absolute;
- top: 0;
- width: 100%;
-}
-
-.carousel .next {
- left: 100%;
-}
-
-.carousel .prev {
- left: -100%;
-}
-
-.carousel .next.left,
-.carousel .prev.right {
- left: 0;
-}
-
-.carousel .active.left {
- left: -100%;
-}
-
-.carousel .active.right {
- left: 100%;
-}
-
-.carousel-control {
- position: absolute;
- top: 40%;
- left: 15px;
- width: 40px;
- height: 40px;
- margin-top: -20px;
- font-size: 60px;
- font-weight: 100;
- line-height: 30px;
- color: #ffffff;
- text-align: center;
- background: #222222;
- border: 3px solid #ffffff;
- -webkit-border-radius: 23px;
- -moz-border-radius: 23px;
- border-radius: 23px;
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-
-.carousel-control.right {
- right: 15px;
- left: auto;
-}
-
-.carousel-control:hover {
- color: #ffffff;
- text-decoration: none;
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-
-.carousel-caption {
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- padding: 15px;
- background: #333333;
- background: rgba(0, 0, 0, 0.75);
-}
-
-.carousel-caption h4,
-.carousel-caption p {
- line-height: 20px;
- color: #ffffff;
-}
-
-.carousel-caption h4 {
- margin: 0 0 5px;
-}
-
-.carousel-caption p {
- margin-bottom: 0;
-}
-
-.hero-unit {
- padding: 60px;
- margin-bottom: 30px;
- background-color: #eeeeee;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-}
-
-.hero-unit h1 {
- margin-bottom: 0;
- font-size: 60px;
- line-height: 1;
- letter-spacing: -1px;
- color: inherit;
-}
-
-.hero-unit p {
- font-size: 18px;
- font-weight: 200;
- line-height: 30px;
- color: inherit;
-}
-
-.pull-right {
- float: right;
-}
-
-.pull-left {
- float: left;
-}
-
-.hide {
- display: none;
-}
-
-.show {
- display: block;
-}
-
-.invisible {
- visibility: hidden;
-}
-
-.affix {
- position: fixed;
-}
diff --git a/src/bootstrap/css/bootstrap.min.css b/src/bootstrap/css/bootstrap.min.css
deleted file mode 100644
index 31d8b960..00000000
--- a/src/bootstrap/css/bootstrap.min.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Bootstrap v2.1.1
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}.text-warning{color:#c09853}.text-error{color:#b94a48}.text-info{color:#3a87ad}.text-success{color:#468847}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:1;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1{font-size:36px;line-height:40px}h2{font-size:30px;line-height:40px}h3{font-size:24px;line-height:40px}h4{font-size:18px;line-height:20px}h5{font-size:14px;line-height:20px}h6{font-size:12px;line-height:20px}h1 small{font-size:24px}h2 small{font-size:18px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:9px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal;cursor:pointer}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:18px;padding-left:18px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"]{float:left}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info>label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;font-size:14px;vertical-align:top;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append .add-on,.input-append .btn{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topleft:4px}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table [class*=span],.row-fluid table [class*=span]{display:table-cell;float:none;margin-left:0}.table .span1{float:none;width:44px;margin-left:0}.table .span2{float:none;width:124px;margin-left:0}.table .span3{float:none;width:204px;margin-left:0}.table .span4{float:none;width:284px;margin-left:0}.table .span5{float:none;width:364px;margin-left:0}.table .span6{float:none;width:444px;margin-left:0}.table .span7{float:none;width:524px;margin-left:0}.table .span8{float:none;width:604px;margin-left:0}.table .span9{float:none;width:684px;margin-left:0}.table .span10{float:none;width:764px;margin-left:0}.table .span11{float:none;width:844px;margin-left:0}.table .span12{float:none;width:924px;margin-left:0}.table .span13{float:none;width:1004px;margin-left:0}.table .span14{float:none;width:1084px;margin-left:0}.table .span15{float:none;width:1164px;margin-left:0}.table .span16{float:none;width:1244px;margin-left:0}.table .span17{float:none;width:1324px;margin-left:0}.table .span18{float:none;width:1404px;margin-left:0}.table .span19{float:none;width:1484px;margin-left:0}.table .span20{float:none;width:1564px;margin-left:0}.table .span21{float:none;width:1644px;margin-left:0}.table .span22{float:none;width:1724px;margin-left:0}.table .span23{float:none;width:1804px;margin-left:0}.table .span24{float:none;width:1884px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-tabs>.active>a>[class^="icon-"],.nav-tabs>.active>a>[class*=" icon-"],.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#08c;background-color:#0081c2;background-image:linear-gradient(to bottom,#08c,#0077b3);background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 14px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.btn-large [class^="icon-"]{margin-top:2px}.btn-small{padding:3px 9px;font-size:12px;line-height:18px}.btn-small [class^="icon-"]{margin-top:0}.btn-mini{padding:2px 6px;font-size:11px;line-height:17px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-image:-moz-linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-image:-moz-linear-gradient(top,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-image:-moz-linear-gradient(top,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-top:0;border-bottom:5px solid #000}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#777}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;width:100%;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-image:-moz-linear-gradient(top,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{height:40px;margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:0 14px;line-height:38px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager a,.pager span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next a,.pager .next span{float:right}.pager .previous a{float:left}.pager .disabled a,.pager .disabled a:hover,.pager .disabled span{color:#999;cursor:default;background-color:#fff}.modal-open .modal .dropdown-menu{z-index:2050}.modal-open .modal .dropdown.open{*z-index:2050}.modal-open .modal .popover{z-index:2060}.modal-open .modal .tooltip{z-index:2080}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;overflow:auto;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-bottom:10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-right:10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.label,.badge{font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel .item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel .item>img{display:block;line-height:1}.carousel .active,.carousel .next,.carousel .prev{display:block}.carousel .active{left:0}.carousel .next,.carousel .prev{position:absolute;top:0;width:100%}.carousel .next{left:100%}.carousel .prev{left:-100%}.carousel .next.left,.carousel .prev.right{left:0}.carousel .active.left{left:-100%}.carousel .active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit p{font-size:18px;font-weight:200;line-height:30px;color:inherit}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}
diff --git a/src/bootstrap/img/glyphicons-halflings-white.png b/src/bootstrap/img/glyphicons-halflings-white.png
deleted file mode 100644
index 3bf6484a..00000000
Binary files a/src/bootstrap/img/glyphicons-halflings-white.png and /dev/null differ
diff --git a/src/bootstrap/img/glyphicons-halflings.png b/src/bootstrap/img/glyphicons-halflings.png
deleted file mode 100644
index a9969993..00000000
Binary files a/src/bootstrap/img/glyphicons-halflings.png and /dev/null differ
diff --git a/src/bootstrap/js/bootstrap.js b/src/bootstrap/js/bootstrap.js
deleted file mode 100644
index f73fcb8e..00000000
--- a/src/bootstrap/js/bootstrap.js
+++ /dev/null
@@ -1,2027 +0,0 @@
-/* ===================================================
- * bootstrap-transition.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#transitions
- * ===================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- $(function () {
-
- "use strict"; // jshint ;_;
-
-
- /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
- * ======================================================= */
-
- $.support.transition = (function () {
-
- var transitionEnd = (function () {
-
- var el = document.createElement('bootstrap')
- , transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd'
- , 'MozTransition' : 'transitionend'
- , 'OTransition' : 'oTransitionEnd otransitionend'
- , 'transition' : 'transitionend'
- }
- , name
-
- for (name in transEndEventNames){
- if (el.style[name] !== undefined) {
- return transEndEventNames[name]
- }
- }
-
- }())
-
- return transitionEnd && {
- end: transitionEnd
- }
-
- })()
-
- })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-alert.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#alerts
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* ALERT CLASS DEFINITION
- * ====================== */
-
- var dismiss = '[data-dismiss="alert"]'
- , Alert = function (el) {
- $(el).on('click', dismiss, this.close)
- }
-
- Alert.prototype.close = function (e) {
- var $this = $(this)
- , selector = $this.attr('data-target')
- , $parent
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- $parent = $(selector)
-
- e && e.preventDefault()
-
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
-
- $parent.trigger(e = $.Event('close'))
-
- if (e.isDefaultPrevented()) return
-
- $parent.removeClass('in')
-
- function removeElement() {
- $parent
- .trigger('closed')
- .remove()
- }
-
- $.support.transition && $parent.hasClass('fade') ?
- $parent.on($.support.transition.end, removeElement) :
- removeElement()
- }
-
-
- /* ALERT PLUGIN DEFINITION
- * ======================= */
-
- $.fn.alert = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('alert')
- if (!data) $this.data('alert', (data = new Alert(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.alert.Constructor = Alert
-
-
- /* ALERT DATA-API
- * ============== */
-
- $(function () {
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
- })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-button.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#buttons
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* BUTTON PUBLIC CLASS DEFINITION
- * ============================== */
-
- var Button = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.button.defaults, options)
- }
-
- Button.prototype.setState = function (state) {
- var d = 'disabled'
- , $el = this.$element
- , data = $el.data()
- , val = $el.is('input') ? 'val' : 'html'
-
- state = state + 'Text'
- data.resetText || $el.data('resetText', $el[val]())
-
- $el[val](data[state] || this.options[state])
-
- // push to event loop to allow forms to submit
- setTimeout(function () {
- state == 'loadingText' ?
- $el.addClass(d).attr(d, d) :
- $el.removeClass(d).removeAttr(d)
- }, 0)
- }
-
- Button.prototype.toggle = function () {
- var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
-
- $parent && $parent
- .find('.active')
- .removeClass('active')
-
- this.$element.toggleClass('active')
- }
-
-
- /* BUTTON PLUGIN DEFINITION
- * ======================== */
-
- $.fn.button = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('button')
- , options = typeof option == 'object' && option
- if (!data) $this.data('button', (data = new Button(this, options)))
- if (option == 'toggle') data.toggle()
- else if (option) data.setState(option)
- })
- }
-
- $.fn.button.defaults = {
- loadingText: 'loading...'
- }
-
- $.fn.button.Constructor = Button
-
-
- /* BUTTON DATA-API
- * =============== */
-
- $(function () {
- $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
- var $btn = $(e.target)
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
- $btn.button('toggle')
- })
- })
-
-}(window.jQuery);/* ==========================================================
- * bootstrap-carousel.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#carousel
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* CAROUSEL CLASS DEFINITION
- * ========================= */
-
- var Carousel = function (element, options) {
- this.$element = $(element)
- this.options = options
- this.options.slide && this.slide(this.options.slide)
- this.options.pause == 'hover' && this.$element
- .on('mouseenter', $.proxy(this.pause, this))
- .on('mouseleave', $.proxy(this.cycle, this))
- }
-
- Carousel.prototype = {
-
- cycle: function (e) {
- if (!e) this.paused = false
- this.options.interval
- && !this.paused
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
- return this
- }
-
- , to: function (pos) {
- var $active = this.$element.find('.item.active')
- , children = $active.parent().children()
- , activePos = children.index($active)
- , that = this
-
- if (pos > (children.length - 1) || pos < 0) return
-
- if (this.sliding) {
- return this.$element.one('slid', function () {
- that.to(pos)
- })
- }
-
- if (activePos == pos) {
- return this.pause().cycle()
- }
-
- return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
- }
-
- , pause: function (e) {
- if (!e) this.paused = true
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
- this.$element.trigger($.support.transition.end)
- this.cycle()
- }
- clearInterval(this.interval)
- this.interval = null
- return this
- }
-
- , next: function () {
- if (this.sliding) return
- return this.slide('next')
- }
-
- , prev: function () {
- if (this.sliding) return
- return this.slide('prev')
- }
-
- , slide: function (type, next) {
- var $active = this.$element.find('.item.active')
- , $next = next || $active[type]()
- , isCycling = this.interval
- , direction = type == 'next' ? 'left' : 'right'
- , fallback = type == 'next' ? 'first' : 'last'
- , that = this
- , e = $.Event('slide', {
- relatedTarget: $next[0]
- })
-
- this.sliding = true
-
- isCycling && this.pause()
-
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
-
- if ($next.hasClass('active')) return
-
- if ($.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $next.addClass(type)
- $next[0].offsetWidth // force reflow
- $active.addClass(direction)
- $next.addClass(direction)
- this.$element.one($.support.transition.end, function () {
- $next.removeClass([type, direction].join(' ')).addClass('active')
- $active.removeClass(['active', direction].join(' '))
- that.sliding = false
- setTimeout(function () { that.$element.trigger('slid') }, 0)
- })
- } else {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $active.removeClass('active')
- $next.addClass('active')
- this.sliding = false
- this.$element.trigger('slid')
- }
-
- isCycling && this.cycle()
-
- return this
- }
-
- }
-
-
- /* CAROUSEL PLUGIN DEFINITION
- * ========================== */
-
- $.fn.carousel = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('carousel')
- , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
- , action = typeof option == 'string' ? option : options.slide
- if (!data) $this.data('carousel', (data = new Carousel(this, options)))
- if (typeof option == 'number') data.to(option)
- else if (action) data[action]()
- else if (options.interval) data.cycle()
- })
- }
-
- $.fn.carousel.defaults = {
- interval: 5000
- , pause: 'hover'
- }
-
- $.fn.carousel.Constructor = Carousel
-
-
- /* CAROUSEL DATA-API
- * ================= */
-
- $(function () {
- $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
- var $this = $(this), href
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
- $target.carousel(options)
- e.preventDefault()
- })
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-collapse.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#collapse
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* COLLAPSE PUBLIC CLASS DEFINITION
- * ================================ */
-
- var Collapse = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.collapse.defaults, options)
-
- if (this.options.parent) {
- this.$parent = $(this.options.parent)
- }
-
- this.options.toggle && this.toggle()
- }
-
- Collapse.prototype = {
-
- constructor: Collapse
-
- , dimension: function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
-
- , show: function () {
- var dimension
- , scroll
- , actives
- , hasData
-
- if (this.transitioning) return
-
- dimension = this.dimension()
- scroll = $.camelCase(['scroll', dimension].join('-'))
- actives = this.$parent && this.$parent.find('> .accordion-group > .in')
-
- if (actives && actives.length) {
- hasData = actives.data('collapse')
- if (hasData && hasData.transitioning) return
- actives.collapse('hide')
- hasData || actives.data('collapse', null)
- }
-
- this.$element[dimension](0)
- this.transition('addClass', $.Event('show'), 'shown')
- $.support.transition && this.$element[dimension](this.$element[0][scroll])
- }
-
- , hide: function () {
- var dimension
- if (this.transitioning) return
- dimension = this.dimension()
- this.reset(this.$element[dimension]())
- this.transition('removeClass', $.Event('hide'), 'hidden')
- this.$element[dimension](0)
- }
-
- , reset: function (size) {
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- [dimension](size || 'auto')
- [0].offsetWidth
-
- this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
-
- return this
- }
-
- , transition: function (method, startEvent, completeEvent) {
- var that = this
- , complete = function () {
- if (startEvent.type == 'show') that.reset()
- that.transitioning = 0
- that.$element.trigger(completeEvent)
- }
-
- this.$element.trigger(startEvent)
-
- if (startEvent.isDefaultPrevented()) return
-
- this.transitioning = 1
-
- this.$element[method]('in')
-
- $.support.transition && this.$element.hasClass('collapse') ?
- this.$element.one($.support.transition.end, complete) :
- complete()
- }
-
- , toggle: function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
- }
-
-
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
-
- $.fn.collapse = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('collapse')
- , options = typeof option == 'object' && option
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.collapse.defaults = {
- toggle: true
- }
-
- $.fn.collapse.Constructor = Collapse
-
-
- /* COLLAPSIBLE DATA-API
- * ==================== */
-
- $(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
- $(target).collapse(option)
- })
- })
-
-}(window.jQuery);/* ============================================================
- * bootstrap-dropdown.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
- * ============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* DROPDOWN CLASS DEFINITION
- * ========================= */
-
- var toggle = '[data-toggle=dropdown]'
- , Dropdown = function (element) {
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
- $('html').on('click.dropdown.data-api', function () {
- $el.parent().removeClass('open')
- })
- }
-
- Dropdown.prototype = {
-
- constructor: Dropdown
-
- , toggle: function (e) {
- var $this = $(this)
- , $parent
- , isActive
-
- if ($this.is('.disabled, :disabled')) return
-
- $parent = getParent($this)
-
- isActive = $parent.hasClass('open')
-
- clearMenus()
-
- if (!isActive) {
- $parent.toggleClass('open')
- $this.focus()
- }
-
- return false
- }
-
- , keydown: function (e) {
- var $this
- , $items
- , $active
- , $parent
- , isActive
- , index
-
- if (!/(38|40|27)/.test(e.keyCode)) return
-
- $this = $(this)
-
- e.preventDefault()
- e.stopPropagation()
-
- if ($this.is('.disabled, :disabled')) return
-
- $parent = getParent($this)
-
- isActive = $parent.hasClass('open')
-
- if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
-
- $items = $('[role=menu] li:not(.divider) a', $parent)
-
- if (!$items.length) return
-
- index = $items.index($items.filter(':focus'))
-
- if (e.keyCode == 38 && index > 0) index-- // up
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
- if (!~index) index = 0
-
- $items
- .eq(index)
- .focus()
- }
-
- }
-
- function clearMenus() {
- getParent($(toggle))
- .removeClass('open')
- }
-
- function getParent($this) {
- var selector = $this.attr('data-target')
- , $parent
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- $parent = $(selector)
- $parent.length || ($parent = $this.parent())
-
- return $parent
- }
-
-
- /* DROPDOWN PLUGIN DEFINITION
- * ========================== */
-
- $.fn.dropdown = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('dropdown')
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.dropdown.Constructor = Dropdown
-
-
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
- * =================================== */
-
- $(function () {
- $('html')
- .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
- $('body')
- .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
- .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
- .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
- })
-
-}(window.jQuery);/* =========================================================
- * bootstrap-modal.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#modals
- * =========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* MODAL CLASS DEFINITION
- * ====================== */
-
- var Modal = function (element, options) {
- this.options = options
- this.$element = $(element)
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
- this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
- }
-
- Modal.prototype = {
-
- constructor: Modal
-
- , toggle: function () {
- return this[!this.isShown ? 'show' : 'hide']()
- }
-
- , show: function () {
- var that = this
- , e = $.Event('show')
-
- this.$element.trigger(e)
-
- if (this.isShown || e.isDefaultPrevented()) return
-
- $('body').addClass('modal-open')
-
- this.isShown = true
-
- this.escape()
-
- this.backdrop(function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
-
- if (!that.$element.parent().length) {
- that.$element.appendTo(document.body) //don't move modals dom position
- }
-
- that.$element
- .show()
-
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
-
- that.$element
- .addClass('in')
- .attr('aria-hidden', false)
- .focus()
-
- that.enforceFocus()
-
- transition ?
- that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
- that.$element.trigger('shown')
-
- })
- }
-
- , hide: function (e) {
- e && e.preventDefault()
-
- var that = this
-
- e = $.Event('hide')
-
- this.$element.trigger(e)
-
- if (!this.isShown || e.isDefaultPrevented()) return
-
- this.isShown = false
-
- $('body').removeClass('modal-open')
-
- this.escape()
-
- $(document).off('focusin.modal')
-
- this.$element
- .removeClass('in')
- .attr('aria-hidden', true)
-
- $.support.transition && this.$element.hasClass('fade') ?
- this.hideWithTransition() :
- this.hideModal()
- }
-
- , enforceFocus: function () {
- var that = this
- $(document).on('focusin.modal', function (e) {
- if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
- that.$element.focus()
- }
- })
- }
-
- , escape: function () {
- var that = this
- if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.modal', function ( e ) {
- e.which == 27 && that.hide()
- })
- } else if (!this.isShown) {
- this.$element.off('keyup.dismiss.modal')
- }
- }
-
- , hideWithTransition: function () {
- var that = this
- , timeout = setTimeout(function () {
- that.$element.off($.support.transition.end)
- that.hideModal()
- }, 500)
-
- this.$element.one($.support.transition.end, function () {
- clearTimeout(timeout)
- that.hideModal()
- })
- }
-
- , hideModal: function (that) {
- this.$element
- .hide()
- .trigger('hidden')
-
- this.backdrop()
- }
-
- , removeBackdrop: function () {
- this.$backdrop.remove()
- this.$backdrop = null
- }
-
- , backdrop: function (callback) {
- var that = this
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
-
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
-
- this.$backdrop = $('')
- .appendTo(document.body)
-
- if (this.options.backdrop != 'static') {
- this.$backdrop.click($.proxy(this.hide, this))
- }
-
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
- this.$backdrop.addClass('in')
-
- doAnimate ?
- this.$backdrop.one($.support.transition.end, callback) :
- callback()
-
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
-
- $.support.transition && this.$element.hasClass('fade')?
- this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
- this.removeBackdrop()
-
- } else if (callback) {
- callback()
- }
- }
- }
-
-
- /* MODAL PLUGIN DEFINITION
- * ======================= */
-
- $.fn.modal = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('modal')
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
- if (!data) $this.data('modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
- })
- }
-
- $.fn.modal.defaults = {
- backdrop: true
- , keyboard: true
- , show: true
- }
-
- $.fn.modal.Constructor = Modal
-
-
- /* MODAL DATA-API
- * ============== */
-
- $(function () {
- $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
- var $this = $(this)
- , href = $this.attr('href')
- , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
- e.preventDefault()
-
- $target
- .modal(option)
- .one('hide', function () {
- $this.focus()
- })
- })
- })
-
-}(window.jQuery);/* ===========================================================
- * bootstrap-tooltip.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* TOOLTIP PUBLIC CLASS DEFINITION
- * =============================== */
-
- var Tooltip = function (element, options) {
- this.init('tooltip', element, options)
- }
-
- Tooltip.prototype = {
-
- constructor: Tooltip
-
- , init: function (type, element, options) {
- var eventIn
- , eventOut
-
- this.type = type
- this.$element = $(element)
- this.options = this.getOptions(options)
- this.enabled = true
-
- if (this.options.trigger == 'click') {
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
- } else if (this.options.trigger != 'manual') {
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
- eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
- }
-
- this.options.selector ?
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
- this.fixTitle()
- }
-
- , getOptions: function (options) {
- options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
-
- if (options.delay && typeof options.delay == 'number') {
- options.delay = {
- show: options.delay
- , hide: options.delay
- }
- }
-
- return options
- }
-
- , enter: function (e) {
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
- if (!self.options.delay || !self.options.delay.show) return self.show()
-
- clearTimeout(this.timeout)
- self.hoverState = 'in'
- this.timeout = setTimeout(function() {
- if (self.hoverState == 'in') self.show()
- }, self.options.delay.show)
- }
-
- , leave: function (e) {
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
-
- if (this.timeout) clearTimeout(this.timeout)
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
- self.hoverState = 'out'
- this.timeout = setTimeout(function() {
- if (self.hoverState == 'out') self.hide()
- }, self.options.delay.hide)
- }
-
- , show: function () {
- var $tip
- , inside
- , pos
- , actualWidth
- , actualHeight
- , placement
- , tp
-
- if (this.hasContent() && this.enabled) {
- $tip = this.tip()
- this.setContent()
-
- if (this.options.animation) {
- $tip.addClass('fade')
- }
-
- placement = typeof this.options.placement == 'function' ?
- this.options.placement.call(this, $tip[0], this.$element[0]) :
- this.options.placement
-
- inside = /in/.test(placement)
-
- $tip
- .remove()
- .css({ top: 0, left: 0, display: 'block' })
- .appendTo(inside ? this.$element : document.body)
-
- pos = this.getPosition(inside)
-
- actualWidth = $tip[0].offsetWidth
- actualHeight = $tip[0].offsetHeight
-
- switch (inside ? placement.split(' ')[1] : placement) {
- case 'bottom':
- tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
- break
- case 'top':
- tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
- break
- case 'left':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
- break
- case 'right':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
- break
- }
-
- $tip
- .css(tp)
- .addClass(placement)
- .addClass('in')
- }
- }
-
- , setContent: function () {
- var $tip = this.tip()
- , title = this.getTitle()
-
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
- $tip.removeClass('fade in top bottom left right')
- }
-
- , hide: function () {
- var that = this
- , $tip = this.tip()
-
- $tip.removeClass('in')
-
- function removeWithAnimation() {
- var timeout = setTimeout(function () {
- $tip.off($.support.transition.end).remove()
- }, 500)
-
- $tip.one($.support.transition.end, function () {
- clearTimeout(timeout)
- $tip.remove()
- })
- }
-
- $.support.transition && this.$tip.hasClass('fade') ?
- removeWithAnimation() :
- $tip.remove()
-
- return this
- }
-
- , fixTitle: function () {
- var $e = this.$element
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
- }
- }
-
- , hasContent: function () {
- return this.getTitle()
- }
-
- , getPosition: function (inside) {
- return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
- width: this.$element[0].offsetWidth
- , height: this.$element[0].offsetHeight
- })
- }
-
- , getTitle: function () {
- var title
- , $e = this.$element
- , o = this.options
-
- title = $e.attr('data-original-title')
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
-
- return title
- }
-
- , tip: function () {
- return this.$tip = this.$tip || $(this.options.template)
- }
-
- , validate: function () {
- if (!this.$element[0].parentNode) {
- this.hide()
- this.$element = null
- this.options = null
- }
- }
-
- , enable: function () {
- this.enabled = true
- }
-
- , disable: function () {
- this.enabled = false
- }
-
- , toggleEnabled: function () {
- this.enabled = !this.enabled
- }
-
- , toggle: function () {
- this[this.tip().hasClass('in') ? 'hide' : 'show']()
- }
-
- , destroy: function () {
- this.hide().$element.off('.' + this.type).removeData(this.type)
- }
-
- }
-
-
- /* TOOLTIP PLUGIN DEFINITION
- * ========================= */
-
- $.fn.tooltip = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tooltip')
- , options = typeof option == 'object' && option
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tooltip.Constructor = Tooltip
-
- $.fn.tooltip.defaults = {
- animation: true
- , placement: 'top'
- , selector: false
- , template: ''
- , trigger: 'hover'
- , title: ''
- , delay: 0
- , html: true
- }
-
-}(window.jQuery);
-/* ===========================================================
- * bootstrap-popover.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#popovers
- * ===========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* POPOVER PUBLIC CLASS DEFINITION
- * =============================== */
-
- var Popover = function (element, options) {
- this.init('popover', element, options)
- }
-
-
- /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
- ========================================== */
-
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
-
- constructor: Popover
-
- , setContent: function () {
- var $tip = this.tip()
- , title = this.getTitle()
- , content = this.getContent()
-
- $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
- $tip.find('.popover-content > *')[this.options.html ? 'html' : 'text'](content)
-
- $tip.removeClass('fade top bottom left right in')
- }
-
- , hasContent: function () {
- return this.getTitle() || this.getContent()
- }
-
- , getContent: function () {
- var content
- , $e = this.$element
- , o = this.options
-
- content = $e.attr('data-content')
- || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
-
- return content
- }
-
- , tip: function () {
- if (!this.$tip) {
- this.$tip = $(this.options.template)
- }
- return this.$tip
- }
-
- , destroy: function () {
- this.hide().$element.off('.' + this.type).removeData(this.type)
- }
-
- })
-
-
- /* POPOVER PLUGIN DEFINITION
- * ======================= */
-
- $.fn.popover = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('popover')
- , options = typeof option == 'object' && option
- if (!data) $this.data('popover', (data = new Popover(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.popover.Constructor = Popover
-
- $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
- placement: 'right'
- , trigger: 'click'
- , content: ''
- , template: ''
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-scrollspy.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#scrollspy
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* SCROLLSPY CLASS DEFINITION
- * ========================== */
-
- function ScrollSpy(element, options) {
- var process = $.proxy(this.process, this)
- , $element = $(element).is('body') ? $(window) : $(element)
- , href
- this.options = $.extend({}, $.fn.scrollspy.defaults, options)
- this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.$body = $('body')
- this.refresh()
- this.process()
- }
-
- ScrollSpy.prototype = {
-
- constructor: ScrollSpy
-
- , refresh: function () {
- var self = this
- , $targets
-
- this.offsets = $([])
- this.targets = $([])
-
- $targets = this.$body
- .find(this.selector)
- .map(function () {
- var $el = $(this)
- , href = $el.data('target') || $el.attr('href')
- , $href = /^#\w/.test(href) && $(href)
- return ( $href
- && $href.length
- && [[ $href.position().top, href ]] ) || null
- })
- .sort(function (a, b) { return a[0] - b[0] })
- .each(function () {
- self.offsets.push(this[0])
- self.targets.push(this[1])
- })
- }
-
- , process: function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
- , maxScroll = scrollHeight - this.$scrollElement.height()
- , offsets = this.offsets
- , targets = this.targets
- , activeTarget = this.activeTarget
- , i
-
- if (scrollTop >= maxScroll) {
- return activeTarget != (i = targets.last()[0])
- && this.activate ( i )
- }
-
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
- }
-
- , activate: function (target) {
- var active
- , selector
-
- this.activeTarget = target
-
- $(this.selector)
- .parent('.active')
- .removeClass('active')
-
- selector = this.selector
- + '[data-target="' + target + '"],'
- + this.selector + '[href="' + target + '"]'
-
- active = $(selector)
- .parent('li')
- .addClass('active')
-
- if (active.parent('.dropdown-menu').length) {
- active = active.closest('li.dropdown').addClass('active')
- }
-
- active.trigger('activate')
- }
-
- }
-
-
- /* SCROLLSPY PLUGIN DEFINITION
- * =========================== */
-
- $.fn.scrollspy = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('scrollspy')
- , options = typeof option == 'object' && option
- if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.scrollspy.Constructor = ScrollSpy
-
- $.fn.scrollspy.defaults = {
- offset: 10
- }
-
-
- /* SCROLLSPY DATA-API
- * ================== */
-
- $(window).on('load', function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
- })
-
-}(window.jQuery);/* ========================================================
- * bootstrap-tab.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* TAB CLASS DEFINITION
- * ==================== */
-
- var Tab = function (element) {
- this.element = $(element)
- }
-
- Tab.prototype = {
-
- constructor: Tab
-
- , show: function () {
- var $this = this.element
- , $ul = $this.closest('ul:not(.dropdown-menu)')
- , selector = $this.attr('data-target')
- , previous
- , $target
- , e
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- if ( $this.parent('li').hasClass('active') ) return
-
- previous = $ul.find('.active a').last()[0]
-
- e = $.Event('show', {
- relatedTarget: previous
- })
-
- $this.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown'
- , relatedTarget: previous
- })
- })
- }
-
- , activate: function ( element, container, callback) {
- var $active = container.find('> .active')
- , transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if ( element.parent('.dropdown-menu') ) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active.one($.support.transition.end, next) :
- next()
-
- $active.removeClass('in')
- }
- }
-
-
- /* TAB PLUGIN DEFINITION
- * ===================== */
-
- $.fn.tab = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tab')
- if (!data) $this.data('tab', (data = new Tab(this)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- /* TAB DATA-API
- * ============ */
-
- $(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
- })
-
-}(window.jQuery);/* =============================================================
- * bootstrap-typeahead.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#typeahead
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============================================================ */
-
-
-!function($){
-
- "use strict"; // jshint ;_;
-
-
- /* TYPEAHEAD PUBLIC CLASS DEFINITION
- * ================================= */
-
- var Typeahead = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.typeahead.defaults, options)
- this.matcher = this.options.matcher || this.matcher
- this.sorter = this.options.sorter || this.sorter
- this.highlighter = this.options.highlighter || this.highlighter
- this.updater = this.options.updater || this.updater
- this.$menu = $(this.options.menu).appendTo('body')
- this.source = this.options.source
- this.shown = false
- this.listen()
- }
-
- Typeahead.prototype = {
-
- constructor: Typeahead
-
- , select: function () {
- var val = this.$menu.find('.active').attr('data-value')
- this.$element
- .val(this.updater(val))
- .change()
- return this.hide()
- }
-
- , updater: function (item) {
- return item
- }
-
- , show: function () {
- var pos = $.extend({}, this.$element.offset(), {
- height: this.$element[0].offsetHeight
- })
-
- this.$menu.css({
- top: pos.top + pos.height
- , left: pos.left
- })
-
- this.$menu.show()
- this.shown = true
- return this
- }
-
- , hide: function () {
- this.$menu.hide()
- this.shown = false
- return this
- }
-
- , lookup: function (event) {
- var items
-
- this.query = this.$element.val()
-
- if (!this.query || this.query.length < this.options.minLength) {
- return this.shown ? this.hide() : this
- }
-
- items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
-
- return items ? this.process(items) : this
- }
-
- , process: function (items) {
- var that = this
-
- items = $.grep(items, function (item) {
- return that.matcher(item)
- })
-
- items = this.sorter(items)
-
- if (!items.length) {
- return this.shown ? this.hide() : this
- }
-
- return this.render(items.slice(0, this.options.items)).show()
- }
-
- , matcher: function (item) {
- return ~item.toLowerCase().indexOf(this.query.toLowerCase())
- }
-
- , sorter: function (items) {
- var beginswith = []
- , caseSensitive = []
- , caseInsensitive = []
- , item
-
- while (item = items.shift()) {
- if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
- else if (~item.indexOf(this.query)) caseSensitive.push(item)
- else caseInsensitive.push(item)
- }
-
- return beginswith.concat(caseSensitive, caseInsensitive)
- }
-
- , highlighter: function (item) {
- var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
- return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
- return '' + match + ''
- })
- }
-
- , render: function (items) {
- var that = this
-
- items = $(items).map(function (i, item) {
- i = $(that.options.item).attr('data-value', item)
- i.find('a').html(that.highlighter(item))
- return i[0]
- })
-
- items.first().addClass('active')
- this.$menu.html(items)
- return this
- }
-
- , next: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , next = active.next()
-
- if (!next.length) {
- next = $(this.$menu.find('li')[0])
- }
-
- next.addClass('active')
- }
-
- , prev: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , prev = active.prev()
-
- if (!prev.length) {
- prev = this.$menu.find('li').last()
- }
-
- prev.addClass('active')
- }
-
- , listen: function () {
- this.$element
- .on('blur', $.proxy(this.blur, this))
- .on('keypress', $.proxy(this.keypress, this))
- .on('keyup', $.proxy(this.keyup, this))
-
- if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
- this.$element.on('keydown', $.proxy(this.keydown, this))
- }
-
- this.$menu
- .on('click', $.proxy(this.click, this))
- .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
- }
-
- , move: function (e) {
- if (!this.shown) return
-
- switch(e.keyCode) {
- case 9: // tab
- case 13: // enter
- case 27: // escape
- e.preventDefault()
- break
-
- case 38: // up arrow
- e.preventDefault()
- this.prev()
- break
-
- case 40: // down arrow
- e.preventDefault()
- this.next()
- break
- }
-
- e.stopPropagation()
- }
-
- , keydown: function (e) {
- this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
- this.move(e)
- }
-
- , keypress: function (e) {
- if (this.suppressKeyPressRepeat) return
- this.move(e)
- }
-
- , keyup: function (e) {
- switch(e.keyCode) {
- case 40: // down arrow
- case 38: // up arrow
- break
-
- case 9: // tab
- case 13: // enter
- if (!this.shown) return
- this.select()
- break
-
- case 27: // escape
- if (!this.shown) return
- this.hide()
- break
-
- default:
- this.lookup()
- }
-
- e.stopPropagation()
- e.preventDefault()
- }
-
- , blur: function (e) {
- var that = this
- setTimeout(function () { that.hide() }, 150)
- }
-
- , click: function (e) {
- e.stopPropagation()
- e.preventDefault()
- this.select()
- }
-
- , mouseenter: function (e) {
- this.$menu.find('.active').removeClass('active')
- $(e.currentTarget).addClass('active')
- }
-
- }
-
-
- /* TYPEAHEAD PLUGIN DEFINITION
- * =========================== */
-
- $.fn.typeahead = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('typeahead')
- , options = typeof option == 'object' && option
- if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.typeahead.defaults = {
- source: []
- , items: 8
- , menu: ''
- , item: ' '
- , minLength: 1
- }
-
- $.fn.typeahead.Constructor = Typeahead
-
-
- /* TYPEAHEAD DATA-API
- * ================== */
-
- $(function () {
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
- var $this = $(this)
- if ($this.data('typeahead')) return
- e.preventDefault()
- $this.typeahead($this.data())
- })
- })
-
-}(window.jQuery);
-/* ==========================================================
- * bootstrap-affix.js v2.1.1
- * http://twitter.github.com/bootstrap/javascript.html#affix
- * ==========================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================== */
-
-
-!function ($) {
-
- "use strict"; // jshint ;_;
-
-
- /* AFFIX CLASS DEFINITION
- * ====================== */
-
- var Affix = function (element, options) {
- this.options = $.extend({}, $.fn.affix.defaults, options)
- this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
- this.$element = $(element)
- this.checkPosition()
- }
-
- Affix.prototype.checkPosition = function () {
- if (!this.$element.is(':visible')) return
-
- var scrollHeight = $(document).height()
- , scrollTop = this.$window.scrollTop()
- , position = this.$element.offset()
- , offset = this.options.offset
- , offsetBottom = offset.bottom
- , offsetTop = offset.top
- , reset = 'affix affix-top affix-bottom'
- , affix
-
- if (typeof offset != 'object') offsetBottom = offsetTop = offset
- if (typeof offsetTop == 'function') offsetTop = offset.top()
- if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
-
- affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
- false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
- 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
- 'top' : false
-
- if (this.affixed === affix) return
-
- this.affixed = affix
- this.unpin = affix == 'bottom' ? position.top - scrollTop : null
-
- this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
- }
-
-
- /* AFFIX PLUGIN DEFINITION
- * ======================= */
-
- $.fn.affix = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('affix')
- , options = typeof option == 'object' && option
- if (!data) $this.data('affix', (data = new Affix(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.affix.Constructor = Affix
-
- $.fn.affix.defaults = {
- offset: 0
- }
-
-
- /* AFFIX DATA-API
- * ============== */
-
- $(window).on('load', function () {
- $('[data-spy="affix"]').each(function () {
- var $spy = $(this)
- , data = $spy.data()
-
- data.offset = data.offset || {}
-
- data.offsetBottom && (data.offset.bottom = data.offsetBottom)
- data.offsetTop && (data.offset.top = data.offsetTop)
-
- $spy.affix(data)
- })
- })
-
-
-}(window.jQuery);
\ No newline at end of file
diff --git a/src/bootstrap/js/bootstrap.min.js b/src/bootstrap/js/bootstrap.min.js
deleted file mode 100644
index 0e33fb16..00000000
--- a/src/bootstrap/js/bootstrap.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
-* Bootstrap.js by @fat & @mdo
-* Copyright 2012 Twitter, Inc.
-* http://www.apache.org/licenses/LICENSE-2.0.txt
-*/
-!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){i(e(t)).removeClass("open")}function i(t){var n=t.attr("data-target"),r;return n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=e(n),r.length||(r=t.parent()),r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||(s.toggleClass("open"),n.focus()),!1},keydown:function(t){var n,r,s,o,u,a;if(!/(38|40|27)/.test(t.keyCode))return;n=e(this),t.preventDefault(),t.stopPropagation();if(n.is(".disabled, :disabled"))return;o=i(n),u=o.hasClass("open");if(!u||u&&t.keyCode==27)return n.click();r=e("[role=menu] li:not(.divider) a",o);if(!r.length)return;a=r.index(r.filter(":focus")),t.keyCode==38&&a>0&&a--,t.keyCode==40&&a ').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''})}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var t=e(this),n=t.data("target")||t.attr("href"),r=/^#\w/.test(n)&&e(n);return r&&r.length&&[[r.position().top,n]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}},e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=e(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),(e.browser.chrome||e.browser.webkit||e.browser.msie)&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this))},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=!~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(e){var t=this;setTimeout(function(){t.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")}},e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:' ',minLength:1},e.fn.typeahead.Constructor=t,e(function(){e("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
\ No newline at end of file
diff --git a/src/classes/AbstractInitialize.php b/src/classes/AbstractInitialize.php
deleted file mode 100644
index c2702bc2..00000000
--- a/src/classes/AbstractInitialize.php
+++ /dev/null
@@ -1,35 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-abstract class AbstractInitialize{
- var $baseService = null;
- public function setBaseService($baseService){
- $this->baseService = $baseService;
- }
-
- public function getCurrentProfileId(){
- return $this->baseService->getCurrentProfileId();
- }
-
- public abstract function init();
-}
\ No newline at end of file
diff --git a/src/classes/AbstractModuleManager.php b/src/classes/AbstractModuleManager.php
deleted file mode 100644
index da265660..00000000
--- a/src/classes/AbstractModuleManager.php
+++ /dev/null
@@ -1,220 +0,0 @@
-addUserClass("EmployeeDocument");
- }
- *
- */
- public abstract function initializeUserClasses();
-
- /**
- * Override this method in module manager class to define file field mappings. If you have a table field that stores a name of a file which need to be
- * deleted from the disk when the record is deleted a file field mapping should be added.
- * @method initializeFieldMappings
- * @example
- public function initializeFieldMappings(){
- $this->addFileFieldMapping('EmployeeDocument', 'attachment', 'name');
- }
- */
- public abstract function initializeFieldMappings();
-
-
- /**
- * Override this method in module manager class to define DB error mappings. Some actions to your model classes trigger database errors.
- * These errors need to be translated to user friendly texts using DB error mappings
- * @method initializeDatabaseErrorMappings
- * @example
- public function initializeDatabaseErrorMappings(){
- $this->addDatabaseErrorMapping('CONSTRAINT `Fk_User_Employee` FOREIGN KEY',"Can not delete Employee, please delete the User for this employee first.");
- $this->addDatabaseErrorMapping("Duplicate entry|for key 'employee'","A duplicate entry found");
- }
- */
- public abstract function initializeDatabaseErrorMappings();
-
- /**
- * Override this method in module manager class to add model classes to this module. All the model classes defind for the module should be added here
- * @method setupModuleClassDefinitions
- * @example
- public function setupModuleClassDefinitions(){
- $this->addModelClass('Employee');
- $this->addModelClass('EmploymentStatus');
- }
- */
- public abstract function setupModuleClassDefinitions();
-
- public function initCalculationHooks(){
-
- }
-
- public function initQuickAccessMenu(){
-
- }
-
- public function setModuleObject($obj){
- $this->moduleObject = $obj;
- }
-
- public function getModuleObject(){
- return $this->moduleObject;
- }
-
- public function setModuleType($type){
- $this->moduleType = $type;
- }
-
- public function getModuleType(){
- return $this->moduleType;
- }
-
- public function getModulePath(){
- $subClass = get_called_class();
- $reflector = new ReflectionClass($subClass);
- $fn = $reflector->getFileName();
- $this->modulePath = realpath(dirname($fn)."/..");
- LogManager::getInstance()->info("Module Path: [$subClass | $fn]".$this->modulePath);
- }
-
- public function getDashboardItemData(){
- return array();
- }
-
- public function getDashboardItem(){
- $this->getModulePath();
- if(!file_exists($this->modulePath."/dashboard.html")){
- //LogManager::getInstance()->error("Dashboard file not found :".$this->modulePath."/dashboard.html");
- return null;
- }
- $dashboardItem = file_get_contents($this->modulePath."/dashboard.html");
- if(empty($dashboardItem)){
- //LogManager::getInstance()->error("Dashboard file is empty :".$this->modulePath."/dashboard.html");
- return null;
- }
-
- $data = $this->getDashboardItemData();
- $data['moduleLink'] = $this->getModuleLink();
- LogManager::getInstance()->info("Module Link:".$data['moduleLink']);
- foreach($data as $k => $v){
- $dashboardItem = str_replace("#_".$k."_#", $v, $dashboardItem);
- }
-
- return $dashboardItem;
-
- }
-
- public function getDashboardItemIndex(){
- $metaData = json_decode(file_get_contents($this->modulePath."/meta.json"),true);
- if(!isset($metaData['dashboardPosition'])){
- return 100;
- }else{
- return $metaData['dashboardPosition'];
- }
-
- }
-
-
- private function getModuleLink(){
-
- $metaData = json_decode(file_get_contents($this->modulePath."/meta.json"),true);
-
- $mod = basename($this->modulePath);
- $group = basename(realpath($this->modulePath."/.."));
-
- //?g=admin&n=candidates&m=admin_Recruitment
-
- return CLIENT_BASE_URL."?g=".$group."&n=".$mod."&m=".$group."_".str_replace(" ","_",$metaData['label']);
- }
-
-
- public function setupRestEndPoints(){
-
- }
-
- public function setupFileFieldMappings(&$fileFields){
- foreach ($this->fileFieldMappings as $mapping){
- if(empty($fileFields[$mapping[0]])){
- $fileFields[$mapping[0]] = array();
- }
-
- $fileFields[$mapping[0]][$mapping[1]] = $mapping[2];
- }
- }
-
- public function setupUserClasses(&$userTables){
- foreach($this->userClasses as $className){
- if(!in_array($className, $userTables)){
- $userTables[] = $className;
- }
- }
-
- }
-
- public function setupErrorMappings(&$mysqlErrors){
- foreach($this->errorMappings as $name=>$desc){
- $mysqlErrors[$name] = $desc;
- }
-
- }
-
- public function getModelClasses(){
- return $this->modelClasses;
- }
-
- protected function addFileFieldMapping($className, $fieldName, $fileTableFieldName){
- $this->fileFieldMappings[] = array($className, $fieldName, $fileTableFieldName);
- }
-
- protected function addUserClass($className){
- $this->userClasses[] = $className;
- }
-
- protected function addDatabaseErrorMapping($error, $description){
- $this->errorMappings[$error] = $description;
- }
-
- protected function addModelClass($className){
- $this->modelClasses[] = $className;
- }
-
- protected function addHistoryGeneric($type, $table, $refName, $refId, $field, $oldValue, $newValue){
- $eh = new $table();
- $eh->type = $type;
- $eh->$refName = $refId;
- $eh->field = $field;
- $eh->user = BaseService::getInstance()->getCurrentUser()->id;
- $eh->old_value = $oldValue;
- $eh->new_value = $newValue;
- $eh->created = date("Y-m-d H:i:s");
- $eh->updated = date("Y-m-d H:i:s");
-
- $eh->Save();
- }
-
- public function addCalculationHook($code, $name, $class, $method){
- BaseService::getInstance()->addCalculationHook($code, $name, $class, $method);
- }
-
-
-}
\ No newline at end of file
diff --git a/src/classes/ApprovalStatus.php b/src/classes/ApprovalStatus.php
deleted file mode 100644
index 7745c66c..00000000
--- a/src/classes/ApprovalStatus.php
+++ /dev/null
@@ -1,163 +0,0 @@
-Load("id = ?",array($employeeId));
- if(empty($emp->approver1) && empty($emp->approver2) && empty($emp->approver3)){
- return true;
- }
- return false;
- }
-
- public function getResolvedStatuses($type, $id){
- $employeeApproval = new EmployeeApproval();
- $eas = $employeeApproval->Find("type = ? and element = ? and status > -1 order by level", array($type, $id));
- return $eas;
- }
-
- public function approvalChainExists($type, $id){
- $list = $this->getAllStatuses($type, $id);
- return count($list) > 0;
- }
-
- public function getAllStatuses($type, $id){
- $employeeApproval = new EmployeeApproval();
- $eas = $employeeApproval->Find("type = ? and element = ? order by level", array($type, $id));
- return $eas;
- }
-
- public function initializeApprovalChain($type, $id){
- $element = new $type();
- $element->Load("id = ?",array($id));
- $employeeId = $element->employee;
-
- for($i = 1; $i < 4; $i++){
- $approver = $this->getApproverByLevel($i, $employeeId);
- if(!empty($approver)){
- $employeeApproval = new EmployeeApproval();
- $employeeApproval->type = $type;
- $employeeApproval->element = $id;
- $employeeApproval->approver = $approver;
- $employeeApproval->level = $i;
- $employeeApproval->status = -1;
- $employeeApproval->active = 0;
- $employeeApproval->created = date("Y-m-d H:i:s");
- $employeeApproval->updated = date("Y-m-d H:i:s");
- $ok = $employeeApproval->Save();
- if(!$ok){
- LogManager::getInstance()->error("Error:".$employeeApproval->ErrorMsg());
- }
- }else{
- LogManager::getInstance()->error("Approver is empty level:".$i);
- }
- }
- }
-
-
- public function updateApprovalStatus($type, $id, $currentEmployee, $status){
- LogManager::getInstance()->error('updateApprovalStatus 1');
- if(!$this->approvalChainExists($type, $id)){
- LogManager::getInstance()->error('updateApprovalStatus 2');
- return new IceResponse(IceResponse::SUCCESS, array(NULL, NULL));
- }
-
- if($status != 0 && $status != 1){
- return new IceResponse(IceResponse::ERROR, "Invalid data");
- }
-
- $element = new $type();
- $element->Load("id = ?",array($id));
- $employeeId = $element->employee;
-
- $eas = $this->getAllStatuses($type, $id);
- $level = 0;
- //check if the element is already rejected
- foreach($eas as $ea){
- if($ea->status == 0){
- return new IceResponse(IceResponse::ERROR, "This item is already rejected");
- }else if($ea->active == 1){
- $level = intval($ea->level);
- }
- }
-
- LogManager::getInstance()->error('level '.$level);
-
- $currentAL = NULL;
- if($level > 0){
- $currentAL = new EmployeeApproval();
- $currentAL->Load("type = ? and element = ? and level = ?",array($type, $id, $level));
- }
-
- $nextAL = null;
- if($level < 3){
- $nextAL = new EmployeeApproval();
- $nextAL->Load("type = ? and element = ? and level = ?",array($type, $id, intval($level)+1));
-
- LogManager::getInstance()->error('next AL '.print_r($nextAL,true));
- if(empty($nextAL->id)){
- $nextAL = NULL;
- }
- }
-
- //Check if the current employee is allowed to approve
- if($level > 0 && $currentEmployee != $currentAL->approver){
- return new IceResponse(IceResponse::ERROR, "You are not allowed to approve or reject");
- }
-
- if(!empty($currentAL)){
- //Now mark the approval status
- $currentAL->status = $status;
- $currentAL->Save();
- }
-
- if(!empty($nextAL)) {
- foreach ($eas as $ea) {
- if ($ea->id == $nextAL->id) {
- $nextAL->active = 1;
- $nextAL->Save();
- } else {
- $ea->active = 0;
- $ea->Save();
- }
- }
- }
-
- if(!empty($currentAL)){
- $oldCurrAlId = $currentAL->id;
- $currentAL = new EmployeeApproval();
- $currentAL->Load("id = ?",array($oldCurrAlId));
- }
-
-
- return new IceResponse(IceResponse::SUCCESS, array($currentAL, $nextAL));
-
- }
-
-
- private function getApproverByLevel($level, $employeeId){
- $emp = new Employee();
- $emp->Load("id = ?",array($employeeId));
- $approver = NULL;
- $alevel = "approver".$level;
- return $emp->$alevel;
- }
-
-}
\ No newline at end of file
diff --git a/src/classes/ApproveActionManager.php b/src/classes/ApproveActionManager.php
deleted file mode 100644
index f1beecb7..00000000
--- a/src/classes/ApproveActionManager.php
+++ /dev/null
@@ -1,337 +0,0 @@
-getModelClass();
- $logs = StatusChangeLogManager::getInstance()->getLogs($class, $req->id);
- return new IceResponse(IceResponse::SUCCESS, $logs);
- }
-}
-
-
-abstract class ApproveAdminActionManager extends ApproveCommonActionManager{
-
- public abstract function getModelClass();
- public abstract function getItemName();
- public abstract function getModuleName();
- public abstract function getModuleTabUrl();
- public abstract function getModuleSubordinateTabUrl();
- public abstract function getModuleApprovalTabUrl();
-
- public function changeStatus($req){
-
- $class = $this->getModelClass();
- $itemName = $this->getItemName();
-
-
- $obj = new $class();
- $obj->Load("id = ?",array($req->id));
-
- if($obj->id != $req->id){
- return new IceResponse(IceResponse::ERROR,"$itemName not found");
- }
-
- /*
- if($this->user->user_level != 'Admin' && $this->user->user_level != 'Manager'){
- return new IceResponse(IceResponse::ERROR,"Only an admin or manager can do this");
- }*/
-
- //Check if this needs to be multi-approved
- $apStatus = 0;
- if($req->status == "Approved"){
- $apStatus = 1;
- }
-
- if($req->status == "Approved" || $req->status == "Rejected"){
- $approvalResp = ApprovalStatus::getInstance()->updateApprovalStatus($class,
- $obj->id,
- BaseService::getInstance()->getCurrentProfileId(),
- $apStatus);
-
- if($approvalResp->getStatus() == IceResponse::SUCCESS){
- $objResp = $approvalResp->getObject();
- $currentAp = $objResp[0];
- $nextAp = $objResp[1];
- $sendApprovalEmailto = null;
- if(empty($currentAp) && empty($nextAp)){
- //No multi level approvals
- LogManager::getInstance()->debug($obj->id."|No multi level approvals|");
- if($req->status == "Approved"){
- $req->status = "Approved";
- }
- }else if(empty($currentAp) && !empty($nextAp)){
- //Approval process is defined, but this person is a supervisor
- LogManager::getInstance()->debug($obj->id."|Approval process is defined, but this person is a supervisor|");
- $sendApprovalEmailto = $nextAp->approver;
- if($req->status == "Approved"){
- $req->status = "Processing";
- }
-
- }else if(!empty($currentAp) && empty($nextAp)){
- //All multi level approvals completed, now we can approve
- LogManager::getInstance()->debug($obj->id."|All multi level approvals completed, now we can approve|");
- if($req->status == "Approved"){
- $req->status = "Approved";
- }
- }else{
- //Current employee is an approver and we have another approval level left
- LogManager::getInstance()->debug($obj->id."|Current employee is an approver and we have another approval level left|");
- $sendApprovalEmailto = $nextAp->approver;
- if($req->status == "Approved"){
- $req->status = "Processing";
- }
- }
- }else{
- return $approvalResp;
- }
- }
-
- $oldStatus = $obj->status;
- $obj->status = $req->status;
-
- if($oldStatus == $req->status && $req->status != "Processing"){
- return new IceResponse(IceResponse::SUCCESS,"");
- }
-
-
- $ok = $obj->Save();
-
- if(!$ok){
- LogManager::getInstance()->info($obj->ErrorMsg());
- return new IceResponse(IceResponse::ERROR,"Error occurred while saving $itemName information. Please contact admin");
- }
-
-
- StatusChangeLogManager::getInstance()->addLog($class, $obj->id,
- BaseService::getInstance()->getCurrentUser()->id, $oldStatus, $req->status, "");
-
-
- $this->baseService->audit(IceConstants::AUDIT_ACTION, "$itemName status changed from:".$oldStatus." to:".$obj->status." id:".$obj->id);
-
- $currentEmpId = $this->getCurrentProfileId();
-
- if(!empty($currentEmpId)){
- $employee = $this->baseService->getElement('Employee',$currentEmpId);
-
- $notificationMsg = "Your $itemName has been $obj->status by ".$employee->first_name." ".$employee->last_name;
- if(!empty($req->reason)){
- $notificationMsg.=" (Note:".$req->reason.")";
- }
-
- $this->baseService->notificationManager->addNotification($obj->employee,$notificationMsg,'{"type":"url","url":"'.$this->getModuleTabUrl().'"}',$this->getModuleName(), null, false, true);
-
- }
-
- if(!empty($sendApprovalEmailto)){
- $employee = $this->baseService->getElement('Employee',BaseService::getInstance()->getCurrentProfileId());
-
- $notificationMsg = "You have been assigned ".$itemName." for approval by ".$employee->first_name." ".$employee->last_name;
-
-
- $this->baseService->notificationManager->addNotification($sendApprovalEmailto,$notificationMsg,'{"type":"url","url":"'.$this->getModuleApprovalTabUrl().'"}',$this->getModuleName(), null, false, true);
-
- }
-
-
- return new IceResponse(IceResponse::SUCCESS,"");
- }
-
-}
-
-
-abstract class ApproveModuleActionManager extends ApproveCommonActionManager{
-
- public abstract function getModelClass();
- public abstract function getItemName();
- public abstract function getModuleName();
- public abstract function getModuleTabUrl();
-
- public function cancel($req){
-
- $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
-
- $class = $this->getModelClass();
- $itemName = $this->getItemName();
- $obj = new $class();
- $obj->Load("id = ?",array($req->id));
- if($obj->id != $req->id){
- return new IceResponse(IceResponse::ERROR,"$itemName record not found");
- }
-
-
- if($this->user->user_level != 'Admin' && $this->getCurrentProfileId() != $obj->employee){
- return new IceResponse(IceResponse::ERROR,"Only an admin or owner of the $itemName can do this");
- }
-
- if($obj->status != 'Approved'){
- return new IceResponse(IceResponse::ERROR,"Only an approved $itemName can be cancelled");
- }
-
- $obj->status = 'Cancellation Requested';
- $ok = $obj->Save();
- if(!$ok){
- LogManager::getInstance()->error("Error occurred while cancelling the $itemName:".$obj->ErrorMsg());
- return new IceResponse(IceResponse::ERROR,"Error occurred while cancelling the $itemName. Please contact admin.");
- }
-
-
- $this->baseService->audit(IceConstants::AUDIT_ACTION, "Expense cancellation | start:".$obj->date_start."| end:".$obj->date_end);
- $notificationMsg = $employee->first_name." ".$employee->last_name." cancelled a expense. Visit expense management module to approve";
-
- $this->baseService->notificationManager->addNotification($employee->supervisor,$notificationMsg,'{"type":"url","url":"'.$this->getModuleTabUrl().'"}',
- $this->getModuleName(), null, false, true);
- return new IceResponse(IceResponse::SUCCESS,$obj);
- }
-}
-
-
-
-abstract class ApproveModel extends ICEHRM_Record {
-
- public function isMultiLevelApprovalsEnabled(){
- return false;
- }
-
- public function executePreSaveActions($obj){
- $preApprove = SettingsManager::getInstance()->getSetting($this->preApproveSettingName);
- $sendNotificationEmail = true;
- if(empty($obj->status)){
- if($preApprove == "1"){
- $obj->status = "Approved";
- $sendNotificationEmail = false;
- }else{
- $obj->status = "Pending";
- }
- }
-
- if($preApprove){
- return new IceResponse(IceResponse::SUCCESS,$obj);
- }
-
- $currentEmpId = BaseService::getInstance()->getCurrentProfileId();
-
- //Auto approve if the current user is an admin
-
- if(!empty($currentEmpId)){
- $employee = BaseService::getInstance()->getElement('Employee',$currentEmpId);
-
- if(!empty($employee->supervisor)) {
- $notificationMsg = "A new ".$this->notificationUnitName." has been added by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it";
-
- BaseService::getInstance()->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, null, false, $sendNotificationEmail);
- }else{
-
- $user = BaseService::getInstance()->getCurrentUser();
-
- if($user->user_level == "Admin"){
- //Auto approve
- $obj->status = "Approved";
- $notificationMsg = "Your ".$this->notificationUnitName." is auto approved since you are an administrator and do not have any supervisor assigned";
- BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, $user->id, false, $sendNotificationEmail);
- }else{
- //If the user do not have a supervisor, notify all admins
- $admins = BaseService::getInstance()->getAllAdmins();
- foreach($admins as $admin){
- $notificationMsg = "A new ".$this->notificationUnitName." has been added by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it. You are getting this notification since you are an administrator and the user do not have any supervisor assigned.";
- BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, $admin->id, false, $sendNotificationEmail);
- }
- }
-
-
- }
- }
-
- return new IceResponse(IceResponse::SUCCESS,$obj);
- }
-
- public function executePreUpdateActions($obj){
-
- $preApprove = SettingsManager::getInstance()->getSetting($this->preApproveSettingName);
- $sendNotificationEmail = true;
-
- $fieldsToCheck = $this->fieldsNeedToBeApproved();
-
- $travelRequest = new EmployeeTravelRecord();
- $travelRequest->Load('id = ?',array($obj->id));
-
- $needToApprove = false;
- if($preApprove != "1"){
- foreach($fieldsToCheck as $field){
- if($obj->$field != $travelRequest->$field) {
- $needToApprove = true;
- break;
- }
- }
- }else{
- $sendNotificationEmail = false;
- }
-
- if($preApprove){
- return new IceResponse(IceResponse::SUCCESS,$obj);
- }
-
- if($needToApprove && $obj->status != 'Pending'){
- $currentEmpId = BaseService::getInstance()->getCurrentProfileId();
-
- //Auto approve if the current user is an admin
-
- if(!empty($currentEmpId)){
- $employee = BaseService::getInstance()->getElement('Employee',$currentEmpId);
-
- if(!empty($employee->supervisor)) {
- $notificationMsg = $this->notificationUnitPrefix." ".$this->notificationUnitName." has been updated by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it";
-
- BaseService::getInstance()->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, null, false, $sendNotificationEmail);
- }else{
-
- $user = BaseService::getInstance()->getCurrentUser();
-
- if($user->user_level == "Admin"){
-
- }else{
- //If the user do not have a supervisor, notify all admins
- $admins = BaseService::getInstance()->getAllAdmins();
- foreach($admins as $admin){
- $notificationMsg = $this->notificationUnitPrefix." ".$this->notificationUnitName." request has been updated by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it. You are getting this notification since you are an administrator and the user do not have any supervisor assigned.";
- BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"g=admin&n=travel&m=admin_Employees"}', "Travel Module", $admin->id, false, $sendNotificationEmail);
- }
- }
-
-
- }
- }
- }
-
- return new IceResponse(IceResponse::SUCCESS,$obj);
- }
-
- public function executePostSaveActions($obj){
- $directAppr = ApprovalStatus::getInstance()->isDirectApproval($obj->employee);
-
- if(!$directAppr && $this->isMultiLevelApprovalsEnabled()){
- ApprovalStatus::getInstance()->initializeApprovalChain(get_called_class(),$obj->id);
- }
- }
-
-
- abstract public function getType();
-
-
- public function findApprovals($obj, $whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
- $currentEmployee = BaseService::getInstance()->getCurrentProfileId();
- $approveal = new EmployeeApproval();
- $approveals = $approveal->Find("type = ? and approver = ? and status = -1 and active = 1",array($this->getType(), $currentEmployee));
- $ids = array();
- foreach ($approveals as $appr){
-
- $ids[] = $appr->element;
- }
- $data = $obj->Find("id in (".implode(",",$ids).")",array());
-
- return $data;
- }
-}
-
-
diff --git a/src/classes/BaseService.php b/src/classes/BaseService.php
deleted file mode 100644
index aca15305..00000000
--- a/src/classes/BaseService.php
+++ /dev/null
@@ -1,1676 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-
-/**
- * BaseService class serves as the core logic for managing the application and for handling most
- * of the tasks related to retriving and saving data. This can be referred within any module using
- * BaseService::getInstance()
- *
-@class BaseService
- */
-
-class BaseService{
-
- var $nonDeletables = array();
- var $errros = array();
- public $userTables = array();
- var $currentUser = null;
- var $db = null;
- var $auditManager = null;
- var $notificationManager = null;
- var $settingsManager = null;
- var $fileFields = null;
- var $moduleManagers = null;
- var $emailSender = null;
- var $user = null;
- var $historyManagers = array();
- var $calculationHooks = array();
- var $customFieldManager = null;
-
- private static $me = null;
-
- private function __construct(){
-
- }
-
- /**
- * Get the only instance created for BaseService
- * @method getInstance
- * @return {BaseService} BaseService object
- */
-
- public static function getInstance(){
- if(empty(self::$me)){
- self::$me = new BaseService();
- }
-
- return self::$me;
- }
-
- /**
- * Get an array of objects from database
- * @method get
- * @param $table {String} model class name of the table to retive data (e.g for Users table model class name is User)
- * @param $mappingStr {String} a JSON string to specify fields of the $table should be mapped to other tables (e.g {"profile":["Profile","id","first_name+last_name"]} : this is how the profile field in Users table is mapped to Profile table. In this case users profile field will get filled by Profile first name and last name. The original value in User->profile field will get moved to User->profile_id)
- * @param $filterStr {String} a JSON string to specify the ordering of the items (e.g {"job_title":"2","department":"2"} - this will select only items having job_title = 2 and department = 2)
- * @param $orderBy {String} a string to specify the ordering (e.g in_time desc)
- * @param string $limit {String} a string to specify the limit (e.g limit 2)
- * @return {Array} an array of objects of type $table
- */
- public function get($table,$mappingStr = null, $filterStr = null, $orderBy = null, $limit = null){
-
- if(!empty($mappingStr)){
- $map = json_decode($mappingStr);
- }
- $obj = new $table();
-
- $this->checkSecureAccess("get",$obj);
-
- $query = "";
- $queryData = array();
- if(!empty($filterStr)){
- $filter = json_decode($filterStr, true);
-
-
- if(!empty($filter)){
- LogManager::getInstance()->debug("Building filter query");
- if(method_exists($obj,'getCustomFilterQuery')){
- LogManager::getInstance()->debug("Method: getCustomFilterQuery exists");
- $response = $obj->getCustomFilterQuery($filter);
- $query = $response[0];
- $queryData = $response[1];
- }else{
- LogManager::getInstance()->debug("Method: getCustomFilterQuery not found");
- $defaultFilterResp = $this->buildDefaultFilterQuery($filter);
- $query = $defaultFilterResp[0];
- $queryData = $defaultFilterResp[1];
- }
-
- }
- }
-
- if(empty($orderBy)){
- $orderBy = "";
- }else{
- $orderBy = " ORDER BY ".$orderBy;
- }
-
-
- if(in_array($table, $this->userTables)){
- $cemp = $this->getCurrentProfileId();
- if(!empty($cemp)){
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- LogManager::getInstance()->debug("Query: ".$signInMappingField." = ?".$query.$orderBy);
- LogManager::getInstance()->debug("Query Data: ".print_r(array_merge(array($cemp),$queryData),true));
- $list = $obj->Find($signInMappingField." = ?".$query.$orderBy, array_merge(array($cemp),$queryData));
- }else{
- $list = array();
- }
-
- }else{
- LogManager::getInstance()->debug("Query: "."1=1".$query.$orderBy);
- LogManager::getInstance()->debug("Query Data: ".print_r($queryData,true));
- $list = $obj->Find("1=1".$query.$orderBy,$queryData);
- }
-
- $newList = array();
- foreach($list as $listObj){
- $newList[] = $this->cleanUpAdoDB($listObj);
- }
-
- if(!empty($mappingStr) && count($map)>0){
- $list = $this->populateMapping($newList, $map);
- }
-
- return $list;
- }
-
- public function buildDefaultFilterQuery($filter){
- $query = "";
- $queryData = array();
- foreach($filter as $k=>$v){
- if(empty($v)){
- continue;
- }
- if(is_array($v)){
- if(empty($v)){
- continue;
- }
- $length = count($v);
- for($i=0; $i<$length; $i++){
-
-
- if($i == 0){
- $query.=" and (";
- }
-
- $query.=$k." like ?";
-
- if($i < $length -1){
- $query.=" or ";
- }else{
- $query.=")";
- }
- $queryData[] = "%".$v[$i]."%";
- }
-
- }else{
- if(!empty($v) && $v != 'NULL'){
- $query.=" and ".$k."=?";
- if($v == '__myid__'){
- $v = $this->getCurrentProfileId();
- }
- $queryData[] = $v;
- }
-
- }
-
- }
-
- return array($query, $queryData);
- }
-
-
- public function getSortingData($req){
- $data = array();
- $data['sorting'] = $req['sorting'];
-
- $columns = json_decode($req['cl'],true);
-
- $data['column'] = $columns[$req['iSortCol_0']];
-
- $data['order'] = $req['sSortDir_0'];
-
- return $data;
- }
-
- /**
- * An extention of get method for the use of data tables with ability to search
- * @method getData
- * @param $table {String} model class name of the table to retive data (e.g for Users table model class name is User)
- * @param $mappingStr {String} a JSON string to specify fields of the $table should be mapped to other tables (e.g {"profile":["Profile","id","first_name+last_name"]} : this is how the profile field in Users table is mapped to Profile table. In this case users profile field will get filled by Profile first name and last name. The original value in User->profile field will get moved to User->profile_id)
- * @param $filterStr {String} a JSON string to specify the ordering of the items (e.g {"job_title":"2","department":"2"} - this will select only items having job_title = 2 and department = 2)
- * @param $orderBy {String} a string to specify the ordering (e.g in_time desc)
- * @param string $limit {String} a string to specify the limit (e.g limit 2)
- * @param string $searchColumns {String} a JSON string to specify names of searchable fields (e.g ["id","employee_id","first_name","last_name","mobile_phone","department","gender","supervisor"])
- * @param string $searchTerm {String} a string to specify term to search
- * @param string $isSubOrdinates {Boolean} a Boolean to specify if we only need to retive subordinates. Any item is a subordinate item if the item has "profile" field defined and the value of "profile" field is equal to id of one of the subordinates of currenly logged in profile id. (Any Profile is a subordinate of curently logged in Profile if the supervisor field of a Profile is set to the id of currently logged in Profile)
- * @param string $skipProfileRestriction {Boolean} default if false - TODO - I'll explain this later
- * @return {Array} an array of objects of type $table
- */
- public function getData($table,$mappingStr = null, $filterStr = null, $orderBy = null, $limit = null, $searchColumns = null, $searchTerm = null, $isSubOrdinates = false, $skipProfileRestriction = false, $sortData = array()){
- if(!empty($mappingStr)){
- $map = json_decode($mappingStr);
- }
- $obj = new $table();
- $this->checkSecureAccess("get",$obj);
- $query = "";
- $queryData = array();
- if(!empty($filterStr)){
- $filter = json_decode($filterStr);
- if(!empty($filter)){
- LogManager::getInstance()->debug("Building filter query");
- if(method_exists($obj,'getCustomFilterQuery')){
- LogManager::getInstance()->debug("Method: getCustomFilterQuery exists");
- $response = $obj->getCustomFilterQuery($filter);
- $query = $response[0];
- $queryData = $response[1];
- }else{
- LogManager::getInstance()->debug("Method: getCustomFilterQuery not found");
- $defaultFilterResp = $this->buildDefaultFilterQuery($filter);
- $query = $defaultFilterResp[0];
- $queryData = $defaultFilterResp[1];
- }
-
-
- }
-
- LogManager::getInstance()->debug("Filter Query:".$query);
- LogManager::getInstance()->debug("Filter Query Data:".json_encode($queryData));
- }
-
-
- if(!empty($searchTerm) && !empty($searchColumns)){
- $searchColumnList = json_decode($searchColumns);
- $searchColumnList = array_diff($searchColumnList, $obj->getVirtualFields());
- if(!empty($searchColumnList)){
- $tempQuery = " and (";
- foreach($searchColumnList as $col){
-
- if($tempQuery != " and ("){
- $tempQuery.=" or ";
- }
- $tempQuery.=$col." like ?";
- $queryData[] = "%".$searchTerm."%";
- }
- $query.= $tempQuery.")";
- }
-
- }
-
- if(!empty($sortData) && $sortData['sorting']."" == "1" && isset($sortData['column'])){
-
- $orderBy = " ORDER BY ".$sortData['column']." ".$sortData['order'];
-
- }else{
- if(empty($orderBy)){
- $orderBy = "";
- }else{
- $orderBy = " ORDER BY ".$orderBy;
- }
- }
-
-
-
-
- if(empty($limit)){
- $limit = "";
- }
-
-
-
- if(in_array($table, $this->userTables) && !$skipProfileRestriction){
-
- $cemp = $this->getCurrentProfileId();
- if(!empty($cemp)){
- if(!$isSubOrdinates){
- array_unshift($queryData, $cemp);
- //$signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $signInMappingField = $obj->getUserOnlyMeAccessField();
- LogManager::getInstance()->debug("Data Load Query (x1):"."1=1".$signInMappingField." = ?".$query.$orderBy.$limit);
- LogManager::getInstance()->debug("Data Load Query Data (x1):".json_encode($queryData));
- $list = $obj->Find($signInMappingField." = ?".$query.$orderBy.$limit, $queryData);
- }else{
- $profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
- $subordinate = new $profileClass();
- $subordinates = $subordinate->Find("supervisor = ?",array($cemp));
- $cempObj = new Employee();
- $cempObj->Load("id = ?",array($cemp));
-
- if($obj->getUserOnlyMeAccessField() == 'id' &&
- SettingsManager::getInstance()->getSetting('System: Company Structure Managers Enabled') == 1 &&
- CompanyStructure::isHeadOfCompanyStructure($cempObj->department, $cemp)){
- if(empty($subordinates)){
- $subordinates = array();
- }
-
- $childCompaniesIds = array();
- if(SettingsManager::getInstance()->getSetting('System: Child Company Structure Managers Enabled') == '1'){
- $childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
- $childCompanies = $childCompaniesResp->getObject();
-
- foreach($childCompanies as $cc){
- $childCompaniesIds[] = $cc->id;
- }
- }else{
- $childCompaniesIds[] = $cempObj->department;
- }
-
-
-
- if(!empty($childCompaniesIds)) {
- $childStructureSubordinates = $subordinate->Find("department in (" . implode(',', $childCompaniesIds) . ") and id != ?", array($cemp));
- $subordinates = array_merge($subordinates, $childStructureSubordinates);
- }
- }
-
- $subordinatesIds = "";
- foreach($subordinates as $sub){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$sub->id;
- }
-
- if($obj->allowIndirectMapping()){
- $indeirectEmployees = $subordinate->Find("indirect_supervisors IS NOT NULL and indirect_supervisors <> '' and status = 'Active'", array());
- foreach($indeirectEmployees as $ie){
- $indirectSupervisors = json_decode($ie->indirect_supervisors, true);
- if(in_array($cemp, $indirectSupervisors)){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$ie->id;
- }
- }
- }
-
- $signInMappingField = $obj->getUserOnlyMeAccessField();
- LogManager::getInstance()->debug("Data Load Query (x2):"."1=1".$signInMappingField." in (".$subordinatesIds.") ".$query.$orderBy.$limit);
- LogManager::getInstance()->debug("Data Load Query Data (x2):".json_encode($queryData));
- if(!empty($subordinatesIds)) {
- $list = $obj->Find($signInMappingField . " in (" . $subordinatesIds . ") " . $query . $orderBy . $limit, $queryData);
- }else{
- $list = array();
- }
- }
-
- }else{
- $list = array();
- }
-
- }else if($isSubOrdinates){
- $cemp = $this->getCurrentProfileId();
- if(!empty($cemp)){
- $profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
- $subordinate = new $profileClass();
- $subordinates = $subordinate->Find("supervisor = ?",array($cemp));
- $cempObj = new Employee();
- $cempObj->Load("id = ?",array($cemp));
- if($obj->getUserOnlyMeAccessField() == 'id' &&
- SettingsManager::getInstance()->getSetting('System: Company Structure Managers Enabled') == 1 &&
- CompanyStructure::isHeadOfCompanyStructure($cempObj->department, $cemp)){
- if(empty($subordinates)){
- $subordinates = array();
- }
-
- $childCompaniesIds = array();
- if(SettingsManager::getInstance()->getSetting('System: Child Company Structure Managers Enabled') == '1'){
- $childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
- $childCompanies = $childCompaniesResp->getObject();
-
- foreach($childCompanies as $cc){
- $childCompaniesIds[] = $cc->id;
- }
- }else{
- $childCompaniesIds[] = $cempObj->department;
- }
-
-
- if(!empty($childCompaniesIds)) {
- $childStructureSubordinates = $subordinate->Find("department in (" . implode(',', $childCompaniesIds) . ") and id != ?", array($cemp));
- $subordinates = array_merge($subordinates, $childStructureSubordinates);
- }
- }
-
-
- $subordinatesIds = "";
- foreach($subordinates as $sub){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$sub->id;
- }
-
-
- if($obj->allowIndirectMapping()){
- $indeirectEmployees = $subordinate->Find("indirect_supervisors IS NOT NULL and indirect_supervisors <> '' and status = 'Active'", array());
- foreach($indeirectEmployees as $ie){
- $indirectSupervisors = json_decode($ie->indirect_supervisors, true);
- if(in_array($cemp, $indirectSupervisors)){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$ie->id;
- }
- }
- }
-
-
- $signInMappingField = $obj->getUserOnlyMeAccessField();
- LogManager::getInstance()->debug("Data Load Query (a1):".$signInMappingField." in (".$subordinatesIds.") ".$query.$orderBy.$limit);
- $list = $obj->Find($signInMappingField." in (".$subordinatesIds.") ".$query.$orderBy.$limit, $queryData);
- }else{
- $list = $obj->Find("1=1".$query.$orderBy.$limit,$queryData);
- }
- }else{
- $list = $obj->Find("1=1".$query.$orderBy.$limit,$queryData);
- }
-
- if(!$list){
- LogManager::getInstance()->debug("Get Data Error:".$obj->ErrorMsg());
- }
-
- LogManager::getInstance()->debug("Data Load Query:"."1=1".$query.$orderBy.$limit);
- LogManager::getInstance()->debug("Data Load Query Data:".json_encode($queryData));
-
- $processedList = array();
- foreach($list as $obj){
- $processedList[] = $this->cleanUpAdoDB($obj->postProcessGetData($obj));
- }
-
- $list = $processedList;
-
- if(!empty($mappingStr) && count($map)>0){
- $list = $this->populateMapping($list, $map);
- }
-
-
- return $list;
- }
-
-
- /**
- * Propulate field mappings for a given set of objects
- * @method populateMapping
- * @param $list {Array} array of model objects
- * @param $map {Array} an associative array of Mappings (e.g {"profile":["Profile","id","first_name+last_name"]})
- * @return {Array} array of populated objects
- */
-
- public function populateMapping($list,$map){
- $listNew = array();
- if(empty($list)){
- return $listNew;
- }
- foreach($list as $item){
- $item = $this->populateMappingItem($item, $map);
- $listNew[] = $item;
- }
- return $listNew;
- }
-
- public function populateMappingItem($item,$map){
- foreach($map as $k=>$v){
- $fTable = $v[0];
- $tObj = new $fTable();
- $tObj->Load($v[1]."= ?",array($item->$k));
-
- if($tObj->$v[1] == $item->$k){
- $v[2] = str_replace("+"," ",$v[2]);
- $values = explode(" ", $v[2]);
- if(count($values) == 1){
- $idField = $k."_id";
- $item->$idField = $item->$k;
- $item->$k = $tObj->$v[2];
-
- }else{
- $objVal = "";
- foreach($values as $v){
- if($objVal != ""){
- $objVal .= " ";
- }
- $objVal .= $tObj->$v;
- }
- $idField = $k."_id";
- $item->$idField = $item->$k;
- $item->$k = $objVal;
- }
- }
- }
- return $item;
- }
-
- /**
- * Retive one element from db
- * @method getElement
- * @param $table {String} model class name of the table to get data (e.g for Users table model class name is User)
- * @param $table {Integer} id of the item to get from $table
- * @param $mappingStr {String} a JSON string to specify fields of the $table should be mapped to other tables (e.g {"profile":["Profile","id","first_name+last_name"]} : this is how the profile field in Users table is mapped to Profile table. In this case users profile field will get filled by Profile first name and last name. The original value in User->profile field will get moved to User->profile_id)
- * @param $skipSecurityCheck {Boolean} if true won't check whether the user has access to that object
- * @return {Object} an object of type $table
- */
-
- public function getElement($table,$id,$mappingStr = null, $skipSecurityCheck = false){
- $obj = new $table();
-
-
- if(in_array($table, $this->userTables)){
- $cemp = $this->getCurrentProfileId();
- if(!empty($cemp)){
- $obj->Load("id = ?", array($id));
- }else{
- }
-
- }else{
- $obj->Load("id = ?",array($id));
- }
-
- if(!$skipSecurityCheck){
- $this->checkSecureAccess("element",$obj);
- }
-
- if(!empty($mappingStr)){
- $map = json_decode($mappingStr);
- }
- if($obj->id == $id){
- if(!empty($mappingStr)){
- foreach($map as $k=>$v){
- $fTable = $v[0];
- $tObj = new $fTable();
- $tObj->Load($v[1]."= ?",array($obj->$k));
- if($tObj->$v[1] == $obj->$k){
- $name = $k."_Name";
- $values = explode("+", $v[2]);
- if(count($values) == 1){
- $idField = $name."_id";
- $obj->$idField = $obj->$name;
- $obj->$name = $tObj->$v[2];
- }else{
- $objVal = "";
- foreach($values as $v){
- if($objVal != ""){
- $objVal .= " ";
- }
- $objVal .= $tObj->$v;
- }
- $idField = $name."_id";
- $obj->$idField = $obj->$name;
- $obj->$name = $objVal;
- }
- }
- }
- }
-
- //Add custom fields
- $customFields = $this->customFieldManager->getCustomFields($table,$obj->id);
- foreach ($customFields as $cf){
- $obj->{$cf->name} = $cf->value;
- }
-
-
- $obj = $obj->postProcessGetElement($obj);
- return $this->cleanUpAdoDB($obj->postProcessGetData($obj));
- }
- return null;
- }
-
- /**
- * Add an element to a given table
- * @method addElement
- * @param $table {String} model class name of the table to add data (e.g for Users table model class name is User)
- * @param $obj {Array} an associative array with field names and values for the new object. If the object id is not empty an existing object will be updated
- * @return {Object} newly added or updated element of type $table
- */
-
- public function addElement($table,$obj){
- $customFields = array();
- $isAdd = true;
- $ele = new $table();
- //LogManager::getInstance()->error("Obj:".json_encode($obj));
-
- if(class_exists("ProVersion")){
- $pro = new ProVersion();
- $subscriptionTables = $pro->getSubscriptionTables();
- if(in_array($table,$subscriptionTables)){
- $resp = $pro->subscriptionCheck($obj);
- if($resp->getStatus() != IceResponse::SUCCESS){
- return $resp;
- }
- }
- }
-
- if(!empty($obj['id'])){
- $isAdd = false;
- $ele->Load('id = ?',array($obj['id']));
- }
-
- $objectKeys = $ele->getObjectKeys();
-
- foreach($obj as $k=>$v){
- if($k == 'id' || $k == 't' || $k == 'a'){
- continue;
- }
- if($v == "NULL"){
- $v = null;
- }
- if(isset($objectKeys[$k])){
- $ele->$k = $v;
- }
-
- }
-
-
- if(empty($obj['id'])){
- if(in_array($table, $this->userTables)){
- $cemp = $this->getCurrentProfileId();
- if(!empty($cemp)){
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $ele->$signInMappingField = $cemp;
- }else{
- return new IceResponse(IceResponse::ERROR,"Profile id is not set");
- }
- }
- }
-
- $this->checkSecureAccess("save",$ele);
-
- $resp =$ele->validateSave($ele);
- if($resp->getStatus() != IceResponse::SUCCESS){
- return $resp;
- }
-
- if($isAdd){
- if(empty($ele->created)){
- $ele->created = date("Y-m-d H:i:s");
- }
- }
-
- if(empty($ele->updated)){
- $ele->updated = date("Y-m-d H:i:s");
- }
- if($isAdd){
- $ele = $ele->executePreSaveActions($ele)->getData();
- }else{
- $ele = $ele->executePreUpdateActions($ele)->getData();
- }
-
-
- $ok = $ele->Save();
-
-
-
- if(!$ok){
-
- $error = $ele->ErrorMsg();
-
- LogManager::getInstance()->info($error);
-
- if($isAdd){
- $this->audit(IceConstants::AUDIT_ERROR, "Error occured while adding an object to ".$table." \ Error: ".$error);
- }else{
- $this->audit(IceConstants::AUDIT_ERROR, "Error occured while editing an object in ".$table." [id:".$ele->id."] \ Error: ".$error);
- }
- return new IceResponse(IceResponse::ERROR,$this->findError($error));
- }
- LogManager::getInstance()->error("Element:".json_encode($ele));
- LogManager::getInstance()->error("Obj:".json_encode($obj));
- LogManager::getInstance()->error("Obj Keys:".json_encode($objectKeys));
- $customFields = $ele->getCustomFields($obj);
- LogManager::getInstance()->error("Custom:".json_encode($customFields));
- foreach($obj as $k=>$v){
- if(isset($customFields[$k])){
- $this->customFieldManager->addCustomField($table, $ele->id, $k, $v);
- }
- }
-
-
- if($isAdd){
- $ele->executePostSaveActions($ele);
- $this->audit(IceConstants::AUDIT_ADD, "Added an object to ".$table." [id:".$ele->id."]");
- }else{
- $ele->executePostUpdateActions($ele);
- $this->audit(IceConstants::AUDIT_EDIT, "Edited an object in ".$table." [id:".$ele->id."]");
- }
-
- return new IceResponse(IceResponse::SUCCESS,$ele);
- }
-
- /**
- * Delete an element if not the $table and $id is defined as a non deletable
- * @method deleteElement
- * @param $table {String} model class name of the table to delete data (e.g for Users table model class name is User)
- * @param $id {Integer} id of the item to delete
- * @return NULL
- */
- public function deleteElement($table,$id){
- $fileFields = $this->fileFields;
- $ele = new $table();
-
- $ele->Load('id = ?',array($id));
-
- $this->checkSecureAccess("delete",$ele);
-
- if(isset($this->nonDeletables[$table])){
- $nonDeletableTable = $this->nonDeletables[$table];
- if(!empty($nonDeletableTable)){
- foreach($nonDeletableTable as $field => $value){
- if($ele->$field == $value){
- return "This item can not be deleted";
- }
- }
- }
- }
-
- //Delete approval requests
- if(class_exists("EmployeeApproval")){
- $approvalRequest = new EmployeeApproval();
- $approvalRequests = $approvalRequest->Find("type = ? and element = ?",array($table, $id));
- foreach($approvalRequests as $approvalRequest){
- $approvalRequest->Delete();
- }
- }
-
-
- $ok = $ele->Delete();
- if(!$ok){
- $error = $ele->ErrorMsg();
- LogManager::getInstance()->info($error);
- return $this->findError($error);
- }else{
- //Backup
- if($table == "Profile"){
- $newObj = $this->cleanUpAdoDB($ele);
- $dataEntryBackup = new DataEntryBackup();
- $dataEntryBackup->tableType = $table;
- $dataEntryBackup->data = json_encode($newObj);
- $dataEntryBackup->Save();
- }
-
- $this->audit(IceConstants::AUDIT_DELETE, "Deleted an object in ".$table." [id:".$ele->id."]");
- }
-
-
-
- if(isset($fileFields[$table])){
- foreach($fileFields[$table] as $k=>$v){
- if(!empty($ele->$k)){
- FileService::getInstance()->deleteFileByField($ele->$k,$v);
- }
-
- }
- }
-
- return null;
- }
-
- /**
- * Get associative array of by retriving data from $table using $key field ans key and $value field as value. Mainly used for getting data for populating option lists of select boxes when adding and editing items
- * @method getFieldValues
- * @param $table {String} model class name of the table to get data (e.g for Users table model class name is User)
- * @param $key {String} key field name
- * @param $value {String} value field name (multiple fileds cam be concatinated using +) - e.g first_name+last_name
- * @param $method {String} if not empty, use this menthod to get only a selected set of objects from db instead of retriving all objects. This method should be defined in class $table and should return an array of objects of type $table
- * @return {Array} associative array
- */
-
- public function getFieldValues($table,$key,$value,$method,$methodParams = NULL){
-
- $values = explode("+", $value);
-
- $ret = array();
- $ele = new $table();
- if(!empty($method)){
- LogManager::getInstance()->debug("Call method for getFieldValues:".$method);
- LogManager::getInstance()->debug("Call method params for getFieldValues:".json_decode($methodParams));
- if(method_exists($ele,$method)){
- if(!empty($methodParams)){
- $list = $ele->$method(json_decode($methodParams));
- }else{
- $list = $ele->$method(array());
- }
- }else{
- LogManager::getInstance()->debug("Could not find method:".$method." in Class:".$table);
- $list = $ele->Find('1 = 1',array());
- }
-
- }else{
- $list = $ele->Find('1 = 1',array());
- }
-
- foreach($list as $obj){
- $obj = $this->cleanUpAdoDB($obj);
- if(count($values) == 1){
- $ret[$obj->$key] = $obj->$value;
- }else{
- $objVal = "";
- foreach($values as $v){
- if($objVal != ""){
- $objVal .= " ";
- }
- $objVal .= $obj->$v;
- }
- $ret[$obj->$key] = $objVal;
- }
- }
- return $ret;
- }
-
- public function setNonDeletables($table, $field, $value){
- if(!isset($this->nonDeletables[$table])){
- $this->nonDeletables[$table] = array();
- }
- $this->nonDeletables[$table][$field] = $value;
- }
-
- public function setSqlErrors($errros){
- $this->errros = $errros;
- }
-
- public function setUserTables($userTables){
- $this->userTables = $userTables;
- }
-
- /**
- * Set the current logged in user
- * @method setCurrentUser
- * @param $currentUser {User} the current logged in user
- * @return None
- */
-
- public function setCurrentUser($currentUser){
- $this->currentUser = $currentUser;
- }
-
-
- public function findError($error){
- foreach($this->errros as $k=>$v){
- if(strstr($error, $k)){
- return $v;
- }else{
- $keyParts = explode("|", $k);
- if(count($keyParts) >= 2){
- if(strstr($error, $keyParts[0]) && strstr($error, $keyParts[1])){
- return $v;
- }
- }
- }
- }
- return $error;
- }
-
- /**
- * Get the currently logged in user from session
- * @method getCurrentUser
- * @return {User} currently logged in user from session
- */
-
- public function getCurrentUser(){
- if(!empty($this->currentUser)){
- return $this->currentUser;
- }
- $user = SessionUtils::getSessionObject('user');
- return $user;
- }
-
- /**
- * Get the Profile id attached to currently logged in user. if the user is switched, this will return the id of switched Profile instead of currently logged in users Prifile id
- * @method getCurrentProfileId
- * @return {Integer}
- */
- public function getCurrentProfileId(){
- if (!class_exists('SessionUtils')) {
- include (APP_BASE_PATH."include.common.php");
- }
- $adminEmpId = SessionUtils::getSessionObject('admin_current_profile');
- $user = SessionUtils::getSessionObject('user');
- if(empty($adminEmpId) && !empty($user)){
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- return $user->$signInMappingField;
- }
- return $adminEmpId;
- }
-
-
- /**
- * Get User by profile id
- * @method getUserFromProfileId
- * @param $profileId {Integer} profile id
- * @return {User} user object
- */
-
- public function getUserFromProfileId($profileId){
- $user = new User();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $user->load($signInMappingField." = ?",array($profileId));
- if($user->$signInMappingField == $profileId){
- return $user;
- }
- return null;
- }
-
-
- public function setCurrentAdminProfile($profileId){
- if (!class_exists('SessionUtils')) {
- include (APP_BASE_PATH."include.common.php");
- }
-
- if($profileId == "-1"){
- SessionUtils::saveSessionObject('admin_current_profile',null);
- return;
- }
-
- if($this->currentUser->user_level == 'Admin'){
- SessionUtils::saveSessionObject('admin_current_profile',$profileId);
-
- }else if($this->currentUser->user_level == 'Manager'){
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $signInMappingFieldTable = ucfirst($signInMappingField);
- $subordinate = new $signInMappingFieldTable();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $subordinates = $subordinate->Find("supervisor = ?",array($this->currentUser->$signInMappingField));
- $subFound = false;
- foreach($subordinates as $sub){
- if($sub->id == $profileId){
- $subFound = true;
- break;
- }
- }
-
- if(!$subFound){
- return;
- }
-
- SessionUtils::saveSessionObject('admin_current_profile',$profileId);
-
- }
- }
-
- public function cleanUpAdoDB($obj){
- unset($obj->_table);
- unset($obj->_dbat);
- unset($obj->_tableat);
- unset($obj->_where);
- unset($obj->_saved);
- unset($obj->_lasterr);
- unset($obj->_original);
- unset($obj->foreignName);
-
- return $obj;
- }
-
- public function setDB($db){
- $this->db = $db;
- }
-
- public function getDB(){
- return $this->db;
- }
-
- public function checkSecureAccessOld($type,$object){
-
- $accessMatrix = array();
- if($this->currentUser->user_level == 'Admin'){
- $accessMatrix = $object->getAdminAccess();
- if (in_array($type, $accessMatrix)) {
- return true;
- }
- }else if($this->currentUser->user_level == 'Manager'){
- $accessMatrix = $object->getManagerAccess();
- if (in_array($type, $accessMatrix)) {
- return true;
- }else{
- $accessMatrix = $object->getUserOnlyMeAccess();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- if (in_array($type, $accessMatrix) && $_REQUEST[$object->getUserOnlyMeAccessField()] == $this->currentUser->$signInMappingField) {
- return true;
- }
-
- if (in_array($type, $accessMatrix)) {
-
- $field = $object->getUserOnlyMeAccessField();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- if($this->currentUser->$signInMappingField."" == $object->$field){
- return true;
- }
-
- }
- }
-
- }else{
- $accessMatrix = $object->getUserAccess();
- if (in_array($type, $accessMatrix)) {
- return true;
- }else{
- $accessMatrix = $object->getUserOnlyMeAccess();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- if (in_array($type, $accessMatrix) && $_REQUEST[$object->getUserOnlyMeAccessField()] == $this->currentUser->$signInMappingField) {
- return true;
- }
-
- if (in_array($type, $accessMatrix)) {
-
- $field = $object->getUserOnlyMeAccessField();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- if($this->currentUser->$signInMappingField."" == $object->$field){
- return true;
- }
-
- }
- }
- }
-
- $ret['status'] = "ERROR";
- $ret['message'] = "Access violation";
- echo json_encode($ret);
- exit();
- }
-
- /**
- * Use user level security functions defined in model classes to check whether a given action type is allowed to be executed by the current user on a given object
- * @method checkSecureAccess
- * @param $type {String} Action type
- * @param $object {Object} object to test access
- * @return {Boolen} true or exit
- */
-
- public function checkSecureAccess($type,$object){
-
- if(!empty($this->currentUser->user_roles)){
- return true;
- }
-
- $accessMatrix = array();
-
- //Construct permission method
- $permMethod = "get".$this->currentUser->user_level."Access";
- if(method_exists($object,$permMethod)){
- $accessMatrix = $object->$permMethod();
- }else{
- $accessMatrix = $object->getDefaultAccessLevel();
- }
-
- if (in_array($type, $accessMatrix)) {
- //The user has required permission, so return true
- return true;
- }else{
- //Now we need to check whther the user has access to his own records
- $accessMatrix = $object->getUserOnlyMeAccess();
-
- $userOnlyMeAccessRequestField = $object->getUserOnlyMeAccessRequestField();
-
- //This will check whether user can access his own records using a value in request
- if(isset($_REQUEST[$object->getUserOnlyMeAccessField()]) && isset($this->currentUser->$userOnlyMeAccessRequestField)){
- if (in_array($type, $accessMatrix) && $_REQUEST[$object->getUserOnlyMeAccessField()] == $this->currentUser->$userOnlyMeAccessRequestField) {
- return true;
- }
- }
-
- //This will check whether user can access his own records using a value in requested object
- if (in_array($type, $accessMatrix)) {
- $field = $object->getUserOnlyMeAccessField();
- if($this->currentUser->$userOnlyMeAccessRequestField == $object->$field){
- return true;
- }
-
- }
- }
-
- $ret['status'] = "ERROR";
- $ret['message'] = "Access violation";
- echo json_encode($ret);
- exit();
- }
-
-
-
- public function getInstanceId(){
- $settings = new Setting();
- $settings->Load("name = ?",array("Instance : ID"));
-
- if($settings->name != "Instance : ID" || empty($settings->value)){
- $settings->value = md5(time());
- $settings->name = "Instance : ID";
- $settings->Save();
- }
-
- return $settings->value;
- }
-
- public function setInstanceKey($key){
- $settings = new Setting();
- $settings->Load("name = ?",array("Instance: Key"));
- if($settings->name != "Instance: Key"){
- $settings->name = "Instance: Key";
-
- }
- $settings->value = $key;
- $settings->Save();
- }
-
- public function getInstanceKey(){
- $settings = new Setting();
- $settings->Load("name = ?",array("Instance: Key"));
- if($settings->name != "Instance: Key"){
- return null;
- }
- return $settings->value;
- }
-
- public function validateInstance(){
- $instanceId = $this->getInstanceId();
- if(empty($instanceId)){
- return true;
- }
-
- $key = $this->getInstanceKey();
-
- if(empty($key)){
- return false;
- }
-
- $data = AesCtr::decrypt($key, $instanceId, 256);
- $arr = explode("|",$data);
- if($arr[0] == KEY_PREFIX && $arr[1] == $instanceId){
- return true;
- }
-
- return false;
- }
-
- public function loadModulePermissions($group, $name, $userLevel){
- $module = new Module();
- $module->Load("update_path = ?",array($group.">".$name));
-
- $arr = array();
- $arr['user'] = json_decode($module->user_levels,true);
- $arr['user_roles'] = !empty($module->user_roles)?json_decode($module->user_roles,true):array();
-
-
- $permission = new Permission();
- $modulePerms = $permission->Find("module_id = ? and user_level = ?",array($module->id,$userLevel));
-
-
- $perms = array();
- foreach($modulePerms as $p){
- $perms[$p->permission] = $p->value;
- }
-
- $arr['perm'] = $perms;
-
- return $arr;
- }
-
- public function isModuleAllowedForUser($moduleManagerObj){
- $moduleObject = $moduleManagerObj->getModuleObject();
-
- //Check if the module is disabled
- if($moduleObject['status'] == 'Disabled'){
- return false;
- }
-
- //Check if user has permissions to this module
- //Check Module Permissions
- $modulePermissions = BaseService::getInstance()->loadModulePermissions($moduleManagerObj->getModuleType(), $moduleObject['name'],BaseService::getInstance()->getCurrentUser()->user_level);
-
-
- if(!in_array(BaseService::getInstance()->getCurrentUser()->user_level, $modulePermissions['user'])){
-
- if(!empty(BaseService::getInstance()->getCurrentUser()->user_roles)){
- $userRoles = json_decode(BaseService::getInstance()->getCurrentUser()->user_roles,true);
- }else{
- $userRoles = array();
- }
- $commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles);
- if(empty($commonRoles)){
- return false;
- }
-
- }
-
- return true;
-
- }
-
- public function isModuleAllowedForGivenUser($moduleManagerObj, $user){
- $moduleObject = $moduleManagerObj->getModuleObject();
-
- //Check if the module is disabled
- if($moduleObject['status'] == 'Disabled'){
- return false;
- }
-
- //Check if user has permissions to this module
- //Check Module Permissions
- $modulePermissions = BaseService::getInstance()->loadModulePermissions($moduleManagerObj->getModuleType(), $moduleObject['name'],$user->user_level);
-
-
- if(!in_array($user->user_level, $modulePermissions['user'])){
-
- if(!empty($user->user_roles)){
- $userRoles = json_decode($user->user_roles,true);
- }else{
- $userRoles = array();
- }
- $commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles);
- if(empty($commonRoles)){
- return false;
- }
-
- }
-
- return true;
-
- }
-
- public function getGAKey(){
- return SettingsManager::getInstance()->getSetting('Analytics: Google Key');
- }
-
- /**
- * Set the audit manager
- * @method setAuditManager
- * @param $auditManager {AuditManager}
- */
-
- public function setAuditManager($auditManager){
- $this->auditManager = $auditManager;
- }
-
- /**
- * Set the NotificationManager
- * @method setNotificationManager
- * @param $notificationManager {NotificationManager}
- */
-
- public function setNotificationManager($notificationManager){
- $this->notificationManager = $notificationManager;
- }
-
- /**
- * Set the SettingsManager
- * @method setSettingsManager
- * @param $settingsManager {SettingsManager}
- */
-
- public function setSettingsManager($settingsManager){
- $this->settingsManager = $settingsManager;
- }
-
- public function setFileFields($fileFields){
- $this->fileFields = $fileFields;
- }
-
- public function audit($type, $data){
- if(!empty($this->auditManager)){
- $this->auditManager->addAudit($type, $data);
- }
- }
-
- public function fixJSON($json){
- $noJSONRequests = SettingsManager::getInstance()->getSetting("System: Do not pass JSON in request");
- if($noJSONRequests."" == "1"){
- $json = str_replace("|",'"',$json);
- }
- return $json;
- }
-
- public function addModuleManager($moduleManager){
- if(empty($this->moduleManagers)){
- $this->moduleManagers = array();
- }
- $moduleObject = $moduleManager->getModuleObject();
- $this->moduleManagers[$moduleManager->getModuleType()."_".$moduleObject['name']] = $moduleManager;
- }
-
- public function getModuleManagers(){
- return array_values($this->moduleManagers);
- }
-
- public function getModuleManagerNames(){
- $keys = array_keys($this->moduleManagers);
- $arr = array();
- foreach($keys as $key){
- $arr[$key] = 1;
- }
-
- return $arr;
- }
-
- public function getModuleManager($type, $name){
- return $this->moduleManagers[$type."_".$name];
- }
-
- public function setEmailSender($emailSender){
- $this->emailSender = $emailSender;
- }
-
- public function getEmailSender(){
- return $this->emailSender;
- }
-
- public function getFieldNameMappings($type){
- $fieldNameMap = new FieldNameMapping();
- $data = $fieldNameMap->Find("type = ?",array($type));
- return $data;
- }
-
- public function getCustomFields($type){
- $customField = new CustomField();
- $data = $customField->Find("type = ? and display = ?",array($type,'Form'));
- return $data;
- }
-
- public function getAllAdmins(){
- $user = new User();
- $admins = $user->Find('user_level = ?',array('Admin'));
- return $admins;
- }
-
- public function getCurrentEmployeeTimeZone(){
- $cemp = $this->getCurrentProfileId();
- if(empty($cemp)){
- return NULL;
- }
- $emp = new Employee();
- $emp->Load("id = ?",array($cemp));
- if(empty($emp->id) || empty($emp->department)){
- return NULL;
- }
-
- $dept = new CompanyStructure();
- $dept->Load("id = ?",array($emp->department));
-
- return $dept->timezone;
-
- }
-
- public function setupHistoryManager($type, $historyManager){
- $this->historyManagers[$type] = $historyManager;
- }
-
- public function addHistoryItem($historyManagerType, $type, $refId , $field, $oldVal, $newVal){
- if(isset($this->historyManagers[$historyManagerType])){
- return $this->historyManagers[$historyManagerType]->addHistory($type, $refId , $field, $oldVal, $newVal);
- }
- return false;
- }
-
- public function getItemFromCache($class, $id){
- $data = MemcacheService::getInstance()->get($class."-".$id);
- if($data !== false){
- return unserialize($data);
- }
-
- $obj = new $class();
- $obj->Load("id = ?",array($id));
- if($obj->id != $id){
- return null;
- }
-
- MemcacheService::getInstance()->set($class."-".$id, serialize($obj), 10 * 60);
-
- return $obj;
-
- }
-
- public function addCalculationHook($code, $name, $class, $method){
- $calcualtionHook = new CalculationHook();
- $calcualtionHook->code = $code;
- $calcualtionHook->name = $name;
- $calcualtionHook->class = $class;
- $calcualtionHook->method = $method;
- $this->calculationHooks[$code] = $calcualtionHook;
- }
-
- public function getCalculationHooks(){
- return array_values($this->calculationHooks);
- }
-
- public function getCalculationHook($code){
- return $this->calculationHooks[$code];
- }
-
- public function executeCalculationHook($parameters, $code = NULL){
- $ch = BaseService::getInstance()->getCalculationHook($code);
-
- if(empty($ch->code)){
- return null;
- }
- $class = $ch->class;
- return call_user_func_array(array(new $class(), $ch->method), $parameters);
- }
-
- public function cleanNonUTFChar($obj){
- $regex = <<<'END'
-/
- (
- (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx
- | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
- | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
- | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
- ){1,100} # ...one or more times
- )
-| . # anything else
-/x
-END;
- if(is_string($obj)){
- return preg_replace($regex, '$1', $obj);
- }else{
-
- foreach($obj as $key => $val){
-
-
- $obj->$key = preg_replace($regex, '$1', $val);
- }
- return $obj;
- }
-
- }
-
- public function setCustomFieldManager($customFieldManager){
- $this->customFieldManager = $customFieldManager;
- }
-
- public function getCustomFieldManager(){
- return $this->customFieldManager;
- }
-
-
-}
-
-class CustomFieldManager {
- public function addCustomField($type, $id, $name, $value){
- $customFieldValue = new CustomFieldValue();
- $customFieldValue->Load("type = ? and name = ? and object_id = ?",
- array($type, $name, $id));
-
- if($customFieldValue->object_id != $id){
- $customFieldValue->name = $name;
- $customFieldValue->object_id = $id;
- $customFieldValue->type = $type;
- $customFieldValue->created = date("Y-md-d H:i:s");
- }
-
- $customFieldValue->value = $value;
- $customFieldValue->updated = date("Y-md-d H:i:s");
- $customFieldValue->Save();
- }
-
- public function getCustomFields($type, $id){
- $customFieldValue = new CustomFieldValue();
- $list = $customFieldValue->Find("type = ? and object_id = ?",
- array($type, $id));
-
- return $list;
- }
-
- public function enrichObjectCustomFields($table, $object){
- $customFieldsList = BaseService::getInstance()->getCustomFields($table);
- $customFieldsListOrdered = array();
- $customFields = array();
- foreach($customFieldsList as $cf){
- $customFields[$cf->name] = $cf;
- }
-
- $customFieldValues = $this->getCustomFields('Employee',$object->id);
- $object->customFields = array();
- foreach ($customFieldValues as $cf){
-
- if(!isset($customFields[$cf->name])){
- continue;
- }
-
- $type = $customFields[$cf->name]->field_type;
- $label = $customFields[$cf->name]->field_label;
- $order = $customFields[$cf->name]->display_order;
- $data = $customFields[$cf->name]->data;
- $section = $customFields[$cf->name]->display_section;
-
-
-
- $customFieldsListOrdered[] = $order;
-
- if($type == "text" || $type == "textarea"){
- $object->customFields[$label] = $cf->value;
-
- }else if($type == 'select' || $type == 'select2'){
- $options = $customFields[$cf->name]->field_options;
- if(empty($options)){
- continue;
- }
-
- $jsonOptions = json_decode($options);
- foreach($jsonOptions as $option){
- if($option->value == $cf->value){
- $object->customFields[$label] = $option->label;
- }
- }
-
- }else if($type == 'select2multi'){
- $resArr = array();
- $options = $customFields[$cf->name]->field_options;
- if(empty($options) || empty($cf->value)){
- continue;
- }
- $jsonOptions = json_decode($options);
- $jsonOptionsKeys = array();
- foreach($jsonOptions as $option){
- $jsonOptionsKeys[$option->value] = $option->label;
- }
-
- $valueList = json_decode($cf->value,true);
- foreach($valueList as $val){
- if(!isset($jsonOptionsKeys[$val])){
- $resArr[] = $val;
- }else{
- $resArr[] = $jsonOptionsKeys[$val];
- }
- }
-
- $object->customFields[$label] = implode('
', $resArr);
-
- }else if($type == "date"){
- if(!empty($cf->value)){
- $object->customFields[$label] = $cf->value;
- }else{
- $object->customFields[$label] = date("F j, Y",strtotime($cf->value));
- }
-
- }else if($type == "datetime"){
- if(!empty($cf->value)){
- $object->customFields[$label] = $cf->value;
- }else{
- $object->customFields[$label] = date("F j, Y, g:i a",strtotime($cf->value));
- }
- }else if($type == "time"){
- if(!empty($cf->value)){
- $object->customFields[$label] = $cf->value;
- }else{
- $object->customFields[$label] = date("g:i a",strtotime($cf->value));
- }
- }
-
- $object->customFields[$label] = array($object->customFields[$label], $section);
- }
- array_multisort($customFieldsListOrdered, SORT_DESC, SORT_NUMERIC, $object->customFields);
-
- return $object;
-
- }
-
-}
-
-
-class MemcacheService {
-
- private $connection = null;
- public static $openConnections = array();
- private static $me = null;
-
- private function __construct(){}
-
- public static function getInstance(){
- if(self::$me == null){
- self::$me = new MemcacheService();
- }
-
- return self::$me;
- }
-
-
- private function connect() {
-
- if($this->connection == null) {
- $this->connection = new Memcached();
- $this->connection->addServer(MEMCACHE_HOST, MEMCACHE_PORT);
-
- if(!$this->isConnected()) {
- $this->connection = null;
- } else {
- self::$openConnections[] = $this->connection;
- }
- }
- return $this->connection;
- }
-
- private function isConnected(){
- $statuses = $this->connection->getStats();
- return isset($statuses[$this->memcacheHost.":".$this->memcachePort]);
- }
-
- private function compressKey($key) {
- return crc32(APP_DB.$key).md5(CLIENT_NAME);
- }
-
- public function set($key, $value, $expiry = 3600) {
- if(!class_exists('Memcached')){
- return false;
- }
- $key = $this->compressKey($key);
- $memcache = $this->connect();
-
- if (!empty($memcache) && $this->isConnected()) {
- $ok = $memcache->set($key, $value, time() + $expiry);
- if(!$ok) {
- return false;
- }
- return true;
- }
- return false;
- }
-
-
- public function get($key) {
- if(!class_exists('Memcached')){
- return false;
- }
- $key = $this->compressKey($key);
- $memcache = $this->connect();
- if(!empty($memcache) && $this->isConnected()) {
- return $memcache->get($key);
- } else {
- return false;
- }
- }
-
- public function close() {
- if($this->connection != null) {
- if($this->isConnected()) {
- $this->connection->quit();
- }
- $this->connection = null;
- }
- }
-}
-
-
-
-class IceConstants{
- const AUDIT_AUTHENTICATION = "Authentication";
- const AUDIT_ADD = "Add";
- const AUDIT_EDIT = "Edit";
- const AUDIT_DELETE = "Delete";
- const AUDIT_ERROR = "Error";
- const AUDIT_ACTION = "User Action";
-
- const NOTIFICATION_LEAVE = "Leave Module";
- const NOTIFICATION_TIMESHEET = "Time Module";
- const NOTIFICATION_TRAINING = "Training Module";
-}
-
-interface HistoryManager{
- public function addHistory($type, $refId, $field, $oldValue, $newValue);
-}
\ No newline at end of file
diff --git a/src/classes/CronUtils.php b/src/classes/CronUtils.php
deleted file mode 100644
index 7117109c..00000000
--- a/src/classes/CronUtils.php
+++ /dev/null
@@ -1,205 +0,0 @@
-clientBasePath = $clientBasePath."/";
- $this->cronFile = $cronFile;
- }
-
- public static function getInstance($clientBasePath, $cronFile){
- if(empty(self::$me)){
- self::$me = new CronUtils($clientBasePath, $cronFile);
- }
- return self::$me;
- }
-
-
- public function run(){
- $ams = scandir($this->clientBasePath);
- $count = 0;
- foreach($ams as $am){
- if(is_dir($this->clientBasePath.$am) && $am != '.' && $am != '..'){
- $command = "php ".$this->clientBasePath.$am."/".$this->cronFile;
- if(file_exists($this->clientBasePath.$am."/".$this->cronFile)){
-
- echo "Run:".$command."\r\n";
- error_log("Run:".$command);
- passthru($command, $res);
- echo "Result :".$res."\r\n";
- error_log("Result :".$res);
-
- $count++;
- if($count > 25){
- sleep(1);
- $count = 0;
- }
- }else{
- echo "Error (File Not Found):".$command."\r\n";
- error_log("Error (File Not Found):".$command);
- }
-
- }
- }
- }
-}
-
-
-class IceCron{
-
- const MINUTELY = "Minutely";
- const HOURLY = "Hourly";
- const DAILY = "Daily";
- const WEEKLY = "Weekly";
- const MONTHLY = "Monthly";
- const YEARLY = "Yearly";
-
- private $cron;
-
- public function __construct($cron){
- $this->cron = $cron;
- }
-
- public function isRunNow(){
- LogManager::getInstance()->debug("Cron ".print_r($this->cron,true));
- $lastRunTime = $this->cron->lastrun;
- if(empty($lastRunTime)){
- LogManager::getInstance()->debug("Cron ".$this->cron->name." is running since last run time is empty");
- return true;
- }
-
- $type = $this->cron->type;
- $frequency = intval($this->cron->frequency);
- $time = intval($this->cron->time);
-
- if(empty($frequency) || !is_int($frequency)){
- LogManager::getInstance()->debug("Cron ".$this->cron->name." is not running since frequency is not an integer");
- return false;
- }
-
-
- if($type == self::MINUTELY){
-
- $diff = (strtotime("now") - strtotime($lastRunTime));
- if(empty($this->time) || !is_int($time)){
- if($diff > 60){
- return true;
- }
- }else{
- if($diff > 60 * $time){
- return true;
- }
- }
-
-
- }else if($type == self::HOURLY){
- if(empty($time) || !is_int($time)){
-
- if(date('H') != date('H',strtotime($lastRunTime))){
- return true;
- }
- }else{
- if(intval(date('i')) <= intval($time) && date('H') != date('H',strtotime($lastRunTime))){
- return true;
- }
- }
- }else if($type == self::DAILY){
- if(empty($time) || !is_int($time)){
-
- if(date('d') != date('d',strtotime($lastRunTime))){
- return true;
- }
- }else{
- if(intval(date('H')) >= intval($time) && date('d') != date('d',strtotime($lastRunTime))){
- return true;
- }
- }
- }else if($type == self::MONTHLY){
- if(empty($time) || !is_int($time)){
-
- if(date('m') != date('m',strtotime($lastRunTime))){
- return true;
- }
- }else{
- if(intval(date('d')) >= intval($time) && date('m') != date('m',strtotime($lastRunTime))){
- return true;
- }
- }
- }else if($type == self::YEARLY){
- if(empty($time) || !is_int($time)){
- if(date('Y') != date('Y',strtotime($lastRunTime))){
- return true;
- }
- }else{
- if(intval(date('m')) >= intval($time) && date('Y') != date('Y',strtotime($lastRunTime))){
- return true;
- }
- }
- }
-
- return false;
- }
-
- public function execute(){
- $class = $this->cron->class;
- $obj = new $class();
- $obj->execute($this->cron);
- $this->cronCompleted();
- }
-
-
- private function cronCompleted(){
- $this->cron->lastrun = date("Y-m-d H:i:s");
- $ok = $this->cron->Save();
- if(!$ok){
- LogManager::getInstance()->error("Error saving cron due to :".$this->cron->ErrorMsg());
- }
- }
-
-}
-
-interface IceTask{
- public function execute($cron);
-}
-
-abstract class EmailIceTask implements IceTask{
- public abstract function execute($cron);
-
- public function sendEmployeeEmails($emailList, $subject){
-
-
- foreach($emailList as $employeeId => $emailData){
- $ccList = array();
- if(SettingsManager::getInstance()->getSetting('Notifications: Copy Document Expiry Emails to Manager') == '1'){
- $employee = new Employee();
- $employee->Load("id = ?",array($employeeId));
- if(!empty($employee->supervisor)){
- $supperuser = BaseService::getInstance()->getUserFromProfileId($employee->supervisor);
- if(!empty($supperuser)){
- $ccList[] = $supperuser->email;
- }
- }
- }
- $user = BaseService::getInstance()->getUserFromProfileId($employeeId);
- if(!empty($user) && !empty($user->email)){
- $email = new IceEmail();
- $email->subject = $subject;
- $email->toEmail = $user->email;
- $email->template = $emailData;
- $email->params = '[]';
- $email->cclist = json_encode($ccList);
- $email->bcclist = '[]';
- $email->status = 'Pending';
- $email->created = date('Y-m-d H:i:s');
- $email->updated = date('Y-m-d H:i:s');
- $ok = $email->Save();
- if(!$ok){
- LogManager::getInstance()->error("Error Saving Email: ".$email->ErrorMsg());
- }
- }
- }
- }
-}
diff --git a/src/classes/EmailSender.php b/src/classes/EmailSender.php
deleted file mode 100644
index 3006acf0..00000000
--- a/src/classes/EmailSender.php
+++ /dev/null
@@ -1,326 +0,0 @@
-settings = $settings;
- }
-
- public function sendEmailFromNotification($notification){
- $toEmail = null;
- $user = new User();
- $user->Load("id = ?",array($notification->toUser));
-
- if(!empty($user->email)){
- $name = "User";
- $employee = new Employee();
- $employee->Load("id = ?",array($user->employee));
- if($employee->id == $user->employee && !empty($employee->id)){
- $name = $employee->first_name;
- }
-
- $action = json_decode($notification->action);
-
- $emailBody = file_get_contents(APP_BASE_PATH.'/templates/email/notificationEmail.html');
- $emailBody = str_replace("#_user_#", $name, $emailBody);
- $emailBody = str_replace("#_message_#", $notification->message, $emailBody);
- if($action->type == "url"){
- $emailBody = str_replace("#_url_#", CLIENT_BASE_URL."?".$action->url, $emailBody);
- }
- $this->sendEmail('IceHrm Notification from '.$notification->type,
- $user->email,
- $emailBody,
- array(),
- array(),
- array()
- );
- }
- }
-
- public function sendEmailFromDB($email){
- $params = array();
- if(!empty($email->params)){
- $params = json_decode($email->params, true);
- }
-
- $cclist = array();
- if(!empty($email->cclist)){
- $cclist = json_decode($email->cclist, true);
- }
-
- $bcclist = array();
- if(!empty($email->bcclist)){
- $bcclist = json_decode($email->bcclist, true);
- }
-
- $resp = $this->sendEmail($email->subject, $email->toEmail, $email->template, $params, $cclist, $bcclist);
- }
-
- public function sendEmail($subject, $toEmail, $template, $params, $ccList = array(), $bccList = array()){
-
- $body = $template;
-
- foreach($params as $k=>$v){
- $body = str_replace("#_".$k."_#", $v, $body);
- }
-
- $fromEmail = APP_NAME." <".$this->settings->getSetting("Email: Email From").">";
-
-
- //Convert to an html email
- $emailBody = file_get_contents(APP_BASE_PATH.'/templates/email/emailBody.html');
-
- $emailBody = str_replace("#_emailBody_#", $body, $emailBody);
- $emailBody = str_replace("#_logourl_#",
- UIManager::getInstance()->getCompanyLogoUrl()
- , $emailBody);
-
- $user = new User();
- $user->load("username = ?",array('admin'));
-
- if(empty($user->id)){
- $users = $user->Find("user_level = ?",array('Admin'));
- $user = $users[0];
- }
-
- $emailBody = str_replace("#_adminEmail_#", $user->email, $emailBody);
- $emailBody = str_replace("#_url_#", CLIENT_BASE_URL, $emailBody);
- foreach($params as $k=>$v){
- $emailBody = str_replace("#_".$k."_#", $v, $emailBody);
- }
-
- $this->sendMail($subject, $emailBody, $toEmail, $fromEmail, $user->email, $ccList, $bccList);
- }
-
- public function sendEmailWithoutWrap($subject, $toEmail, $template, $params, $ccList = array(), $bccList = array()){
-
- $body = $template;
-
- foreach($params as $k=>$v){
- $body = str_replace("#_".$k."_#", $v, $body);
- }
-
- $fromEmail = APP_NAME." <".$this->settings->getSetting("Email: Email From").">";
-
-
- //Convert to an html email
- $emailBody = $body;
- $emailBody = str_replace("#_logourl_#",
- UIManager::getInstance()->getCompanyLogoUrl()
- , $emailBody);
-
- $user = new User();
- $user->load("username = ?",array('admin'));
-
- if(empty($user->id)){
- $users = $user->Find("user_level = ?",array('Admin'));
- $user = $users[0];
- }
-
- $emailBody = str_replace("#_adminEmail_#", $user->email, $emailBody);
- $emailBody = str_replace("#_url_#", CLIENT_BASE_URL, $emailBody);
- foreach($params as $k=>$v){
- $emailBody = str_replace("#_".$k."_#", $v, $emailBody);
- }
-
- $this->sendMail($subject, $emailBody, $toEmail, $fromEmail, $user->email, $ccList, $bccList);
- }
-
- protected abstract function sendMail($subject, $body, $toEmail, $fromEmail, $replyToEmail = null, $ccList = array(), $bccList = array());
-
- public function sendResetPasswordEmail($emailOrUserId){
- $user = new User();
- $user->Load("email = ?",array($emailOrUserId));
- if(empty($user->id)){
- $user = new User();
- $user->Load("username = ?",array($emailOrUserId));
- if(empty($user->id)){
- return false;
- }
- }
-
- $params = array();
- //$params['user'] = $user->first_name." ".$user->last_name;
- $params['url'] = CLIENT_BASE_URL;
-
- $newPassHash = array();
- $newPassHash["CLIENT_NAME"] = CLIENT_NAME;
- $newPassHash["oldpass"] = $user->password;
- $newPassHash["email"] = $user->email;
- $newPassHash["time"] = time();
- $json = json_encode($newPassHash);
-
- $encJson = AesCtr::encrypt($json, $user->password, 256);
- $encJson = urlencode($user->id."-".$encJson);
- $params['passurl'] = CLIENT_BASE_URL."service.php?a=rsp&key=".$encJson;
-
- $emailBody = file_get_contents(APP_BASE_PATH.'/templates/email/passwordReset.html');
-
- $this->sendEmail("[".APP_NAME."] Password Change Request", $user->email, $emailBody, $params);
- return true;
- }
-
-}
-
-
-class SNSEmailSender extends EmailSender{
- var $ses = null;
- public function __construct($settings){
- parent::__construct($settings);
- $arr = array(
- 'key' => $this->settings->getSetting('Email: Amazon Access Key ID'),
- 'secret' => $this->settings->getSetting('Email: Amazon Secret Access Key'),
- 'region' => AWS_REGION
- );
- //$this->ses = new AmazonSES($arr);
- $this->ses = SesClient::factory($arr);
- }
-
- protected function sendMail($subject, $body, $toEmail, $fromEmail, $replyToEmail = null, $ccList = array(), $bccList = array()) {
-
- if(empty($replyToEmail)){
- $replyToEmail = $fromEmail;
- }
-
- LogManager::getInstance()->info("Sending email to: ".$toEmail."/ from: ".$fromEmail);
-
- $toArray = array('ToAddresses' => array($toEmail),
- 'CcAddresses' => $ccList,
- 'BccAddresses' => $bccList);
- $message = array(
- 'Subject' => array(
- 'Data' => $subject,
- 'Charset' => 'UTF-8'
- ),
- 'Body' => array(
- 'Html' => array(
- 'Data' => $body,
- 'Charset' => 'UTF-8'
- )
- )
- );
-
- //$response = $this->ses->sendEmail($fromEmail, $toArray, $message);
- $response = $this->ses->sendEmail(
- array(
- 'Source'=>$fromEmail,
- 'Destination'=>$toArray,
- 'Message'=>$message,
- 'ReplyToAddresses' => array($replyToEmail),
- 'ReturnPath' => $fromEmail
- )
- );
-
- LogManager::getInstance()->info("SES Response:".print_r($response,true));
-
- return $response;
-
- }
-}
-
-
-class SMTPEmailSender extends EmailSender{
-
- public function __construct($settings){
- parent::__construct($settings);
- }
-
- protected function sendMail($subject, $body, $toEmail, $fromEmail, $replyToEmail = null, $ccList = array(), $bccList = array()) {
-
- if(empty($replyToEmail)){
- $replyToEmail = $fromEmail;
- }
-
- LogManager::getInstance()->info("Sending email to: ".$toEmail."/ from: ".$fromEmail);
-
- $host = $this->settings->getSetting("Email: SMTP Host");
- $username = $this->settings->getSetting("Email: SMTP User");
- $password = $this->settings->getSetting("Email: SMTP Password");
- $port = $this->settings->getSetting("Email: SMTP Port");
-
- if(empty($port)){
- $port = '25';
- }
-
- if($this->settings->getSetting("Email: SMTP Authentication Required") == "0"){
- $auth = array ('host' => $host,
- 'auth' => false);
- }else{
- $auth = array ('host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'port' => $port,
- 'password' => $password);
- }
-
-
- $smtp = Mail::factory('smtp',$auth);
-
- $headers = array ('MIME-Version' => '1.0',
- 'Content-type' => 'text/html',
- 'charset' => 'iso-8859-1',
- 'From' => $fromEmail,
- 'To' => $toEmail,
- 'Reply-To' => $replyToEmail,
- 'Subject' => $subject);
-
- if(!empty($ccList)){
- $headers['Cc'] = implode(",",$ccList);
- }
-
- if(!empty($bccList)){
- $headers['Bcc'] = implode(",",$bccList);
- }
-
-
- $mail = $smtp->send($toEmail, $headers, $body);
- if (PEAR::isError($mail)) {
- LogManager::getInstance()->info("SMTP Error Response:".$mail->getMessage());
- }
-
- return $mail;
- }
-}
-
-
-class PHPMailer extends EmailSender{
-
- public function __construct($settings){
- parent::__construct($settings);
- }
-
- protected function sendMail($subject, $body, $toEmail, $fromEmail, $replyToEmail = null, $ccList = array(), $bccList = array()) {
-
- if(empty($replyToEmail)){
- $replyToEmail = $fromEmail;
- }
-
- LogManager::getInstance()->info("Sending email to: ".$toEmail."/ from: ".$fromEmail);
-
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- $headers .= 'From: '.$fromEmail. "\r\n";
- if(!empty($ccList)){
- $headers .= 'CC: '.implode(",",$ccList). "\r\n";
- }
- if(!empty($bccList)){
- $headers .= 'BCC: '.implode(",",$bccList). "\r\n";
- }
- $headers .= 'ReplyTo: '.$replyToEmail. "\r\n";
- $headers .= 'Ice-Mailer: PHP/' . phpversion();
-
- // Mail it
- $res = mail($toEmail, $subject, $body, $headers);
-
- LogManager::getInstance()->info("PHP mailer result : ".$res);
-
- return $res;
- }
-}
\ No newline at end of file
diff --git a/src/classes/ErrorCodes.php b/src/classes/ErrorCodes.php
deleted file mode 100644
index fc887c7b..00000000
--- a/src/classes/ErrorCodes.php
+++ /dev/null
@@ -1,4 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-class FileService{
-
- private static $me = null;
-
- private $memcache;
-
- private function __construct(){
-
- }
-
- public static function getInstance(){
- if(empty(self::$me)){
- self::$me = new FileService();
- }
-
- return self::$me;
- }
-
- public function getFromCache($key){
- try{
- /*
- if(empty($this->memcache)){
- $this->memcache = new Memcached();
- $this->memcache->addServer("127.0.0.1", 11211);
- }
- $data = $this->memcache->get($key);
- */
-
- $data = MemcacheService::getInstance()->get($key);
-
- if(!empty($data)){
- return $data;
- }
-
- return null;
-
- }catch(Exception $e){
- return null;
- }
-
- }
-
- public function saveInCache($key, $data, $expire){
- if(!class_exists('Memcached')){
- return;
- }
- try{
- if(empty($this->memcache)){
- $this->memcache = new Memcached();
- $this->memcache->addServer("127.0.0.1", 11211);
- }
- $this->memcache->set($key,$data, $expire);
- }catch(Exception $e){
-
- }
- }
-
- public function checkAddSmallProfileImage($profileImage){
- $file = new File();
- $file->Load('name = ?',array($profileImage->name."_small"));
-
- if(empty($file->id)){
-
- LogManager::getInstance()->info("Small profile image ".$profileImage->name."_small not found");
-
- $largeFileUrl = $this->getFileUrl($profileImage->name);
-
- $file->name = $profileImage->name."_small";
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $file->$signInMappingField = $profileImage->$signInMappingField;
- $file->filename = $file->name.str_replace($profileImage->name,"",$profileImage->filename);
- $file->file_group = $profileImage->file_group;
-
- file_put_contents("/tmp/".$file->filename."_orig", file_get_contents($largeFileUrl));
-
- if(file_exists("/tmp/".$file->filename."_orig")){
-
- //Resize image to 100
-
- $img = new abeautifulsite\SimpleImage("/tmp/".$file->filename."_orig");
- $img->fit_to_width(100);
- $img->save("/tmp/".$file->filename);
-
-
- $uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
- $uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
- $s3Bucket = SettingsManager::getInstance()->getSetting("Files: S3 Bucket");
-
- $uploadname = CLIENT_NAME."/".$file->filename;
- $localFile = "/tmp/".$file->filename;
-
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $result = $s3FileSys->putObject($s3Bucket, $uploadname, $localFile, 'authenticated-read');
-
- unlink("/tmp/".$file->filename);
- unlink("/tmp/".$file->filename."_orig");
-
- LogManager::getInstance()->info("Upload Result:".print_r($result,true));
-
- if(!empty($result)){
- $ok = $file->Save();
- }
-
- return $file;
-
- }
-
- return null;
- }
-
- return $file;
- }
-
- public function updateSmallProfileImage($profile){
- $file = new File();
- $file->Load('name = ?',array('profile_image_'.$profile->id));
-
- if($file->name == 'profile_image_'.$profile->id){
-
- $uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
- if($uploadFilesToS3 == "1"){
-
- try{
- $fileNew = $this->checkAddSmallProfileImage($file);
- if(!empty($fileNew)){
- $file = $fileNew;
- }
-
- $uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
- $uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $s3WebUrl = SettingsManager::getInstance()->getSetting("Files: S3 Web Url");
- $fileUrl = $s3WebUrl.CLIENT_NAME."/".$file->filename;
-
- $expireUrl = $this->getFromCache($fileUrl);
- if(empty($expireUrl)){
- $expireUrl = $s3FileSys->generateExpiringURL($fileUrl, 600);
- $this->saveInCache($fileUrl, $expireUrl, 500);
- }
-
-
- $profile->image = $expireUrl;
-
- }catch (Exception $e){
- LogManager::getInstance()->error("Error generating profile image: ".$e->getMessage());
- if($profile->gender == 'Female'){
- $profile->image = BASE_URL."images/user_female.png";
- }else{
- $profile->image = BASE_URL."images/user_male.png";
- }
- }
-
-
- }else{
- $profile->image = CLIENT_BASE_URL.'data/'.$file->filename;
- }
-
- }else{
- if($profile->gender == 'Female'){
- $profile->image = BASE_URL."images/user_female.png";
- }else{
- $profile->image = BASE_URL."images/user_male.png";
- }
- }
-
- return $profile;
- }
-
- public function updateProfileImage($profile){
- $file = new File();
- $file->Load('name = ?',array('profile_image_'.$profile->id));
-
- if($file->name == 'profile_image_'.$profile->id){
- $uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
- if($uploadFilesToS3 == "1"){
- $uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
- $uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $s3WebUrl = SettingsManager::getInstance()->getSetting("Files: S3 Web Url");
- $fileUrl = $s3WebUrl.CLIENT_NAME."/".$file->filename;
-
- $expireUrl = $this->getFromCache($fileUrl);
- if(empty($expireUrl)){
- $expireUrl = $s3FileSys->generateExpiringURL($fileUrl, 600);
- $this->saveInCache($fileUrl, $expireUrl, 500);
- }
-
-
- $profile->image = $expireUrl;
- }else{
- $profile->image = CLIENT_BASE_URL.'data/'.$file->filename;
- }
-
- }else{
- if($profile->gender == 'Female'){
- $profile->image = BASE_URL."images/user_female.png";
- }else{
- $profile->image = BASE_URL."images/user_male.png";
- }
- }
-
- return $profile;
- }
-
- public function getFileUrl($fileName){
- $file = new File();
- $file->Load('name = ?',array($fileName));
-
- $uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
-
- if($uploadFilesToS3 == "1"){
- $uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
- $uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $s3WebUrl = SettingsManager::getInstance()->getSetting("Files: S3 Web Url");
- $fileUrl = $s3WebUrl.CLIENT_NAME."/".$file->filename;
-
- $expireUrl = $this->getFromCache($fileUrl);
- if(empty($expireUrl)){
- $expireUrl = $s3FileSys->generateExpiringURL($fileUrl, 600);
- $this->saveInCache($fileUrl, $expireUrl, 500);
- }
-
-
- return $expireUrl;
- }else{
- return CLIENT_BASE_URL.'data/'.$file->filename;
- }
- }
-
- public function deleteProfileImage($profileId){
- $file = new File();
- $file->Load('name = ?',array('profile_image_'.$profileId));
- if($file->name == 'profile_image_'.$profileId){
- $ok = $file->Delete();
- if($ok){
- LogManager::getInstance()->info("Delete File:".CLIENT_BASE_PATH.$file->filename);
- unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
- }else{
- return false;
- }
- }
-
- $file = new File();
- $file->Load('name = ?',array('profile_image_'.$profileId."_small"));
- if($file->name == 'profile_image_'.$profileId."_small"){
- $ok = $file->Delete();
- if($ok){
- LogManager::getInstance()->info("Delete File:".CLIENT_BASE_PATH.$file->filename);
- unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
- }else{
- return false;
- }
- }
-
-
- return true;
- }
-
- public function deleteFileByField($value, $field){
- LogManager::getInstance()->info("Delete file by field: $field / value: $value");
- $file = new File();
- $file->Load("$field = ?",array($value));
- if($file->$field == $value){
- $ok = $file->Delete();
- if($ok){
- $uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
-
- if($uploadFilesToS3 == "1"){
- $uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
- $uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
- $s3Bucket = SettingsManager::getInstance()->getSetting("Files: S3 Bucket");
-
- $uploadname = CLIENT_NAME."/".$file->filename;
- LogManager::getInstance()->info("Delete from S3:".$uploadname);
-
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $res = $s3FileSys->deleteObject($s3Bucket, $uploadname);
-
- }else{
- LogManager::getInstance()->info("Delete:".CLIENT_BASE_PATH.'data/'.$file->filename);
- unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
- }
-
-
- }else{
- return false;
- }
- }
- return true;
- }
-}
\ No newline at end of file
diff --git a/src/classes/LDAPManager.php b/src/classes/LDAPManager.php
deleted file mode 100644
index 5ffc2ac0..00000000
--- a/src/classes/LDAPManager.php
+++ /dev/null
@@ -1,82 +0,0 @@
-getSetting("LDAP: Server");
- $ldap_port = SettingsManager::getInstance()->getSetting("LDAP: Port");
- $ldap_dn = SettingsManager::getInstance()->getSetting("LDAP: Root DN");
-
- $managerDN = SettingsManager::getInstance()->getSetting("LDAP: Manager DN");
- $managerPassword = SettingsManager::getInstance()->getSetting("LDAP: Manager Password");
-
- // connect to active directory
- if(empty($ldap_port)){
- $ldap_port = 389;
- }
-
- $ldap = ldap_connect($ldap_host, intval($ldap_port));
-
- if(!$ldap){
- return new IceResponse(IceResponse::ERROR,"Could not connect to LDAP Server");
- }
-
- LogManager::getInstance()->debug("LDAP Connect Result:".print_r($ldap,true));
-
- if(SettingsManager::getInstance()->getSetting("LDAP: Version 3") == "1"){
- ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
- }
- ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
-
- // verify user and password
- $bind = @ldap_bind($ldap, $managerDN, $managerPassword);
-
- LogManager::getInstance()->debug("LDAP Manager Bind:".print_r($bind,true));
-
- if($bind) {
-
- $userFilterStr = SettingsManager::getInstance()->getSetting("LDAP: User Filter");
-
- $filter = str_replace("{}", $user, $userFilterStr); //"(uid=" . $user . ")";
- $result = ldap_search($ldap, $ldap_dn, $filter);
- LogManager::getInstance()->debug("LDAP Search Result:".print_r($result,true));
- if(!$result){
- exit("Unable to search LDAP server");
- }
- $entries = ldap_get_entries($ldap, $result);
- LogManager::getInstance()->debug("LDAP Search Entries:".print_r($entries,true));
-
- if(empty($entries) || !isset($entries[0]) || !isset($entries[0]['dn'])){
- return new IceResponse(IceResponse::ERROR,"Invalid user");
- }
-
- $bind = @ldap_bind($ldap,$entries[0]['dn'], $password);
- ldap_unbind($ldap);
-
- if($bind){
- return new IceResponse(IceResponse::SUCCESS, $entries[0]);
- }else{
- return new IceResponse(IceResponse::ERROR,"Invalid user");
- }
-
-
- } else {
- return new IceResponse(IceResponse::ERROR,"Invalid manager user");
- }
- }
-}
\ No newline at end of file
diff --git a/src/classes/LanguageManager.php b/src/classes/LanguageManager.php
deleted file mode 100644
index 492da0eb..00000000
--- a/src/classes/LanguageManager.php
+++ /dev/null
@@ -1,75 +0,0 @@
-loadLanguage();
- }
-
- return self::$me;
- }
-
- private function loadLanguage(){
- $lang = $this->getCurrentLang();
- $this->translations = Translations::fromPoFile(APP_BASE_PATH.'lang/'.$lang.'.po');
- if(file_exists(APP_BASE_PATH.'lang/'.$lang.'-ext.po')){
- $this->translations->addFromPoFile(APP_BASE_PATH.'lang/'.$lang.'-ext.po');
- }
- $t = new Translator();
- $t->loadTranslations($this->translations);
- $t->register();
- $this->translator = $t;
- }
-
- private function getCurrentLang(){
- $user = BaseService::getInstance()->getCurrentUser();
- LogManager::getInstance()->info("User:".json_encode($user));
- if(empty($user) || empty($user->lang) || $user->lang == "NULL"){
- $lang = SettingsManager::getInstance()->getSetting('System: Language');
- LogManager::getInstance()->info("System Lang:".$lang);
- }else{
- $lang = $user->lang;
- }
- if(empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')){
- $lang = 'en';
- }
- LogManager::getInstance()->info("Current Language:".$lang);
- return $lang;
- }
-
- public static function getTranslations(){
- $me = self::getInstance();
- return Gettext\Generators\Json::toString($me->translations);
- }
-
- public static function tran($text){
- $me = self::getInstance();
- return $me->translator->gettext($text);
- }
-
- public static function translateTnrText($string){
- $me = self::getInstance();
- $pattern = "#(.*?) #";
- preg_match_all($pattern, $string, $matches);
-
- for($i = 0;$i '[^/]+',
- ':num' => '[0-9]+',
- ':all' => '.*'
- );
-
- public static $error_callback;
-
- /**
- * Defines a route w/ callback and method
- */
- public static function __callstatic($method, $params)
- {
-
- $uri = dirname($_SERVER['PHP_SELF']).$params[0];
- $callback = $params[1];
-
- array_push(self::$routes, $uri);
- array_push(self::$methods, strtoupper($method));
- array_push(self::$callbacks, $callback);
- }
-
- /**
- * Defines callback if route is not found
- */
- public static function error($callback)
- {
- self::$error_callback = $callback;
- }
-
- public static function haltOnMatch($flag = true)
- {
- self::$halts = $flag;
- }
-
- /**
- * Runs the callback for the given request
- */
- public static function dispatch()
- {
- $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
- $method = $_SERVER['REQUEST_METHOD'];
-
- $searches = array_keys(static::$patterns);
- $replaces = array_values(static::$patterns);
-
- $found_route = false;
-
- self::$routes = str_replace('//', '/', self::$routes);
-
- // check if route is defined without regex
- if (in_array($uri, self::$routes)) {
- $route_pos = array_keys(self::$routes, $uri);
- foreach ($route_pos as $route) {
-
- //using an ANY option to match both GET and POST requests
- if (self::$methods[$route] == $method || self::$methods[$route] == 'ANY') {
- $found_route = true;
-
- //if route is not an object
- if(!is_object(self::$callbacks[$route])){
-
- //grab all parts based on a / separator
- $parts = explode('/',self::$callbacks[$route]);
-
- //collect the last index of the array
- $last = end($parts);
-
- //grab the controller name and method call
- $segments = explode('@',$last);
-
- //instanitate controller
- $controller = new $segments[0]();
-
- //call method
- $controller->$segments[1]();
-
- if (self::$halts) return;
-
- } else {
- //call closure
- call_user_func(self::$callbacks[$route]);
-
- if (self::$halts) return;
- }
- }
- }
- } else {
- // check if defined with regex
- $pos = 0;
- foreach (self::$routes as $route) {
-
- if (strpos($route, ':') !== false) {
- $route = str_replace($searches, $replaces, $route);
- }
-
- if (preg_match('#^' . $route . '$#', $uri, $matched)) {
- if (self::$methods[$pos] == $method) {
- $found_route = true;
-
- array_shift($matched); //remove $matched[0] as [1] is the first parameter.
-
-
- if(!is_object(self::$callbacks[$pos])){
-
- //grab all parts based on a / separator
- $parts = explode('/',self::$callbacks[$pos]);
-
- //collect the last index of the array
- $last = end($parts);
-
- //grab the controller name and method call
- $segments = explode('@',$last);
-
- //instanitate controller
- $controller = new $segments[0]();
-
- //fix multi parameters
- if(!method_exists($controller, $segments[1])){
- echo "controller and action not found";
- }else{
- call_user_func_array(array($controller, $segments[1]), $matched);
- }
-
- //call method and pass any extra parameters to the method
- // $controller->$segments[1](implode(",", $matched));
-
- if (self::$halts) return;
- } else {
- call_user_func_array(self::$callbacks[$pos], $matched);
-
- if (self::$halts) return;
- }
-
- }
- }
- $pos++;
- }
- }
-
-
- // run the error callback if the route was not found
- if ($found_route == false) {
- if (!self::$error_callback) {
- self::$error_callback = function() {
- header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
- echo '404';
- };
- }
- call_user_func(self::$error_callback);
- }
- }
-}
diff --git a/src/classes/ModuleBuilder.php b/src/classes/ModuleBuilder.php
deleted file mode 100644
index f34f123e..00000000
--- a/src/classes/ModuleBuilder.php
+++ /dev/null
@@ -1,156 +0,0 @@
-modules[] = $module;
- }
-
- public function getTabHeadersHTML(){
- $html = "";
- foreach($this->modules as $module){
- $html .= $module->getHTML()."\r\n";
- }
- return $html;
- }
-
- public function getTabPagesHTML(){
- $html = "";
- foreach($this->modules as $module){
- if(get_class($module) == "ModuleTab"){
- $html .= $module->getPageHTML()."\r\n";
- }else{
- foreach($module->modules as $mod){
- $html .= $mod->getPageHTML()."\r\n";
- }
- }
-
- }
- return $html;
- }
-
- public function getModJsHTML(){
- $html = "var modJsList = new Array();\r\n";
- $activeModule = "";
- foreach($this->modules as $module){
- if(get_class($module) == "ModuleTab"){
- $html .= $module->getJSObjectCode()."\r\n";
- if($module->isActive){
- $activeModule = $module->name;
- }
- }else{
-
- foreach($module->modules as $mod){
- if($module->isActive && $activeModule == ""){
- $activeModule = $mod->name;
- }
- $html .= $mod->getJSObjectCode()."\r\n";
- }
- }
-
- }
-
- $html .= "var modJs = modJsList['tab".$activeModule."'];\r\n";
- return $html;
- }
-}
-
-class ModuleTab{
- public $name;
- var $class;
- var $label;
- var $adapterName;
- var $filter;
- var $orderBy;
- public $isActive = false;
- public $isInsideGroup = false;
- var $options = array();
-
- public function __construct($name, $class, $label, $adapterName, $filter, $orderBy, $isActive = false, $options = array()){
- $this->name = $name;
- $this->class = $class;
- $this->label = $label;
- $this->adapterName = $adapterName;
- $this->filter = $filter;
- $this->orderBy = $orderBy;
- $this->isActive = $isActive;
- $this->options = $options;
- }
-
- public function getHTML(){
- $active = ($this->isActive)?"active":"";
- if(!$this->isInsideGroup) {
- return '' . LanguageManager::tran($this->label) . ' ';
- }else{
- return '' . LanguageManager::tran($this->label) . ' ';
- }
- }
-
- public function getPageHTML(){
- $active = ($this->isActive)?" active":"";
- $html = ''.
- ''.
- ''.
- '';
-
- return $html;
- }
-
- public function getJSObjectCode()
- {
- $js = '';
- if (empty($this->filter)) {
- $js.= "modJsList['tab" . $this->name . "'] = new " . $this->adapterName . "('" . $this->class . "','" . $this->name . "','','".$this->orderBy."');";
- } else {
- $js.= "modJsList['tab" . $this->name . "'] = new " . $this->adapterName . "('" . $this->class . "','" . $this->name . "'," . $this->filter . ",'".$this->orderBy."');";
- }
-
- foreach($this->options as $key => $val){
- $js.= "modJsList['tab" . $this->name . "'].".$key."(".$val.");";
- }
-
- return $js;
- }
-
-}
-
-class ModuleTabGroup{
- var $name;
- var $label;
- var $isActive = false;
- public $modules = array();
-
- public function __construct($name, $label){
- $this->name = $name;
- $this->label = $label;
- }
-
- public function addModuleTab($moduleTab){
- if($moduleTab->isActive){
- $this->isActive = true;
- $moduleTab->isActive = false;
- }
- $moduleTab->isInsideGroup = true;
- $this->modules[] = $moduleTab;
- }
-
- public function getHTML(){
- $html = "";
- $active = ($this->isActive)?" active":"";
-
- $html.= ''."\r\n".
- ''.$this->label.' '."\r\n".
- ' ";
-
- return $html;
-
- }
-}
-
diff --git a/src/classes/NotificationManager.php b/src/classes/NotificationManager.php
deleted file mode 100644
index d63715a1..00000000
--- a/src/classes/NotificationManager.php
+++ /dev/null
@@ -1,78 +0,0 @@
-baseService = $baseService;
- }
-
- public function addNotification($toUser, $message, $action, $type){
- $profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
- $userEmp = new User();
- $userEmp->load("profile = ?",array($toUser));
-
- if(!empty($userEmp->$profileVar) && $userEmp->$profileVar == $toUser){
- $toUser = $userEmp->id;
- }else{
- return;
- }
-
- $noti = new Notification();
- $user = $this->baseService->getCurrentUser();
- $noti->fromUser = $user->id;
- $noti->fromProfile = $user->$profileVar;
- $noti->toUser = $toUser;
- $noti->message = $message;
-
- if(!empty($noti->fromProfile)){
- $profile = $this->baseService->getElement($profileClass,$noti->fromProfile,null,true);
- if(!empty($profile)){
- $fs = FileService::getInstance();
- $profile = $fs->updateProfileImage($profile);
- $noti->image = $profile->image;
- }
- }
-
- if(empty($noti->image)){
- $noti->image = BASE_URL."images/user_male.png";
- }
-
- $noti->action = $action;
- $noti->type = $type;
- $noti->time = date('Y-m-d H:i:s');
- $noti->status = 'Unread';
-
- $ok = $noti->Save();
- if(!$ok){
- LogManager::getInstance()->info("Error adding notification: ".$noti->ErrorMsg());
- }
- }
-
- public function clearNotifications($userId){
- $notification = new Notification();
-
- $listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread'));
-
- foreach($listUnread as $not){
- $not->status = "Read";
- $not->Save();
- }
- }
-
- public function getLatestNotificationsAndCounts($userId){
- $notification = new Notification();
-
- $listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread'));
- $unreadCount = count($listUnread);
-
- $limit = ($unreadCount < 20)?20:$unreadCount;
-
- $list = $notification->Find("toUser = ? order by time desc limit ?",array($userId,$limit));
-
- return array($unreadCount, $list);
-
- }
-
-}
\ No newline at end of file
diff --git a/src/classes/ReportHandler.php b/src/classes/ReportHandler.php
deleted file mode 100644
index 45abdf04..00000000
--- a/src/classes/ReportHandler.php
+++ /dev/null
@@ -1,104 +0,0 @@
-Load("id = ?",array($request['id']));
- if($report->id."" == $request['id']){
- include APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
- if($report->type == 'Query'){
- $where = $this->buildQueryOmmit(json_decode($report->paramOrder,true), $request);
- $query = str_replace("_where_", $where[0], $report->query);
- return $this->executeReport(new CSVReportBuilder(), $report,$query,$where[1]);
-
- }else if($report->type == 'Class'){
- $className = $report->query;
-
- if($request['t'] == "Report"){
- include APP_BASE_PATH.'admin/reports/reportClasses/'.$className.".php";
- }else{
- include APP_BASE_PATH.'modules/reports/reportClasses/'.$className.".php";
- }
-
- $cls = new $className();
- $data = $cls->getData($report,$request);
- if(empty($data)){
- return array("ERROR", "No data found");
- }
- return $this->generateReport($cls, $report,$data);
- }
- }else{
- return array("ERROR","Report id not found");
- }
- }
- }
-
-
- private function executeReport($reportBuilder, $report,$query,$parameters){
-
- $report->DB()->SetFetchMode(ADODB_FETCH_ASSOC);
- $rs = $report->DB()->Execute($query,$parameters);
- if(!$rs){
- LogManager::getInstance()->info($report->DB()->ErrorMsg());
- return array("ERROR","Error generating report");
- }
-
- $reportNamesFilled = false;
- $columnNames = array();
- $reportData = array();
- foreach ($rs as $rowId => $row) {
- $reportData[] = array();
- if(!$reportNamesFilled){
- foreach ($row as $name=> $value){
- $columnNames[] = $name;
- $reportData[count($reportData)-1][] = $value;
- }
- $reportNamesFilled = true;
- }else{
- foreach ($row as $name=> $value){
- $reportData[count($reportData)-1][] = $value;
- }
- }
- }
-
-
- array_unshift($reportData,$columnNames);
-
- return $this->generateReport($reportBuilder, $report, $reportData);
-
-
- }
-
- protected function generateReport($reportBuilder, $report, $data){
-
- $reportCreationData = $reportBuilder->createReportFile($report, $data);
-
- $saveResp = $reportBuilder->saveFile($reportCreationData[0], $reportCreationData[1], $reportCreationData[2]);
-
- $headers = array_shift($data);
-
- return array($saveResp[0],array($saveResp[1],$headers,$data));
-
- }
-
- private function buildQueryOmmit($names, $params){
- $parameters = array();
- $query = "";
- foreach($names as $name){
- if($params[$name] != "NULL"){
- if($query != ""){
- $query.=" AND ";
- }
- $query.=$name." = ?";
- $parameters[] = $params[$name];
- }
- }
-
- if($query != ""){
- $query = "where ".$query;
- }
-
- return array($query, $parameters);
- }
-}
\ No newline at end of file
diff --git a/src/classes/RestApiManager.php b/src/classes/RestApiManager.php
deleted file mode 100644
index 320a48e6..00000000
--- a/src/classes/RestApiManager.php
+++ /dev/null
@@ -1,162 +0,0 @@
-id;
- $data['expires'] = strtotime('now') + 60*60;
-
- $accessTokenTemp = AesCtr::encrypt(json_encode($data), $user->password, 256);
- $accessTokenTemp = $user->id."|".$accessTokenTemp;
- $accessToken = AesCtr::encrypt($accessTokenTemp, APP_SEC, 256);
-
- return new IceResponse(IceResponse::SUCCESS, $accessToken);
- }
-
- public function getAccessTokenForUser($user){
- $accessTokenObj = new RestAccessToken();
- $accessTokenObj->Load("userId = ?",array($user->id));
-
- $generateAccessToken = false;
- $accessToken = $accessTokenObj->token;
- if(!empty($accessToken)){
- $resp = $this->validateAccessTokenInner($accessToken);
- if($resp->getStatus() != IceResponse::SUCCESS){
- $generateAccessToken = true;
- }
- }else{
- $generateAccessToken = true;
- }
-
- if($generateAccessToken){
- $accessToken = $this->generateUserAccessToken($user)->getData();
- if(!empty($accessTokenObj->id)){
- $accessTokenObj->token = $accessToken;
- $accessTokenObj->hash = md5(CLIENT_BASE_URL.$accessTokenObj->token);
- $accessTokenObj->updated = date("Y-m-d H:i:s");
- $accessTokenObj->Save();
- }else{
- $accessTokenObj = new RestAccessToken();
- $accessTokenObj->userId = $user->id;
- $accessTokenObj->token = $accessToken;
- $accessTokenObj->hash = md5(CLIENT_BASE_URL.$accessTokenObj->token);
- $accessTokenObj->updated = date("Y-m-d H:i:s");
- $accessTokenObj->created = date("Y-m-d H:i:s");
- $accessTokenObj->Save();
- }
- }
-
- return new IceResponse(IceResponse::SUCCESS, $accessTokenObj->hash);
- }
-
-
- public function validateAccessToken($hash){
- $accessTokenObj = new RestAccessToken();
- LogManager::getInstance()->info("AT Hash:".$hash);
- $accessTokenObj->Load("hash = ?",array($hash));
- LogManager::getInstance()->info("AT Hash Object:".json_encode($accessTokenObj));
- if(!empty($accessTokenObj->id) && $accessTokenObj->hash == $hash){
- return $this->validateAccessTokenInner($accessTokenObj->token);
- }
-
- return new IceResponse(IceResponse::ERROR, "Access Token not found");
- }
-
- private function validateAccessTokenInner($accessToken){
- $accessTokenTemp = AesCtr::decrypt($accessToken, APP_SEC, 256);
- $parts = explode("|", $accessTokenTemp);
-
- $user = new User();
- $user->Load("id = ?",array($parts[0]));
- if(empty($user->id) || $user->id != $parts[0] || empty($parts[0])){
- return new IceResponse(IceResponse::ERROR, -1);
- }
-
- $accessToken = AesCtr::decrypt($parts[1], $user->password, 256);
-
- $data = json_decode($accessToken, true);
- if($data['userId'] == $user->id){
- return new IceResponse(IceResponse::SUCCESS, true);
- }
-
- return new IceResponse(IceResponse::ERROR, false);
- }
-
- public function addEndPoint($endPoint){
- $url = $endPoint->getUrl();
- LogManager::getInstance()->info("Adding REST end point for - ".$url);
- $this->endPoints[$url] = $endPoint;
- }
-
- public function process($type, $url, $parameters){
-
- $accessTokenValidation = $this->validateAccessToken($parameters['access_token']);
-
- if($accessTokenValidation->getStatus() == IceResponse::ERROR){
- return $accessTokenValidation;
- }
-
- if(isset($this->endPoints[$url])){
- return $this->endPoints[$url]->$type($parameters);
- }
-
- return new IceResponse(IceResponse::ERROR, "End Point ".$url." - Not Found");
- }
-}
-
-
-class RestEndPoint{
-
- public function process($type , $parameter = NULL){
- $resp = $this->$type($parameter);
- $this->printResponse($resp);
- }
-
- public function get($parameter){
- return new IceResponse(IceResponse::ERROR, "Method not Implemented");
- }
-
- public function post($parameter){
- return new IceResponse(IceResponse::ERROR, "Method not Implemented");
- }
-
- public function put($parameter){
- return new IceResponse(IceResponse::ERROR, "Method not Implemented");
- }
-
- public function delete($parameter){
- return new IceResponse(IceResponse::ERROR, "Method not Implemented");
- }
-
- public function clearObject($obj){
- return BaseService::getInstance()->cleanUpAdoDB($obj);
- }
-
- public function validateAccessToken(){
- $accessTokenValidation = RestApiManager::getInstance()->validateAccessToken($_REQUEST['access_token']);
-
- return $accessTokenValidation;
- }
-
- public function printResponse($response){
- echo json_encode($response,JSON_PRETTY_PRINT);
- }
-}
-
diff --git a/src/classes/S3FileSystem.php b/src/classes/S3FileSystem.php
deleted file mode 100644
index c703577c..00000000
--- a/src/classes/S3FileSystem.php
+++ /dev/null
@@ -1,107 +0,0 @@
-key = $key;
- $this->secret = $secret;
- $arr = array(
- 'key' => $key,
- 'secret' => $secret,
- 'region' => AWS_REGION
- );
- $this->s3 = S3Client::factory($arr);
- }
-
- public function putObject($bucket, $key, $sourceFile, $acl){
- $res = null;
- try{
- $res = $this->s3->putObject(array(
- 'Bucket' => $bucket,
- 'Key' => $key,
- 'SourceFile' => $sourceFile,
- 'ACL' => $acl
- /*'ContentType' => 'image/jpeg'*/
- ));
- }catch(Exception $e){
- LogManager::getInstance()->info($e->getMessage());
- return NULL;
- }
-
- LogManager::getInstance()->info("Response from s3:".print_r($res,true));
-
- $result = $res->get('RequestId');
- if(!empty($result)){
- return $result;
- }
-
- return NULL;
- }
-
- public function deleteObject($bucket, $key){
- $res = null;
-
- try{
- $res = $this->s3->deleteObject(array(
- 'Bucket' => $bucket,
- 'Key' => $key
- ));
- }catch(Exception $e){
- LogManager::getInstance()->info($e->getMessage());
- return NULL;
- }
-
- LogManager::getInstance()->info("Response from s3:".print_r($res,true));
-
- $result = $res->get('RequestId');
- if(!empty($result)){
- return $result;
- }
-
- return NULL;
- }
-
- public function generateExpiringURL($url, $expiresIn = 600) {
- // Calculate expiry time
- $expiresTimestamp = time() + intval($expiresIn);
- $path = parse_url($url, PHP_URL_PATH);
- $path = str_replace('%2F', '/', rawurlencode($path = ltrim($path, '/')));
- $host = parse_url($url, PHP_URL_HOST);
- $bucket = str_replace(".s3.amazonaws.com", "", $host);
- // Path for signature starts with the bucket
- $signpath = '/'. $bucket .'/'. $path;
-
- // S3 friendly string to sign
- $signsz = implode("\n", $pieces = array('GET', null, null, $expiresTimestamp, $signpath));
-
- // Calculate the hash
- $signature = $this->el_crypto_hmacSHA1($this->secret, $signsz);
- // ... to the query string ...
- $qs = http_build_query($pieces = array(
- 'AWSAccessKeyId' => $this->key,
- 'Expires' => $expiresTimestamp,
- 'Signature' => $signature,
- ));
- // ... and return the URL!
- return $url.'?'.$qs;
- }
-
- private function el_crypto_hmacSHA1($key, $data, $blocksize = 64) {
- if (strlen($key) > $blocksize) $key = pack('H*', sha1($key));
- $key = str_pad($key, $blocksize, chr(0x00));
- $ipad = str_repeat(chr(0x36), $blocksize);
- $opad = str_repeat(chr(0x5c), $blocksize);
- $hmac = pack( 'H*', sha1(
- ($key ^ $opad) . pack( 'H*', sha1(
- ($key ^ $ipad) . $data
- ))
- ));
- return base64_encode($hmac);
- }
-
-}
\ No newline at end of file
diff --git a/src/classes/SettingsManager.php b/src/classes/SettingsManager.php
deleted file mode 100644
index 4d519d17..00000000
--- a/src/classes/SettingsManager.php
+++ /dev/null
@@ -1,44 +0,0 @@
-getSetting($name);
- if(!empty($val)){
- return $val;
- }
- }
-
- $setting = new Setting();
- $setting->Load("name = ?",array($name));
- if($setting->name == $name){
- return $setting->value;
- }
- return null;
- }
-
- public function setSetting($name, $value){
- $setting = new Setting();
- $setting->Load("name = ?",array($name));
- if($setting->name == $name){
- $setting->value = $value;
- $setting->Save();
- }
- }
-}
\ No newline at end of file
diff --git a/src/classes/SimpleImage.php b/src/classes/SimpleImage.php
deleted file mode 100644
index b8dc332a..00000000
--- a/src/classes/SimpleImage.php
+++ /dev/null
@@ -1,1287 +0,0 @@
- - merging of forks, namespace support, PhpDoc editing, adaptive_resize() method, other fixes
- * @license This software is licensed under the MIT license: http://opensource.org/licenses/MIT
- * @copyright A Beautiful Site, LLC
- *
- */
-
-namespace abeautifulsite;
-use Exception;
-
-/**
- * Class SimpleImage
- * This class makes image manipulation in PHP as simple as possible.
- * @package SimpleImage
- *
- */
-class SimpleImage {
-
- /**
- * @var int Default output image quality
- *
- */
- public $quality = 80;
-
- protected $image, $filename, $original_info, $width, $height, $imagestring;
-
- /**
- * Create instance and load an image, or create an image from scratch
- *
- * @param null|string $filename Path to image file (may be omitted to create image from scratch)
- * @param int $width Image width (is used for creating image from scratch)
- * @param int|null $height If omitted - assumed equal to $width (is used for creating image from scratch)
- * @param null|string $color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- * (is used for creating image from scratch)
- *
- * @return SimpleImage
- * @throws Exception
- *
- */
- function __construct($filename = null, $width = null, $height = null, $color = null) {
- if ($filename) {
- $this->load($filename);
- } elseif ($width) {
- $this->create($width, $height, $color);
- }
- return $this;
- }
-
- /**
- * Destroy image resource
- *
- */
- function __destruct() {
- if( get_resource_type($this->image) === 'gd' ) {
- imagedestroy($this->image);
- }
- }
-
- /**
- * Adaptive resize
- *
- * This function has been deprecated and will be removed in an upcoming release. Please
- * update your code to use the `thumbnail()` method instead. The arguments for both
- * methods are exactly the same.
- *
- * @param int $width
- * @param int|null $height If omitted - assumed equal to $width
- *
- * @return SimpleImage
- *
- */
- function adaptive_resize($width, $height = null) {
-
- return $this->thumbnail($width, $height);
-
- }
-
- /**
- * Rotates and/or flips an image automatically so the orientation will be correct (based on exif 'Orientation')
- *
- * @return SimpleImage
- *
- */
- function auto_orient() {
-
- switch ($this->original_info['exif']['Orientation']) {
- case 1:
- // Do nothing
- break;
- case 2:
- // Flip horizontal
- $this->flip('x');
- break;
- case 3:
- // Rotate 180 counterclockwise
- $this->rotate(-180);
- break;
- case 4:
- // vertical flip
- $this->flip('y');
- break;
- case 5:
- // Rotate 90 clockwise and flip vertically
- $this->flip('y');
- $this->rotate(90);
- break;
- case 6:
- // Rotate 90 clockwise
- $this->rotate(90);
- break;
- case 7:
- // Rotate 90 clockwise and flip horizontally
- $this->flip('x');
- $this->rotate(90);
- break;
- case 8:
- // Rotate 90 counterclockwise
- $this->rotate(-90);
- break;
- }
-
- return $this;
-
- }
-
- /**
- * Best fit (proportionally resize to fit in specified width/height)
- *
- * Shrink the image proportionally to fit inside a $width x $height box
- *
- * @param int $max_width
- * @param int $max_height
- *
- * @return SimpleImage
- *
- */
- function best_fit($max_width, $max_height) {
-
- // If it already fits, there's nothing to do
- if ($this->width <= $max_width && $this->height <= $max_height) {
- return $this;
- }
-
- // Determine aspect ratio
- $aspect_ratio = $this->height / $this->width;
-
- // Make width fit into new dimensions
- if ($this->width > $max_width) {
- $width = $max_width;
- $height = $width * $aspect_ratio;
- } else {
- $width = $this->width;
- $height = $this->height;
- }
-
- // Make height fit into new dimensions
- if ($height > $max_height) {
- $height = $max_height;
- $width = $height / $aspect_ratio;
- }
-
- return $this->resize($width, $height);
-
- }
-
- /**
- * Blur
- *
- * @param string $type selective|gaussian
- * @param int $passes Number of times to apply the filter
- *
- * @return SimpleImage
- *
- */
- function blur($type = 'selective', $passes = 1) {
- switch (strtolower($type)) {
- case 'gaussian':
- $type = IMG_FILTER_GAUSSIAN_BLUR;
- break;
- default:
- $type = IMG_FILTER_SELECTIVE_BLUR;
- break;
- }
- for ($i = 0; $i < $passes; $i++) {
- imagefilter($this->image, $type);
- }
- return $this;
- }
-
- /**
- * Brightness
- *
- * @param int $level Darkest = -255, lightest = 255
- *
- * @return SimpleImage
- *
- */
- function brightness($level) {
- imagefilter($this->image, IMG_FILTER_BRIGHTNESS, $this->keep_within($level, -255, 255));
- return $this;
- }
-
- /**
- * Contrast
- *
- * @param int $level Min = -100, max = 100
- *
- * @return SimpleImage
- *
- *
- */
- function contrast($level) {
- imagefilter($this->image, IMG_FILTER_CONTRAST, $this->keep_within($level, -100, 100));
- return $this;
- }
-
- /**
- * Colorize
- *
- * @param string $color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- * @param float|int $opacity 0-1
- *
- * @return SimpleImage
- *
- */
- function colorize($color, $opacity) {
- $rgba = $this->normalize_color($color);
- $alpha = $this->keep_within(127 - (127 * $opacity), 0, 127);
- imagefilter($this->image, IMG_FILTER_COLORIZE, $this->keep_within($rgba['r'], 0, 255), $this->keep_within($rgba['g'], 0, 255), $this->keep_within($rgba['b'], 0, 255), $alpha);
- return $this;
- }
-
- /**
- * Create an image from scratch
- *
- * @param int $width Image width
- * @param int|null $height If omitted - assumed equal to $width
- * @param null|string $color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- *
- * @return SimpleImage
- *
- */
- function create($width, $height = null, $color = null) {
-
- $height = $height ?: $width;
- $this->width = $width;
- $this->height = $height;
- $this->image = imagecreatetruecolor($width, $height);
- $this->original_info = array(
- 'width' => $width,
- 'height' => $height,
- 'orientation' => $this->get_orientation(),
- 'exif' => null,
- 'format' => 'png',
- 'mime' => 'image/png'
- );
-
- if ($color) {
- $this->fill($color);
- }
-
- return $this;
-
- }
-
- /**
- * Crop an image
- *
- * @param int $x1 Left
- * @param int $y1 Top
- * @param int $x2 Right
- * @param int $y2 Bottom
- *
- * @return SimpleImage
- *
- */
- function crop($x1, $y1, $x2, $y2) {
-
- // Determine crop size
- if ($x2 < $x1) {
- list($x1, $x2) = array($x2, $x1);
- }
- if ($y2 < $y1) {
- list($y1, $y2) = array($y2, $y1);
- }
- $crop_width = $x2 - $x1;
- $crop_height = $y2 - $y1;
-
- // Perform crop
- $new = imagecreatetruecolor($crop_width, $crop_height);
- imagealphablending($new, false);
- imagesavealpha($new, true);
- imagecopyresampled($new, $this->image, 0, 0, $x1, $y1, $crop_width, $crop_height, $crop_width, $crop_height);
-
- // Update meta data
- $this->width = $crop_width;
- $this->height = $crop_height;
- $this->image = $new;
-
- return $this;
-
- }
-
- /**
- * Desaturate
- *
- * @param int $percentage Level of desaturization.
- *
- * @return SimpleImage
- *
- */
- function desaturate($percentage = 100) {
-
- // Determine percentage
- $percentage = $this->keep_within($percentage, 0, 100);
-
- if( $percentage === 100 ) {
- imagefilter($this->image, IMG_FILTER_GRAYSCALE);
- } else {
- // Make a desaturated copy of the image
- $new = imagecreatetruecolor($this->width, $this->height);
- imagealphablending($new, false);
- imagesavealpha($new, true);
- imagecopy($new, $this->image, 0, 0, 0, 0, $this->width, $this->height);
- imagefilter($new, IMG_FILTER_GRAYSCALE);
-
- // Merge with specified percentage
- $this->imagecopymerge_alpha($this->image, $new, 0, 0, 0, 0, $this->width, $this->height, $percentage);
- imagedestroy($new);
-
- }
-
- return $this;
- }
-
- /**
- * Edge Detect
- *
- * @return SimpleImage
- *
- */
- function edges() {
- imagefilter($this->image, IMG_FILTER_EDGEDETECT);
- return $this;
- }
-
- /**
- * Emboss
- *
- * @return SimpleImage
- *
- */
- function emboss() {
- imagefilter($this->image, IMG_FILTER_EMBOSS);
- return $this;
- }
-
- /**
- * Fill image with color
- *
- * @param string $color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- *
- * @return SimpleImage
- *
- */
- function fill($color = '#000000') {
-
- $rgba = $this->normalize_color($color);
- $fill_color = imagecolorallocatealpha($this->image, $rgba['r'], $rgba['g'], $rgba['b'], $rgba['a']);
- imagealphablending($this->image, false);
- imagesavealpha($this->image, true);
- imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $fill_color);
-
- return $this;
-
- }
-
- /**
- * Fit to height (proportionally resize to specified height)
- *
- * @param int $height
- *
- * @return SimpleImage
- *
- */
- function fit_to_height($height) {
-
- $aspect_ratio = $this->height / $this->width;
- $width = $height / $aspect_ratio;
-
- return $this->resize($width, $height);
-
- }
-
- /**
- * Fit to width (proportionally resize to specified width)
- *
- * @param int $width
- *
- * @return SimpleImage
- *
- */
- function fit_to_width($width) {
-
- $aspect_ratio = $this->height / $this->width;
- $height = $width * $aspect_ratio;
-
- return $this->resize($width, $height);
-
- }
-
- /**
- * Flip an image horizontally or vertically
- *
- * @param string $direction x|y
- *
- * @return SimpleImage
- *
- */
- function flip($direction) {
-
- $new = imagecreatetruecolor($this->width, $this->height);
- imagealphablending($new, false);
- imagesavealpha($new, true);
-
- switch (strtolower($direction)) {
- case 'y':
- for ($y = 0; $y < $this->height; $y++) {
- imagecopy($new, $this->image, 0, $y, 0, $this->height - $y - 1, $this->width, 1);
- }
- break;
- default:
- for ($x = 0; $x < $this->width; $x++) {
- imagecopy($new, $this->image, $x, 0, $this->width - $x - 1, 0, 1, $this->height);
- }
- break;
- }
-
- $this->image = $new;
-
- return $this;
-
- }
-
- /**
- * Get the current height
- *
- * @return int
- *
- */
- function get_height() {
- return $this->height;
- }
-
- /**
- * Get the current orientation
- *
- * @return string portrait|landscape|square
- *
- */
- function get_orientation() {
-
- if (imagesx($this->image) > imagesy($this->image)) {
- return 'landscape';
- }
-
- if (imagesx($this->image) < imagesy($this->image)) {
- return 'portrait';
- }
-
- return 'square';
-
- }
-
- /**
- * Get info about the original image
- *
- * @return array array(
- * width => 320,
- * height => 200,
- * orientation => ['portrait', 'landscape', 'square'],
- * exif => array(...),
- * mime => ['image/jpeg', 'image/gif', 'image/png'],
- * format => ['jpeg', 'gif', 'png']
- * )
- *
- */
- function get_original_info() {
- return $this->original_info;
- }
-
- /**
- * Get the current width
- *
- * @return int
- *
- */
- function get_width() {
- return $this->width;
- }
-
- /**
- * Invert
- *
- * @return SimpleImage
- *
- */
- function invert() {
- imagefilter($this->image, IMG_FILTER_NEGATE);
- return $this;
- }
-
- /**
- * Load an image
- *
- * @param string $filename Path to image file
- *
- * @return SimpleImage
- * @throws Exception
- *
- */
- function load($filename) {
-
- // Require GD library
- if (!extension_loaded('gd')) {
- throw new Exception('Required extension GD is not loaded.');
- }
- $this->filename = $filename;
- return $this->get_meta_data();
- }
-
- /**
- * Load a base64 string as image
- *
- * @param string $filename base64 string
- *
- * @return SimpleImage
- *
- */
- function load_base64($base64string) {
- if (!extension_loaded('gd')) {
- throw new Exception('Required extension GD is not loaded.');
- }
- //remove data URI scheme and spaces from base64 string then decode it
- $this->imagestring = base64_decode(str_replace(' ', '+',preg_replace('#^data:image/[^;]+;base64,#', '', $base64string)));
- $this->image = imagecreatefromstring($this->imagestring);
- return $this->get_meta_data();
- }
-
- /**
- * Mean Remove
- *
- * @return SimpleImage
- *
- */
- function mean_remove() {
- imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL);
- return $this;
- }
-
- /**
- * Changes the opacity level of the image
- *
- * @param float|int $opacity 0-1
- *
- * @throws Exception
- *
- */
- function opacity($opacity) {
-
- // Determine opacity
- $opacity = $this->keep_within($opacity, 0, 1) * 100;
-
- // Make a copy of the image
- $copy = imagecreatetruecolor($this->width, $this->height);
- imagealphablending($copy, false);
- imagesavealpha($copy, true);
- imagecopy($copy, $this->image, 0, 0, 0, 0, $this->width, $this->height);
-
- // Create transparent layer
- $this->create($this->width, $this->height, array(0, 0, 0, 127));
-
- // Merge with specified opacity
- $this->imagecopymerge_alpha($this->image, $copy, 0, 0, 0, 0, $this->width, $this->height, $opacity);
- imagedestroy($copy);
-
- return $this;
-
- }
-
- /**
- * Outputs image without saving
- *
- * @param null|string $format If omitted or null - format of original file will be used, may be gif|jpg|png
- * @param int|null $quality Output image quality in percents 0-100
- *
- * @throws Exception
- *
- */
- function output($format = null, $quality = null) {
-
- // Determine quality
- $quality = $quality ?: $this->quality;
-
- // Determine mimetype
- switch (strtolower($format)) {
- case 'gif':
- $mimetype = 'image/gif';
- break;
- case 'jpeg':
- case 'jpg':
- imageinterlace($this->image, true);
- $mimetype = 'image/jpeg';
- break;
- case 'png':
- $mimetype = 'image/png';
- break;
- default:
- $info = (empty($this->imagestring)) ? getimagesize($this->filename) : getimagesizefromstring($this->imagestring);
- $mimetype = $info['mime'];
- unset($info);
- break;
- }
-
- // Output the image
- header('Content-Type: '.$mimetype);
- switch ($mimetype) {
- case 'image/gif':
- imagegif($this->image);
- break;
- case 'image/jpeg':
- imagejpeg($this->image, null, round($quality));
- break;
- case 'image/png':
- imagepng($this->image, null, round(9 * $quality / 100));
- break;
- default:
- throw new Exception('Unsupported image format: '.$this->filename);
- break;
- }
- }
-
- /**
- * Outputs image as data base64 to use as img src
- *
- * @param null|string $format If omitted or null - format of original file will be used, may be gif|jpg|png
- * @param int|null $quality Output image quality in percents 0-100
- *
- * @return string
- * @throws Exception
- *
- */
- function output_base64($format = null, $quality = null) {
-
- // Determine quality
- $quality = $quality ?: $this->quality;
-
- // Determine mimetype
- switch (strtolower($format)) {
- case 'gif':
- $mimetype = 'image/gif';
- break;
- case 'jpeg':
- case 'jpg':
- imageinterlace($this->image, true);
- $mimetype = 'image/jpeg';
- break;
- case 'png':
- $mimetype = 'image/png';
- break;
- default:
- $info = getimagesize($this->filename);
- $mimetype = $info['mime'];
- unset($info);
- break;
- }
-
- // Output the image
- ob_start();
- switch ($mimetype) {
- case 'image/gif':
- imagegif($this->image);
- break;
- case 'image/jpeg':
- imagejpeg($this->image, null, round($quality));
- break;
- case 'image/png':
- imagepng($this->image, null, round(9 * $quality / 100));
- break;
- default:
- throw new Exception('Unsupported image format: '.$this->filename);
- break;
- }
- $image_data = ob_get_contents();
- ob_end_clean();
-
- // Returns formatted string for img src
- return 'data:'.$mimetype.';base64,'.base64_encode($image_data);
-
- }
-
- /**
- * Overlay
- *
- * Overlay an image on top of another, works with 24-bit PNG alpha-transparency
- *
- * @param string $overlay An image filename or a SimpleImage object
- * @param string $position center|top|left|bottom|right|top left|top right|bottom left|bottom right
- * @param float|int $opacity Overlay opacity 0-1
- * @param int $x_offset Horizontal offset in pixels
- * @param int $y_offset Vertical offset in pixels
- *
- * @return SimpleImage
- *
- */
- function overlay($overlay, $position = 'center', $opacity = 1, $x_offset = 0, $y_offset = 0) {
-
- // Load overlay image
- if( !($overlay instanceof SimpleImage) ) {
- $overlay = new SimpleImage($overlay);
- }
-
- // Convert opacity
- $opacity = $opacity * 100;
-
- // Determine position
- switch (strtolower($position)) {
- case 'top left':
- $x = 0 + $x_offset;
- $y = 0 + $y_offset;
- break;
- case 'top right':
- $x = $this->width - $overlay->width + $x_offset;
- $y = 0 + $y_offset;
- break;
- case 'top':
- $x = ($this->width / 2) - ($overlay->width / 2) + $x_offset;
- $y = 0 + $y_offset;
- break;
- case 'bottom left':
- $x = 0 + $x_offset;
- $y = $this->height - $overlay->height + $y_offset;
- break;
- case 'bottom right':
- $x = $this->width - $overlay->width + $x_offset;
- $y = $this->height - $overlay->height + $y_offset;
- break;
- case 'bottom':
- $x = ($this->width / 2) - ($overlay->width / 2) + $x_offset;
- $y = $this->height - $overlay->height + $y_offset;
- break;
- case 'left':
- $x = 0 + $x_offset;
- $y = ($this->height / 2) - ($overlay->height / 2) + $y_offset;
- break;
- case 'right':
- $x = $this->width - $overlay->width + $x_offset;
- $y = ($this->height / 2) - ($overlay->height / 2) + $y_offset;
- break;
- case 'center':
- default:
- $x = ($this->width / 2) - ($overlay->width / 2) + $x_offset;
- $y = ($this->height / 2) - ($overlay->height / 2) + $y_offset;
- break;
- }
-
- // Perform the overlay
- $this->imagecopymerge_alpha($this->image, $overlay->image, $x, $y, 0, 0, $overlay->width, $overlay->height, $opacity);
-
- return $this;
-
- }
-
- /**
- * Pixelate
- *
- * @param int $block_size Size in pixels of each resulting block
- *
- * @return SimpleImage
- *
- */
- function pixelate($block_size = 10) {
- imagefilter($this->image, IMG_FILTER_PIXELATE, $block_size, true);
- return $this;
- }
-
- /**
- * Resize an image to the specified dimensions
- *
- * @param int $width
- * @param int $height
- *
- * @return SimpleImage
- *
- */
- function resize($width, $height) {
-
- // Generate new GD image
- $new = imagecreatetruecolor($width, $height);
-
- if( $this->original_info['format'] === 'gif' ) {
- // Preserve transparency in GIFs
- $transparent_index = imagecolortransparent($this->image);
- $palletsize = imagecolorstotal($this->image);
- if ($transparent_index >= 0 && $transparent_index < $palletsize) {
- $transparent_color = imagecolorsforindex($this->image, $transparent_index);
- $transparent_index = imagecolorallocate($new, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
- imagefill($new, 0, 0, $transparent_index);
- imagecolortransparent($new, $transparent_index);
- }
- } else {
- // Preserve transparency in PNGs (benign for JPEGs)
- imagealphablending($new, false);
- imagesavealpha($new, true);
- }
-
- // Resize
- imagecopyresampled($new, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);
-
- // Update meta data
- $this->width = $width;
- $this->height = $height;
- $this->image = $new;
-
- return $this;
-
- }
-
- /**
- * Rotate an image
- *
- * @param int $angle 0-360
- * @param string $bg_color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- *
- * @return SimpleImage
- *
- */
- function rotate($angle, $bg_color = '#000000') {
-
- // Perform the rotation
- $rgba = $this->normalize_color($bg_color);
- $bg_color = imagecolorallocatealpha($this->image, $rgba['r'], $rgba['g'], $rgba['b'], $rgba['a']);
- $new = imagerotate($this->image, -($this->keep_within($angle, -360, 360)), $bg_color);
- imagesavealpha($new, true);
- imagealphablending($new, true);
-
- // Update meta data
- $this->width = imagesx($new);
- $this->height = imagesy($new);
- $this->image = $new;
-
- return $this;
-
- }
-
- /**
- * Save an image
- *
- * The resulting format will be determined by the file extension.
- *
- * @param null|string $filename If omitted - original file will be overwritten
- * @param null|int $quality Output image quality in percents 0-100
- * @param null|string $format The format to use; determined by file extension if null
- *
- * @return SimpleImage
- * @throws Exception
- *
- */
- function save($filename = null, $quality = null, $format = null) {
-
- // Determine quality, filename, and format
- $quality = $quality ?: $this->quality;
- $filename = $filename ?: $this->filename;
- if( !$format ) {
- $format = $this->file_ext($filename) ?: $this->original_info['format'];
- }
-
- // Create the image
- switch (strtolower($format)) {
- case 'gif':
- $result = imagegif($this->image, $filename);
- break;
- case 'jpg':
- case 'jpeg':
- imageinterlace($this->image, true);
- $result = imagejpeg($this->image, $filename, round($quality));
- break;
- case 'png':
- $result = imagepng($this->image, $filename, round(9 * $quality / 100));
- break;
- default:
- throw new Exception('Unsupported format');
- }
-
- if (!$result) {
- throw new Exception('Unable to save image: ' . $filename);
- }
-
- return $this;
-
- }
-
- /**
- * Sepia
- *
- * @return SimpleImage
- *
- */
- function sepia() {
- imagefilter($this->image, IMG_FILTER_GRAYSCALE);
- imagefilter($this->image, IMG_FILTER_COLORIZE, 100, 50, 0);
- return $this;
- }
-
- /**
- * Sketch
- *
- * @return SimpleImage
- *
- */
- function sketch() {
- imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL);
- return $this;
- }
-
- /**
- * Smooth
- *
- * @param int $level Min = -10, max = 10
- *
- * @return SimpleImage
- *
- */
- function smooth($level) {
- imagefilter($this->image, IMG_FILTER_SMOOTH, $this->keep_within($level, -10, 10));
- return $this;
- }
-
- /**
- * Add text to an image
- *
- * @param string $text
- * @param string $font_file
- * @param float|int $font_size
- * @param string $color
- * @param string $position
- * @param int $x_offset
- * @param int $y_offset
- *
- * @return SimpleImage
- * @throws Exception
- *
- */
- function text($text, $font_file, $font_size = 12, $color = '#000000', $position = 'center', $x_offset = 0, $y_offset = 0) {
-
- // todo - this method could be improved to support the text angle
- $angle = 0;
-
- // Determine text color
- $rgba = $this->normalize_color($color);
- $color = imagecolorallocatealpha($this->image, $rgba['r'], $rgba['g'], $rgba['b'], $rgba['a']);
-
- // Determine textbox size
- $box = imagettfbbox($font_size, $angle, $font_file, $text);
- if (!$box) {
- throw new Exception('Unable to load font: '.$font_file);
- }
- $box_width = abs($box[6] - $box[2]);
- $box_height = abs($box[7] - $box[1]);
-
- // Determine position
- switch (strtolower($position)) {
- case 'top left':
- $x = 0 + $x_offset;
- $y = 0 + $y_offset + $box_height;
- break;
- case 'top right':
- $x = $this->width - $box_width + $x_offset;
- $y = 0 + $y_offset + $box_height;
- break;
- case 'top':
- $x = ($this->width / 2) - ($box_width / 2) + $x_offset;
- $y = 0 + $y_offset + $box_height;
- break;
- case 'bottom left':
- $x = 0 + $x_offset;
- $y = $this->height - $box_height + $y_offset + $box_height;
- break;
- case 'bottom right':
- $x = $this->width - $box_width + $x_offset;
- $y = $this->height - $box_height + $y_offset + $box_height;
- break;
- case 'bottom':
- $x = ($this->width / 2) - ($box_width / 2) + $x_offset;
- $y = $this->height - $box_height + $y_offset + $box_height;
- break;
- case 'left':
- $x = 0 + $x_offset;
- $y = ($this->height / 2) - (($box_height / 2) - $box_height) + $y_offset;
- break;
- case 'right';
- $x = $this->width - $box_width + $x_offset;
- $y = ($this->height / 2) - (($box_height / 2) - $box_height) + $y_offset;
- break;
- case 'center':
- default:
- $x = ($this->width / 2) - ($box_width / 2) + $x_offset;
- $y = ($this->height / 2) - (($box_height / 2) - $box_height) + $y_offset;
- break;
- }
-
- // Add the text
- imagesavealpha($this->image, true);
- imagealphablending($this->image, true);
- imagettftext($this->image, $font_size, $angle, $x, $y, $color, $font_file, $text);
-
- return $this;
-
- }
-
- /**
- * Thumbnail
- *
- * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the
- * remaining overflow (from the center) to get the image to be the size specified. Useful for generating thumbnails.
- *
- * @param int $width
- * @param int|null $height If omitted - assumed equal to $width
- *
- * @return SimpleImage
- *
- */
- function thumbnail($width, $height = null) {
-
- // Determine height
- $height = $height ?: $width;
-
- // Determine aspect ratios
- $current_aspect_ratio = $this->height / $this->width;
- $new_aspect_ratio = $height / $width;
-
- // Fit to height/width
- if ($new_aspect_ratio > $current_aspect_ratio) {
- $this->fit_to_height($height);
- } else {
- $this->fit_to_width($width);
- }
- $left = floor(($this->width / 2) - ($width / 2));
- $top = floor(($this->height / 2) - ($height / 2));
-
- // Return trimmed image
- return $this->crop($left, $top, $width + $left, $height + $top);
-
- }
-
- /**
- * Returns the file extension of the specified file
- *
- * @param string $filename
- *
- * @return string
- *
- */
- protected function file_ext($filename) {
-
- if (!preg_match('/\./', $filename)) {
- return '';
- }
-
- return preg_replace('/^.*\./', '', $filename);
-
- }
-
- /**
- * Get meta data of image or base64 string
- *
- * @param string|null $imagestring If omitted treat as a normal image
- *
- * @return SimpleImage
- * @throws Exception
- *
- */
- protected function get_meta_data() {
- //gather meta data
- if(empty($this->imagestring)) {
- $info = getimagesize($this->filename);
-
- switch ($info['mime']) {
- case 'image/gif':
- $this->image = imagecreatefromgif($this->filename);
- break;
- case 'image/jpeg':
- $this->image = imagecreatefromjpeg($this->filename);
- break;
- case 'image/png':
- $this->image = imagecreatefrompng($this->filename);
- break;
- default:
- throw new Exception('Invalid image: '.$this->filename);
- break;
- }
- } elseif (function_exists('getimagesizefromstring')) {
- $info = getimagesizefromstring($this->imagestring);
- } else {
- throw new Exception('PHP 5.4 is required to use method getimagesizefromstring');
- }
-
- $this->original_info = array(
- 'width' => $info[0],
- 'height' => $info[1],
- 'orientation' => $this->get_orientation(),
- 'exif' => function_exists('exif_read_data') && $info['mime'] === 'image/jpeg' && $this->imagestring === null ? $this->exif = @exif_read_data($this->filename) : null,
- 'format' => preg_replace('/^image\//', '', $info['mime']),
- 'mime' => $info['mime']
- );
- $this->width = $info[0];
- $this->height = $info[1];
-
- imagesavealpha($this->image, true);
- imagealphablending($this->image, true);
-
- return $this;
-
- }
-
- /**
- * Same as PHP's imagecopymerge() function, except preserves alpha-transparency in 24-bit PNGs
- *
- * @param $dst_im
- * @param $src_im
- * @param $dst_x
- * @param $dst_y
- * @param $src_x
- * @param $src_y
- * @param $src_w
- * @param $src_h
- * @param $pct
- *
- * @link http://www.php.net/manual/en/function.imagecopymerge.php#88456
- *
- */
- protected function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) {
-
- // Get image width and height and percentage
- $pct /= 100;
- $w = imagesx($src_im);
- $h = imagesy($src_im);
-
- // Turn alpha blending off
- imagealphablending($src_im, false);
-
- // Find the most opaque pixel in the image (the one with the smallest alpha value)
- $minalpha = 127;
- for ($x = 0; $x < $w; $x++) {
- for ($y = 0; $y < $h; $y++) {
- $alpha = (imagecolorat($src_im, $x, $y) >> 24) & 0xFF;
- if ($alpha < $minalpha) {
- $minalpha = $alpha;
- }
- }
- }
-
- // Loop through image pixels and modify alpha for each
- for ($x = 0; $x < $w; $x++) {
- for ($y = 0; $y < $h; $y++) {
- // Get current alpha value (represents the TANSPARENCY!)
- $colorxy = imagecolorat($src_im, $x, $y);
- $alpha = ($colorxy >> 24) & 0xFF;
- // Calculate new alpha
- if ($minalpha !== 127) {
- $alpha = 127 + 127 * $pct * ($alpha - 127) / (127 - $minalpha);
- } else {
- $alpha += 127 * $pct;
- }
- // Get the color index with new alpha
- $alphacolorxy = imagecolorallocatealpha($src_im, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha);
- // Set pixel with the new color + opacity
- if (!imagesetpixel($src_im, $x, $y, $alphacolorxy)) {
- return;
- }
- }
- }
-
- // Copy it
- imagesavealpha($dst_im, true);
- imagealphablending($dst_im, true);
- imagesavealpha($src_im, true);
- imagealphablending($src_im, true);
- imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
-
- }
-
- /**
- * Ensures $value is always within $min and $max range.
- *
- * If lower, $min is returned. If higher, $max is returned.
- *
- * @param int|float $value
- * @param int|float $min
- * @param int|float $max
- *
- * @return int|float
- *
- */
- protected function keep_within($value, $min, $max) {
-
- if ($value < $min) {
- return $min;
- }
-
- if ($value > $max) {
- return $max;
- }
-
- return $value;
-
- }
-
- /**
- * Converts a hex color value to its RGB equivalent
- *
- * @param string $color Hex color string, array(red, green, blue) or array(red, green, blue, alpha).
- * Where red, green, blue - integers 0-255, alpha - integer 0-127
- *
- * @return array|bool
- *
- */
- protected function normalize_color($color) {
-
- if (is_string($color)) {
-
- $color = trim($color, '#');
-
- if (strlen($color) == 6) {
- list($r, $g, $b) = array(
- $color[0].$color[1],
- $color[2].$color[3],
- $color[4].$color[5]
- );
- } elseif (strlen($color) == 3) {
- list($r, $g, $b) = array(
- $color[0].$color[0],
- $color[1].$color[1],
- $color[2].$color[2]
- );
- } else {
- return false;
- }
- return array(
- 'r' => hexdec($r),
- 'g' => hexdec($g),
- 'b' => hexdec($b),
- 'a' => 0
- );
-
- } elseif (is_array($color) && (count($color) == 3 || count($color) == 4)) {
-
- if (isset($color['r'], $color['g'], $color['b'])) {
- return array(
- 'r' => $this->keep_within($color['r'], 0, 255),
- 'g' => $this->keep_within($color['g'], 0, 255),
- 'b' => $this->keep_within($color['b'], 0, 255),
- 'a' => $this->keep_within(isset($color['a']) ? $color['a'] : 0, 0, 127)
- );
- } elseif (isset($color[0], $color[1], $color[2])) {
- return array(
- 'r' => $this->keep_within($color[0], 0, 255),
- 'g' => $this->keep_within($color[1], 0, 255),
- 'b' => $this->keep_within($color[2], 0, 255),
- 'a' => $this->keep_within(isset($color[3]) ? $color[3] : 0, 0, 127)
- );
- }
-
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/src/classes/StatusChangeLogManager.php b/src/classes/StatusChangeLogManager.php
deleted file mode 100644
index 63d3b7dc..00000000
--- a/src/classes/StatusChangeLogManager.php
+++ /dev/null
@@ -1,72 +0,0 @@
-type = $type;
- $statusChangeLog->element = $element;
- $statusChangeLog->user_id = $userId;
- $statusChangeLog->status_from = $oldStatus;
- $statusChangeLog->status_to = $newStatus;
- $statusChangeLog->created = date("Y-m-d H:i:s");
- $statusChangeLog->data = $note;
- $ok = $statusChangeLog->Save();
- if(!$ok){
- LogManager::getInstance()->info($statusChangeLog->ErrorMsg());
- return new IceResponse(IceResponse::ERROR, NULL);
- }
-
- return new IceResponse(IceResponse::SUCCESS, $statusChangeLog);
- }
-
- public function getLogs($type, $element){
- $statusChangeLog = new StatusChangeLog();
- $logsTemp = $statusChangeLog->Find("type = ? and element = ? order by created",array($type, $element));
- $logs = array();
- foreach($logsTemp as $statusChangeLog){
- $t = array();
- $t['time'] = $statusChangeLog->created;
- $t['status_from'] = $statusChangeLog->status_from;
- $t['status_to'] = $statusChangeLog->status_to;
- $t['time'] = $statusChangeLog->created;
- $userName = null;
- if(!empty($statusChangeLog->user_id)){
- $lgUser = new User();
- $lgUser->Load("id = ?",array($statusChangeLog->user_id));
- if($lgUser->id == $statusChangeLog->user_id){
- if(!empty($lgUser->employee)){
- $lgEmployee = new Employee();
- $lgEmployee->Load("id = ?",array($lgUser->employee));
- $userName = $lgEmployee->first_name." ".$lgEmployee->last_name;
- }else{
- $userName = $lgUser->userName;
- }
-
- }
- }
-
- if(!empty($userName)){
- $t['note'] = $statusChangeLog->data." (by: ".$userName.")";
- }else{
- $t['note'] = $statusChangeLog->data;
- }
-
- $logs[] = $t;
- }
-
- return new IceResponse(IceResponse::SUCCESS, $logs);
- }
-
-}
\ No newline at end of file
diff --git a/src/classes/SubActionManager.php b/src/classes/SubActionManager.php
deleted file mode 100644
index 954da6ab..00000000
--- a/src/classes/SubActionManager.php
+++ /dev/null
@@ -1,104 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-class IceResponse{
-
- const SUCCESS = "SUCCESS";
- const ERROR = "ERROR";
-
- var $status;
- var $data;
-
- public function __construct($status,$data = null){
- $this->status = $status;
- $this->data = $data;
- }
-
- public function getStatus(){
- return $this->status;
- }
-
- public function getData(){
- return $this->data;
- }
-
- public function getObject(){
- return $this->data;
- }
-
- public function getJsonArray(){
- return array("status"=>$this->status,"data"=>$this->data);
- }
-}
-
-abstract class SubActionManager{
- var $user = null;
- protected $baseService = null;
- var $emailTemplates = null;
- var $emailSender = null;
-
- public function setUser($user){
- $this->user = $user;
- }
-
- public function setBaseService($baseService){
- $this->baseService = $baseService;
- }
-
- public function getCurrentProfileId(){
- return $this->baseService->getCurrentProfileId();
- }
-
- public function setEmailTemplates($emailTemplates){
-
- $this->emailTemplates = $emailTemplates;
-
- }
-
- public function getEmailTemplate($name){
- //Read module email templates
- if($this->emailTemplates == null){
- $this->emailTemplates = array();
- if(is_dir(MODULE_PATH.'/emailTemplates/')){
- $ams = scandir(MODULE_PATH.'/emailTemplates/');
- foreach($ams as $am){
- if(!is_dir(MODULE_PATH.'/emailTemplates/'.$am) && $am != '.' && $am != '..'){
- $this->emailTemplates[$am] = file_get_contents(MODULE_PATH.'/emailTemplates/'.$am);
- }
- }
- }
- }
-
- return $this->emailTemplates[$name];
- }
-
- public function setEmailSender($emailSender){
- $this->emailSender = $emailSender;
- }
-
- public function getUserFromProfileId($profileId){
- return $this->baseService->getUserFromProfileId($profileId);
- }
-
-
-}
\ No newline at end of file
diff --git a/src/classes/UIManager.php b/src/classes/UIManager.php
deleted file mode 100644
index cd18b560..00000000
--- a/src/classes/UIManager.php
+++ /dev/null
@@ -1,257 +0,0 @@
-tempates[$name])){
- return $this->tempates[$name];
- }
-
- $this->tempates[$name] = file_get_contents(APP_BASE_PATH."templates/".$type."/".$name.".html");
-
- return $this->tempates[$name];
- }
-
- public function populateTemplate($name, $type, $params){
- $template= $this->getTemplate($name, $type);
- foreach($params as $key=>$value){
- $template = str_replace("#_".$key."_#", $value, $template);
- }
-
- return LanguageManager::translateTnrText($template);
- }
-
- public function setCurrentUser($user){
- $this->user = $user;
- }
-
- public function setHomeLink($homeLink){
- $this->homeLink = $homeLink;
- }
-
- public function setProfiles($profileCurrent, $profileSwitched){
- $this->currentProfile = $profileCurrent;
- $this->switchedProfile = $profileSwitched;
-
- if(!empty($profileCurrent) && !empty($profileSwitched)){
-
- $this->currentProfileBlock = array(
- "profileImage"=>$profileCurrent->image,
- "firstName"=>$profileCurrent->first_name,
- "lastName"=>$profileCurrent->last_name
- );
-
- $this->switchedProfileBlock = array(
- "profileImage"=>$profileSwitched->image,
- "firstName"=>$profileSwitched->first_name,
- "lastName"=>$profileSwitched->last_name
- );
-
- } else if(!empty($profileCurrent)){
-
- $this->currentProfileBlock = array(
- "profileImage"=>$profileCurrent->image,
- "firstName"=>$profileCurrent->first_name,
- "lastName"=>$profileCurrent->last_name
- );
-
- } else if(!empty($profileSwitched)){
-
- $this->currentProfileBlock = array(
- "profileImage"=>BASE_URL."images/user_male.png",
- "firstName"=>$this->user->username,
- "lastName"=>""
- );
-
- $this->switchedProfileBlock = array(
- "profileImage"=>$profileSwitched->image,
- "firstName"=>$profileSwitched->first_name,
- "lastName"=>$profileSwitched->last_name
- );
-
- }else{
-
- $this->currentProfileBlock = array(
- "profileImage"=>BASE_URL."images/user_male.png",
- "firstName"=>$this->user->username,
- "lastName"=>""
- );
- }
- }
-
- public function getProfileBlocks(){
- $tempateProfileBlock = "";
- $tempateProfileBlock = $this->populateTemplate('profile_info', 'app', $this->currentProfileBlock);
- if(!empty($this->switchedProfileBlock)){
- $tempateProfileBlock .= $this->populateTemplate('switched_profile_info', 'app', $this->switchedProfileBlock);
- }
- return $tempateProfileBlock;
- }
-
- public function getMenuBlocks(){
- $manuItems = array();
-
- if(!empty($this->quickAccessMenuItems)){
- $itemsHtml = $this->getQuickAccessMenuItemsHTML();
- if(!empty($itemsHtml)){
- $manuItems[] = new MenuItemTemplate('menuButtonQuick', array("ITEMS"=>$itemsHtml));
- }
-
- }
-
- $manuItems[] = new MenuItemTemplate('menuButtonNotification', array());
- if($this->user->user_level == "Admin"){
- $manuItems[] = new MenuItemTemplate('menuButtonSwitchProfile', array());
- }
-
- if(!empty($this->currentProfile)){
-
- $manuItems[] = new MenuItemTemplate('menuButtonProfile', array(
- "profileImage"=>$this->currentProfile->image,
- "firstName"=>$this->currentProfile->first_name,
- "lastName"=>$this->currentProfile->last_name,
- "homeLink"=>$this->homeLink,
- "CLIENT_BASE_URL"=>CLIENT_BASE_URL
-
- ));
- }else{
-
- $manuItems[] = new MenuItemTemplate('menuButtonProfile', array(
- "profileImage"=>BASE_URL."images/user_male.png",
- "firstName"=>$this->user->username,
- "lastName"=>"",
- "homeLink"=>$this->homeLink,
- "CLIENT_BASE_URL"=>CLIENT_BASE_URL
-
- ));
- }
-
- if($this->user->user_level == "Admin"){
-
- $other = '';
- if(class_exists('ProVersion')){
- $pro = new ProVersion();
- if(method_exists($pro, 'getDetails')){
- $other = $pro->getDetails();
- }
- }
-
-
- $manuItems[] = new MenuItemTemplate('menuButtonHelp', array(
- "APP_NAME"=>APP_NAME,
- "VERSION"=>VERSION,
- "VERSION_DATE"=>VERSION_DATE,
- "OTHER"=>$other
- ));
- }
-
- return $manuItems;
-
- }
-
- public function getMenuItemsHTML(){
- $menuItems = $this->getMenuBlocks();
- $menuHtml = "";
- foreach($menuItems as $item){
- $menuHtml.=$item->getHtml();
- }
-
- return $menuHtml;
- }
-
- public function addQuickAccessMenuItem($name, $icon, $link, $userLevels = array()){
- $newName = LanguageManager::tran($name);
- $this->quickAccessMenuItems[] = array($newName, $icon, $link, $userLevels);
- }
-
- public function getQuickAccessMenuItemsHTML(){
- $html = "";
- $user = BaseService::getInstance()->getCurrentUser();
- foreach($this->quickAccessMenuItems as $item){
- if(empty($item[3]) || in_array($user->user_level,$item[3])){
- $html .= ' '.$item[0].'';
- }
-
- }
-
- return $html;
- }
-
- public function renderModule($moduleBuilder){
- $str = '__tabPages__';
- $str = str_replace("__tabHeaders__",$moduleBuilder->getTabHeadersHTML(), $str);
- $str = str_replace("__tabPages__",$moduleBuilder->getTabPagesHTML(), $str);
- $str = str_replace("__tabJs__",$moduleBuilder->getModJsHTML(), $str);
- return $str;
- }
-
-
- public function getCompanyLogoUrl(){
- $logoFileSet = false;
- $logoFileName = CLIENT_BASE_PATH."data/logo.png";
- $logoSettings = SettingsManager::getInstance()->getSetting("Company: Logo");
- if(!empty($logoSettings)){
- $logoFileName = FileService::getInstance()->getFileUrl($logoSettings);
- $logoFileSet = true;
- }
-
- if(!$logoFileSet && !file_exists($logoFileName)){
- return BASE_URL."images/logo.png";
- }
-
- return $logoFileName;
- }
-
-}
-
-
-
-//Menu Items
-
-class MenuItemTemplate{
-
- public $templateName;
- public $params;
-
- public function __construct($templateName, $params){
- $this->templateName = $templateName;
- $this->params = $params;
- }
-
- public function getHtml(){
- return UIManager::getInstance()->populateTemplate($this->templateName, 'menu', $this->params);
- }
-
-}
-
-
-
-
-
-
diff --git a/src/classes/UserService.php b/src/classes/UserService.php
deleted file mode 100644
index 1181858a..00000000
--- a/src/classes/UserService.php
+++ /dev/null
@@ -1,28 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-class UserService{
- public function getAuthUser($username, $password){
-
- }
-}
\ No newline at end of file
diff --git a/src/classes/crypt/Aes.php b/src/classes/crypt/Aes.php
deleted file mode 100644
index 8c7827ab..00000000
--- a/src/classes/crypt/Aes.php
+++ /dev/null
@@ -1,165 +0,0 @@
- 6 && $i%$Nk == 4) {
- $temp = self::subWord($temp);
- }
- for ($t=0; $t<4; $t++) $w[$i][$t] = $w[$i-$Nk][$t] ^ $temp[$t];
- }
- return $w;
- }
-
- private static function subWord($w) { // apply SBox to 4-byte word w
- for ($i=0; $i<4; $i++) $w[$i] = self::$sBox[$w[$i]];
- return $w;
- }
-
- private static function rotWord($w) { // rotate 4-byte word w left by one byte
- $tmp = $w[0];
- for ($i=0; $i<3; $i++) $w[$i] = $w[$i+1];
- $w[3] = $tmp;
- return $w;
- }
-
- // sBox is pre-computed multiplicative inverse in GF(2^8) used in subBytes and keyExpansion [5.1.1]
- private static $sBox = array(
- 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,
- 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,
- 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,
- 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,
- 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,
- 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,
- 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,
- 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,
- 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,
- 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,
- 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,
- 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,
- 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,
- 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,
- 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,
- 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16);
-
- // rCon is Round Constant used for the Key Expansion [1st col is 2^(r-1) in GF(2^8)] [5.2]
- private static $rCon = array(
- array(0x00, 0x00, 0x00, 0x00),
- array(0x01, 0x00, 0x00, 0x00),
- array(0x02, 0x00, 0x00, 0x00),
- array(0x04, 0x00, 0x00, 0x00),
- array(0x08, 0x00, 0x00, 0x00),
- array(0x10, 0x00, 0x00, 0x00),
- array(0x20, 0x00, 0x00, 0x00),
- array(0x40, 0x00, 0x00, 0x00),
- array(0x80, 0x00, 0x00, 0x00),
- array(0x1b, 0x00, 0x00, 0x00),
- array(0x36, 0x00, 0x00, 0x00) );
-
-}
-
-/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-?>
\ No newline at end of file
diff --git a/src/classes/crypt/AesCtr.php b/src/classes/crypt/AesCtr.php
deleted file mode 100644
index ba68f6ba..00000000
--- a/src/classes/crypt/AesCtr.php
+++ /dev/null
@@ -1,164 +0,0 @@
->> operator nor unsigned ints
- *
- * @param a number to be shifted (32-bit integer)
- * @param b number of bits to shift a to the right (0..31)
- * @return a right-shifted and zero-filled by b bits
- */
- private static function urs($a, $b) {
- $a &= 0xffffffff; $b &= 0x1f; // (bounds check)
- if ($a&0x80000000 && $b>0) { // if left-most bit set
- $a = ($a>>1) & 0x7fffffff; // right-shift one bit & clear left-most bit
- $a = $a >> ($b-1); // remaining right-shifts
- } else { // otherwise
- $a = ($a>>$b); // use normal right-shift
- }
- return $a;
- }
-
-}
-/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-?>
\ No newline at end of file
diff --git a/src/common.cron.tasks.php b/src/common.cron.tasks.php
deleted file mode 100644
index c38150ca..00000000
--- a/src/common.cron.tasks.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Find("status = ? limit 10",array('Pending'));
- $emailSender = BaseService::getInstance()->getEmailSender();
- foreach($emails as $email){
- try{
- $emailSender->sendEmailFromDB($email);
- }catch(Exception $e){
- LogManager::getInstance()->error("Error sending email:".$e->getMessage());
- }
-
- $email->status = 'Sent';
- $email->updated = date('Y-m-d H:i:s');
- $email->Save();
- }
- }
-}
-
-
-include('common.cron.tasks.ext.php');
\ No newline at end of file
diff --git a/src/composer/composer.json b/src/composer/composer.json
deleted file mode 100644
index c04a2382..00000000
--- a/src/composer/composer.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "require": {
- "monolog/monolog": "1.13.1",
- "twig/twig": "1.23.*",
- "gettext/gettext": "4.0.0"
- },
- "require-dev": {
- }
-}
\ No newline at end of file
diff --git a/src/composer/composer.lock b/src/composer/composer.lock
deleted file mode 100644
index 8c6dc6b4..00000000
--- a/src/composer/composer.lock
+++ /dev/null
@@ -1,305 +0,0 @@
-{
- "_readme": [
- "This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
- "This file is @generated automatically"
- ],
- "hash": "95e43fed311dc21e1acaec81abd3dcda",
- "content-hash": "cfb1065268b2b1b5e656e13a78e2b2a4",
- "packages": [
- {
- "name": "gettext/gettext",
- "version": "v4.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/oscarotero/Gettext.git",
- "reference": "7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1",
- "reference": "7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1",
- "shasum": ""
- },
- "require": {
- "gettext/languages": "2.*",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "illuminate/view": "*",
- "symfony/yaml": "~2",
- "twig/extensions": "*",
- "twig/twig": "*"
- },
- "suggest": {
- "illuminate/view": "Is necessary if you want to use the Blade extractor",
- "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator",
- "twig/extensions": "Is necessary if you want to use the Twig extractor",
- "twig/twig": "Is necessary if you want to use the Twig extractor"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Gettext\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Oscar Otero",
- "email": "oom@oscarotero.com",
- "homepage": "http://oscarotero.com",
- "role": "Developer"
- }
- ],
- "description": "PHP gettext manager",
- "homepage": "https://github.com/oscarotero/Gettext",
- "keywords": [
- "JS",
- "gettext",
- "i18n",
- "mo",
- "po",
- "translation"
- ],
- "time": "2016-06-15 18:14:14"
- },
- {
- "name": "gettext/languages",
- "version": "2.1.2",
- "source": {
- "type": "git",
- "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git",
- "reference": "c43ade7e3fb68bcf2379036513dce8d20553d9c8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/c43ade7e3fb68bcf2379036513dce8d20553d9c8",
- "reference": "c43ade7e3fb68bcf2379036513dce8d20553d9c8",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Gettext\\Languages\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michele Locati",
- "email": "mlocati@gmail.com",
- "role": "Developer"
- }
- ],
- "description": "gettext languages with plural rules",
- "homepage": "https://github.com/mlocati/cldr-to-gettext-plural-rules",
- "keywords": [
- "cldr",
- "i18n",
- "internationalization",
- "l10n",
- "language",
- "languages",
- "localization",
- "php",
- "plural",
- "plural rules",
- "plurals",
- "translate",
- "translations",
- "unicode"
- ],
- "time": "2015-03-27 11:32:41"
- },
- {
- "name": "monolog/monolog",
- "version": "1.13.1",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/monolog.git",
- "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
- "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0",
- "psr/log": "~1.0"
- },
- "provide": {
- "psr/log-implementation": "1.0.0"
- },
- "require-dev": {
- "aws/aws-sdk-php": "~2.4, >2.4.8",
- "doctrine/couchdb": "~1.0@dev",
- "graylog2/gelf-php": "~1.0",
- "phpunit/phpunit": "~4.0",
- "raven/raven": "~0.5",
- "ruflin/elastica": "0.90.*",
- "swiftmailer/swiftmailer": "~5.3",
- "videlalvaro/php-amqplib": "~2.4"
- },
- "suggest": {
- "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
- "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
- "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
- "ext-mongo": "Allow sending log messages to a MongoDB server",
- "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
- "raven/raven": "Allow sending log messages to a Sentry server",
- "rollbar/rollbar": "Allow sending log messages to Rollbar",
- "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
- "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.13.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Monolog\\": "src/Monolog"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
- "homepage": "http://github.com/Seldaek/monolog",
- "keywords": [
- "log",
- "logging",
- "psr-3"
- ],
- "time": "2015-03-09 09:58:04"
- },
- {
- "name": "psr/log",
- "version": "1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
- "shasum": ""
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Psr\\Log\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ],
- "time": "2012-12-21 11:40:51"
- },
- {
- "name": "twig/twig",
- "version": "v1.23.3",
- "source": {
- "type": "git",
- "url": "https://github.com/twigphp/Twig.git",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae53fc2c312fdee63773b75cb570304f85388b08",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2.7"
- },
- "require-dev": {
- "symfony/debug": "~2.7",
- "symfony/phpunit-bridge": "~2.7"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.23-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Twig_": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Armin Ronacher",
- "email": "armin.ronacher@active-4.com",
- "role": "Project Founder"
- },
- {
- "name": "Twig Team",
- "homepage": "http://twig.sensiolabs.org/contributors",
- "role": "Contributors"
- }
- ],
- "description": "Twig, the flexible, fast, and secure template language for PHP",
- "homepage": "http://twig.sensiolabs.org",
- "keywords": [
- "templating"
- ],
- "time": "2016-01-11 14:02:19"
- }
- ],
- "packages-dev": [],
- "aliases": [],
- "minimum-stability": "stable",
- "stability-flags": [],
- "prefer-stable": false,
- "prefer-lowest": false,
- "platform": [],
- "platform-dev": []
-}
diff --git a/src/composer/composer.phar b/src/composer/composer.phar
deleted file mode 100644
index 63cb0dfb..00000000
Binary files a/src/composer/composer.phar and /dev/null differ
diff --git a/src/composer/vendor/autoload.php b/src/composer/vendor/autoload.php
deleted file mode 100644
index 5aa35507..00000000
--- a/src/composer/vendor/autoload.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- * Jordi Boggiano
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Composer\Autoload;
-
-/**
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
- *
- * $loader = new \Composer\Autoload\ClassLoader();
- *
- * // register classes with namespaces
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * // activate the autoloader
- * $loader->register();
- *
- * // to enable searching the include path (eg. for PEAR packages)
- * $loader->setUseIncludePath(true);
- *
- * In this example, if you try to use a class in the Symfony\Component
- * namespace or one of its children (Symfony\Component\Console for instance),
- * the autoloader will first look for the class under the component/
- * directory, and it will then fallback to the framework/ directory if not
- * found before giving up.
- *
- * This class is loosely based on the Symfony UniversalClassLoader.
- *
- * @author Fabien Potencier
- * @author Jordi Boggiano
- * @see http://www.php-fig.org/psr/psr-0/
- * @see http://www.php-fig.org/psr/psr-4/
- */
-class ClassLoader
-{
- // PSR-4
- private $prefixLengthsPsr4 = array();
- private $prefixDirsPsr4 = array();
- private $fallbackDirsPsr4 = array();
-
- // PSR-0
- private $prefixesPsr0 = array();
- private $fallbackDirsPsr0 = array();
-
- private $useIncludePath = false;
- private $classMap = array();
-
- private $classMapAuthoritative = false;
-
- public function getPrefixes()
- {
- if (!empty($this->prefixesPsr0)) {
- return call_user_func_array('array_merge', $this->prefixesPsr0);
- }
-
- return array();
- }
-
- public function getPrefixesPsr4()
- {
- return $this->prefixDirsPsr4;
- }
-
- public function getFallbackDirs()
- {
- return $this->fallbackDirsPsr0;
- }
-
- public function getFallbackDirsPsr4()
- {
- return $this->fallbackDirsPsr4;
- }
-
- public function getClassMap()
- {
- return $this->classMap;
- }
-
- /**
- * @param array $classMap Class to filename map
- */
- public function addClassMap(array $classMap)
- {
- if ($this->classMap) {
- $this->classMap = array_merge($this->classMap, $classMap);
- } else {
- $this->classMap = $classMap;
- }
- }
-
- /**
- * Registers a set of PSR-0 directories for a given prefix, either
- * appending or prepending to the ones previously set for this prefix.
- *
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
- */
- public function add($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- if ($prepend) {
- $this->fallbackDirsPsr0 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr0
- );
- } else {
- $this->fallbackDirsPsr0 = array_merge(
- $this->fallbackDirsPsr0,
- (array) $paths
- );
- }
-
- return;
- }
-
- $first = $prefix[0];
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
-
- return;
- }
- if ($prepend) {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- (array) $paths,
- $this->prefixesPsr0[$first][$prefix]
- );
- } else {
- $this->prefixesPsr0[$first][$prefix] = array_merge(
- $this->prefixesPsr0[$first][$prefix],
- (array) $paths
- );
- }
- }
-
- /**
- * Registers a set of PSR-4 directories for a given namespace, either
- * appending or prepending to the ones previously set for this namespace.
- *
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
- *
- * @throws \InvalidArgumentException
- */
- public function addPsr4($prefix, $paths, $prepend = false)
- {
- if (!$prefix) {
- // Register directories for the root namespace.
- if ($prepend) {
- $this->fallbackDirsPsr4 = array_merge(
- (array) $paths,
- $this->fallbackDirsPsr4
- );
- } else {
- $this->fallbackDirsPsr4 = array_merge(
- $this->fallbackDirsPsr4,
- (array) $paths
- );
- }
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
- // Register directories for a new namespace.
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- } elseif ($prepend) {
- // Prepend directories for an already registered namespace.
- $this->prefixDirsPsr4[$prefix] = array_merge(
- (array) $paths,
- $this->prefixDirsPsr4[$prefix]
- );
- } else {
- // Append directories for an already registered namespace.
- $this->prefixDirsPsr4[$prefix] = array_merge(
- $this->prefixDirsPsr4[$prefix],
- (array) $paths
- );
- }
- }
-
- /**
- * Registers a set of PSR-0 directories for a given prefix,
- * replacing any others previously set for this prefix.
- *
- * @param string $prefix The prefix
- * @param array|string $paths The PSR-0 base directories
- */
- public function set($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr0 = (array) $paths;
- } else {
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
- }
- }
-
- /**
- * Registers a set of PSR-4 directories for a given namespace,
- * replacing any others previously set for this namespace.
- *
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param array|string $paths The PSR-4 base directories
- *
- * @throws \InvalidArgumentException
- */
- public function setPsr4($prefix, $paths)
- {
- if (!$prefix) {
- $this->fallbackDirsPsr4 = (array) $paths;
- } else {
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- }
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
- }
- }
-
- /**
- * Turns on searching the include path for class files.
- *
- * @param bool $useIncludePath
- */
- public function setUseIncludePath($useIncludePath)
- {
- $this->useIncludePath = $useIncludePath;
- }
-
- /**
- * Can be used to check if the autoloader uses the include path to check
- * for classes.
- *
- * @return bool
- */
- public function getUseIncludePath()
- {
- return $this->useIncludePath;
- }
-
- /**
- * Turns off searching the prefix and fallback directories for classes
- * that have not been registered with the class map.
- *
- * @param bool $classMapAuthoritative
- */
- public function setClassMapAuthoritative($classMapAuthoritative)
- {
- $this->classMapAuthoritative = $classMapAuthoritative;
- }
-
- /**
- * Should class lookup fail if not found in the current class map?
- *
- * @return bool
- */
- public function isClassMapAuthoritative()
- {
- return $this->classMapAuthoritative;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- * @return bool|null True if loaded, null otherwise
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- includeFile($file);
-
- return true;
- }
- }
-
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|false The path if found, false otherwise
- */
- public function findFile($class)
- {
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
- if ('\\' == $class[0]) {
- $class = substr($class, 1);
- }
-
- // class map lookup
- if (isset($this->classMap[$class])) {
- return $this->classMap[$class];
- }
- if ($this->classMapAuthoritative) {
- return false;
- }
-
- $file = $this->findFileWithExtension($class, '.php');
-
- // Search for Hack files if we are running on HHVM
- if ($file === null && defined('HHVM_VERSION')) {
- $file = $this->findFileWithExtension($class, '.hh');
- }
-
- if ($file === null) {
- // Remember that this class does not exist.
- return $this->classMap[$class] = false;
- }
-
- return $file;
- }
-
- private function findFileWithExtension($class, $ext)
- {
- // PSR-4 lookup
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
-
- $first = $class[0];
- if (isset($this->prefixLengthsPsr4[$first])) {
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- if (0 === strpos($class, $prefix)) {
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
- return $file;
- }
- }
- }
- }
- }
-
- // PSR-4 fallback dirs
- foreach ($this->fallbackDirsPsr4 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
- return $file;
- }
- }
-
- // PSR-0 lookup
- if (false !== $pos = strrpos($class, '\\')) {
- // namespaced class name
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
- } else {
- // PEAR-like class name
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
- }
-
- if (isset($this->prefixesPsr0[$first])) {
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
- if (0 === strpos($class, $prefix)) {
- foreach ($dirs as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
- }
- }
- }
-
- // PSR-0 fallback dirs
- foreach ($this->fallbackDirsPsr0 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- return $file;
- }
- }
-
- // PSR-0 include paths.
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
- return $file;
- }
- }
-}
-
-/**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- */
-function includeFile($file)
-{
- include $file;
-}
diff --git a/src/composer/vendor/composer/LICENSE b/src/composer/vendor/composer/LICENSE
deleted file mode 100644
index 1a281248..00000000
--- a/src/composer/vendor/composer/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-
-Copyright (c) 2016 Nils Adermann, Jordi Boggiano
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
diff --git a/src/composer/vendor/composer/autoload_classmap.php b/src/composer/vendor/composer/autoload_classmap.php
deleted file mode 100644
index 7a91153b..00000000
--- a/src/composer/vendor/composer/autoload_classmap.php
+++ /dev/null
@@ -1,9 +0,0 @@
- array($vendorDir . '/twig/twig/lib'),
- 'Psr\\Log\\' => array($vendorDir . '/psr/log'),
-);
diff --git a/src/composer/vendor/composer/autoload_psr4.php b/src/composer/vendor/composer/autoload_psr4.php
deleted file mode 100644
index 11dca6fe..00000000
--- a/src/composer/vendor/composer/autoload_psr4.php
+++ /dev/null
@@ -1,12 +0,0 @@
- array($vendorDir . '/monolog/monolog/src/Monolog'),
- 'Gettext\\Languages\\' => array($vendorDir . '/gettext/languages/src'),
- 'Gettext\\' => array($vendorDir . '/gettext/gettext/src'),
-);
diff --git a/src/composer/vendor/composer/autoload_real.php b/src/composer/vendor/composer/autoload_real.php
deleted file mode 100644
index e81e9eaf..00000000
--- a/src/composer/vendor/composer/autoload_real.php
+++ /dev/null
@@ -1,52 +0,0 @@
-= 50600 && !defined('HHVM_VERSION');
- if ($useStaticLoader) {
- require_once __DIR__ . '/autoload_static.php';
-
- call_user_func(\Composer\Autoload\ComposerStaticInit91d733469d809ee1828b45ab2da48a10::getInitializer($loader));
- } else {
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
-
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
-
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
- }
- }
-
- $loader->register(true);
-
- return $loader;
- }
-}
diff --git a/src/composer/vendor/composer/autoload_static.php b/src/composer/vendor/composer/autoload_static.php
deleted file mode 100644
index 2d99756d..00000000
--- a/src/composer/vendor/composer/autoload_static.php
+++ /dev/null
@@ -1,62 +0,0 @@
-
- array (
- 'Monolog\\' => 8,
- ),
- 'G' =>
- array (
- 'Gettext\\Languages\\' => 18,
- 'Gettext\\' => 8,
- ),
- );
-
- public static $prefixDirsPsr4 = array (
- 'Monolog\\' =>
- array (
- 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
- ),
- 'Gettext\\Languages\\' =>
- array (
- 0 => __DIR__ . '/..' . '/gettext/languages/src',
- ),
- 'Gettext\\' =>
- array (
- 0 => __DIR__ . '/..' . '/gettext/gettext/src',
- ),
- );
-
- public static $prefixesPsr0 = array (
- 'T' =>
- array (
- 'Twig_' =>
- array (
- 0 => __DIR__ . '/..' . '/twig/twig/lib',
- ),
- ),
- 'P' =>
- array (
- 'Psr\\Log\\' =>
- array (
- 0 => __DIR__ . '/..' . '/psr/log',
- ),
- ),
- );
-
- public static function getInitializer(ClassLoader $loader)
- {
- return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit91d733469d809ee1828b45ab2da48a10::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit91d733469d809ee1828b45ab2da48a10::$prefixDirsPsr4;
- $loader->prefixesPsr0 = ComposerStaticInit91d733469d809ee1828b45ab2da48a10::$prefixesPsr0;
-
- }, null, ClassLoader::class);
- }
-}
diff --git a/src/composer/vendor/composer/installed.json b/src/composer/vendor/composer/installed.json
deleted file mode 100644
index b2b9de09..00000000
--- a/src/composer/vendor/composer/installed.json
+++ /dev/null
@@ -1,298 +0,0 @@
-[
- {
- "name": "psr/log",
- "version": "1.0.0",
- "version_normalized": "1.0.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
- "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
- "shasum": ""
- },
- "time": "2012-12-21 11:40:51",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Psr\\Log\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ]
- },
- {
- "name": "monolog/monolog",
- "version": "1.13.1",
- "version_normalized": "1.13.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Seldaek/monolog.git",
- "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
- "reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0",
- "psr/log": "~1.0"
- },
- "provide": {
- "psr/log-implementation": "1.0.0"
- },
- "require-dev": {
- "aws/aws-sdk-php": "~2.4, >2.4.8",
- "doctrine/couchdb": "~1.0@dev",
- "graylog2/gelf-php": "~1.0",
- "phpunit/phpunit": "~4.0",
- "raven/raven": "~0.5",
- "ruflin/elastica": "0.90.*",
- "swiftmailer/swiftmailer": "~5.3",
- "videlalvaro/php-amqplib": "~2.4"
- },
- "suggest": {
- "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
- "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
- "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
- "ext-mongo": "Allow sending log messages to a MongoDB server",
- "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
- "raven/raven": "Allow sending log messages to a Sentry server",
- "rollbar/rollbar": "Allow sending log messages to Rollbar",
- "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
- "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
- },
- "time": "2015-03-09 09:58:04",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.13.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Monolog\\": "src/Monolog"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
- "homepage": "http://github.com/Seldaek/monolog",
- "keywords": [
- "log",
- "logging",
- "psr-3"
- ]
- },
- {
- "name": "twig/twig",
- "version": "v1.23.3",
- "version_normalized": "1.23.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/twigphp/Twig.git",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae53fc2c312fdee63773b75cb570304f85388b08",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2.7"
- },
- "require-dev": {
- "symfony/debug": "~2.7",
- "symfony/phpunit-bridge": "~2.7"
- },
- "time": "2016-01-11 14:02:19",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.23-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Twig_": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Armin Ronacher",
- "email": "armin.ronacher@active-4.com",
- "role": "Project Founder"
- },
- {
- "name": "Twig Team",
- "homepage": "http://twig.sensiolabs.org/contributors",
- "role": "Contributors"
- }
- ],
- "description": "Twig, the flexible, fast, and secure template language for PHP",
- "homepage": "http://twig.sensiolabs.org",
- "keywords": [
- "templating"
- ]
- },
- {
- "name": "gettext/languages",
- "version": "2.1.2",
- "version_normalized": "2.1.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git",
- "reference": "c43ade7e3fb68bcf2379036513dce8d20553d9c8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/c43ade7e3fb68bcf2379036513dce8d20553d9c8",
- "reference": "c43ade7e3fb68bcf2379036513dce8d20553d9c8",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "time": "2015-03-27 11:32:41",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Gettext\\Languages\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michele Locati",
- "email": "mlocati@gmail.com",
- "role": "Developer"
- }
- ],
- "description": "gettext languages with plural rules",
- "homepage": "https://github.com/mlocati/cldr-to-gettext-plural-rules",
- "keywords": [
- "cldr",
- "i18n",
- "internationalization",
- "l10n",
- "language",
- "languages",
- "localization",
- "php",
- "plural",
- "plural rules",
- "plurals",
- "translate",
- "translations",
- "unicode"
- ]
- },
- {
- "name": "gettext/gettext",
- "version": "v4.0.0",
- "version_normalized": "4.0.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/oscarotero/Gettext.git",
- "reference": "7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1",
- "reference": "7efdd4a01afd7fab85a90fb64fb88eeaef06f3b1",
- "shasum": ""
- },
- "require": {
- "gettext/languages": "2.*",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "illuminate/view": "*",
- "symfony/yaml": "~2",
- "twig/extensions": "*",
- "twig/twig": "*"
- },
- "suggest": {
- "illuminate/view": "Is necessary if you want to use the Blade extractor",
- "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator",
- "twig/extensions": "Is necessary if you want to use the Twig extractor",
- "twig/twig": "Is necessary if you want to use the Twig extractor"
- },
- "time": "2016-06-15 18:14:14",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Gettext\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Oscar Otero",
- "email": "oom@oscarotero.com",
- "homepage": "http://oscarotero.com",
- "role": "Developer"
- }
- ],
- "description": "PHP gettext manager",
- "homepage": "https://github.com/oscarotero/Gettext",
- "keywords": [
- "JS",
- "gettext",
- "i18n",
- "mo",
- "po",
- "translation"
- ]
- }
-]
diff --git a/src/composer/vendor/gettext/gettext/CONTRIBUTING.md b/src/composer/vendor/gettext/gettext/CONTRIBUTING.md
deleted file mode 100644
index eda824f9..00000000
--- a/src/composer/vendor/gettext/gettext/CONTRIBUTING.md
+++ /dev/null
@@ -1,17 +0,0 @@
-Contributing to Gettext
-=======================
-
-Looking to contribute something to this library? Here's how you can help.
-
-## Bugs
-
-A bug is a demonstrable problem that is caused by the code in the repository. Good bug reports are extremely helpful – thank you!
-
-Please try to be as detailed as possible in your report. Include specific information about the environment – version of PHP, version of gettext, etc, and steps required to reproduce the issue.
-
-## Pull Requests
-
-Good pull requests – patches, improvements, new features – are a fantastic help. New extractors or generator are welcome. Before create a pull request, please follow these instructions:
-
-* The code must be PSR-2 compliant
-* Write some tests
diff --git a/src/composer/vendor/gettext/gettext/LICENSE b/src/composer/vendor/gettext/gettext/LICENSE
deleted file mode 100644
index 01954d5c..00000000
--- a/src/composer/vendor/gettext/gettext/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Oscar Otero Marzoa
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/src/composer/vendor/gettext/gettext/README.md b/src/composer/vendor/gettext/gettext/README.md
deleted file mode 100644
index 52db3136..00000000
--- a/src/composer/vendor/gettext/gettext/README.md
+++ /dev/null
@@ -1,401 +0,0 @@
-Gettext
-=======
-
-[](https://travis-ci.org/oscarotero/Gettext)
-[](https://scrutinizer-ci.com/g/oscarotero/Gettext/?branch=master)
-[](https://www.versioneye.com/php/gettext:gettext/references)
-[](https://packagist.org/packages/gettext/gettext)
-[](https://packagist.org/packages/gettext/gettext)
-[](https://packagist.org/packages/gettext/gettext)
-[](https://packagist.org/packages/gettext/gettext)
-
-[](https://insight.sensiolabs.com/projects/496dc2a6-43be-4046-a283-f8370239dd47)
-
-Created by Oscar Otero (MIT License)
-
-Gettext is a PHP (>=5.4) library to import/export/edit gettext from PO, MO, PHP, JS files, etc.
-
-## Installation
-
-With composer (recomended):
-
-```
-composer require gettext/gettext
-```
-
-If you don't use composer in your project, you have to download and place this package in a directory of your project. You need to install also [gettext/languages](https://github.com/mlocati/cldr-to-gettext-plural-rules). Then, include the autoloaders of both projects in any place of your php code:
-
-```php
-include_once "libs/gettext/src/autoloader.php";
-include_once "libs/cldr-to-gettext-plural-rules/src/autoloader.php";
-```
-
-## Classes and functions
-
-This package contains the following classes:
-
-* `Gettext\Translation` - A translation definition
-* `Gettext\Translations` - A collection of translations
-* `Gettext\Extractors\*` - Import translations from various sources (po, mo, php, js, etc)
-* `Gettext\Generators\*` - Export translations to various formats (po, mo, php, json, etc)
-* `Gettext\Translator` - To use the translations in your php templates instead the [gettext extension](http://php.net/gettext)
-* `Gettext\GettextTranslator` - To use the [gettext extension](http://php.net/gettext)
-
-## Usage example
-
-```php
-use Gettext\Translations;
-
-//import from a .po file:
-$translations = Translations::fromPoFile('locales/gl.po');
-
-//edit some translations:
-$translation = $translations->find(null, 'apple');
-
-if ($translation) {
- $translation->setTranslation('Mazá');
-}
-
-//export to a php array:
-$translations->toPhpArrayFile('locales/gl.php');
-
-//and to a .mo file
-$translations->toMoFile('Locale/gl/LC_MESSAGES/messages.mo');
-```
-
-If you want use this translations in your php templates without using the gettext extension:
-
-```php
-use Gettext\Translator;
-
-//Create the translator instance
-$t = new Translator();
-
-//Load your translations (exported as PhpArray):
-$t->loadTranslations('locales/gl.php');
-
-//Use it:
-echo $t->gettext('apple'); // "Mazá"
-
-//If you want use global functions:
-$t->register();
-
-echo __('apple'); // "Mazá"
-
-__e('apple'); // "Mazá"
-```
-
-To use this translations with the gettext extension:
-
-```php
-use Gettext\GettextTranslator;
-
-//Create the translator instance
-$t = new GettextTranslator();
-
-//Set the language and load the domain
-$t->setLanguage('gl');
-$t->loadDomain('messages', 'Locale');
-
-//Use it:
-echo $t->gettext('apple'); // "Mazá"
-
-//Or use the gettext functions
-echo gettext('apple'); // "Mazá"
-
-//If you want use the global functions
-$t->register();
-
-echo __('apple'); // "Mazá"
-```
-
-The benefits of using the functions provided by this library (`__()` instead `_()` or `gettext()`) are:
-
-* You are using the same functions, no matter whether the translations are provided by gettext extension or any other method
-* You can use variables easier because sprintf functionality is included. For example: `__('Hello %s', 'world')` instead `sprintf(_('Hello %s'), 'world')`.
-
-## Translation
-
-The `Gettext\Translation` class stores all information about a translation: the original text, the translated text, source references, comments, etc.
-
-```php
-// __construct($context, $original, $plural)
-$translation = new Gettext\Translation('comments', 'One comment', '%s comments');
-
-$translation->setTranslation('Un comentario');
-$translation->setPluralTranslation('%s comentarios');
-
-$translation->addReference('templates/comments/comment.php', 34);
-$translation->addComment('To display the amount of comments in a post');
-
-echo $translation->getContext(); // comments
-echo $translation->getOriginal(); // One comment
-echo $translation->getTranslation(); // Un comentario
-
-// etc...
-```
-
-## Translations
-
-The `Gettext\Translations` class stores a collection of translations:
-
-```php
-$translations = new Gettext\Translations();
-
-//You can add new translations using the array syntax
-$translations[] = new Gettext\Translation('comments', 'One comment', '%s comments');
-
-//Or using the "insert" method
-$insertedTranslation = $translations->insert('comments', 'One comments', '%s comments');
-
-//Find a specific translation
-$translation = $translations->find('comments', 'One comments');
-
-//Edit headers, domain, etc
-$translations->setHeader('Last-Translator', 'Oscar Otero');
-$translations->setDomain('my-blog');
-```
-
-## Extractors
-
-The extrators allows to fetch gettext values from any source. For example, to scan a .po file:
-
-```php
-$translations = new Gettext\Translations();
-
-//From a file
-Gettext\Extractors\Po::fromFile('locales/en.po', $translations);
-
-//From a string
-$string = file_get_contents('locales2/en.po');
-Gettext\Extractors\Po::fromString($string, $translations);
-```
-
-The better way to use extractors is using the magic methods of `Gettext\Translations`:
-
-```php
-//Create a Translations instance using a po file
-$translations = Gettext\Translations::fromPoFile('locales/en.po');
-
-//Add more messages from other files
-$translations->addFromPoFile('locales2/en.po');
-```
-
-The available extractors are the following:
-
-Name | Description | Example
----- | ----------- | --------
-**Blade** | Scans a Blade template (For laravel users). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/4/Input.Blade.php)
-**Csv** | Gets the messages from csv. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Csv.csv)
-**CsvDictionary** | Gets the messages from csv (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/CsvDictionary.csv)
-**Jed** | Gets the messages from a json compatible with [Jed](http://slexaxton.github.com/Jed/). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Jed.json)
-**JsCode** | Scans javascript code looking for all gettext functions (the same than PhpCode but for javascript). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/8/Input.JsCode.js)
-**Json** | Gets the messages from json. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Json.json)
-**JsonDictionary** | Gets the messages from a json (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/JsonDictionary.json)
-**Mo** | Gets the messages from MO. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Mo.mo)
-**PhpArray** | Gets the messages from a php file that returns an array. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/PhpArray.php)
-**PhpCode** | Scans php code looking for all gettext functions (see `translator_functions.php`). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/2/Input.PhpCode.php)
-**Po** | Gets the messages from PO. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Po.po)
-**Twig** | To scan a Twig template. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/6/Input.Twig.php)
-**Xliff** | Gets the messages from [xliff (2.0)](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Xliff.xlf)
-**Yaml** | Gets the messages from yaml. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Yaml.yml)
-**YamlDictionary** | Gets the messages from a yaml (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/YamlDictionary.yml)
-
-## Generators
-
-The generators export a `Gettext\Translations` instance to any format (po, mo, array, etc).
-
-```php
-//Save to a file
-Gettext\Generators\Po::toFile($translations, 'locales/en.po');
-
-//Return as a string
-$content = Gettext\Generators\Po::toString($translations);
-file_put_contents('locales/en.po', $content);
-```
-
-Like extractors, the better way to use generators is using the magic methods of `Gettext\Translations`:
-
-```php
-//Extract messages from a php code file
-$translations = Gettext\Translations::fromPhpCodeFile('templates/index.php');
-
-//Export to a po file
-$translations->toPoFile('locales/en.po');
-
-//Export to a po string
-$content = $translatons->toPoString();
-file_put_contents('locales/en.po', $content);
-```
-
-The available generators are the following:
-
-Name | Description | Example
----- | ----------- | --------
-**Csv** | Exports to csv. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Csv.csv)
-**CsvDictionary** | Exports to csv (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/CsvDictionary.csv)
-**Json** | Exports to json. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Json.json)
-**JsonDictionary** | Exports to json (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/JsonDictionary.json)
-**Mo** | Exports to Mo. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Mo.mo)
-**PhpArray** | Exports to php code that returns an array. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/PhpArray.php)
-**Po** | Exports to Po. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Po.po)
-**Jed** | Exports to json format compatible with [Jed](http://slexaxton.github.com/Jed/). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Jed.json)
-**Xliff** | Exports to [xliff (2.0)](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Xliff.xlf)
-**Yaml** | Exports to yaml. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/Yaml.yml)
-**YamlDictionary** | Exports to yaml (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/1/YamlDictionary.yml)
-
-## Translator
-
-The class `Gettext\Translator` implements the gettext functions in php. Useful if you don't have the native gettext extension for php or want to avoid problems with it. You can load the translations from a php array file or using a `Gettext\Translations` instance:
-
-```php
-use Gettext\Translator;
-
-//Create a new instance of the translator
-$t = new Translator();
-
-//Load the translations using any of the following ways:
-
-// 1. from php files (generated by Gettext\Extractors\PhpArray)
-$t->loadTranslations('locales/gl.php');
-
-// 2. using the array directly
-$array = include 'locales/gl.php';
-$t->loadTranslations($array);
-
-// 3. using a Gettext\Translations instance (slower)
-$translations = Gettext\Translations::fromPoFile('locales/gl.po');
-$t->loadTranslations($translations);
-
-//Now you can use it in your templates
-echo $t->gettext('apple');
-```
-
-## GettextTranslator
-
-The class `Gettext\GettextTranslator` uses the gettext extension. It's useful because combines the performance of using real gettext functions but with the same API than `Translator` class, so you can switch to one or other translator deppending of the environment without change code of your app.
-
-```php
-use Gettext\GettextTranslator;
-
-//Create a new instance
-$t = new GettextTranslator();
-
-//It detects the environment variables to set the locale, but you can change it:
-$t->setLanguage('gl');
-
-//Load the domains:
-$t->loadDomain('messages', 'project/Locale');
-//this means you have the file "project/Locale/gl/LC_MESSAGES/messages.po"
-
-//Now you can use it in your templates
-echo $t->gettext('apple');
-```
-
-## Global functions
-
-To ease the use of translations in your php templates, you can use the provided functions:
-
-```php
-//Register the translator to use the global functions
-$t->register();
-
-echo __('apple'); // it's the same than $t->gettext('apple');
-
-__e('apple'); // it's the same than echo $t->gettext('apple');
-```
-
-You can scan the php files containing these functions and extract the values with the PhpCode extractor:
-
-```html
-
-
-
-
-
-
-```
-
-
-## Merge translations
-
-To work with different translations you may want merge them in an unique file. There are two ways to do this:
-
-The simplest way is adding new translations:
-
-```php
-use Gettext\Translations;
-
-$translations = Translations::fromPoFile('my-file1.po');
-$translations->addFromPoFile('my-file2.po');
-```
-
-A more advanced way is merge two `Translations` instances:
-
-```php
-use Gettext\Translations;
-
-//Create a new Translations instances with our translations.
-
-$translations1 = Translations::fromPoFile('my-file1.po');
-$translations2 = Translations::fromPoFile('my-file2.po');
-
-//Merge one inside other:
-$translations1->mergeWith($translations2);
-
-//Now translations1 has all values
-```
-
-The second argument of `mergeWith` defines how the merge will be done. Use the `Gettext\Merge` constants to configure the merging:
-
-Constant | Description
---------- | -----------
-`Merge::ADD` | Adds the translations from `$translations2` that are missing
-`Merge::REMOVE` | Removes the translations missing in `$translations2`
-`Merge::HEADERS_ADD` | Adds the headers from `$translations2` that are missing
-`Merge::HEADERS_REMOVE` | Removes the headers missing in `$translations2`
-`Merge::HEADERS_OVERRIDE` | Overrides the headers with the values of `$translations2`
-`Merge::LANGUAGE_OVERRIDE` | Set the language defined in `$translations2`
-`Merge::DOMAIN_OVERRIDE` | Set the domain defined in `$translations2`
-`Merge::TRANSLATION_OVERRIDE` | Override the translation and plural translations with the value of `$translation2`
-`Merge::COMMENTS_OURS` | Use only the comments of `$translation1`
-`Merge::COMMENTS_THEIRS` | Use only the comments of `$translation2`
-`Merge::EXTRACTED_COMMENTS_OURS` | Use only the extracted comments of `$translation1`
-`Merge::EXTRACTED_COMMENTS_THEIRS` | Use only the extracted comments of `$translation2`
-`Merge::FLAGS_OURS` | Use only the flags of `$translation1`
-`Merge::FLAGS_THEIRS` | Use only the flags of `$translation2`
-`Merge::REFERENCES_OURS` | Use only the references of `$translation1`
-`Merge::REFERENCES_THEIRS` | Use only the references of `$translation2`
-
-Example:
-
-```php
-use Gettext\Translations;
-use Gettext\Merge;
-
-//Scan the php code to find the latest gettext translations
-$phpTranslations = Translations::fromPhpCodeFile('my-templates.php');
-
-//Get the translations of the code that are stored in a po file
-$poTranslations = Translations::fromPoFile('locale.po');
-
-//Merge the translations from the po file using the references from `$phpTranslations`:
-$translations->mergeWith($poTranslations, Merge::REFERENCES_OURS);
-
-//Now save a po file with the result
-$translations->toPoFile('locale.po');
-```
-
-Note, if the second argument is not defined, the default value is `Merge::DEFAULTS` that's equivalent to `Merge::ADD | Merge::HEADERS_ADD`.
-
-## Use from CLI
-
-There's a Robo task to use this library from the command line interface: https://github.com/oscarotero/GettextRobo
-
-## Use in the browser
-
-If you want to use your translations in the browser, there's a javascript translator: https://github.com/oscarotero/gettext-translator
-
-## Contributors
-
-Thanks to all [contributors](https://github.com/oscarotero/Gettext/graphs/contributors) specially to [@mlocati](https://github.com/mlocati).
diff --git a/src/composer/vendor/gettext/gettext/composer.json b/src/composer/vendor/gettext/gettext/composer.json
deleted file mode 100644
index 69556f0d..00000000
--- a/src/composer/vendor/gettext/gettext/composer.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "gettext/gettext",
- "type": "library",
- "description": "PHP gettext manager",
- "keywords": ["js", "gettext", "i18n", "translation", "po", "mo"],
- "homepage": "https://github.com/oscarotero/Gettext",
- "license": "MIT",
- "authors": [
- {
- "name": "Oscar Otero",
- "email": "oom@oscarotero.com",
- "homepage": "http://oscarotero.com",
- "role": "Developer"
- }
- ],
- "support": {
- "email": "oom@oscarotero.com",
- "issues": "https://github.com/oscarotero/Gettext/issues"
- },
- "require": {
- "php": ">=5.4.0",
- "gettext/languages": "2.*"
- },
- "require-dev": {
- "illuminate/view": "*",
- "twig/twig": "*",
- "twig/extensions": "*",
- "symfony/yaml": "~2"
- },
- "suggest": {
- "illuminate/view": "Is necessary if you want to use the Blade extractor",
- "twig/twig": "Is necessary if you want to use the Twig extractor",
- "twig/extensions": "Is necessary if you want to use the Twig extractor",
- "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator"
- },
- "autoload": {
- "psr-4": {
- "Gettext\\": "src"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Gettext\\Tests\\": "tests"
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/BaseTranslator.php b/src/composer/vendor/gettext/gettext/src/BaseTranslator.php
deleted file mode 100644
index 0023c035..00000000
--- a/src/composer/vendor/gettext/gettext/src/BaseTranslator.php
+++ /dev/null
@@ -1,23 +0,0 @@
-compileString($string);
-
- PhpCode::fromString($string, $translations, $options);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Csv.php b/src/composer/vendor/gettext/gettext/src/Extractors/Csv.php
deleted file mode 100644
index a9efd741..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Csv.php
+++ /dev/null
@@ -1,44 +0,0 @@
-insert($context, $original);
-
- if (!empty($row)) {
- $translation->setTranslation(array_shift($row));
- $translation->setPluralTranslations($row);
- }
- }
-
- fclose($handle);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/CsvDictionary.php b/src/composer/vendor/gettext/gettext/src/Extractors/CsvDictionary.php
deleted file mode 100644
index 065b501d..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/CsvDictionary.php
+++ /dev/null
@@ -1,38 +0,0 @@
-insert(null, $original)->setTranslation($translation);
- }
-
- fclose($handle);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Extractor.php b/src/composer/vendor/gettext/gettext/src/Extractors/Extractor.php
deleted file mode 100644
index 76b4b9d7..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Extractor.php
+++ /dev/null
@@ -1,80 +0,0 @@
-setDomain($headers['domain']);
- }
-
- if (!empty($headers['lang'])) {
- $translations->setLanguage($headers['lang']);
- }
-
- if (!empty($headers['plural-forms'])) {
- $translations->setHeader(Translations::HEADER_PLURAL, $headers['plural-forms']);
- }
-
- $context_glue = '\u0004';
-
- foreach ($messages as $key => $translation) {
- $key = explode($context_glue, $key);
- $context = isset($key[1]) ? array_shift($key) : '';
-
- $translations->insert($context, array_shift($key))
- ->setTranslation(array_shift($translation))
- ->setPluralTranslations($translation);
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/JsCode.php b/src/composer/vendor/gettext/gettext/src/Extractors/JsCode.php
deleted file mode 100644
index 6c7aa3ae..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/JsCode.php
+++ /dev/null
@@ -1,42 +0,0 @@
- [
- 'gettext' => 'gettext',
- '__' => 'gettext',
- 'ngettext' => 'ngettext',
- 'n__' => 'ngettext',
- 'pgettext' => 'pgettext',
- 'p__' => 'pgettext',
- 'dgettext' => 'dgettext',
- 'd__' => 'dgettext',
- 'dpgettext' => 'dpgettext',
- 'dp__' => 'dpgettext',
- 'npgettext' => 'npgettext',
- 'np__' => 'npgettext',
- 'dnpgettext' => 'dnpgettext',
- 'dnp__' => 'dnpgettext',
- ],
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function fromString($string, Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- $functions = new JsFunctionsScanner($string);
- $functions->saveGettextFunctions($translations, $options);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Json.php b/src/composer/vendor/gettext/gettext/src/Extractors/Json.php
deleted file mode 100644
index 626ded34..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Json.php
+++ /dev/null
@@ -1,26 +0,0 @@
-seekto($originals);
- $table_originals = self::readIntArray($stream, $byteOrder, $total * 2);
-
- $stream->seekto($tran);
- $table_translations = self::readIntArray($stream, $byteOrder, $total * 2);
-
- for ($i = 0; $i < $total; ++$i) {
- $next = $i * 2;
-
- $stream->seekto($table_originals[$next + 2]);
- $original = $stream->read($table_originals[$next + 1]);
-
- $stream->seekto($table_translations[$next + 2]);
- $translated = $stream->read($table_translations[$next + 1]);
-
- if ($original === '') {
- // Headers
- foreach (explode("\n", $translated) as $headerLine) {
- if ($headerLine === '') {
- continue;
- }
-
- $headerChunks = preg_split('/:\s*/', $headerLine, 2);
- $translations->setHeader($headerChunks[0], isset($headerChunks[1]) ? $headerChunks[1] : '');
- }
-
- continue;
- }
-
- $chunks = explode("\x04", $original, 2);
-
- if (isset($chunks[1])) {
- $context = $chunks[0];
- $original = $chunks[1];
- } else {
- $context = '';
- }
-
- $chunks = explode("\x00", $original, 2);
-
- if (isset($chunks[1])) {
- $original = $chunks[0];
- $plural = $chunks[1];
- } else {
- $plural = '';
- }
-
- $translation = $translations->insert($context, $original, $plural);
-
- if ($translated === '') {
- continue;
- }
-
- if ($plural === '') {
- $translation->setTranslation($translated);
- continue;
- }
-
- $v = explode("\x00", $translated);
- $translation->setTranslation(array_shift($v));
- $translation->setPluralTranslations($v);
- }
- }
-
- /**
- * @param StringReader $stream
- * @param string $byteOrder
- */
- private static function readInt(StringReader $stream, $byteOrder)
- {
- if (($read = $stream->read(4)) === false) {
- return false;
- }
-
- $read = unpack($byteOrder, $read);
-
- return array_shift($read);
- }
-
- /**
- * @param StringReader $stream
- * @param string $byteOrder
- * @param int $count
- */
- private static function readIntArray(StringReader $stream, $byteOrder, $count)
- {
- return unpack($byteOrder.$count, $stream->read(4 * $count));
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/PhpArray.php b/src/composer/vendor/gettext/gettext/src/Extractors/PhpArray.php
deleted file mode 100644
index 558d8b49..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/PhpArray.php
+++ /dev/null
@@ -1,33 +0,0 @@
- false,
-
- 'functions' => [
- 'gettext' => 'gettext',
- '__' => 'gettext',
- 'ngettext' => 'ngettext',
- 'n__' => 'ngettext',
- 'pgettext' => 'pgettext',
- 'p__' => 'pgettext',
- 'dgettext' => 'dgettext',
- 'd__' => 'dgettext',
- 'dpgettext' => 'dpgettext',
- 'dp__' => 'dpgettext',
- 'npgettext' => 'npgettext',
- 'np__' => 'npgettext',
- 'dnpgettext' => 'dnpgettext',
- 'dnp__' => 'dnpgettext',
- ],
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function fromString($string, Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- $functions = new PhpFunctionsScanner($string);
-
- if ($options['extractComments'] !== false) {
- $functions->enableCommentsExtraction($options['extractComments']);
- }
-
- $functions->saveGettextFunctions($translations, $options);
- }
-
- /**
- * Decodes a T_CONSTANT_ENCAPSED_STRING string.
- *
- * @param string $value
- *
- * @return string
- */
- public static function convertString($value)
- {
- if (strpos($value, '\\') === false) {
- return substr($value, 1, -1);
- }
-
- if ($value[0] === "'") {
- return strtr(substr($value, 1, -1), ['\\\\' => '\\', '\\\'' => '\'']);
- }
-
- $value = substr($value, 1, -1);
-
- return preg_replace_callback('/\\\(n|r|t|v|e|f|\$|"|\\\|x[0-9A-Fa-f]{1,2}|u{[0-9a-f]{1,6}}|[0-7]{1,3})/', function ($match) {
- switch ($match[1][0]) {
- case 'n':
- return "\n";
- case 'r':
- return "\r";
- case 't':
- return "\t";
- case 'v':
- return "\v";
- case 'e':
- return "\e";
- case 'f':
- return "\f";
- case '$':
- return '$';
- case '"':
- return '"';
- case '\\':
- return '\\';
- case 'x':
- return chr(hexdec(substr($match[0], 1)));
- case 'u':
- return self::unicodeChar(hexdec(substr($match[0], 1)));
- default:
- return chr(octdec($match[0]));
- }
- }, $value);
- }
-
- //http://php.net/manual/en/function.chr.php#118804
- private static function unicodeChar($dec)
- {
- if ($dec < 0x80) {
- return chr($dec);
- }
-
- if ($dec < 0x0800) {
- return chr(0xC0 + ($dec >> 6))
- .chr(0x80 + ($dec & 0x3f));
- }
-
- if ($dec < 0x010000) {
- return chr(0xE0 + ($dec >> 12))
- .chr(0x80 + (($dec >> 6) & 0x3f))
- .chr(0x80 + ($dec & 0x3f));
- }
-
- if ($dec < 0x200000) {
- return chr(0xF0 + ($dec >> 18))
- .chr(0x80 + (($dec >> 12) & 0x3f))
- .chr(0x80 + (($dec >> 6) & 0x3f))
- .chr(0x80 + ($dec & 0x3f));
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Po.php b/src/composer/vendor/gettext/gettext/src/Extractors/Po.php
deleted file mode 100644
index 8ff314cf..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Po.php
+++ /dev/null
@@ -1,199 +0,0 @@
-is('', '')) {
- self::extractHeaders($translation->getTranslation(), $translations);
- } elseif ($translation->hasOriginal()) {
- $translations[] = $translation;
- }
-
- $translation = new Translation('', '');
- continue;
- }
-
- $splitLine = preg_split('/\s+/', $line, 2);
- $key = $splitLine[0];
- $data = isset($splitLine[1]) ? $splitLine[1] : '';
-
- switch ($key) {
- case '#':
- $translation->addComment($data);
- $append = null;
- break;
-
- case '#.':
- $translation->addExtractedComment($data);
- $append = null;
- break;
-
- case '#,':
- foreach (array_map('trim', explode(',', trim($data))) as $value) {
- $translation->addFlag($value);
- }
- $append = null;
- break;
-
- case '#:':
- foreach (preg_split('/\s+/', trim($data)) as $value) {
- if (preg_match('/^(.+)(:(\d*))?$/U', $value, $matches)) {
- $translation->addReference($matches[1], isset($matches[3]) ? $matches[3] : null);
- }
- }
- $append = null;
- break;
-
- case 'msgctxt':
- $translation = $translation->getClone(self::convertString($data));
- $append = 'Context';
- break;
-
- case 'msgid':
- $translation = $translation->getClone(null, self::convertString($data));
- $append = 'Original';
- break;
-
- case 'msgid_plural':
- $translation->setPlural(self::convertString($data));
- $append = 'Plural';
- break;
-
- case 'msgstr':
- case 'msgstr[0]':
- $translation->setTranslation(self::convertString($data));
- $append = 'Translation';
- break;
-
- case 'msgstr[1]':
- $translation->setPluralTranslations([self::convertString($data)]);
- $append = 'PluralTranslation';
- break;
-
- default:
- if (strpos($key, 'msgstr[') === 0) {
- $p = $translation->getPluralTranslations();
- $p[] = self::convertString($data);
-
- $translation->setPluralTranslations($p);
- $append = 'PluralTranslation';
- break;
- }
-
- if (isset($append)) {
- if ($append === 'Context') {
- $translation = $translation->getClone($translation->getContext()."\n".self::convertString($data));
- break;
- }
-
- if ($append === 'Original') {
- $translation = $translation->getClone(null, $translation->getOriginal()."\n".self::convertString($data));
- break;
- }
-
- if ($append === 'PluralTranslation') {
- $p = $translation->getPluralTranslations();
- $p[] = array_pop($p)."\n".self::convertString($data);
- $translation->setPluralTranslations($p);
- break;
- }
-
- $getMethod = 'get'.$append;
- $setMethod = 'set'.$append;
- $translation->$setMethod($translation->$getMethod()."\n".self::convertString($data));
- }
- break;
- }
- }
-
- if ($translation->hasOriginal() && !in_array($translation, iterator_to_array($translations))) {
- $translations[] = $translation;
- }
- }
-
- /**
- * Gets one string from multiline strings.
- *
- * @param string $line
- * @param array $lines
- * @param int &$i
- *
- * @return string
- */
- private static function fixMultiLines($line, array $lines, &$i)
- {
- for ($j = $i, $t = count($lines); $j < $t; ++$j) {
- if (substr($line, -1, 1) == '"'
- && isset($lines[$j + 1])
- && substr(trim($lines[$j + 1]), 0, 1) == '"'
- ) {
- $line = substr($line, 0, -1).substr(trim($lines[$j + 1]), 1);
- } else {
- $i = $j;
- break;
- }
- }
-
- return $line;
- }
-
- /**
- * Convert a string from its PO representation.
- *
- * @param string $value
- *
- * @return string
- */
- public static function convertString($value)
- {
- if (!$value) {
- return '';
- }
-
- if ($value[0] === '"') {
- $value = substr($value, 1, -1);
- }
-
- return strtr(
- $value,
- [
- '\\\\' => '\\',
- '\\a' => "\x07",
- '\\b' => "\x08",
- '\\t' => "\t",
- '\\n' => "\n",
- '\\v' => "\x0b",
- '\\f' => "\x0c",
- '\\r' => "\r",
- '\\"' => '"',
- ]
- );
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Twig.php b/src/composer/vendor/gettext/gettext/src/Extractors/Twig.php
deleted file mode 100644
index 18b59973..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Twig.php
+++ /dev/null
@@ -1,43 +0,0 @@
- null
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function fromString($string, Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- $twig = $options['twig'] ?: self::createTwig();
-
- PhpCode::fromString($twig->compileSource($string), $translations, $options);
- }
-
- /**
- * Returns a Twig instance.
- *
- * @return Twig_Environment
- */
- private static function createTwig()
- {
- $twig = new Twig_Environment(new Twig_Loader_String());
- $twig->addExtension(new Twig_Extensions_Extension_I18n());
-
- return static::$options['twig'] = $twig;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Xliff.php b/src/composer/vendor/gettext/gettext/src/Extractors/Xliff.php
deleted file mode 100644
index 311a7e27..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Xliff.php
+++ /dev/null
@@ -1,72 +0,0 @@
-file as $file) {
- if (isset($file->notes)) {
- foreach ($file->notes->note as $note) {
- $translations->setHeader($note['id'], (string) $note);
- }
- }
-
- foreach ($file->unit as $unit) {
- foreach ($unit->segment as $segment) {
- $targets = [];
-
- foreach ($segment->target as $target) {
- $targets[] = (string) $target;
- }
-
- $translation = new Translation(null, (string) $segment->source);
- $translation->setTranslation(array_shift($targets));
- $translation->setPluralTranslations($targets);
-
- if (isset($unit->notes)) {
- foreach ($unit->notes->note as $note) {
- switch ($note['category']) {
- case 'context':
- $translation = $translation->getClone((string) $note);
- break;
-
- case 'extracted-comment':
- $translation->addExtractedComment((string) $note);
- break;
-
- case 'flag':
- $translation->addFlag((string) $note);
- break;
-
- case 'reference':
- $ref = explode(':', (string) $note, 2);
- $translation->addReference($ref[0], isset($ref[1]) ? $ref[1] : null);
- break;
-
- default:
- $translation->addComment((string) $note);
- break;
- }
- }
- }
-
- $translations[] = $translation;
- }
- }
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Extractors/Yaml.php b/src/composer/vendor/gettext/gettext/src/Extractors/Yaml.php
deleted file mode 100644
index 194763ef..00000000
--- a/src/composer/vendor/gettext/gettext/src/Extractors/Yaml.php
+++ /dev/null
@@ -1,27 +0,0 @@
- false,
- ];
-
- /**
- * {@parentDoc}.
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
- $handle = fopen('php://memory', 'w');
-
- if ($options['includeHeaders']) {
- fputcsv($handle, ['', '', self::generateHeaders($translations)]);
- }
-
- foreach ($translations as $translation) {
- $line = [$translation->getContext(), $translation->getOriginal(), $translation->getTranslation()];
-
- if ($translation->hasPluralTranslations(true)) {
- $line = array_merge($line, $translation->getPluralTranslations());
- }
-
- fputcsv($handle, $line);
- }
-
- rewind($handle);
- $csv = stream_get_contents($handle);
- fclose($handle);
-
- return $csv;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/CsvDictionary.php b/src/composer/vendor/gettext/gettext/src/Generators/CsvDictionary.php
deleted file mode 100644
index 1c90af5e..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/CsvDictionary.php
+++ /dev/null
@@ -1,34 +0,0 @@
- false,
- ];
-
- /**
- * {@parentDoc}.
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
- $handle = fopen('php://memory', 'w');
-
- foreach (self::toArray($translations, $options['includeHeaders']) as $original => $translation) {
- fputcsv($handle, [$original, $translation]);
- }
-
- rewind($handle);
- $csv = stream_get_contents($handle);
- fclose($handle);
-
- return $csv;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/Generator.php b/src/composer/vendor/gettext/gettext/src/Generators/Generator.php
deleted file mode 100644
index 6ee0bdec..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/Generator.php
+++ /dev/null
@@ -1,22 +0,0 @@
- 0,
- ];
-
- /**
- * {@parentDoc}.
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $domain = $translations->getDomain() ?: 'messages';
- $options += static::$options;
-
- return json_encode([
- $domain => [
- '' => [
- 'domain' => $domain,
- 'lang' => $translations->getLanguage() ?: 'en',
- 'plural-forms' => $translations->getHeader('Plural-Forms') ?: 'nplurals=2; plural=(n != 1);',
- ],
- ] + self::buildMessages($translations),
- ], $options['json']);
- }
-
- /**
- * Generates an array with all translations.
- *
- * @param Translations $translations
- *
- * @return array
- */
- private static function buildMessages(Translations $translations)
- {
- $pluralForm = $translations->getPluralForms();
- $pluralLimit = is_array($pluralForm) ? ($pluralForm[0] - 1) : null;
- $messages = [];
- $context_glue = '\u0004';
-
- foreach ($translations as $translation) {
- $key = ($translation->hasContext() ? $translation->getContext().$context_glue : '').$translation->getOriginal();
-
- if ($translation->hasPluralTranslations(true)) {
- $message = $translation->getPluralTranslations($pluralLimit);
- array_unshift($message, $translation->getTranslation());
- } else {
- $message = [$translation->getTranslation()];
- }
-
- $messages[$key] = $message;
- }
-
- return $messages;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/Json.php b/src/composer/vendor/gettext/gettext/src/Generators/Json.php
deleted file mode 100644
index da8cb774..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/Json.php
+++ /dev/null
@@ -1,26 +0,0 @@
- 0,
- 'includeHeaders' => false,
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- return json_encode(self::toArray($translations, $options['includeHeaders'], true), $options['json']);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/JsonDictionary.php b/src/composer/vendor/gettext/gettext/src/Generators/JsonDictionary.php
deleted file mode 100644
index 60ac4bef..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/JsonDictionary.php
+++ /dev/null
@@ -1,26 +0,0 @@
- 0,
- 'includeHeaders' => false,
- ];
-
- /**
- * {@parentDoc}.
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- return json_encode(self::toArray($translations, $options['includeHeaders']), $options['json']);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/Mo.php b/src/composer/vendor/gettext/gettext/src/Generators/Mo.php
deleted file mode 100644
index 523691a1..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/Mo.php
+++ /dev/null
@@ -1,134 +0,0 @@
- true,
- ];
-
- /**
- * {@parentDoc}.
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
- $messages = [];
-
- if ($options['includeHeaders']) {
- $messages[''] = self::generateHeaders($translations);
- }
-
- foreach ($translations as $translation) {
- if (!$translation->hasTranslation()) {
- continue;
- }
-
- if ($translation->hasContext()) {
- $originalString = $translation->getContext()."\x04".$translation->getOriginal();
- } else {
- $originalString = $translation->getOriginal();
- }
-
- $messages[$originalString] = $translation;
- }
-
- ksort($messages);
- $numEntries = count($messages);
- $originalsTable = '';
- $translationsTable = '';
- $originalsIndex = [];
- $translationsIndex = [];
- $pluralForm = $translations->getPluralForms();
- $pluralLimit = is_array($pluralForm) ? ($pluralForm[0] - 1) : null;
-
- foreach ($messages as $originalString => $translation) {
- if (is_string($translation)) {
- // Headers
- $translationString = $translation;
- } else {
- /* @var $translation \Gettext\Translation */
- if ($translation->hasPlural() && $translation->hasPluralTranslations(true)) {
- $originalString .= "\x00".$translation->getPlural();
- $translationString = $translation->getTranslation();
- $translationString .= "\x00".implode("\x00", $translation->getPluralTranslations($pluralLimit));
- } else {
- $translationString = $translation->getTranslation();
- }
- }
-
- $originalsIndex[] = ['relativeOffset' => strlen($originalsTable), 'length' => strlen($originalString)];
- $originalsTable .= $originalString."\x00";
- $translationsIndex[] = ['relativeOffset' => strlen($translationsTable), 'length' => strlen($translationString)];
- $translationsTable .= $translationString."\x00";
- }
-
- // Offset of table with the original strings index: right after the header (which is 7 words)
- $originalsIndexOffset = 7 * 4;
-
- // Size of table with the original strings index
- $originalsIndexSize = $numEntries * (4 + 4);
-
- // Offset of table with the translation strings index: right after the original strings index table
- $translationsIndexOffset = $originalsIndexOffset + $originalsIndexSize;
-
- // Size of table with the translation strings index
- $translationsIndexSize = $numEntries * (4 + 4);
-
- // Hashing table starts after the header and after the index table
- $originalsStringsOffset = $translationsIndexOffset + $translationsIndexSize;
-
- // Translations start after the keys
- $translationsStringsOffset = $originalsStringsOffset + strlen($originalsTable);
-
- // Let's generate the .mo file binary data
- $mo = '';
-
- // Magic number
- $mo .= pack('L', 0x950412de);
-
- // File format revision
- $mo .= pack('L', 0);
-
- // Number of strings
- $mo .= pack('L', $numEntries);
-
- // Offset of table with original strings
- $mo .= pack('L', $originalsIndexOffset);
-
- // Offset of table with translation strings
- $mo .= pack('L', $translationsIndexOffset);
-
- // Size of hashing table: we don't use it.
- $mo .= pack('L', 0);
-
- // Offset of hashing table: it would start right after the translations index table
- $mo .= pack('L', $translationsIndexOffset + $translationsIndexSize);
-
- // Write the lengths & offsets of the original strings
- foreach ($originalsIndex as $info) {
- $mo .= pack('L', $info['length']);
- $mo .= pack('L', $originalsStringsOffset + $info['relativeOffset']);
- }
-
- // Write the lengths & offsets of the translated strings
- foreach ($translationsIndex as $info) {
- $mo .= pack('L', $info['length']);
- $mo .= pack('L', $translationsStringsOffset + $info['relativeOffset']);
- }
-
- // Write original strings
- $mo .= $originalsTable;
-
- // Write translation strings
- $mo .= $translationsTable;
-
- return $mo;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/PhpArray.php b/src/composer/vendor/gettext/gettext/src/Generators/PhpArray.php
deleted file mode 100644
index 55d69175..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/PhpArray.php
+++ /dev/null
@@ -1,40 +0,0 @@
- true,
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $array = self::generate($translations, $options);
-
- return 'getHeaders() as $name => $value) {
- $lines[] = sprintf('"%s: %s\\n"', $name, $value);
- }
-
- $lines[] = '';
-
- //Translations
- foreach ($translations as $translation) {
- if ($translation->hasComments()) {
- foreach ($translation->getComments() as $comment) {
- $lines[] = '# '.$comment;
- }
- }
-
- if ($translation->hasExtractedComments()) {
- foreach ($translation->getExtractedComments() as $comment) {
- $lines[] = '#. '.$comment;
- }
- }
-
- if ($translation->hasReferences()) {
- foreach ($translation->getReferences() as $reference) {
- $lines[] = '#: '.$reference[0].(!is_null($reference[1]) ? ':'.$reference[1] : null);
- }
- }
-
- if ($translation->hasFlags()) {
- $lines[] = '#, '.implode(',', $translation->getFlags());
- }
-
- if ($translation->hasContext()) {
- $lines[] = 'msgctxt '.self::convertString($translation->getContext());
- }
-
- self::addLines($lines, 'msgid', $translation->getOriginal());
-
- if ($translation->hasPlural()) {
- self::addLines($lines, 'msgid_plural', $translation->getPlural());
- self::addLines($lines, 'msgstr[0]', $translation->getTranslation());
-
- foreach ($translation->getPluralTranslations() as $k => $v) {
- self::addLines($lines, 'msgstr['.($k + 1).']', $v);
- }
- } else {
- self::addLines($lines, 'msgstr', $translation->getTranslation());
- }
-
- $lines[] = '';
- }
-
- return implode("\n", $lines);
- }
-
- /**
- * Escapes and adds double quotes to a string.
- *
- * @param string $string
- *
- * @return string
- */
- private static function multilineQuote($string)
- {
- $lines = explode("\n", $string);
- $last = count($lines) - 1;
-
- foreach ($lines as $k => $line) {
- if ($k === $last) {
- $lines[$k] = self::convertString($line);
- } else {
- $lines[$k] = self::convertString($line."\n");
- }
- }
-
- return $lines;
- }
-
- /**
- * Add one or more lines depending whether the string is multiline or not.
- *
- * @param array &$lines
- * @param string $name
- * @param string $value
- */
- private static function addLines(array &$lines, $name, $value)
- {
- $newLines = self::multilineQuote($value);
-
- if (count($newLines) === 1) {
- $lines[] = $name.' '.$newLines[0];
- } else {
- $lines[] = $name.' ""';
-
- foreach ($newLines as $line) {
- $lines[] = $line;
- }
- }
- }
-
- /**
- * Convert a string to its PO representation.
- *
- * @param string $value
- *
- * @return string
- */
- public static function convertString($value)
- {
- return '"'.strtr(
- $value,
- [
- "\x00" => '',
- '\\' => '\\\\',
- "\t" => '\t',
- "\n" => '\n',
- '"' => '\\"',
- ]
- ).'"';
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/Xliff.php b/src/composer/vendor/gettext/gettext/src/Generators/Xliff.php
deleted file mode 100644
index d5a256a1..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/Xliff.php
+++ /dev/null
@@ -1,87 +0,0 @@
-formatOutput = true;
- $xliff = $dom->appendChild($dom->createElement('xliff'));
- $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0');
- $xliff->setAttribute('version', '2.0');
- $xliff->setAttribute('srcLang', $translations->getLanguage());
- $xliff->setAttribute('trgLang', $translations->getLanguage());
- $file = $xliff->appendChild($dom->createElement('file'));
- $file->setAttribute('id', $translations->getDomain().'.'.$translations->getLanguage());
-
- //Save headers as notes
- $notes = $dom->createElement('notes');
-
- foreach ($translations->getHeaders() as $name => $value) {
- $notes->appendChild(self::createTextNode($dom, 'note', $value))->setAttribute('id', $name);
- }
-
- if ($notes->hasChildNodes()) {
- $file->appendChild($notes);
- }
-
- foreach ($translations as $translation) {
- $unit = $dom->createElement('unit');
- $unit->setAttribute('id', md5($translation->getContext().$translation->getOriginal()));
-
- //Save comments as notes
- $notes = $dom->createElement('notes');
-
- $notes->appendChild(self::createTextNode($dom, 'note', $translation->getContext()))->setAttribute('category', 'context');
-
- foreach ($translation->getComments() as $comment) {
- $notes->appendChild(self::createTextNode($dom, 'note', $comment))->setAttribute('category', 'comment');
- }
-
- foreach ($translation->getExtractedComments() as $comment) {
- $notes->appendChild(self::createTextNode($dom, 'note', $comment))->setAttribute('category', 'extracted-comment');
- }
-
- foreach ($translation->getFlags() as $flag) {
- $notes->appendChild(self::createTextNode($dom, 'note', $flag))->setAttribute('category', 'flag');
- }
-
- foreach ($translation->getReferences() as $reference) {
- $notes->appendChild(self::createTextNode($dom, 'note', $reference[0].':'.$reference[1]))->setAttribute('category', 'reference');
- }
-
- $unit->appendChild($notes);
-
- $segment = $unit->appendChild($dom->createElement('segment'));
- $segment->appendChild(self::createTextNode($dom, 'source', $translation->getOriginal()));
- $segment->appendChild(self::createTextNode($dom, 'target', $translation->getTranslation()));
-
- foreach ($translation->getPluralTranslations() as $plural) {
- if ($plural !== '') {
- $segment->appendChild(self::createTextNode($dom, 'target', $plural));
- }
- }
-
- $file->appendChild($unit);
- }
-
- return $dom->saveXML();
- }
-
- private static function createTextNode(DOMDocument $dom, $name, $string)
- {
- $node = $dom->createElement($name);
- $text = (preg_match('/[&<>]/', $string) === 1) ? $dom->createCDATASection($string) : $dom->createTextNode($string);
- $node->appendChild($text);
-
- return $node;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/Yaml.php b/src/composer/vendor/gettext/gettext/src/Generators/Yaml.php
deleted file mode 100644
index 8805cddb..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/Yaml.php
+++ /dev/null
@@ -1,28 +0,0 @@
- false,
- 'indent' => 2,
- 'inline' => 4,
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- return YamlDumper::dump(self::toArray($translations, $options['includeHeaders']), $options['inline'], $options['indent']);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Generators/YamlDictionary.php b/src/composer/vendor/gettext/gettext/src/Generators/YamlDictionary.php
deleted file mode 100644
index b873bbda..00000000
--- a/src/composer/vendor/gettext/gettext/src/Generators/YamlDictionary.php
+++ /dev/null
@@ -1,28 +0,0 @@
- false,
- 'indent' => 2,
- 'inline' => 3,
- ];
-
- /**
- * {@inheritdoc}
- */
- public static function toString(Translations $translations, array $options = [])
- {
- $options += static::$options;
-
- return YamlDumper::dump(self::toArray($translations, $options['includeHeaders']), $options['inline'], $options['indent']);
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/GettextTranslator.php b/src/composer/vendor/gettext/gettext/src/GettextTranslator.php
deleted file mode 100644
index 5d411ee2..00000000
--- a/src/composer/vendor/gettext/gettext/src/GettextTranslator.php
+++ /dev/null
@@ -1,161 +0,0 @@
-setLanguage($language);
- }
- }
-
- /**
- * Define the current locale.
- *
- * @param string $language
- * @param int|null $category
- *
- * @return self
- */
- public function setLanguage($language, $category = null)
- {
- if ($category === null) {
- $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
- }
-
- setlocale($category, $language);
- putenv('LANGUAGE='.$language);
-
- return $this;
- }
-
- /**
- * Loads a gettext domain.
- *
- * @param string $domain
- * @param string $path
- * @param bool $default
- *
- * @return self
- */
- public function loadDomain($domain, $path = null, $default = true)
- {
- bindtextdomain($domain, $path);
- bind_textdomain_codeset($domain, 'UTF-8');
-
- if ($default) {
- textdomain($domain);
- }
-
- return $this;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function gettext($original)
- {
- return gettext($original);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function ngettext($original, $plural, $value)
- {
- return ngettext($original, $plural, $value);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dngettext($domain, $original, $plural, $value)
- {
- return dngettext($domain, $original, $plural, $value);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function npgettext($context, $original, $plural, $value)
- {
- $message = $context."\x04".$original;
- $translation = ngettext($message, $plural, $value);
-
- return ($translation === $message) ? $original : $translation;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function pgettext($context, $original)
- {
- $message = $context."\x04".$original;
- $translation = gettext($message);
-
- return ($translation === $message) ? $original : $translation;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dgettext($domain, $original)
- {
- return dgettext($domain, $original);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dpgettext($domain, $context, $original)
- {
- $message = $context."\x04".$original;
- $translation = dgettext($domain, $message);
-
- return ($translation === $message) ? $original : $translation;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dnpgettext($domain, $context, $original, $plural, $value)
- {
- $message = $context."\x04".$original;
- $translation = dngettext($domain, $message, $plural, $value);
-
- return ($translation === $message) ? $original : $translation;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Merge.php b/src/composer/vendor/gettext/gettext/src/Merge.php
deleted file mode 100644
index 7f28b91a..00000000
--- a/src/composer/vendor/gettext/gettext/src/Merge.php
+++ /dev/null
@@ -1,221 +0,0 @@
-deleteFlags();
- }
-
- if (!($options & self::FLAGS_OURS)) {
- foreach ($from->getFlags() as $flag) {
- $to->addFlag($flag);
- }
- }
- }
-
- /**
- * Merge the extracted comments of two translations.
- *
- * @param Translation $from
- * @param Translation $to
- * @param int $options
- */
- public static function mergeExtractedComments(Translation $from, Translation $to, $options = self::DEFAULTS)
- {
- if ($options & self::EXTRACTED_COMMENTS_THEIRS) {
- $to->deleteExtractedComments();
- }
-
- if (!($options & self::EXTRACTED_COMMENTS_OURS)) {
- foreach ($from->getExtractedComments() as $comment) {
- $to->addExtractedComment($comment);
- }
- }
- }
-
- /**
- * Merge the comments of two translations.
- *
- * @param Translation $from
- * @param Translation $to
- * @param int $options
- */
- public static function mergeComments(Translation $from, Translation $to, $options = self::DEFAULTS)
- {
- if ($options & self::COMMENTS_THEIRS) {
- $to->deleteComments();
- }
-
- if (!($options & self::COMMENTS_OURS)) {
- foreach ($from->getComments() as $comment) {
- $to->addComment($comment);
- }
- }
- }
-
- /**
- * Merge the references of two translations.
- *
- * @param Translation $from
- * @param Translation $to
- * @param int $options
- */
- public static function mergeReferences(Translation $from, Translation $to, $options = self::DEFAULTS)
- {
- if ($options & self::REFERENCES_THEIRS) {
- $to->deleteReferences();
- }
-
- if (!($options & self::REFERENCES_OURS)) {
- foreach ($from->getReferences() as $reference) {
- $to->addReference($reference[0], $reference[1]);
- }
- }
- }
-
- /**
- * Merge the translations of two translations.
- *
- * @param Translation $from
- * @param Translation $to
- * @param int $options
- */
- public static function mergeTranslation(Translation $from, Translation $to, $options = self::DEFAULTS)
- {
- $override = (boolean) ($options & self::TRANSLATION_OVERRIDE);
-
- if (!$to->hasTranslation() || ($from->hasTranslation() && $override)) {
- $to->setTranslation($from->getTranslation());
- }
-
- if (!$to->hasPlural() || ($from->hasPlural() && $override)) {
- $to->setPlural($from->getPlural());
- }
-
- if (!$to->hasPluralTranslations() || ($from->hasPluralTranslations() && $override)) {
- $to->setPluralTranslations($from->getPluralTranslations());
- }
- }
-
- /**
- * Merge the translations of two translations.
- *
- * @param Translations $from
- * @param Translations $to
- * @param int $options
- */
- public static function mergeTranslations(Translations $from, Translations $to, $options = self::DEFAULTS)
- {
- if ($options & self::REMOVE) {
- $filtered = [];
-
- foreach ($to as $entry) {
- if ($from->find($entry)) {
- $filtered[$entry->getId()] = $entry;
- }
- }
-
- $to->exchangeArray($filtered);
- }
-
- foreach ($from as $entry) {
- if (($existing = $to->find($entry))) {
- $existing->mergeWith($entry);
- } elseif ($options & self::ADD) {
- $to[] = $entry;
- }
- }
- }
-
- /**
- * Merge the headers of two translations.
- *
- * @param Translations $from
- * @param Translations $to
- * @param int $options
- */
- public static function mergeHeaders(Translations $from, Translations $to, $options = self::DEFAULTS)
- {
- if ($options & self::HEADERS_REMOVE) {
- foreach (array_keys($to->getHeaders()) as $name) {
- if ($from->getHeader($name) === null) {
- $to->deleteHeader($name);
- }
- }
- }
-
- foreach ($from->getHeaders() as $name => $value) {
- $current = $to->getHeader($name);
-
- if (empty($current)) {
- if ($options & self::HEADERS_ADD) {
- $to->setHeader($name, $value);
- }
- continue;
- }
-
- if (empty($value)) {
- continue;
- }
-
- switch ($name) {
- case Translations::HEADER_LANGUAGE:
- case Translations::HEADER_PLURAL:
- if ($options & self::LANGUAGE_OVERRIDE) {
- $to->setHeader($name, $value);
- }
- break;
-
- case Translations::HEADER_DOMAIN:
- if ($options & self::DOMAIN_OVERRIDE) {
- $to->setHeader($name, $value);
- }
- break;
-
- default:
- if ($options & self::HEADERS_OVERRIDE) {
- $to->setHeader($name, $value);
- }
- }
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Translation.php b/src/composer/vendor/gettext/gettext/src/Translation.php
deleted file mode 100644
index 6653454f..00000000
--- a/src/composer/vendor/gettext/gettext/src/Translation.php
+++ /dev/null
@@ -1,480 +0,0 @@
-context = (string) $context;
- $this->original = (string) $original;
-
- $this->setPlural($plural);
- }
-
- /**
- * Clones this translation.
- *
- * @param null|string $context Optional new context
- * @param null|string $original Optional new original
- *
- * @return Translation
- */
- public function getClone($context = null, $original = null)
- {
- $new = clone $this;
-
- if ($context !== null) {
- $new->context = (string) $context;
- }
-
- if ($original !== null) {
- $new->original = (string) $original;
- }
-
- return $new;
- }
-
- /**
- * Returns the id of this translation.
- *
- * @return string
- */
- public function getId()
- {
- return static::generateId($this->context, $this->original);
- }
-
- /**
- * Checks whether the translation matches with the arguments.
- *
- * @param string $context
- * @param string $original
- *
- * @return bool
- */
- public function is($context, $original = '')
- {
- return (($this->context === $context) && ($this->original === $original)) ? true : false;
- }
-
- /**
- * Gets the original string.
- *
- * @return string
- */
- public function getOriginal()
- {
- return $this->original;
- }
-
- /**
- * Checks if the original string is empty or not.
- *
- * @return bool
- */
- public function hasOriginal()
- {
- return ($this->original !== '') ? true : false;
- }
-
- /**
- * Sets the translation string.
- *
- * @param string $translation
- *
- * @return self
- */
- public function setTranslation($translation)
- {
- $this->translation = (string) $translation;
-
- return $this;
- }
-
- /**
- * Gets the translation string.
- *
- * @return string
- */
- public function getTranslation()
- {
- return $this->translation;
- }
-
- /**
- * Checks if the translation string is empty or not.
- *
- * @return bool
- */
- public function hasTranslation()
- {
- return ($this->translation !== '') ? true : false;
- }
-
- /**
- * Sets the plural translation string.
- *
- * @param string $plural
- *
- * @return self
- */
- public function setPlural($plural)
- {
- $this->plural = (string) $plural;
-
- return $this;
- }
-
- /**
- * Gets the plural translation string.
- *
- * @return string
- */
- public function getPlural()
- {
- return $this->plural;
- }
-
- /**
- * Checks if the plural translation string is empty or not.
- *
- * @return bool
- */
- public function hasPlural()
- {
- return ($this->plural !== '') ? true : false;
- }
-
- /**
- * Set a new plural translation.
- *
- * @param array $plural
- *
- * @return self
- */
- public function setPluralTranslations(array $plural)
- {
- $this->pluralTranslation = $plural;
-
- return $this;
- }
-
- /**
- * Gets all plural translations.
- *
- * @param int $limit
- *
- * @return array
- */
- public function getPluralTranslations($limit = null)
- {
- if ($limit === null) {
- return $this->pluralTranslation;
- }
-
- $current = count($this->pluralTranslation);
-
- if ($limit > $current) {
- return $this->pluralTranslation + array_fill(0, $limit, '');
- }
-
- if ($limit < $current) {
- return array_slice($this->pluralTranslation, 0, $limit);
- }
-
- return $this->pluralTranslation;
- }
-
- /**
- * Checks if there are any plural translation.
- *
- * @param bool $checkContent
- *
- * @return bool
- */
- public function hasPluralTranslations($checkContent = false)
- {
- if ($checkContent) {
- return implode('', $this->pluralTranslation) !== '';
- }
-
- return !empty($this->pluralTranslation);
- }
-
- /**
- * Removes all plural translations.
- *
- * @return self
- */
- public function deletePluralTranslation()
- {
- $this->pluralTranslation = [];
-
- return $this;
- }
-
- /**
- * Gets the context of this translation.
- *
- * @return string
- */
- public function getContext()
- {
- return $this->context;
- }
-
- /**
- * Checks if the context is empty or not.
- *
- * @return bool
- */
- public function hasContext()
- {
- return (isset($this->context) && ($this->context !== '')) ? true : false;
- }
-
- /**
- * Adds a new reference for this translation.
- *
- * @param string $filename The file path where the translation has been found
- * @param null|int $line The line number where the translation has been found
- *
- * @return self
- */
- public function addReference($filename, $line = null)
- {
- $key = "{$filename}:{$line}";
- $this->references[$key] = [$filename, $line];
-
- return $this;
- }
-
- /**
- * Checks if the translation has any reference.
- *
- * @return bool
- */
- public function hasReferences()
- {
- return !empty($this->references);
- }
-
- /**
- * Return all references for this translation.
- *
- * @return array
- */
- public function getReferences()
- {
- return array_values($this->references);
- }
-
- /**
- * Removes all references.
- *
- * @return self
- */
- public function deleteReferences()
- {
- $this->references = [];
-
- return $this;
- }
-
- /**
- * Adds a new comment for this translation.
- *
- * @param string $comment
- *
- * @return self
- */
- public function addComment($comment)
- {
- if (!in_array($comment, $this->comments, true)) {
- $this->comments[] = $comment;
- }
-
- return $this;
- }
-
- /**
- * Checks if the translation has any comment.
- *
- * @return bool
- */
- public function hasComments()
- {
- return isset($this->comments[0]);
- }
-
- /**
- * Returns all comments for this translation.
- *
- * @return array
- */
- public function getComments()
- {
- return $this->comments;
- }
-
- /**
- * Removes all comments.
- *
- * @return self
- */
- public function deleteComments()
- {
- $this->comments = [];
-
- return $this;
- }
-
- /**
- * Adds a new extracted comment for this translation.
- *
- * @param string $comment
- *
- * @return self
- */
- public function addExtractedComment($comment)
- {
- if (!in_array($comment, $this->extractedComments, true)) {
- $this->extractedComments[] = $comment;
- }
-
- return $this;
- }
-
- /**
- * Checks if the translation has any extracted comment.
- *
- * @return bool
- */
- public function hasExtractedComments()
- {
- return isset($this->extractedComments[0]);
- }
-
- /**
- * Returns all extracted comments for this translation.
- *
- * @return array
- */
- public function getExtractedComments()
- {
- return $this->extractedComments;
- }
-
- /**
- * Removes all extracted comments.
- *
- * @return self
- */
- public function deleteExtractedComments()
- {
- $this->extractedComments = [];
-
- return $this;
- }
-
- /**
- * Adds a new flag for this translation.
- *
- * @param string $flag
- *
- * @return self
- */
- public function addFlag($flag)
- {
- if (!in_array($flag, $this->flags, true)) {
- $this->flags[] = $flag;
- }
-
- return $this;
- }
-
- /**
- * Checks if the translation has any flag.
- *
- * @return bool
- */
- public function hasFlags()
- {
- return isset($this->flags[0]);
- }
-
- /**
- * Returns all extracted flags for this translation.
- *
- * @return array
- */
- public function getFlags()
- {
- return $this->flags;
- }
-
- /**
- * Removes all flags.
- *
- * @return self
- */
- public function deleteFlags()
- {
- $this->flags = [];
-
- return $this;
- }
-
- /**
- * Merges this translation with other translation.
- *
- * @param Translation $translation The translation to merge with
- * @param int $options
- *
- * @return self
- */
- public function mergeWith(Translation $translation, $options = Merge::DEFAULTS)
- {
- Merge::mergeTranslation($translation, $this, $options);
- Merge::mergeReferences($translation, $this, $options);
- Merge::mergeComments($translation, $this, $options);
- Merge::mergeExtractedComments($translation, $this, $options);
- Merge::mergeFlags($translation, $this, $options);
-
- return $this;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Translations.php b/src/composer/vendor/gettext/gettext/src/Translations.php
deleted file mode 100644
index ae59a7fa..00000000
--- a/src/composer/vendor/gettext/gettext/src/Translations.php
+++ /dev/null
@@ -1,409 +0,0 @@
- [
- 'Project-Id-Version' => '',
- 'Report-Msgid-Bugs-To' => '',
- 'Last-Translator' => '',
- 'Language-Team' => '',
- 'MIME-Version' => '1.0',
- 'Content-Type' => 'text/plain; charset=UTF-8',
- 'Content-Transfer-Encoding' => '8bit',
- ],
- 'headersSorting' => false,
- 'defaultDateHeaders' => [
- 'POT-Creation-Date',
- 'PO-Revision-Date',
- ],
- ];
-
- private $headers;
-
- /**
- * @see \ArrayObject::__construct()
- */
- public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator')
- {
- $this->headers = static::$options['defaultHeaders'];
-
- foreach (static::$options['defaultDateHeaders'] as $header) {
- $this->headers[$header] = date('c');
- }
-
- $this->headers[self::HEADER_LANGUAGE] = '';
-
- parent::__construct($input, $flags, $iterator_class);
- }
-
- /**
- * Magic method to create new instances using extractors
- * For example: Translations::fromMoFile($filename, $options);.
- *
- * @return Translations
- */
- public static function __callStatic($name, $arguments)
- {
- if (!preg_match('/^from(\w+)(File|String)$/i', $name, $matches)) {
- throw new BadMethodCallException("The method $name does not exists");
- }
-
- return call_user_func_array([new static(), 'add'.ucfirst($name)], $arguments);
- }
-
- /**
- * Magic method to import/export the translations to a specific format
- * For example: $translations->toMoFile($filename, $options);
- * For example: $translations->addFromMoFile($filename, $options);.
- *
- * @return self|bool
- */
- public function __call($name, $arguments)
- {
- if (!preg_match('/^(addFrom|to)(\w+)(File|String)$/i', $name, $matches)) {
- throw new BadMethodCallException("The method $name does not exists");
- }
-
- if ($matches[1] === 'addFrom') {
- $extractor = 'Gettext\\Extractors\\'.$matches[2].'::from'.$matches[3];
- $source = array_shift($arguments);
- $options = array_shift($arguments) ?: [];
-
- call_user_func($extractor, $source, $this, $options);
-
- return $this;
- }
-
- $generator = 'Gettext\\Generators\\'.$matches[2].'::to'.$matches[3];
-
- array_unshift($arguments, $this);
-
- return call_user_func_array($generator, $arguments);
- }
-
- /**
- * Magic method to clone each translation on clone the translations object.
- */
- public function __clone()
- {
- $array = [];
-
- foreach ($this as $key => $translation) {
- $array[$key] = clone $translation;
- }
-
- $this->exchangeArray($array);
- }
-
- /**
- * Control the new translations added.
- *
- * @param mixed $index
- * @param Translation $value
- *
- * @throws InvalidArgumentException If the value is not an instance of Gettext\Translation
- *
- * @return Translation
- */
- public function offsetSet($index, $value)
- {
- if (!($value instanceof Translation)) {
- throw new InvalidArgumentException('Only instances of Gettext\\Translation must be added to a Gettext\\Translations');
- }
-
- $id = $value->getId();
-
- if ($this->offsetExists($id)) {
- $this[$id]->mergeWith($value);
-
- return $this[$id];
- }
-
- parent::offsetSet($id, $value);
-
- return $value;
- }
-
- /**
- * Set the plural definition.
- *
- * @param int $count
- * @param string $rule
- *
- * @return self
- */
- public function setPluralForms($count, $rule)
- {
- $this->setHeader(self::HEADER_PLURAL, "nplurals={$count}; plural={$rule};");
-
- return $this;
- }
-
- /**
- * Returns the parsed plural definition.
- *
- * @param null|array [count, rule]
- */
- public function getPluralForms()
- {
- $header = $this->getHeader(self::HEADER_PLURAL);
-
- if (!empty($header) && preg_match('/^nplurals\s*=\s*(\d+)\s*;\s*plural\s*=\s*([^;]+)\s*;$/', $header, $matches)) {
- return [intval($matches[1]), $matches[2]];
- }
- }
-
- /**
- * Set a new header.
- *
- * @param string $name
- * @param string $value
- *
- * @return self
- */
- public function setHeader($name, $value)
- {
- $name = trim($name);
- $this->headers[$name] = trim($value);
-
- return $this;
- }
-
- /**
- * Returns a header value.
- *
- * @param string $name
- *
- * @return null|string
- */
- public function getHeader($name)
- {
- return isset($this->headers[$name]) ? $this->headers[$name] : null;
- }
-
- /**
- * Returns all header for this translations (in alphabetic order).
- *
- * @return array
- */
- public function getHeaders()
- {
- if (static::$options['headersSorting']) {
- ksort($this->headers);
- }
-
- return $this->headers;
- }
-
- /**
- * Removes all headers.
- *
- * @return self
- */
- public function deleteHeaders()
- {
- $this->headers = [];
-
- return $this;
- }
-
- /**
- * Removes one header.
- *
- * @param string $name
- *
- * @return self
- */
- public function deleteHeader($name)
- {
- unset($this->headers[$name]);
-
- return $this;
- }
-
- /**
- * Returns the language value.
- *
- * @return string $language
- */
- public function getLanguage()
- {
- return $this->getHeader(self::HEADER_LANGUAGE);
- }
-
- /**
- * Sets the language and the plural forms.
- *
- * @param string $language
- *
- * @throws InvalidArgumentException if the language hasn't been recognized
- *
- * @return self
- */
- public function setLanguage($language)
- {
- $this->setHeader(self::HEADER_LANGUAGE, trim($language));
-
- if (($info = Language::getById($language))) {
- return $this->setPluralForms(count($info->categories), $info->formula);
- }
-
- throw new InvalidArgumentException(sprintf('The language "%s" is not valid', $language));
- }
-
- /**
- * Checks whether the language is empty or not.
- *
- * @return bool
- */
- public function hasLanguage()
- {
- $language = $this->getLanguage();
-
- return (is_string($language) && ($language !== '')) ? true : false;
- }
-
- /**
- * Set a new domain for this translations.
- *
- * @param string $domain
- *
- * @return self
- */
- public function setDomain($domain)
- {
- $this->setHeader(self::HEADER_DOMAIN, trim($domain));
-
- return $this;
- }
-
- /**
- * Returns the domain.
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->getHeader(self::HEADER_DOMAIN);
- }
-
- /**
- * Checks whether the domain is empty or not.
- *
- * @return bool
- */
- public function hasDomain()
- {
- $domain = $this->getDomain();
-
- return (is_string($domain) && ($domain !== '')) ? true : false;
- }
-
- /**
- * Search for a specific translation.
- *
- * @param string|Translation $context The context of the translation or a translation instance
- * @param string $original The original string
- *
- * @return Translation|false
- */
- public function find($context, $original = '')
- {
- if ($context instanceof Translation) {
- $id = $context->getId();
- } else {
- $id = Translation::generateId($context, $original);
- }
-
- return $this->offsetExists($id) ? $this[$id] : false;
- }
-
- /**
- * Creates and insert/merges a new translation.
- *
- * @param string $context The translation context
- * @param string $original The translation original string
- * @param string $plural The translation original plural string
- *
- * @return Translation The translation created
- */
- public function insert($context, $original, $plural = '')
- {
- return $this->offsetSet(null, new Translation($context, $original, $plural));
- }
-
- /**
- * Merges this translations with other translations.
- *
- * @param Translations $translations The translations instance to merge with
- * @param int $options
- *
- * @return self
- */
- public function mergeWith(Translations $translations, $options = Merge::DEFAULTS)
- {
- Merge::mergeHeaders($translations, $this, $options);
- Merge::mergeTranslations($translations, $this, $options);
-
- return $this;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Translator.php b/src/composer/vendor/gettext/gettext/src/Translator.php
deleted file mode 100644
index bb375c5b..00000000
--- a/src/composer/vendor/gettext/gettext/src/Translator.php
+++ /dev/null
@@ -1,264 +0,0 @@
-addTranslations($translations);
-
- return $this;
- }
-
- /**
- * Set the default domain.
- *
- * @param string $domain
- *
- * @return self
- */
- public function defaultDomain($domain)
- {
- $this->domain = $domain;
-
- return $this;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function gettext($original)
- {
- return $this->dpgettext($this->domain, null, $original);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function ngettext($original, $plural, $value)
- {
- return $this->dnpgettext($this->domain, null, $original, $plural, $value);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dngettext($domain, $original, $plural, $value)
- {
- return $this->dnpgettext($domain, null, $original, $plural, $value);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function npgettext($context, $original, $plural, $value)
- {
- return $this->dnpgettext($this->domain, $context, $original, $plural, $value);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function pgettext($context, $original)
- {
- return $this->dpgettext($this->domain, $context, $original);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dgettext($domain, $original)
- {
- return $this->dpgettext($domain, null, $original);
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dpgettext($domain, $context, $original)
- {
- $translation = $this->getTranslation($domain, $context, $original);
-
- if (isset($translation[0]) && $translation[0] !== '') {
- return $translation[0];
- }
-
- return $original;
- }
-
- /**
- * @see TranslatorInterface
- *
- * {@inheritdoc}
- */
- public function dnpgettext($domain, $context, $original, $plural, $value)
- {
- $key = $this->getPluralIndex($domain, $value);
- $translation = $this->getTranslation($domain, $context, $original);
-
- if (isset($translation[$key]) && $translation[$key] !== '') {
- return $translation[$key];
- }
-
- return ($key === 0) ? $original : $plural;
- }
-
- /**
- * Set new translations to the dictionary.
- *
- * @param array $translations
- */
- protected function addTranslations(array $translations)
- {
- $domain = isset($translations['domain']) ? $translations['domain'] : '';
-
- //Set the first domain loaded as default domain
- if ($this->domain === null) {
- $this->domain = $domain;
- }
-
- if (isset($this->dictionary[$domain])) {
- $this->dictionary[$domain] = array_replace_recursive($this->dictionary[$domain], $translations['messages']);
-
- return;
- }
-
- if (!empty($translations['plural-forms'])) {
- list($count, $code) = array_map('trim', explode(';', $translations['plural-forms'], 2));
-
- // extract just the expression turn 'n' into a php variable '$n'.
- // Slap on a return keyword and semicolon at the end.
- $this->plurals[$domain] = [
- 'count' => (int) str_replace('nplurals=', '', $count),
- 'code' => str_replace('plural=', 'return ', str_replace('n', '$n', $code)).';',
- ];
- }
-
- $this->dictionary[$domain] = $translations['messages'];
- }
-
- /**
- * Search and returns a translation.
- *
- * @param string $domain
- * @param string $context
- * @param string $original
- *
- * @return string|false
- */
- protected function getTranslation($domain, $context, $original)
- {
- return isset($this->dictionary[$domain][$context][$original]) ? $this->dictionary[$domain][$context][$original] : false;
- }
-
- /**
- * Executes the plural decision code given the number to decide which
- * plural version to take.
- *
- * @param string $domain
- * @param string $n
- *
- * @return int
- */
- protected function getPluralIndex($domain, $n)
- {
- //Not loaded domain, use a fallback
- if (!isset($this->plurals[$domain])) {
- return $n == 1 ? 0 : 1;
- }
-
- if (!isset($this->plurals[$domain]['function'])) {
- $this->plurals[$domain]['function'] = create_function('$n', self::fixTerseIfs($this->plurals[$domain]['code']));
- }
-
- if ($this->plurals[$domain]['count'] <= 2) {
- return call_user_func($this->plurals[$domain]['function'], $n) ? 1 : 0;
- }
-
- return call_user_func($this->plurals[$domain]['function'], $n);
- }
-
- /**
- * This function will recursively wrap failure states in brackets if they contain a nested terse if.
- *
- * This because PHP can not handle nested terse if's unless they are wrapped in brackets.
- *
- * This code probably only works for the gettext plural decision codes.
- *
- * return ($n==1 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2);
- * becomes
- * return ($n==1 ? 0 : ($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2));
- *
- * @param string $code the terse if string
- * @param bool $inner If inner is true we wrap it in brackets
- *
- * @return string A formatted terse If that PHP can work with.
- */
- private static function fixTerseIfs($code, $inner = false)
- {
- /*
- * (?P[^?]+) Capture everything up to ? as 'expression'
- * \? ?
- * (?P[^:]+) Capture everything up to : as 'success'
- * : :
- * (?P[^;]+) Capture everything up to ; as 'failure'
- */
- preg_match('/(?P[^?]+)\?(?P[^:]+):(?P[^;]+)/', $code, $matches);
-
- // If no match was found then no terse if was present
- if (!isset($matches[0])) {
- return $code;
- }
-
- $expression = $matches['expression'];
- $success = $matches['success'];
- $failure = $matches['failure'];
-
- // Go look for another terse if in the failure state.
- $failure = self::fixTerseIfs($failure, true);
- $code = $expression.' ? '.$success.' : '.$failure;
-
- if ($inner) {
- return "($code)";
- }
-
- // note the semicolon. We need that for executing the code.
- return "$code;";
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/TranslatorInterface.php b/src/composer/vendor/gettext/gettext/src/TranslatorInterface.php
deleted file mode 100644
index d7722280..00000000
--- a/src/composer/vendor/gettext/gettext/src/TranslatorInterface.php
+++ /dev/null
@@ -1,103 +0,0 @@
- singular-translation).
- */
-trait DictionaryTrait
-{
- use HeadersGeneratorTrait;
- use HeadersExtractorTrait;
-
- /**
- * Returns a plain dictionary with the format [original => translation].
- *
- * @param Translations $translations
- * @param bool $includeHeaders
- *
- * @return array
- */
- private static function toArray(Translations $translations, $includeHeaders)
- {
- $messages = [];
-
- if ($includeHeaders) {
- $messages[''] = self::generateHeaders($translations);
- }
-
- foreach ($translations as $translation) {
- $messages[$translation->getOriginal()] = $translation->getTranslation();
- }
-
- return $messages;
- }
-
- /**
- * Extract the entries from a dictionary.
- *
- * @param array $messages
- * @param Translations $translations
- */
- private static function fromArray(array $messages, Translations $translations)
- {
- foreach ($messages as $original => $translation) {
- if ($original === '') {
- self::extractHeaders($translation, $translations);
- continue;
- }
-
- $translations->insert(null, $original)->setTranslation($translation);
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/FunctionsScanner.php b/src/composer/vendor/gettext/gettext/src/Utils/FunctionsScanner.php
deleted file mode 100644
index 0a49c79b..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/FunctionsScanner.php
+++ /dev/null
@@ -1,110 +0,0 @@
-getFunctions() as $function) {
- list($name, $line, $args) = $function;
-
- if (!isset($functions[$name])) {
- continue;
- }
-
- $domain = $context = $original = $plural = null;
-
- switch ($functions[$name]) {
- case 'gettext':
- if (!isset($args[0])) {
- continue 2;
- }
-
- $original = $args[0];
- break;
-
- case 'ngettext':
- if (!isset($args[1])) {
- continue 2;
- }
-
- list($original, $plural) = $args;
- break;
-
- case 'pgettext':
- if (!isset($args[1])) {
- continue 2;
- }
-
- list($context, $original) = $args;
- break;
-
- case 'dgettext':
- if (!isset($args[1])) {
- continue 2;
- }
-
- list($domain, $original) = $args;
- break;
-
- case 'dpgettext':
- if (!isset($args[2])) {
- continue 2;
- }
-
- list($domain, $context, $original) = $args;
- break;
-
- case 'npgettext':
- if (!isset($args[2])) {
- continue 2;
- }
-
- list($context, $original, $plural) = $args;
- break;
-
- case 'dnpgettext':
- if (!isset($args[4])) {
- continue 2;
- }
-
- list($domain, $context, $original, $plural) = $args;
- break;
-
- default:
- throw new Exception(sprintf('Not valid function %s', $functions[$name]));
- }
-
- if ((string) $original !== '' && ($domain === null || $domain === $translations->getDomain())) {
- $translation = $translations->insert($context, $original, $plural);
- $translation->addReference($file, $line);
-
- if (isset($function[3])) {
- foreach ($function[3] as $extractedComment) {
- $translation->addExtractedComment($extractedComment);
- }
- }
- }
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php b/src/composer/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php
deleted file mode 100644
index 25f8db04..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php
+++ /dev/null
@@ -1,67 +0,0 @@
-setHeader($currentHeader, $header[1]);
- } else {
- $entry = $translations->getHeader($currentHeader);
- $translations->setHeader($currentHeader, $entry.$line);
- }
- }
- }
-
- /**
- * Checks if it is a header definition line. Useful for distguishing between header definitions
- * and possible continuations of a header entry.
- *
- * @param string $line Line to parse
- *
- * @return bool
- */
- private static function isHeaderDefinition($line)
- {
- return (bool) preg_match('/^[\w-]+:/', $line);
- }
-
- /**
- * Normalize a string.
- *
- * @param string $value
- *
- * @return string
- */
- public static function convertString($value)
- {
- return $value;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php b/src/composer/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php
deleted file mode 100644
index d738790f..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php
+++ /dev/null
@@ -1,29 +0,0 @@
-getHeaders() as $name => $value) {
- $headers .= sprintf("%s: %s\n", $name, $value);
- }
-
- return $headers;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php b/src/composer/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php
deleted file mode 100644
index d6cc4665..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php
+++ /dev/null
@@ -1,220 +0,0 @@
-code = $code;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFunctions()
- {
- $length = strlen($this->code);
- $line = 1;
- $buffer = '';
- $functions = [];
- $bufferFunctions = [];
- $char = null;
-
- for ($pos = 0; $pos < $length; ++$pos) {
- $prev = $char;
- $char = $this->code[$pos];
- $next = isset($this->code[$pos]) ? $this->code[$pos] : null;
-
- switch ($char) {
- case "\n":
- ++$line;
-
- if ($this->status('line-comment')) {
- $this->upStatus();
- }
- break;
-
- case '/':
- switch ($this->status()) {
- case 'simple-quote':
- case 'double-quote':
- case 'line-comment':
- break;
-
- case 'block-comment':
- if ($prev === '*') {
- $this->upStatus();
- }
- break;
-
- default:
- if ($next === '/') {
- $this->downStatus('line-comment');
- } elseif ($next === '*') {
- $this->downStatus('block-comment');
- }
- break;
- }
- break;
-
- case "'":
- switch ($this->status()) {
- case 'simple-quote':
- $this->upStatus();
- break;
-
- case 'line-comment':
- case 'block-comment':
- case 'double-quote':
- break;
-
- default:
- $this->downStatus('simple-quote');
- break;
- }
- break;
-
- case '"':
- switch ($this->status()) {
- case 'double-quote':
- $this->upStatus();
- break;
-
- case 'line-comment':
- case 'block-comment':
- case 'simple-quote':
- break;
-
- default:
- $this->downStatus('double-quote');
- break;
- }
- break;
-
- case '(':
- switch ($this->status()) {
- case 'double-quote':
- case 'line-comment':
- case 'block-comment':
- case 'line-comment':
- break;
-
- default:
- if ($buffer && preg_match('/(\w+)$/', $buffer, $matches)) {
- $this->downStatus('function');
- array_unshift($bufferFunctions, [$matches[1], $line, []]);
- $buffer = '';
- continue 3;
- }
- break;
- }
- break;
-
- case ')':
- switch ($this->status()) {
- case 'function':
- if (($argument = self::prepareArgument($buffer))) {
- $bufferFunctions[0][2][] = $argument;
- }
-
- if (!empty($bufferFunctions)) {
- $functions[] = array_shift($bufferFunctions);
- }
-
- $buffer = '';
- continue 3;
- }
-
- case ',':
- switch ($this->status()) {
- case 'function':
- if (($argument = self::prepareArgument($buffer))) {
- $bufferFunctions[0][2][] = $argument;
- }
-
- $buffer = '';
- continue 3;
- }
- }
-
- switch ($this->status()) {
- case 'line-comment':
- case 'block-comment':
- break;
-
- default:
- $buffer .= $char;
- break;
- }
- }
-
- return $functions;
- }
-
- /**
- * Get the current context of the scan.
- *
- * @param null|string $match To check whether the current status is this value
- *
- * @return string|bool
- */
- protected function status($match = null)
- {
- $status = isset($this->status[0]) ? $this->status[0] : null;
-
- if ($match !== null) {
- return $status === $match;
- }
-
- return $status;
- }
-
- /**
- * Add a new status to the stack.
- *
- * @param string $status
- */
- protected function downStatus($status)
- {
- array_unshift($this->status, $status);
- }
-
- /**
- * Removes and return the current status.
- *
- * @return string|null
- */
- protected function upStatus()
- {
- return array_shift($this->status);
- }
-
- /**
- * Prepares the arguments found in functions.
- *
- * @param string $argument
- *
- * @return string
- */
- protected static function prepareArgument($argument)
- {
- if ($argument && ($argument[0] === '"' || $argument[0] === "'")) {
- if ($argument[0] === '"') {
- $argument = str_replace('\\"', '"', $argument);
- } else {
- $argument = str_replace("\\'", "'", $argument);
- }
-
- return substr($argument, 1, -1);
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php b/src/composer/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php
deleted file mode 100644
index a1b44786..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php
+++ /dev/null
@@ -1,95 +0,0 @@
- [original => [translation, plural1, pluraln...]]).
- */
-trait MultidimensionalArrayTrait
-{
- use HeadersGeneratorTrait;
- use HeadersExtractorTrait;
-
- /**
- * Returns a multidimensional array.
- *
- * @param Translations $translations
- * @param bool $includeHeaders
- * @param bool $forceArray
- *
- * @return array
- */
- private static function toArray(Translations $translations, $includeHeaders, $forceArray = false)
- {
- $pluralForm = $translations->getPluralForms();
- $pluralLimit = is_array($pluralForm) ? ($pluralForm[0] - 1) : null;
- $messages = [];
-
- if ($includeHeaders) {
- $messages[''] = [
- '' => [self::generateHeaders($translations)],
- ];
- }
-
- foreach ($translations as $translation) {
- $context = $translation->getContext();
- $original = $translation->getOriginal();
-
- if (!isset($messages[$context])) {
- $messages[$context] = [];
- }
-
- if ($translation->hasPluralTranslations(true)) {
- $messages[$context][$original] = $translation->getPluralTranslations($pluralLimit);
- array_unshift($messages[$context][$original], $translation->getTranslation());
- } elseif ($forceArray) {
- $messages[$context][$original] = [$translation->getTranslation()];
- } else {
- $messages[$context][$original] = $translation->getTranslation();
- }
- }
-
- return [
- 'domain' => $translations->getDomain(),
- 'plural-forms' => $translations->getHeader('Plural-Forms'),
- 'messages' => $messages,
- ];
- }
-
- /**
- * Extract the entries from a multidimensional array.
- *
- * @param array $messages
- * @param Translations $translations
- */
- private static function fromArray(array $messages, Translations $translations)
- {
- if (!empty($messages['domain'])) {
- $translations->setDomain($messages['domain']);
- }
-
- if (!empty($messages['plural-forms'])) {
- $translations->setHeader(Translations::HEADER_PLURAL, $messages['plural-forms']);
- }
-
- foreach ($messages['messages'] as $context => $contextTranslations) {
- foreach ($contextTranslations as $original => $value) {
- if ($context === '' && $original === '') {
- self::extractHeaders(is_array($value) ? array_shift($value) : $value, $translations);
- continue;
- }
-
- $translation = $translations->insert($context, $original);
-
- if (is_array($value)) {
- $translation->setTranslation(array_shift($value));
- $translation->setPluralTranslations($value);
- } else {
- $translation->setTranslation($value);
- }
- }
- }
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/ParsedFunction.php b/src/composer/vendor/gettext/gettext/src/Utils/ParsedFunction.php
deleted file mode 100644
index c5c8794c..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/ParsedFunction.php
+++ /dev/null
@@ -1,148 +0,0 @@
-name = $name;
- $this->line = $line;
- $this->arguments = [];
- $this->argumentIndex = -1;
- $this->argumentStopped = false;
- $this->comments = null;
- }
-
- /**
- * Stop extracting strings from the current argument (because we found something that's not a string).
- */
- public function stopArgument()
- {
- if ($this->argumentIndex === -1) {
- $this->argumentIndex = 0;
- }
- $this->argumentStopped = true;
- }
-
- /**
- * Go to the next argument because we a comma was found.
- */
- public function nextArgument()
- {
- if ($this->argumentIndex === -1) {
- // This should neve occur, but let's stay safe - During test/development an Exception should be thrown.
- $this->argumentIndex = 1;
- } else {
- ++$this->argumentIndex;
- }
- $this->argumentStopped = false;
- }
-
- /**
- * Add a string to the current argument.
- *
- * @param string $chunk
- */
- public function addArgumentChunk($chunk)
- {
- if ($this->argumentStopped === false) {
- if ($this->argumentIndex === -1) {
- $this->argumentIndex = 0;
- }
- if (isset($this->arguments[$this->argumentIndex])) {
- $this->arguments[$this->argumentIndex] .= $chunk;
- } else {
- $this->arguments[$this->argumentIndex] = $chunk;
- }
- }
- }
-
- /**
- * Add a comment associated to this function.
- *
- * @param string $comment
- */
- public function addComment($comment)
- {
- if ($this->comments === null) {
- $this->comments = [];
- }
- $this->comments[] = $comment;
- }
- /**
- * A closing parenthesis was found: return the final data.
- * The array returned has the following values:
- * 0 => string The function name.
- * 1 => int The line where the function starts.
- * 2 => string[] the strings extracted from the function arguments.
- * 3 => string[] the comments associated to the function.
- *
- * @return array
- */
- public function close()
- {
- $arguments = [];
- for ($i = 0; $i <= $this->argumentIndex; ++$i) {
- $arguments[$i] = isset($this->arguments[$i]) ? $this->arguments[$i] : '';
- }
-
- return [
- $this->name,
- $this->line,
- $arguments,
- $this->comments,
- ];
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php b/src/composer/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php
deleted file mode 100644
index 8af0fa55..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php
+++ /dev/null
@@ -1,160 +0,0 @@
-extractComments = (string) $tag;
- }
-
- /**
- * Disable comments extraction.
- */
- public function disableCommentsExtraction()
- {
- $this->extractComments = false;
- }
-
- /**
- * Constructor.
- *
- * @param string $code The php code to scan
- */
- public function __construct($code)
- {
- $this->tokens = array_values(
- array_filter(
- token_get_all($code),
- function ($token) {
- return !is_array($token) || $token[0] !== T_WHITESPACE;
- }
- )
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFunctions()
- {
- $count = count($this->tokens);
- $bufferFunctions = [];
- /* @var ParsedFunction[] $bufferFunctions */
- $functions = [];
- /* @var ParsedFunction[] $functions */
-
- for ($k = 0; $k < $count; ++$k) {
- $value = $this->tokens[$k];
-
- if (is_string($value)) {
- if (isset($bufferFunctions[0])) {
- switch ($value) {
- case ',':
- $bufferFunctions[0]->nextArgument();
- break;
- case ')':
- $functions[] = array_shift($bufferFunctions)->close();
- break;
- case '.':
- break;
- default:
- $bufferFunctions[0]->stopArgument();
- break;
- }
- }
- continue;
- }
-
- switch ($value[0]) {
- case T_CONSTANT_ENCAPSED_STRING:
- //add an argument to the current function
- if (isset($bufferFunctions[0])) {
- $bufferFunctions[0]->addArgumentChunk(PhpCode::convertString($value[1]));
- }
- break;
- case T_STRING:
- if (isset($bufferFunctions[0])) {
- $bufferFunctions[0]->stopArgument();
- }
- //new function found
- for ($j = $k + 1; $j < $count; ++$j) {
- $nextToken = $this->tokens[$j];
- if (is_array($nextToken) && $nextToken[0] === T_COMMENT) {
- continue;
- }
- if ($nextToken === '(') {
- $newFunction = new ParsedFunction($value[1], $value[2]);
- if ($k > 0 && is_array($this->tokens[$k - 1]) && $this->tokens[$k - 1][0] === T_COMMENT) {
- $comment = $this->parsePhpComment($this->tokens[$k - 1][1]);
- if ($comment !== null) {
- $newFunction->addComment($comment);
- }
- }
- array_unshift($bufferFunctions, $newFunction);
- $k = $j;
- }
- break;
- }
- break;
- case T_COMMENT:
- if (isset($bufferFunctions[0])) {
- $comment = $this->parsePhpComment($value[1]);
- if ($comment !== null) {
- $bufferFunctions[0]->addComment($comment);
- }
- }
- break;
- default:
- if (isset($bufferFunctions[0])) {
- $bufferFunctions[0]->stopArgument();
- }
- break;
- }
- }
-
- return $functions;
- }
-
- protected function parsePhpComment($value)
- {
- $result = null;
- if ($this->extractComments !== false) {
- if ($value[0] === '#') {
- $value = substr($value, 1);
- } elseif ($value[1] === '/') {
- $value = substr($value, 2);
- } else {
- $value = substr($value, 2, -2);
- }
- $value = trim($value);
- if ($value !== '' && ($this->extractComments === '' || strpos($value, $this->extractComments) === 0)) {
- $result = $value;
- }
- }
-
- return $result;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/Utils/StringReader.php b/src/composer/vendor/gettext/gettext/src/Utils/StringReader.php
deleted file mode 100644
index 0236aa35..00000000
--- a/src/composer/vendor/gettext/gettext/src/Utils/StringReader.php
+++ /dev/null
@@ -1,51 +0,0 @@
-str = $str;
- $this->strlen = strlen($this->str);
- }
-
- /**
- * Read and returns a part of the string.
- *
- * @param int $bytes The number of bytes to read
- *
- * @return string
- */
- public function read($bytes)
- {
- $data = substr($this->str, $this->pos, $bytes);
-
- $this->seekto($this->pos + $bytes);
-
- return $data;
- }
-
- /**
- * Move the cursor to a specific position.
- *
- * @param int $pos The amount of bytes to move
- *
- * @return int The new position
- */
- public function seekto($pos)
- {
- $this->pos = ($this->strlen < $pos) ? $this->strlen : $pos;
-
- return $this->pos;
- }
-}
diff --git a/src/composer/vendor/gettext/gettext/src/autoloader.php b/src/composer/vendor/gettext/gettext/src/autoloader.php
deleted file mode 100644
index 6a35ff4f..00000000
--- a/src/composer/vendor/gettext/gettext/src/autoloader.php
+++ /dev/null
@@ -1,13 +0,0 @@
-gettext($original);
-
- if (func_num_args() === 1) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 1);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the singular/plural translation of a string.
- *
- * @param string $original
- * @param string $plural
- * @param string $value
- *
- * @return string
- */
-function n__($original, $plural, $value)
-{
- $text = BaseTranslator::$current->ngettext($original, $plural, $value);
-
- if (func_num_args() === 3) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 3);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the translation of a string in a specific context.
- *
- * @param string $context
- * @param string $original
- *
- * @return string
- */
-function p__($context, $original)
-{
- $text = BaseTranslator::$current->pgettext($context, $original);
-
- if (func_num_args() === 2) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 2);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the translation of a string in a specific domain.
- *
- * @param string $domain
- * @param string $original
- *
- * @return string
- */
-function d__($domain, $original)
-{
- $text = BaseTranslator::$current->dgettext($domain, $original);
-
- if (func_num_args() === 2) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 2);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the translation of a string in a specific domain and context.
- *
- * @param string $domain
- * @param string $context
- * @param string $original
- *
- * @return string
- */
-function dp__($domain, $context, $original)
-{
- $text = BaseTranslator::$current->dpgettext($domain, $context, $original);
-
- if (func_num_args() === 3) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 3);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the singular/plural translation of a string in a specific context.
- *
- * @param string $context
- * @param string $original
- * @param string $plural
- * @param string $value
- *
- * @return string
- */
-function np__($context, $original, $plural, $value)
-{
- $text = BaseTranslator::$current->npgettext($context, $original, $plural, $value);
-
- if (func_num_args() === 4) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 4);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
-
-/**
- * Returns the singular/plural translation of a string in a specific domain and context.
- *
- * @param string $domain
- * @param string $context
- * @param string $original
- * @param string $plural
- * @param string $value
- *
- * @return string
- */
-function dnp__($domain, $context, $original, $plural, $value)
-{
- $text = BaseTranslator::$current->dnpgettext($domain, $context, $original, $plural, $value);
-
- if (func_num_args() === 5) {
- return $text;
- }
-
- $args = array_slice(func_get_args(), 5);
-
- return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
-}
diff --git a/src/composer/vendor/gettext/languages/LICENSE b/src/composer/vendor/gettext/languages/LICENSE
deleted file mode 100644
index 26ddf05e..00000000
--- a/src/composer/vendor/gettext/languages/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Michele Locati
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/src/composer/vendor/gettext/languages/UNICODE-LICENSE.txt b/src/composer/vendor/gettext/languages/UNICODE-LICENSE.txt
deleted file mode 100644
index a121510c..00000000
--- a/src/composer/vendor/gettext/languages/UNICODE-LICENSE.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
-
- Unicode Data Files include all data files under the directories
-http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF
-online code charts under the directory http://www.unicode.org/Public/.
-Software includes any source code published in the Unicode Standard or under
-the directories http://www.unicode.org/Public/,
-http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/.
-
- NOTICE TO USER: Carefully read the following legal agreement. BY
-DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES
-("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND
-AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF
-YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA
-FILES OR SOFTWARE.
-
- COPYRIGHT AND PERMISSION NOTICE
-
- Copyright © 1991-2014 Unicode, Inc. All rights reserved. Distributed under
-the Terms of Use in http://www.unicode.org/copyright.html.
-
- Permission is hereby granted, free of charge, to any person obtaining a
-copy of the Unicode data files and any associated documentation (the "Data
-Files") or Unicode software and any associated documentation (the "Software")
-to deal in the Data Files or Software without restriction, including without
-limitation the rights to use, copy, modify, merge, publish, distribute, and/or
-sell copies of the Data Files or Software, and to permit persons to whom the
-Data Files or Software are furnished to do so, provided that (a) the above
-copyright notice(s) and this permission notice appear with all copies of the
-Data Files or Software, (b) both the above copyright notice(s) and this
-permission notice appear in associated documentation, and (c) there is clear
-notice in each modified Data File or in the Software as well as in the
-documentation associated with the Data File(s) or Software that the data or
-software has been modified.
-
- THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
-PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
-THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
-DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE
-DATA FILES OR SOFTWARE.
-
- Except as contained in this notice, the name of a copyright holder shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in these Data Files or Software without prior written authorization
-of the copyright holder.
diff --git a/src/composer/vendor/gettext/languages/bin/export.cmd b/src/composer/vendor/gettext/languages/bin/export.cmd
deleted file mode 100644
index 11da1394..00000000
--- a/src/composer/vendor/gettext/languages/bin/export.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off
-
-php "%~dpn0.php" %*
diff --git a/src/composer/vendor/gettext/languages/bin/export.php b/src/composer/vendor/gettext/languages/bin/export.php
deleted file mode 100644
index 29adda01..00000000
--- a/src/composer/vendor/gettext/languages/bin/export.php
+++ /dev/null
@@ -1,234 +0,0 @@
- Enviro::$outputUSAscii));
- } else {
- echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toString'), $languages, array('us-ascii' => Enviro::$outputUSAscii));
- }
-} catch (Exception $x) {
- Enviro::echoErr($x->getMessage()."\n");
- Enviro::echoErr("Trace:\n");
- Enviro::echoErr($x->getTraceAsString()."\n");
- die(4);
-}
-
-die(0);
-
-/**
- * Helper class to handle command line options.
- */
-class Enviro
-{
- /**
- * Shall the output contain only US-ASCII characters?
- * @var bool
- */
- public static $outputUSAscii;
- /**
- * The output format.
- * @var string
- */
- public static $outputFormat;
- /**
- * Output file name.
- * @var string
- */
- public static $outputFilename;
- /**
- * List of wanted language IDs; it not set: all languages will be returned.
- * @var array|null
- */
- public static $languages;
- /**
- * Reduce the language list to the minimum common denominator.
- * @var bool
- */
- public static $reduce;
- /**
- * Parse the command line options.
- */
- public static function initialize()
- {
- global $argv;
- self::$outputUSAscii = false;
- self::$outputFormat = null;
- self::$outputFilename = null;
- self::$languages = null;
- self::$reduce = null;
- $exporters = Exporter::getExporters();
- if (isset($argv) && is_array($argv)) {
- foreach ($argv as $argi => $arg) {
- if ($argi === 0) {
- continue;
- }
- if (is_string($arg)) {
- $argLC = trim(strtolower($arg));
- switch ($argLC) {
- case '--us-ascii':
- self::$outputUSAscii = true;
- break;
- case '--reduce=yes':
- self::$reduce = true;
- break;
- case '--reduce=no':
- self::$reduce = false;
- break;
- default:
- if (preg_match('/^--output=.+$/', $argLC)) {
- if (isset(self::$outputFilename)) {
- self::echoErr("The output file name has been specified more than once!\n");
- self::showSyntax();
- die(3);
- }
- list(, self::$outputFilename) = explode('=', $arg, 2);
- self::$outputFilename = trim(self::$outputFilename);
- } elseif (preg_match('/^--languages?=.+$/', $argLC)) {
- list(, $s) = explode('=', $arg, 2);
- $list = explode(',', $s);
- if (is_array(self::$languages)) {
- self::$languages = array_merge(self::$languages, $list);
- } else {
- self::$languages = $list;
- }
- } elseif (isset($exporters[$argLC])) {
- if (isset(self::$outputFormat)) {
- self::echoErr("The output format has been specified more than once!\n");
- self::showSyntax();
- die(3);
- }
- self::$outputFormat = $argLC;
- } else {
- self::echoErr("Unknown option: $arg\n");
- self::showSyntax();
- die(2);
- }
- break;
- }
- }
- }
- }
- if (!isset(self::$outputFormat)) {
- self::showSyntax();
- die(1);
- }
- if (isset(self::$languages)) {
- self::$languages = array_values(array_unique(self::$languages));
- }
- if (!isset(self::$reduce)) {
- self::$reduce = isset(self::$languages) ? false : true;
- }
- }
-
- /**
- * Write out the syntax.
- */
- public static function showSyntax()
- {
- $exporters = array_keys(Exporter::getExporters(true));
- self::echoErr("Syntax: php ".basename(__FILE__)." [--us-ascii] [--languages=[,,...]] [--reduce=yes|no] [--output=] <".implode('|', $exporters).">\n");
- self::echoErr("Where:\n");
- self::echoErr("--us-ascii : if specified, the output will contain only US-ASCII characters.\n");
- self::echoErr("--languages: (or --language) export only the specified language codes.\n");
- self::echoErr(" Separate languages with commas; you can also use this argument\n");
- self::echoErr(" more than once; it's case insensitive and accepts both '_' and\n");
- self::echoErr(" '-' as locale chunks separator (eg we accept 'it_IT' as well as\n");
- self::echoErr(" 'it-it').\n");
- self::echoErr("--reduce : if set to yes the output won't contain languages with the same\n");
- self::echoErr(" base language and rules.\n For instance nl_BE ('Flemish') will be\n");
- self::echoErr(" omitted because it's the same as nl ('Dutch').\n");
- self::echoErr(" Defaults to 'no' --languages is specified, to 'yes' otherwise.\n");
- self::echoErr("--output : if specified, the output will be saved to . If not\n");
- self::echoErr(" specified we'll output to standard output.\n");
- self::echoErr("Output formats\n");
- $len = max(array_map('strlen', $exporters));
- foreach ($exporters as $exporter) {
- self::echoErr(str_pad($exporter, $len).": ".Exporter::getExporterDescription($exporter)."\n");
- }
- }
- /**
- * Print a string to stderr.
- * @param string $str The string to be printed out.
- */
- public static function echoErr($str)
- {
- $hStdErr = @fopen('php://stderr', 'a');
- if ($hStdErr === false) {
- echo $str;
- } else {
- fwrite($hStdErr, $str);
- fclose($hStdErr);
- }
- }
- /**
- * Reduce a language list to the minimum common denominator.
- * @param Language[] $languages
- * @return Language[]
- */
- public static function reduce($languages)
- {
- for ($numChunks = 3; $numChunks >= 2; $numChunks--) {
- $filtered = array();
- foreach ($languages as $language) {
- $chunks = explode('_', $language->id);
- $compatibleFound = false;
- if (count($chunks) === $numChunks) {
- $categoriesHash = serialize($language->categories);
- $otherIds = array();
- $otherIds[] = $chunks[0];
- for ($k = 2; $k < $numChunks; $k++) {
- $otherIds[] = $chunks[0].'_'.$chunks[$numChunks - 1];
- }
-
- foreach ($languages as $check) {
- foreach ($otherIds as $otherId) {
- if (($check->id === $otherId) && ($check->formula === $language->formula) && (serialize($check->categories) === $categoriesHash)) {
- $compatibleFound = true;
- break;
- }
- }
- if ($compatibleFound === true) {
- break;
- }
- }
- }
- if (!$compatibleFound) {
- $filtered[] = $language;
- }
- }
- $languages = $filtered;
- }
-
- return $languages;
- }
-}
diff --git a/src/composer/vendor/gettext/languages/bin/export.sh b/src/composer/vendor/gettext/languages/bin/export.sh
deleted file mode 100755
index 5bcf1baf..00000000
--- a/src/composer/vendor/gettext/languages/bin/export.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-php "$(dirname -- "$0")/export.php" $@
diff --git a/src/composer/vendor/gettext/languages/composer.json b/src/composer/vendor/gettext/languages/composer.json
deleted file mode 100644
index ba629ab2..00000000
--- a/src/composer/vendor/gettext/languages/composer.json
+++ /dev/null
@@ -1,38 +0,0 @@
-
-{
- "name": "gettext/languages",
- "description": "gettext languages with plural rules",
- "keywords": [
- "localization",
- "l10n",
- "internationalization",
- "i18n",
- "translations",
- "translate",
- "php",
- "unicode",
- "cldr",
- "language",
- "languages",
- "plural",
- "plurals",
- "plural rules"
- ],
- "homepage": "https://github.com/mlocati/cldr-to-gettext-plural-rules",
- "license": "MIT",
- "authors": [
- {
- "name": "Michele Locati",
- "email": "mlocati@gmail.com",
- "role": "Developer"
- }
- ],
- "autoload": {
- "psr-4": {
- "Gettext\\Languages\\": "src/"
- }
- },
- "require": {
- "php": ">=5.3"
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Category.php b/src/composer/vendor/gettext/languages/src/Category.php
deleted file mode 100644
index c8a368ad..00000000
--- a/src/composer/vendor/gettext/languages/src/Category.php
+++ /dev/null
@@ -1,108 +0,0 @@
-id = $matches[1];
- $cldrFormulaAndExamplesNormalized = trim(preg_replace('/\s+/', ' ', $cldrFormulaAndExamples));
- if (!preg_match('/^([^@]*)(?:@integer([^@]+))?(?:@decimal(?:[^@]+))?$/', $cldrFormulaAndExamplesNormalized, $matches)) {
- throw new Exception("Invalid CLDR category rule: $cldrFormulaAndExamples");
- }
- $cldrFormula = trim($matches[1]);
- $s = isset($matches[2]) ? trim($matches[2]) : '';
- $this->examples = ($s === '') ? null : $s;
- switch ($this->id) {
- case CldrData::OTHER_CATEGORY:
- if ($cldrFormula !== '') {
- throw new Exception("The '".CldrData::OTHER_CATEGORY."' category should not have any formula, but it has '$cldrFormula'");
- }
- $this->formula = null;
- break;
- default:
- if ($cldrFormula === '') {
- throw new Exception("The '{$this->id}' category does not have a formula");
- }
- $this->formula = FormulaConverter::convertFormula($cldrFormula);
- break;
- }
- }
- /**
- * Return a list of numbers corresponding to the $examples value.
- * @throws Exception Throws an Exception if we weren't able to expand the examples.
- * @return int[]
- */
- public function getExampleIntegers()
- {
- return self::expandExamples($this->examples);
- }
- /**
- * Expand a list of examples as defined by CLDR.
- * @param string $examples A string like '1, 2, 5...7, …'.
- * @throws Exception Throws an Exception if we weren't able to expand $examples.
- * @return int[]
- */
- public static function expandExamples($examples)
- {
- $result = array();
- $m = null;
- if (substr($examples, -strlen(', …')) === ', …') {
- $examples = substr($examples, 0, strlen($examples) -strlen(', …'));
- }
- foreach (explode(',', str_replace(' ', '', $examples)) as $range) {
- if (preg_match('/^\d+$/', $range)) {
- $result[] = intval($range);
- } elseif (preg_match('/^(\d+)~(\d+)$/', $range, $m)) {
- $from = intval($m[1]);
- $to = intval($m[2]);
- $delta = $to - $from;
- $step = (int) max(1, $delta / 100);
- for ($i = $from; $i < $to; $i += $step) {
- $result[] = $i;
- }
- $result[] = $to;
- } else {
- throw new Exception("Unhandled test range '$range' in '$examples'");
- }
- }
- if (empty($result)) {
- throw new Exception("No test numbers from '$examples'");
- }
-
- return $result;
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/CldrData.php b/src/composer/vendor/gettext/languages/src/CldrData.php
deleted file mode 100644
index 07023201..00000000
--- a/src/composer/vendor/gettext/languages/src/CldrData.php
+++ /dev/null
@@ -1,320 +0,0 @@
- $value) {
- $variant = '';
- if (preg_match('/^(.+)-alt-(short|variant|stand-alone)$/', $key, $match)) {
- $key = $match[1];
- $variant = $match[2];
- }
- $key = str_replace('-', '_', $key);
- switch ($key) {
- case 'root': // Language: Root
- case 'und': // Language: Unknown Language
- case 'zxx': // Language: No linguistic content
- case 'ZZ': // Territory: Unknown Region
- case 'Zinh': // Script: Inherited
- case 'Zmth': // Script: Mathematical Notation
- case 'Zsym': // Script: Symbols
- case 'Zxxx': // Script: Unwritten
- case 'Zyyy': // Script: Common
- case 'Zzzz': // Script: Unknown Script
- break;
- default:
- if (
- ((strlen($key) !== 4) || ($key < 'Qaaa') || ($key > 'Qabx')) // Script: Reserved for private use
- ) {
- switch ($variant) {
- case 'stand-alone':
- $standAlone[$key] = $value;
- break;
- case '':
- $result[$key] = $value;
- break;
- }
- }
- break;
- }
- }
-
- return $result;
- };
- $data = array();
- $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/languages.json'), true);
- $data['languages'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['languages']);
- $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/territories.json'), true);
- $data['territories'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['territories']);
- $json = json_decode(file_get_contents(__DIR__.'/cldr-data/supplemental/plurals.json'), true);
- $data['plurals'] = $fixKeys($json['supplemental']['plurals-type-cardinal']);
- $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/scripts.json'), true);
- $data['scripts'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['scripts'], $data['standAloneScripts']);
- $data['standAloneScripts'] = array_merge($data['scripts'], $data['standAloneScripts']);
- $data['scripts'] = array_merge($data['standAloneScripts'], $data['scripts']);
- $data['supersededLanguages'] = array();
- // Remove the languages for which we don't have plurals
- $m = null;
- foreach (array_keys(array_diff_key($data['languages'], $data['plurals'])) as $missingPlural) {
- if (preg_match('/^([a-z]{2,3})_/', $missingPlural, $m)) {
- if (!isset($data['plurals'][$m[1]])) {
- unset($data['languages'][$missingPlural]);
- }
- } else {
- unset($data['languages'][$missingPlural]);
- }
- }
- // Fix the languages for which we have plurals
- $formerCodes = array(
- 'in' => 'id', // former Indonesian
- 'iw' => 'he', // former Hebrew
- 'ji' => 'yi', // former Yiddish
- 'jw' => 'jv', // former Javanese
- 'mo' => 'ro_MD', // former Moldavian
- );
- $knownMissingLanguages = array(
- 'bh' => 'Bihari',
- 'guw' => 'Gun',
- 'nah' => 'Nahuatl',
- 'smi' => 'Sami',
- );
- foreach (array_keys(array_diff_key($data['plurals'], $data['languages'])) as $missingLanguage) {
- if (isset($formerCodes[$missingLanguage]) && isset($data['languages'][$formerCodes[$missingLanguage]])) {
- $data['languages'][$missingLanguage] = $data['languages'][$formerCodes[$missingLanguage]];
- $data['supersededLanguages'][$missingLanguage] = $formerCodes[$missingLanguage];
- } else {
- if (isset($knownMissingLanguages[$missingLanguage])) {
- $data['languages'][$missingLanguage] = $knownMissingLanguages[$missingLanguage];
- } else {
- throw new Exception("We have the plural rule for the language '$missingLanguage' but we don't have its language name");
- }
- }
- }
- ksort($data['languages'], SORT_STRING);
- ksort($data['territories'], SORT_STRING);
- ksort($data['plurals'], SORT_STRING);
- ksort($data['scripts'], SORT_STRING);
- ksort($data['standAloneScripts'], SORT_STRING);
- ksort($data['supersededLanguages'], SORT_STRING);
- self::$data = $data;
- }
- if (!@isset(self::$data[$key])) {
- throw new Exception("Invalid CLDR data key: '$key'");
- }
-
- return self::$data[$key];
- }
- /**
- * Returns a dictionary containing the language names.
- * The keys are the language identifiers.
- * The values are the language names in US English.
- * @return string[]
- */
- public static function getLanguageNames()
- {
- return self::getData('languages');
- }
- /**
- * Return a dictionary containing the territory names (in US English).
- * The keys are the territory identifiers.
- * The values are the territory names in US English.
- * @return string[]
- */
- public static function getTerritoryNames()
- {
- return self::getData('territories');
- }
- /**
- * Return a dictionary containing the script names (in US English).
- * The keys are the script identifiers.
- * The values are the script names in US English.
- * @param bool $standAlone Set to true to retrieve the stand-alone script names, false otherwise.
- * @return string[]
- */
- public static function getScriptNames($standAlone)
- {
- return self::getData($standAlone ? 'standAloneScripts' : 'scripts');
- }
- /**
- * @var array
- */
- private static $plurals;
- /**
- * A dictionary containing the plural rules.
- * The keys are the language identifiers.
- * The values are arrays whose keys are the CLDR category names and the values are the CLDR category definition.
- * @example The English key-value pair is somethink like this:
- *
- * "en": {
- * "pluralRule-count-one": "i = 1 and v = 0 @integer 1",
- * "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
- * }
- *
- * @var array
- */
- public static function getPlurals()
- {
- return self::getData('plurals');
- }
- /**
- * Return a list of superseded language codes.
- * @return array Keys are the former language codes, values are the new language/locale codes.
- */
- public static function getSupersededLanguages()
- {
- return self::getData('supersededLanguages');
- }
- /**
- * Retrieve the name of a language, as well as if a language code is deprecated in favor of another language code.
- * @param string $id The language identifier.
- * @return array|null Returns an array with the keys 'id' (normalized), 'name', 'supersededBy' (optional), 'territory' (optional), 'script' (optional), 'baseLanguage' (optional), 'categories'. If $id is not valid returns null.
- */
- public static function getLanguageInfo($id)
- {
- $result = null;
- $matches = array();
- if (preg_match('/^([a-z]{2,3})(?:[_\-]([a-z]{4}))?(?:[_\-]([a-z]{2}|[0-9]{3}))?(?:$|-)/i', $id, $matches)) {
- $languageId = strtolower($matches[1]);
- $scriptId = (isset($matches[2]) && ($matches[2] !== '')) ? ucfirst(strtolower($matches[2])) : null;
- $territoryId = (isset($matches[3]) && ($matches[3] !== '')) ? strtoupper($matches[3]) : null;
- $normalizedId = $languageId;
- if (isset($scriptId)) {
- $normalizedId .= '_'.$scriptId;
- }
- if (isset($territoryId)) {
- $normalizedId .= '_'.$territoryId;
- }
- // Structure precedence: see Likely Subtags - http://www.unicode.org/reports/tr35/tr35-31/tr35.html#Likely_Subtags
- $variants = array();
- $variantsWithScript = array();
- $variantsWithTerritory = array();
- if (isset($scriptId) && isset($territoryId)) {
- $variantsWithTerritory[] = $variantsWithScript[] = $variants[] = "{$languageId}_{$scriptId}_{$territoryId}";
- }
- if (isset($scriptId)) {
- $variantsWithScript[] = $variants[] = "{$languageId}_{$scriptId}";
- }
- if (isset($territoryId)) {
- $variantsWithTerritory[] = $variants[] = "{$languageId}_{$territoryId}";
- }
- $variants[] = $languageId;
- $allGood = true;
- $scriptName = null;
- $scriptStandAloneName = null;
- if (isset($scriptId)) {
- $scriptNames = self::getScriptNames(false);
- if (isset($scriptNames[$scriptId])) {
- $scriptName = $scriptNames[$scriptId];
- $scriptStandAloneNames = self::getScriptNames(true);
- $scriptStandAloneName = $scriptStandAloneNames[$scriptId];
- } else {
- $allGood = false;
- }
- }
- $territoryName = null;
- if (isset($territoryId)) {
- $territoryNames = self::getTerritoryNames();
- if (isset($territoryNames[$territoryId])) {
- if ($territoryId !== '001') {
- $territoryName = $territoryNames[$territoryId];
- }
- } else {
- $allGood = false;
- }
- }
- $languageName = null;
- $languageNames = self::getLanguageNames();
- foreach ($variants as $variant) {
- if (isset($languageNames[$variant])) {
- $languageName = $languageNames[$variant];
- if (isset($scriptName) && (!in_array($variant, $variantsWithScript))) {
- $languageName = $scriptName.' '.$languageName;
- }
- if (isset($territoryName) && (!in_array($variant, $variantsWithTerritory))) {
- $languageName .= ' ('.$territoryNames[$territoryId].')';
- }
- break;
- }
- }
- if (!isset($languageName)) {
- $allGood = false;
- }
- $baseLanguage = null;
- if (isset($scriptId) || isset($territoryId)) {
- if (isset($languageNames[$languageId]) && ($languageNames[$languageId] !== $languageName)) {
- $baseLanguage = $languageNames[$languageId];
- }
- }
- $plural = null;
- $plurals = self::getPlurals();
- foreach ($variants as $variant) {
- if (isset($plurals[$variant])) {
- $plural = $plurals[$variant];
- break;
- }
- }
- if (!isset($plural)) {
- $allGood = false;
- }
- $supersededBy = null;
- $supersededBys = self::getSupersededLanguages();
- foreach ($variants as $variant) {
- if (isset($supersededBys[$variant])) {
- $supersededBy = $supersededBys[$variant];
- break;
- }
- }
- if ($allGood) {
- $result = array();
- $result['id'] = $normalizedId;
- $result['name'] = $languageName;
- if (isset($supersededBy)) {
- $result['supersededBy'] = $supersededBy;
- }
- if (isset($scriptStandAloneName)) {
- $result['script'] = $scriptStandAloneName;
- }
- if (isset($territoryName)) {
- $result['territory'] = $territoryName;
- }
- if (isset($baseLanguage)) {
- $result['baseLanguage'] = $baseLanguage;
- }
- $result['categories'] = $plural;
- }
- }
-
- return $result;
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Docs.php b/src/composer/vendor/gettext/languages/src/Exporter/Docs.php
deleted file mode 100644
index 45acac27..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Docs.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
- gettext plural rules - built from CLDR
-
-
-
-
-
-
-
-
-EOT;
- $result .= static::buildTable($languages, true);
- $result .= <<
-
-
-
-
-EOT;
-
- return $result;
- }
- /**
- * @see Exporter::isForPublicUse
- */
- public static function isForPublicUse()
- {
- return false;
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build the page http://mlocati.github.io/cldr-to-gettext-plural-rules';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Exporter.php b/src/composer/vendor/gettext/languages/src/Exporter/Exporter.php
deleted file mode 100644
index 9d7f1905..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Exporter.php
+++ /dev/null
@@ -1,128 +0,0 @@
- $class) {
- if (call_user_func(self::getExporterClassName($handle).'::isForPublicUse') === true) {
- $result[$handle] = $class;
- }
- }
- } else {
- $result = self::$exporters;
- }
-
- return $result;
- }
- /**
- * Return the description of a specific exporter.
- * @param string $exporterHandle The handle of the exporter.
- * @throws Exception Throws an Exception if $exporterHandle is not valid.
- * @return string
- */
- final public static function getExporterDescription($exporterHandle)
- {
- $exporters = self::getExporters();
- if (!isset($exporters[$exporterHandle])) {
- throw new Exception("Invalid exporter handle: '$exporterHandle'");
- }
-
- return call_user_func(self::getExporterClassName($exporterHandle).'::getDescription');
- }
- /**
- * Returns the fully qualified class name of a exporter given its handle.
- * @param string $exporterHandle The exporter class handle.
- * @return string
- */
- final public static function getExporterClassName($exporterHandle)
- {
- return __NAMESPACE__.'\\'.ucfirst(strtolower($exporterHandle));
- }
- /**
- * Convert a list of Language instances to string.
- * @param Language[] $languages The Language instances to convert.
- * @return string
- */
- protected static function toStringDo($languages)
- {
- throw new Exception(get_called_class().' does not implement the method '.__FUNCTION__);
- }
- /**
- * Convert a list of Language instances to string.
- * @param Language[] $languages The Language instances to convert.
- * @return string
- */
- final public static function toString($languages, $options = null)
- {
- if (isset($options) && is_array($options)) {
- if (isset($options['us-ascii']) && $options['us-ascii']) {
- $asciiList = array();
- foreach ($languages as $language) {
- $asciiList[] = $language->getUSAsciiClone();
- }
- $languages = $asciiList;
- }
- }
-
- return static::toStringDo($languages);
- }
- /**
- * Save the Language instances to a file.
- * @param Language[] $languages The Language instances to convert.
- * @throws Exception
- */
- final public static function toFile($languages, $filename, $options = null)
- {
- $data = self::toString($languages, $options);
- if (@file_put_contents($filename, $data) === false) {
- throw new Exception("Error writing data to '$filename'");
- }
- }
- /**
- * Is this exporter for public use?
- * @return bool
- */
- public static function isForPublicUse()
- {
- return true;
- }
- /**
- * Return a short description of the exporter.
- * @return string
- */
- public static function getDescription()
- {
- throw new Exception(get_called_class().' does not implement the method '.__FUNCTION__);
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Html.php b/src/composer/vendor/gettext/languages/src/Exporter/Html.php
deleted file mode 100644
index be293c70..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Html.php
+++ /dev/null
@@ -1,61 +0,0 @@
-';
- $lines[] = $prefix.' ';
- $lines[] = $prefix.' ';
- $lines[] = $prefix.' Language code ';
- $lines[] = $prefix.' Language name ';
- $lines[] = $prefix.' # plurals ';
- $lines[] = $prefix.' Formula ';
- $lines[] = $prefix.' Plurals ';
- $lines[] = $prefix.' ';
- $lines[] = $prefix.' ';
- $lines[] = $prefix.' ';
- foreach ($languages as $lc) {
- $lines[] = $prefix.' ';
- $lines[] = $prefix.' '.$lc->id.' ';
- $name = self::h($lc->name);
- if (isset($lc->supersededBy)) {
- $name .= '
Superseded by '.$lc->supersededBy.'';
- }
- $lines[] = $prefix.' '.$name.' ';
- $lines[] = $prefix.' '.count($lc->categories).' ';
- $lines[] = $prefix.' '.self::h($lc->formula).' ';
- $cases = array();
- foreach ($lc->categories as $c) {
- $cases[] = ''.$c->id.''.self::h($c->examples).' ';
- }
- $lines[] = $prefix.' '.implode('', $cases).'
';
- $lines[] = $prefix.' ';
- }
- $lines[] = $prefix.' ';
- $lines[] = $prefix.'';
-
- return implode("\n", $lines);
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build a HTML table';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Json.php b/src/composer/vendor/gettext/languages/src/Exporter/Json.php
deleted file mode 100644
index 09e79f01..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Json.php
+++ /dev/null
@@ -1,63 +0,0 @@
-name;
- if (isset($language->supersededBy)) {
- $item['supersededBy'] = $language->supersededBy;
- }
- if (isset($language->script)) {
- $item['script'] = $language->script;
- }
- if (isset($language->territory)) {
- $item['territory'] = $language->territory;
- }
- if (isset($language->baseLanguage)) {
- $item['baseLanguage'] = $language->baseLanguage;
- }
- $item['formula'] = $language->formula;
- $item['plurals'] = count($language->categories);
- $item['cases'] = array();
- $item['examples'] = array();
- foreach ($language->categories as $category) {
- $item['cases'][] = $category->id;
- $item['examples'][$category->id] = $category->examples;
- }
- $list[$language->id] = $item;
- }
-
- return json_encode($list, static::getEncodeOptions());
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build a compressed JSON-encoded file';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Php.php b/src/composer/vendor/gettext/languages/src/Exporter/Php.php
deleted file mode 100644
index d8ef4cc1..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Php.php
+++ /dev/null
@@ -1,55 +0,0 @@
-id.'\' => array(';
- $lines[] = ' \'name\' => \''.addslashes($lc->name).'\',';
- if (isset($lc->supersededBy)) {
- $lines[] = ' \'supersededBy\' => \''.$lc->supersededBy.'\',';
- }
- if (isset($lc->script)) {
- $lines[] = ' \'script\' => \''.addslashes($lc->script).'\',';
- }
- if (isset($lc->territory)) {
- $lines[] = ' \'territory\' => \''.addslashes($lc->territory).'\',';
- }
- if (isset($lc->baseLanguage)) {
- $lines[] = ' \'baseLanguage\' => \''.addslashes($lc->baseLanguage).'\',';
- }
- $lines[] = ' \'formula\' => \''.$lc->formula.'\',';
- $lines[] = ' \'plurals\' => '.count($lc->categories).',';
- $catNames = array();
- foreach ($lc->categories as $c) {
- $catNames[] = "'{$c->id}'";
- }
- $lines[] = ' \'cases\' => array('.implode(', ', $catNames).'),';
- $lines[] = ' \'examples\' => array(';
- foreach ($lc->categories as $c) {
- $lines[] = ' \''.$c->id.'\' => \''.$c->examples.'\',';
- }
- $lines[] = ' ),';
- $lines[] = ' ),';
- }
- $lines[] = ');';
- $lines[] = '';
-
- return implode("\n", $lines);
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build a PHP array';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Po.php b/src/composer/vendor/gettext/languages/src/Exporter/Po.php
deleted file mode 100644
index c89ab13b..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Po.php
+++ /dev/null
@@ -1,31 +0,0 @@
-id.'\n"';
- $lines[] = '"Plural-Forms: nplurals='.count($language->categories).'; plural='.$language->formula.'\n"';
- $lines[] = '';
-
- return implode("\n", $lines);
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build a string to be used for gettext .po files';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Exporter/Prettyjson.php b/src/composer/vendor/gettext/languages/src/Exporter/Prettyjson.php
deleted file mode 100644
index aa8fd991..00000000
--- a/src/composer/vendor/gettext/languages/src/Exporter/Prettyjson.php
+++ /dev/null
@@ -1,25 +0,0 @@
-loadXML(' ');
- $xLanguages = $xml->firstChild;
- foreach ($languages as $language) {
- $xLanguage = $xml->createElement('language');
- $xLanguage->setAttribute('id', $language->id);
- $xLanguage->setAttribute('name', $language->name);
- if (isset($language->supersededBy)) {
- $xLanguage->setAttribute('supersededBy', $language->supersededBy);
- }
- if (isset($language->script)) {
- $xLanguage->setAttribute('script', $language->script);
- }
- if (isset($language->territory)) {
- $xLanguage->setAttribute('territory', $language->territory);
- }
- if (isset($language->baseLanguage)) {
- $xLanguage->setAttribute('baseLanguage', $language->baseLanguage);
- }
- $xLanguage->setAttribute('formula', $language->formula);
- foreach ($language->categories as $category) {
- $xCategory = $xml->createElement('category');
- $xCategory->setAttribute('id', $category->id);
- $xCategory->setAttribute('examples', $category->examples);
- $xLanguage->appendChild($xCategory);
- }
- $xLanguages->appendChild($xLanguage);
- }
- $xml->formatOutput = true;
-
- return $xml->saveXML();
- }
- /**
- * @see Exporter::getDescription
- */
- public static function getDescription()
- {
- return 'Build an XML file - schema available at http://mlocati.github.io/cldr-to-gettext-plural-rules/GettextLanguages.xsd';
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/FormulaConverter.php b/src/composer/vendor/gettext/languages/src/FormulaConverter.php
deleted file mode 100644
index 27960903..00000000
--- a/src/composer/vendor/gettext/languages/src/FormulaConverter.php
+++ /dev/null
@@ -1,154 +0,0 @@
- the whole 'and' group is always false
- $gettextFormulaChunk = false;
- break;
- } elseif ($gettextAtom !== true) {
- $andSeparatedChunks[] = $gettextAtom;
- }
- }
- if (!isset($gettextFormulaChunk)) {
- if (empty($andSeparatedChunks)) {
- // All the atoms joined by 'and' always evaluate to true => the whole 'and' group is always true
- $gettextFormulaChunk = true;
- } else {
- $gettextFormulaChunk = implode(' && ', $andSeparatedChunks);
- // Special cases simplification
- switch ($gettextFormulaChunk) {
- case 'n >= 0 && n <= 2 && n != 2':
- $gettextFormulaChunk = 'n == 0 || n == 1';
- break;
- }
- }
- }
- if ($gettextFormulaChunk === true) {
- // One part of the formula joined with the others by 'or' always evaluates to true => the whole formula always evaluates to true
- return true;
- } elseif ($gettextFormulaChunk !== false) {
- $orSeparatedChunks[] = $gettextFormulaChunk;
- }
- }
- if (empty($orSeparatedChunks)) {
- // All the parts joined by 'or' always evaluate to false => the whole formula always evaluates to false
- return false;
- } else {
- return implode(' || ', $orSeparatedChunks);
- }
- }
- /**
- * Converts an atomic part of the CLDR formula to its gettext representation.
- * @param string $cldrAtom The CLDR formula atom to convert.
- * @throws Exception
- * @return bool|string Returns true if the gettext will always evaluate to true, false if gettext will always evaluate to false, return the gettext formula otherwise.
- */
- private static function convertAtom($cldrAtom)
- {
- $m = null;
- $gettextAtom = $cldrAtom;
- $gettextAtom = str_replace(' = ', ' == ', $gettextAtom);
- $gettextAtom = str_replace('i', 'n', $gettextAtom);
- if (preg_match('/^n( % \d+)? (!=|==) \d+$/', $gettextAtom)) {
- return $gettextAtom;
- }
- if (preg_match('/^n( % \d+)? (!=|==) \d+(,\d+|\.\.\d+)+$/', $gettextAtom)) {
- return self::expandAtom($gettextAtom);
- }
- if (preg_match('/^(?:v|w)(?: % 10+)? == (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // For gettext: v == 0, w == 0
- return (intval($m[1]) === 0) ? true : false;
- }
- if (preg_match('/^(?:v|w)(?: % 10+)? != (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // For gettext: v == 0, w == 0
- return (intval($m[1]) === 0) ? false : true;
- }
- if (preg_match('/^(?:f|t)(?: % 10+)? == (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // f == empty, t == empty
- return (intval($m[1]) === 0) ? true : false;
- }
- if (preg_match('/^(?:f|t)(?: % 10+)? != (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // f == empty, t == empty
- return (intval($m[1]) === 0) ? false : true;
- }
- throw new Exception("Unable to convert the formula chunk '$cldrAtom' from CLDR to gettext");
- }
- /**
- * Expands an atom containing a range (for instance: 'n == 1,3..5').
- * @param string $atom
- * @throws Exception
- * @return string
- */
- private static function expandAtom($atom)
- {
- $m = null;
- if (preg_match('/^(n(?: % \d+)?) (==|!=) (\d+(?:\.\.\d+|,\d+)+)$/', $atom, $m)) {
- $what = $m[1];
- $op = $m[2];
- $chunks = array();
- foreach (explode(',', $m[3]) as $range) {
- $chunk = null;
- if ((!isset($chunk)) && preg_match('/^\d+$/', $range)) {
- $chunk = "$what $op $range";
- }
- if ((!isset($chunk)) && preg_match('/^(\d+)\.\.(\d+)$/', $range, $m)) {
- $from = intval($m[1]);
- $to = intval($m[2]);
- if (($to - $from) === 1) {
- switch ($op) {
- case '==':
- $chunk = "($what == $from || $what == $to)";
- break;
- case '!=':
- $chunk = "$what != $from && $what == $to";
- break;
- }
- } else {
- switch ($op) {
- case '==':
- $chunk = "$what >= $from && $what <= $to";
- break;
- case '!=':
- $chunk = "($what < $from || $what > $to)";
- break;
- }
- }
- }
- if (!isset($chunk)) {
- throw new Exception("Unhandled range '$range' in '$atom'");
- }
- $chunks[] = $chunk;
- }
- if (count($chunks) === 1) {
- return $chunks[0];
- }
- switch ($op) {
- case '==':
- return '('.implode(' || ', $chunks).')';break;
- case '!=':
- return implode(' && ', $chunks);
- }
- }
- throw new Exception("Unable to expand '$atom'");
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/Language.php b/src/composer/vendor/gettext/languages/src/Language.php
deleted file mode 100644
index 898bb61e..00000000
--- a/src/composer/vendor/gettext/languages/src/Language.php
+++ /dev/null
@@ -1,366 +0,0 @@
-id = $info['id'];
- $this->name = $info['name'];
- $this->supersededBy = isset($info['supersededBy']) ? $info['supersededBy'] : null;
- $this->script = isset($info['script']) ? $info['script'] : null;
- $this->territory = isset($info['territory']) ? $info['territory'] : null;
- $this->baseLanguage = isset($info['baseLanguage']) ? $info['baseLanguage'] : null;
- // Let's build the category list
- $this->categories = array();
- foreach ($info['categories'] as $cldrCategoryId => $cldrFormulaAndExamples) {
- $category = new Category($cldrCategoryId, $cldrFormulaAndExamples);
- foreach ($this->categories as $c) {
- if ($category->id === $c->id) {
- throw new Exception("The category '{$category->id}' is specified more than once");
- }
- }
- $this->categories[] = $category;
- }
- if (empty($this->categories)) {
- throw new Exception("The language '$id' does not have any plural category");
- }
- // Let's sort the categories from 'zero' to 'other'
- usort($this->categories, function (Category $category1, Category $category2) {
- return array_search($category1->id, CldrData::$categories) - array_search($category2->id, CldrData::$categories);
- });
- // The 'other' category should always be there
- if ($this->categories[count($this->categories) - 1]->id !== CldrData::OTHER_CATEGORY) {
- throw new Exception("The language '$id' does not have the '".CldrData::OTHER_CATEGORY."' plural category");
- }
- $this->checkAlwaysTrueCategories();
- $this->checkAlwaysFalseCategories();
- $this->checkAllCategoriesWithExamples();
- $this->formula = $this->buildFormula();
- }
- /**
- * Return a list of all languages available.
- * @throws Exception
- * @return Language[]
- */
- public static function getAll()
- {
- $result = array();
- foreach (array_keys(CldrData::getLanguageNames()) as $cldrLanguageId) {
- $result[] = new Language(CldrData::getLanguageInfo($cldrLanguageId));
- }
-
- return $result;
- }
- /**
- * Return a Language instance given the language id
- * @param string $id
- * @return Language|null
- */
- public static function getById($id)
- {
- $result = null;
- $info = CldrData::getLanguageInfo($id);
- if (isset($info)) {
- $result = new Language($info);
- }
-
- return $result;
- }
-
- /**
- * Let's look for categories that will always occur.
- * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have just one case.
- * If we found that (single) category we reduce the categories to that one only.
- */
- private function checkAlwaysTrueCategories()
- {
- $alwaysTrueCategory = null;
- foreach ($this->categories as $category) {
- if ($category->formula === true) {
- if (!isset($category->examples)) {
- throw new Exception("The category '{$category->id}' should always occur, but it does not have examples (so for CLDR it will never occur for integers!)");
- }
- $alwaysTrueCategory = $category;
- break;
- }
- }
- if (isset($alwaysTrueCategory)) {
- foreach ($this->categories as $category) {
- if (($category !== $alwaysTrueCategory) && isset($category->examples)) {
- throw new Exception("The category '{$category->id}' should never occur, but it has some examples (so for CLDR it will occur!)");
- }
- }
- $alwaysTrueCategory->id = CldrData::OTHER_CATEGORY;
- $alwaysTrueCategory->formula = null;
- $this->categories = array($alwaysTrueCategory);
- }
- }
- /**
- * Let's look for categories that will never occur.
- * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases.
- * If we found those categories we strip them out.
- */
- private function checkAlwaysFalseCategories()
- {
- $filtered = array();
- foreach ($this->categories as $category) {
- if ($category->formula === false) {
- if (isset($category->examples)) {
- throw new Exception("The category '{$category->id}' should never occur, but it has examples (so for CLDR it may occur!)");
- }
- } else {
- $filtered[] = $category;
- }
- }
- $this->categories = $filtered;
- }
- /**
- * Let's look for categories that don't have examples.
- * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases.
- * If we found those categories, we check that they never occur and we strip them out.
- * @throws Exception
- */
- private function checkAllCategoriesWithExamples()
- {
- $allCategoriesIds = array();
- $goodCategories = array();
- $badCategories = array();
- $badCategoriesIds = array();
- foreach ($this->categories as $category) {
- $allCategoriesIds[] = $category->id;
- if (isset($category->examples)) {
- $goodCategories[] = $category;
- } else {
- $badCategories[] = $category;
- $badCategoriesIds[] = $category->id;
- }
- }
- if (empty($badCategories)) {
- return;
- }
- $removeCategoriesWithoutExamples = false;
- switch (implode(',', $badCategoriesIds).'@'.implode(',', $allCategoriesIds)) {
- case CldrData::OTHER_CATEGORY.'@one,few,many,'.CldrData::OTHER_CATEGORY:
- switch ($this->buildFormula()) {
- case '(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : ((n % 10 == 0 || n % 10 >= 5 && n % 10 <= 9 || n % 100 >= 11 && n % 100 <= 14) ? 2 : 3))':
- // Numbers ending with 0 => case 2 ('many')
- // Numbers ending with 1 but not with 11 => case 0 ('one')
- // Numbers ending with 11 => case 2 ('many')
- // Numbers ending with 2 but not with 12 => case 1 ('few')
- // Numbers ending with 12 => case 2 ('many')
- // Numbers ending with 3 but not with 13 => case 1 ('few')
- // Numbers ending with 13 => case 2 ('many')
- // Numbers ending with 4 but not with 14 => case 1 ('few')
- // Numbers ending with 14 => case 2 ('many')
- // Numbers ending with 5 => case 2 ('many')
- // Numbers ending with 6 => case 2 ('many')
- // Numbers ending with 7 => case 2 ('many')
- // Numbers ending with 8 => case 2 ('many')
- // Numbers ending with 9 => case 2 ('many')
- // => the 'other' case never occurs: use 'other' for 'many'
- $removeCategoriesWithoutExamples = true;
- break;
- case '(n == 1) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : ((n != 1 && (n % 10 == 0 || n % 10 == 1) || n % 10 >= 5 && n % 10 <= 9 || n % 100 >= 12 && n % 100 <= 14) ? 2 : 3))':
- // Numbers ending with 0 => case 2 ('many')
- // Numbers ending with 1 but not number 1 => case 2 ('many')
- // Number 1 => case 0 ('one')
- // Numbers ending with 2 but not with 12 => case 1 ('few')
- // Numbers ending with 12 => case 2 ('many')
- // Numbers ending with 3 but not with 13 => case 1 ('few')
- // Numbers ending with 13 => case 2 ('many')
- // Numbers ending with 4 but not with 14 => case 1 ('few')
- // Numbers ending with 14 => case 2 ('many')
- // Numbers ending with 5 => case 2 ('many')
- // Numbers ending with 6 => case 2 ('many')
- // Numbers ending with 7 => case 2 ('many')
- // Numbers ending with 8 => case 2 ('many')
- // Numbers ending with 9 => case 2 ('many')
- // => the 'other' case never occurs: use 'other' for 'many'
- $removeCategoriesWithoutExamples = true;
- break;
- }
- }
- if (!$removeCategoriesWithoutExamples) {
- throw new Exception("Unhandled case of plural categories without examples '".implode(', ', $badCategoriesIds)."' out of '".implode(', ', $allCategoriesIds)."'");
- }
- if ($badCategories[count($badCategories) - 1]->id === CldrData::OTHER_CATEGORY) {
- // We're removing the 'other' cagory: let's change the last good category to 'other'
- $lastGood = $goodCategories[count($goodCategories) - 1];
- $lastGood->id = CldrData::OTHER_CATEGORY;
- $lastGood->formula = null;
- }
- $this->categories = $goodCategories;
- }
- /**
- * Build the formula starting from the currently defined categories.
- * @return string
- */
- private function buildFormula()
- {
- $numCategories = count($this->categories);
- switch ($numCategories) {
- case 1:
- // Just one category
- return '0';
- case 2:
- return self::reduceFormula(self::reverseFormula($this->categories[0]->formula));
- default:
- $formula = strval($numCategories - 1);
- for ($i = $numCategories - 2; $i >= 0; $i--) {
- $f = self::reduceFormula($this->categories[$i]->formula);
- if (!preg_match('/^\([^()]+\)$/', $f)) {
- $f = "($f)";
- }
- $formula = "$f ? $i : $formula";
- if ($i > 0) {
- $formula = "($formula)";
- }
- }
-
- return $formula;
- }
- }
- /**
- * Reverse a formula.
- * @param string $formula
- * @throws Exception
- * @return string
- */
- private static function reverseFormula($formula)
- {
- if (preg_match('/^n( % \d+)? == \d+(\.\.\d+|,\d+)*?$/', $formula)) {
- return str_replace(' == ', ' != ', $formula);
- }
- if (preg_match('/^n( % \d+)? != \d+(\.\.\d+|,\d+)*?$/', $formula)) {
- return str_replace(' != ', ' == ', $formula);
- }
- if (preg_match('/^\(?n == \d+ \|\| n == \d+\)?$/', $formula)) {
- return trim(str_replace(array(' == ', ' || '), array(' != ', ' && '), $formula), '()');
- }
- $m = null;
- if (preg_match('/^(n(?: % \d+)?) == (\d+) && (n(?: % \d+)?) != (\d+)$/', $formula, $m)) {
- return "{$m[1]} != {$m[2]} || {$m[3]} == {$m[4]}";
- }
- switch ($formula) {
- case '(n == 1 || n == 2 || n == 3) || n % 10 != 4 && n % 10 != 6 && n % 10 != 9':
- return 'n != 1 && n != 2 && n != 3 && (n % 10 == 4 || n % 10 == 6 || n % 10 == 9)';
- case '(n == 0 || n == 1) || n >= 11 && n <= 99':
- return 'n >= 2 && (n < 11 || n > 99)';
- }
- throw new Exception("Unable to reverse the formula '$formula'");
- }
- /**
- * Reduce some excessively complex formulas.
- * @param string $formula
- * @return string
- */
- private static function reduceFormula($formula)
- {
- $map = array(
- 'n != 0 && n != 1' => 'n > 1' ,
- '(n == 0 || n == 1) && n != 0' => 'n == 1',
- );
-
- return isset($map[$formula]) ? $map[$formula] : $formula;
- }
- /**
- * Take one variable and, if it's a string, we transliterate it to US-ASCII.
- * @param mixed $value The variable to work on.
- * @throws Exception
- */
- private static function asciifier(&$value)
- {
- if (is_string($value) && ($value !== '')) {
- // Avoid converting from 'Ÿ' to '"Y', let's prefer 'Y'
- $transliterated = strtr($value, array(
- 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A',
- 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E',
- 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',
- 'Ñ' => 'N',
- 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O',
- 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U',
- 'Ÿ' => 'Y', 'Ý' => 'Y',
- 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a',
- 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e',
- 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i',
- 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o',
- 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u',
- 'ý' => 'y', 'ÿ' => 'y',
- ));
- $transliterated = @iconv('UTF-8', 'US-ASCII//IGNORE//TRANSLIT', $transliterated);
- if (($transliterated === false) || ($transliterated === '')) {
- throw new Exception("Unable to transliterate '$value'");
- }
- $value = $transliterated;
- }
- }
- /**
- * Returns a clone of this instance with all the strings to US-ASCII.
- * @return Language
- */
- public function getUSAsciiClone()
- {
- $clone = clone $this;
- self::asciifier($clone->name);
- self::asciifier($clone->formula);
- $clone->categories = array();
- foreach ($this->categories as $category) {
- $categoryClone = clone $category;
- self::asciifier($categoryClone->examples);
- $clone->categories[] = $categoryClone;
- }
-
- return $clone;
- }
-}
diff --git a/src/composer/vendor/gettext/languages/src/autoloader.php b/src/composer/vendor/gettext/languages/src/autoloader.php
deleted file mode 100644
index 435eb890..00000000
--- a/src/composer/vendor/gettext/languages/src/autoloader.php
+++ /dev/null
@@ -1,12 +0,0 @@
-files()
- ->name('*.php')
- ->in(__DIR__.'/src')
- ->in(__DIR__.'/tests')
-;
-
-return Symfony\CS\Config\Config::create()
- ->fixers(array(
- 'psr0', 'encoding', 'short_tag', 'braces', 'elseif', 'eof_ending', 'function_declaration', 'indentation', 'line_after_namespace', 'linefeed', 'lowercase_constants', 'lowercase_keywords', 'multiple_use', 'php_closing_tag', 'trailing_spaces', 'visibility', 'duplicate_semicolon', 'extra_empty_lines', 'include', 'namespace_no_leading_whitespace', 'object_operator', 'operators_spaces', 'phpdoc_params', 'return', 'single_array_no_trailing_comma', 'spaces_cast', 'standardize_not_equal', 'ternary_spaces', 'unused_use', 'whitespacy_lines',
- ))
- ->finder($finder)
-;
diff --git a/src/composer/vendor/monolog/monolog/CHANGELOG.mdown b/src/composer/vendor/monolog/monolog/CHANGELOG.mdown
deleted file mode 100644
index cf8db7b5..00000000
--- a/src/composer/vendor/monolog/monolog/CHANGELOG.mdown
+++ /dev/null
@@ -1,217 +0,0 @@
-### 1.13.1 (2015-03-09)
-
- * Fixed regression in HipChat requiring a new token to be created
-
-### 1.13.0 (2015-03-05)
-
- * Added Registry::hasLogger to check for the presence of a logger instance
- * Added context.user support to RavenHandler
- * Added HipChat API v2 support in the HipChatHandler
- * Added NativeMailerHandler::addParameter to pass params to the mail() process
- * Added context data to SlackHandler when $includeContextAndExtra is true
- * Added ability to customize the Swift_Message per-email in SwiftMailerHandler
- * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided
- * Fixed serialization of INF and NaN values in Normalizer and LineFormatter
-
-### 1.12.0 (2014-12-29)
-
- * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers.
- * Added PsrHandler to forward records to another PSR-3 logger
- * Added SamplingHandler to wrap around a handler and include only every Nth record
- * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now)
- * Added exception codes in the output of most formatters
- * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line)
- * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data
- * Added $host to HipChatHandler for users of private instances
- * Added $transactionName to NewRelicHandler and support for a transaction_name context value
- * Fixed MandrillHandler to avoid outputing API call responses
- * Fixed some non-standard behaviors in SyslogUdpHandler
-
-### 1.11.0 (2014-09-30)
-
- * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names
- * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails
- * Added MandrillHandler to send emails via the Mandrillapp.com API
- * Added SlackHandler to log records to a Slack.com account
- * Added FleepHookHandler to log records to a Fleep.io account
- * Added LogglyHandler::addTag to allow adding tags to an existing handler
- * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end
- * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing
- * Added support for PhpAmqpLib in the AmqpHandler
- * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs
- * Added support for adding extra fields from $_SERVER in the WebProcessor
- * Fixed support for non-string values in PrsLogMessageProcessor
- * Fixed SwiftMailer messages being sent with the wrong date in long running scripts
- * Fixed minor PHP 5.6 compatibility issues
- * Fixed BufferHandler::close being called twice
-
-### 1.10.0 (2014-06-04)
-
- * Added Logger::getHandlers() and Logger::getProcessors() methods
- * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached
- * Added support for extra data in NewRelicHandler
- * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines
-
-### 1.9.1 (2014-04-24)
-
- * Fixed regression in RotatingFileHandler file permissions
- * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records
- * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative
-
-### 1.9.0 (2014-04-20)
-
- * Added LogEntriesHandler to send logs to a LogEntries account
- * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler
- * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes
- * Added support for table formatting in FirePHPHandler via the table context key
- * Added a TagProcessor to add tags to records, and support for tags in RavenHandler
- * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files
- * Added sound support to the PushoverHandler
- * Fixed multi-threading support in StreamHandler
- * Fixed empty headers issue when ChromePHPHandler received no records
- * Fixed default format of the ErrorLogHandler
-
-### 1.8.0 (2014-03-23)
-
- * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them
- * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output
- * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler
- * Added FlowdockHandler to send logs to a Flowdock account
- * Added RollbarHandler to send logs to a Rollbar account
- * Added HtmlFormatter to send prettier log emails with colors for each log level
- * Added GitProcessor to add the current branch/commit to extra record data
- * Added a Monolog\Registry class to allow easier global access to pre-configured loggers
- * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement
- * Added support for HHVM
- * Added support for Loggly batch uploads
- * Added support for tweaking the content type and encoding in NativeMailerHandler
- * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor
- * Fixed batch request support in GelfHandler
-
-### 1.7.0 (2013-11-14)
-
- * Added ElasticSearchHandler to send logs to an Elastic Search server
- * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB
- * Added SyslogUdpHandler to send logs to a remote syslogd server
- * Added LogglyHandler to send logs to a Loggly account
- * Added $level to IntrospectionProcessor so it only adds backtraces when needed
- * Added $version to LogstashFormatter to allow using the new v1 Logstash format
- * Added $appName to NewRelicHandler
- * Added configuration of Pushover notification retries/expiry
- * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default
- * Added chainability to most setters for all handlers
- * Fixed RavenHandler batch processing so it takes the message from the record with highest priority
- * Fixed HipChatHandler batch processing so it sends all messages at once
- * Fixed issues with eAccelerator
- * Fixed and improved many small things
-
-### 1.6.0 (2013-07-29)
-
- * Added HipChatHandler to send logs to a HipChat chat room
- * Added ErrorLogHandler to send logs to PHP's error_log function
- * Added NewRelicHandler to send logs to NewRelic's service
- * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler
- * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel
- * Added stack traces output when normalizing exceptions (json output & co)
- * Added Monolog\Logger::API constant (currently 1)
- * Added support for ChromePHP's v4.0 extension
- * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel
- * Added support for sending messages to multiple users at once with the PushoverHandler
- * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler)
- * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now
- * Fixed issue in RotatingFileHandler when an open_basedir restriction is active
- * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0
- * Fixed SyslogHandler issue when many were used concurrently with different facilities
-
-### 1.5.0 (2013-04-23)
-
- * Added ProcessIdProcessor to inject the PID in log records
- * Added UidProcessor to inject a unique identifier to all log records of one request/run
- * Added support for previous exceptions in the LineFormatter exception serialization
- * Added Monolog\Logger::getLevels() to get all available levels
- * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle
-
-### 1.4.1 (2013-04-01)
-
- * Fixed exception formatting in the LineFormatter to be more minimalistic
- * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0
- * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days
- * Fixed WebProcessor array access so it checks for data presence
- * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors
-
-### 1.4.0 (2013-02-13)
-
- * Added RedisHandler to log to Redis via the Predis library or the phpredis extension
- * Added ZendMonitorHandler to log to the Zend Server monitor
- * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor
- * Added `$useSSL` option to the PushoverHandler which is enabled by default
- * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously
- * Fixed header injection capability in the NativeMailHandler
-
-### 1.3.1 (2013-01-11)
-
- * Fixed LogstashFormatter to be usable with stream handlers
- * Fixed GelfMessageFormatter levels on Windows
-
-### 1.3.0 (2013-01-08)
-
- * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface`
- * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance
- * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash)
- * Added PushoverHandler to send mobile notifications
- * Added CouchDBHandler and DoctrineCouchDBHandler
- * Added RavenHandler to send data to Sentry servers
- * Added support for the new MongoClient class in MongoDBHandler
- * Added microsecond precision to log records' timestamps
- * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing
- the oldest entries
- * Fixed normalization of objects with cyclic references
-
-### 1.2.1 (2012-08-29)
-
- * Added new $logopts arg to SyslogHandler to provide custom openlog options
- * Fixed fatal error in SyslogHandler
-
-### 1.2.0 (2012-08-18)
-
- * Added AmqpHandler (for use with AMQP servers)
- * Added CubeHandler
- * Added NativeMailerHandler::addHeader() to send custom headers in mails
- * Added the possibility to specify more than one recipient in NativeMailerHandler
- * Added the possibility to specify float timeouts in SocketHandler
- * Added NOTICE and EMERGENCY levels to conform with RFC 5424
- * Fixed the log records to use the php default timezone instead of UTC
- * Fixed BufferHandler not being flushed properly on PHP fatal errors
- * Fixed normalization of exotic resource types
- * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog
-
-### 1.1.0 (2012-04-23)
-
- * Added Monolog\Logger::isHandling() to check if a handler will
- handle the given log level
- * Added ChromePHPHandler
- * Added MongoDBHandler
- * Added GelfHandler (for use with Graylog2 servers)
- * Added SocketHandler (for use with syslog-ng for example)
- * Added NormalizerFormatter
- * Added the possibility to change the activation strategy of the FingersCrossedHandler
- * Added possibility to show microseconds in logs
- * Added `server` and `referer` to WebProcessor output
-
-### 1.0.2 (2011-10-24)
-
- * Fixed bug in IE with large response headers and FirePHPHandler
-
-### 1.0.1 (2011-08-25)
-
- * Added MemoryPeakUsageProcessor and MemoryUsageProcessor
- * Added Monolog\Logger::getName() to get a logger's channel name
-
-### 1.0.0 (2011-07-06)
-
- * Added IntrospectionProcessor to get info from where the logger was called
- * Fixed WebProcessor in CLI
-
-### 1.0.0-RC1 (2011-07-01)
-
- * Initial release
diff --git a/src/composer/vendor/monolog/monolog/LICENSE b/src/composer/vendor/monolog/monolog/LICENSE
deleted file mode 100644
index 35727045..00000000
--- a/src/composer/vendor/monolog/monolog/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011-2014 Jordi Boggiano
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/src/composer/vendor/monolog/monolog/README.mdown b/src/composer/vendor/monolog/monolog/README.mdown
deleted file mode 100644
index 7ac9904e..00000000
--- a/src/composer/vendor/monolog/monolog/README.mdown
+++ /dev/null
@@ -1,292 +0,0 @@
-Monolog - Logging for PHP 5.3+ [](http://travis-ci.org/Seldaek/monolog)
-==============================
-
-[](https://packagist.org/packages/monolog/monolog)
-[](https://packagist.org/packages/monolog/monolog)
-[](https://www.versioneye.com/php/monolog:monolog/references)
-
-
-Monolog sends your logs to files, sockets, inboxes, databases and various
-web services. See the complete list of handlers below. Special handlers
-allow you to build advanced logging strategies.
-
-This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
-interface that you can type-hint against in your own libraries to keep
-a maximum of interoperability. You can also use it in your applications to
-make sure you can always use another compatible logger at a later time.
-As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
-Internally Monolog still uses its own level scheme since it predates PSR-3.
-
-Usage
------
-
-Install the latest version with `composer require monolog/monolog`
-
-```php
-pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
-
-// add records to the log
-$log->addWarning('Foo');
-$log->addError('Bar');
-```
-
-Core Concepts
--------------
-
-Every `Logger` instance has a channel (name) and a stack of handlers. Whenever
-you add a record to the logger, it traverses the handler stack. Each handler
-decides whether it fully handled the record, and if so, the propagation of the
-record ends there.
-
-This allows for flexible logging setups, for example having a `StreamHandler` at
-the bottom of the stack that will log anything to disk, and on top of that add
-a `MailHandler` that will send emails only when an error message is logged.
-Handlers also have a `$bubble` property which defines whether they block the
-record or not if they handled it. In this example, setting the `MailHandler`'s
-`$bubble` argument to false means that records handled by the `MailHandler` will
-not propagate to the `StreamHandler` anymore.
-
-You can create many `Logger`s, each defining a channel (e.g.: db, request,
-router, ..) and each of them combining various handlers, which can be shared
-or not. The channel is reflected in the logs and allows you to easily see or
-filter records.
-
-Each Handler also has a Formatter, a default one with settings that make sense
-will be created if you don't set one. The formatters normalize and format
-incoming records so that they can be used by the handlers to output useful
-information.
-
-Custom severity levels are not available. Only the eight
-[RFC 5424](http://tools.ietf.org/html/rfc5424) levels (debug, info, notice,
-warning, error, critical, alert, emergency) are present for basic filtering
-purposes, but for sorting and other use cases that would require
-flexibility, you should add Processors to the Logger that can add extra
-information (tags, user ip, ..) to the records before they are handled.
-
-Log Levels
-----------
-
-Monolog supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424).
-
-- **DEBUG** (100): Detailed debug information.
-
-- **INFO** (200): Interesting events. Examples: User logs in, SQL logs.
-
-- **NOTICE** (250): Normal but significant events.
-
-- **WARNING** (300): Exceptional occurrences that are not errors. Examples:
- Use of deprecated APIs, poor use of an API, undesirable things that are not
- necessarily wrong.
-
-- **ERROR** (400): Runtime errors that do not require immediate action but
- should typically be logged and monitored.
-
-- **CRITICAL** (500): Critical conditions. Example: Application component
- unavailable, unexpected exception.
-
-- **ALERT** (550): Action must be taken immediately. Example: Entire website
- down, database unavailable, etc. This should trigger the SMS alerts and wake
- you up.
-
-- **EMERGENCY** (600): Emergency: system is unusable.
-
-Docs
-====
-
-**See the `doc` directory for more detailed documentation.
-The following is only a list of all parts that come with Monolog.**
-
-Handlers
---------
-
-### Log to files and syslog
-
-- _StreamHandler_: Logs records into any PHP stream, use this for log files.
-- _RotatingFileHandler_: Logs records to a file and creates one logfile per day.
- It will also delete files older than `$maxFiles`. You should use
- [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile
- setups though, this is just meant as a quick and dirty solution.
-- _SyslogHandler_: Logs records to the syslog.
-- _ErrorLogHandler_: Logs records to PHP's
- [`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function.
-
-### Send alerts and emails
-
-- _NativeMailerHandler_: Sends emails using PHP's
- [`mail()`](http://php.net/manual/en/function.mail.php) function.
-- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance.
-- _PushoverHandler_: Sends mobile notifications via the [Pushover](https://www.pushover.net/) API.
-- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
-- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
-- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account.
-- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
-- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
-
-### Log specific servers and networked logging
-
-- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
- for UNIX and TCP sockets. See an [example](https://github.com/Seldaek/monolog/blob/master/doc/sockets.md).
-- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible
- server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+).
-- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
-- _CubeHandler_: Logs records to a [Cube](http://square.github.com/cube/) server.
-- _RavenHandler_: Logs records to a [Sentry](http://getsentry.com/) server using
- [raven](https://packagist.org/packages/raven/raven).
-- _ZendMonitorHandler_: Logs records to the Zend Monitor present in Zend Server.
-- _NewRelicHandler_: Logs records to a [NewRelic](http://newrelic.com/) application.
-- _LogglyHandler_: Logs records to a [Loggly](http://www.loggly.com/) account.
-- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account.
-- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
-- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
-
-### Logging in development
-
-- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing
- inline `console` messages within [FireBug](http://getfirebug.com/).
-- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing
- inline `console` messages within Chrome.
-- _BrowserConsoleHandler_: Handler to send logs to browser's Javascript `console` with
- no browser extension required. Most browsers supporting `console` API are supported.
-
-### Log to databases
-
-- _RedisHandler_: Logs records to a [redis](http://redis.io) server.
-- _MongoDBHandler_: Handler to write records in MongoDB via a
- [Mongo](http://pecl.php.net/package/mongo) extension connection.
-- _CouchDBHandler_: Logs records to a CouchDB server.
-- _DoctrineCouchDBHandler_: Logs records to a CouchDB server via the Doctrine CouchDB ODM.
-- _ElasticSearchHandler_: Logs records to an Elastic Search server.
-- _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
-
-### Wrappers / Special Handlers
-
-- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as
- parameter and will accumulate log records of all levels until a record
- exceeds the defined severity level. At which point it delivers all records,
- including those of lower severity, to the handler it wraps. This means that
- until an error actually happens you will not see anything in your logs, but
- when it happens you will have the full information, including debug and info
- records. This provides you with all the information you need, but only when
- you need it.
-- _WhatFailureGroupHandler_: This handler extends the _GroupHandler_ ignoring
- exceptions raised by each child handler. This allows you to ignore issues
- where a remote tcp connection may have died but you do not want your entire
- application to crash and may wish to continue to log to other handlers.
-- _BufferHandler_: This handler will buffer all the log records it receives
- until `close()` is called at which point it will call `handleBatch()` on the
- handler it wraps with all the log messages at once. This is very useful to
- send an email with all records at once for example instead of having one mail
- for every log record.
-- _GroupHandler_: This handler groups other handlers. Every record received is
- sent to all the handlers it is configured with.
-- _FilterHandler_: This handler only lets records of the given levels through
- to the wrapped handler.
-- _SamplingHandler_: Wraps around another handler and lets you sample records
- if you only want to store some of them.
-- _NullHandler_: Any record it can handle will be thrown away. This can be used
- to put on top of an existing handler stack to disable it temporarily.
-- _PsrHandler_: Can be used to forward log records to an existing PSR-3 logger
-- _TestHandler_: Used for testing, it records everything that is sent to it and
- has accessors to read out the information.
-
-Formatters
-----------
-
-- _LineFormatter_: Formats a log record into a one-line string.
-- _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails.
-- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded.
-- _ScalarFormatter_: Used to format log records into an associative array of scalar values.
-- _JsonFormatter_: Encodes a log record into json.
-- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
-- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
-- _GelfMessageFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler.
-- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest).
-- _ElasticaFormatter_: Used to format log records into an Elastica\Document object, only useful for the ElasticSearchHandler.
-- _LogglyFormatter_: Used to format log records into Loggly messages, only useful for the LogglyHandler.
-- _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler.
-- _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
-
-Processors
-----------
-
-- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated.
-- _WebProcessor_: Adds the current request URI, request method and client IP to a log record.
-- _MemoryUsageProcessor_: Adds the current memory usage to a log record.
-- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
-- _ProcessIdProcessor_: Adds the process id to a log record.
-- _UidProcessor_: Adds a unique identifier to a log record.
-- _GitProcessor_: Adds the current git branch and commit to a log record.
-- _TagProcessor_: Adds an array of predefined tags to a log record.
-
-Utilities
----------
-
-- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you
- can then statically access from anywhere. It is not really a best practice but can
- help in some older codebases or for ease of use.
-- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
- a Logger instance as an exception handler, error handler or fatal error handler.
-- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
- level is reached.
-- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
- log level is reached, depending on which channel received the log record.
-
-Third Party Packages
---------------------
-
-Third party handlers, formatters and processors are
-[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
-can also add your own there if you publish one.
-
-About
-=====
-
-Requirements
-------------
-
-- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM.
-
-Submitting bugs and feature requests
-------------------------------------
-
-Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
-
-Frameworks Integration
-----------------------
-
-- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
- can be used very easily with Monolog since it implements the interface.
-- [Symfony2](http://symfony.com) comes out of the box with Monolog.
-- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog.
-- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog.
-- [PPI](http://www.ppi.io/) comes out of the box with Monolog.
-- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
-- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
-- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
-- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
-- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension.
-- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
-
-Author
-------
-
-Jordi Boggiano - -
-See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project.
-
-License
--------
-
-Monolog is licensed under the MIT License - see the `LICENSE` file for details
-
-Acknowledgements
-----------------
-
-This library is heavily inspired by Python's [Logbook](http://packages.python.org/Logbook/)
-library, although most concepts have been adjusted to fit to the PHP world.
diff --git a/src/composer/vendor/monolog/monolog/composer.json b/src/composer/vendor/monolog/monolog/composer.json
deleted file mode 100644
index 9fec07a7..00000000
--- a/src/composer/vendor/monolog/monolog/composer.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "monolog/monolog",
- "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
- "keywords": ["log", "logging", "psr-3"],
- "homepage": "http://github.com/Seldaek/monolog",
- "type": "library",
- "license": "MIT",
- "authors": [
- {
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "require": {
- "php": ">=5.3.0",
- "psr/log": "~1.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0",
- "graylog2/gelf-php": "~1.0",
- "raven/raven": "~0.5",
- "ruflin/elastica": "0.90.*",
- "doctrine/couchdb": "~1.0@dev",
- "aws/aws-sdk-php": "~2.4, >2.4.8",
- "videlalvaro/php-amqplib": "~2.4",
- "swiftmailer/swiftmailer": "~5.3"
- },
- "suggest": {
- "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
- "raven/raven": "Allow sending log messages to a Sentry server",
- "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
- "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
- "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
- "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
- "ext-mongo": "Allow sending log messages to a MongoDB server",
- "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
- "rollbar/rollbar": "Allow sending log messages to Rollbar"
- },
- "autoload": {
- "psr-4": {"Monolog\\": "src/Monolog"}
- },
- "provide": {
- "psr/log-implementation": "1.0.0"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.13.x-dev"
- }
- },
- "scripts": {
- "test": "phpunit"
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/doc/extending.md b/src/composer/vendor/monolog/monolog/doc/extending.md
deleted file mode 100644
index bb39ddcf..00000000
--- a/src/composer/vendor/monolog/monolog/doc/extending.md
+++ /dev/null
@@ -1,76 +0,0 @@
-Extending Monolog
-=================
-
-Monolog is fully extensible, allowing you to adapt your logger to your needs.
-
-Writing your own handler
-------------------------
-
-Monolog provides many built-in handlers. But if the one you need does not
-exist, you can write it and use it in your logger. The only requirement is
-to implement `Monolog\Handler\HandlerInterface`.
-
-Let's write a PDOHandler to log records to a database. We will extend the
-abstract class provided by Monolog to keep things DRY.
-
-```php
-pdo = $pdo;
- parent::__construct($level, $bubble);
- }
-
- protected function write(array $record)
- {
- if (!$this->initialized) {
- $this->initialize();
- }
-
- $this->statement->execute(array(
- 'channel' => $record['channel'],
- 'level' => $record['level'],
- 'message' => $record['formatted'],
- 'time' => $record['datetime']->format('U'),
- ));
- }
-
- private function initialize()
- {
- $this->pdo->exec(
- 'CREATE TABLE IF NOT EXISTS monolog '
- .'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)'
- );
- $this->statement = $this->pdo->prepare(
- 'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)'
- );
-
- $this->initialized = true;
- }
-}
-```
-
-You can now use this handler in your logger:
-
-```php
-pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')));
-
-// You can now use your logger
-$logger->addInfo('My logger is now ready');
-```
-
-The `Monolog\Handler\AbstractProcessingHandler` class provides most of the
-logic needed for the handler, including the use of processors and the formatting
-of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``).
diff --git a/src/composer/vendor/monolog/monolog/doc/sockets.md b/src/composer/vendor/monolog/monolog/doc/sockets.md
deleted file mode 100644
index fad30a9f..00000000
--- a/src/composer/vendor/monolog/monolog/doc/sockets.md
+++ /dev/null
@@ -1,37 +0,0 @@
-Sockets Handler
-===============
-
-This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen)
-or [pfsockopen](http://php.net/pfsockopen).
-
-Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening
-the connections between requests.
-
-Basic Example
--------------
-
-```php
-setPersistent(true);
-
-// Now add the handler
-$logger->pushHandler($handler, Logger::DEBUG);
-
-// You can now use your logger
-$logger->addInfo('My logger is now ready');
-
-```
-
-In this example, using syslog-ng, you should see the log on the log server:
-
- cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] []
-
diff --git a/src/composer/vendor/monolog/monolog/doc/usage.md b/src/composer/vendor/monolog/monolog/doc/usage.md
deleted file mode 100644
index 7585fa2a..00000000
--- a/src/composer/vendor/monolog/monolog/doc/usage.md
+++ /dev/null
@@ -1,162 +0,0 @@
-Using Monolog
-=============
-
-Installation
-------------
-
-Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog))
-and as such installable via [Composer](http://getcomposer.org/).
-
-```bash
-php composer.phar require monolog/monolog
-```
-
-If you do not use Composer, you can grab the code from GitHub, and use any
-PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader))
-to load Monolog classes.
-
-Configuring a logger
---------------------
-
-Here is a basic setup to log to a file and to firephp on the DEBUG level:
-
-```php
-pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG));
-$logger->pushHandler(new FirePHPHandler());
-
-// You can now use your logger
-$logger->addInfo('My logger is now ready');
-```
-
-Let's explain it. The first step is to create the logger instance which will
-be used in your code. The argument is a channel name, which is useful when
-you use several loggers (see below for more details about it).
-
-The logger itself does not know how to handle a record. It delegates it to
-some handlers. The code above registers two handlers in the stack to allow
-handling records in two different ways.
-
-Note that the FirePHPHandler is called first as it is added on top of the
-stack. This allows you to temporarily add a logger with bubbling disabled if
-you want to override other configured loggers.
-
-Adding extra data in the records
---------------------------------
-
-Monolog provides two different ways to add extra informations along the simple
-textual message.
-
-### Using the logging context
-
-The first way is the context, allowing to pass an array of data along the
-record:
-
-```php
-addInfo('Adding a new user', array('username' => 'Seldaek'));
-```
-
-Simple handlers (like the StreamHandler for instance) will simply format
-the array to a string but richer handlers can take advantage of the context
-(FirePHP is able to display arrays in pretty way for instance).
-
-### Using processors
-
-The second way is to add extra data for all records by using a processor.
-Processors can be any callable. They will get the record as parameter and
-must return it after having eventually changed the `extra` part of it. Let's
-write a processor adding some dummy data in the record:
-
-```php
-pushProcessor(function ($record) {
- $record['extra']['dummy'] = 'Hello world!';
-
- return $record;
-});
-```
-
-Monolog provides some built-in processors that can be used in your project.
-Look at the [README file](https://github.com/Seldaek/monolog/blob/master/README.mdown) for the list.
-
-> Tip: processors can also be registered on a specific handler instead of
- the logger to apply only for this handler.
-
-Leveraging channels
--------------------
-
-Channels are a great way to identify to which part of the application a record
-is related. This is useful in big applications (and is leveraged by
-MonologBundle in Symfony2).
-
-Picture two loggers sharing a handler that writes to a single log file.
-Channels would allow you to identify the logger that issued every record.
-You can easily grep through the log files filtering this or that channel.
-
-```php
-pushHandler($stream);
-$logger->pushHandler($firephp);
-
-// Create a logger for the security-related stuff with a different channel
-$securityLogger = new Logger('security');
-$securityLogger->pushHandler($stream);
-$securityLogger->pushHandler($firephp);
-```
-
-Customizing log format
-----------------------
-
-In Monolog it's easy to customize the format of the logs written into files,
-sockets, mails, databases and other handlers. Most of the handlers use the
-
-```php
-$record['formatted']
-```
-
-value to be automatically put into the log device. This value depends on the
-formatter settings. You can choose between predefined formatter classes or
-write your own (e.g. a multiline text file for human-readable output).
-
-To configure a predefined formatter class, just set it as the handler's field:
-
-```php
-// the default date format is "Y-m-d H:i:s"
-$dateFormat = "Y n j, g:i a";
-// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
-$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
-// finally, create a formatter
-$formatter = new LineFormatter($output, $dateFormat);
-
-// Create a handler
-$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
-$stream->setFormatter($formatter);
-// bind it to a logger object
-$securityLogger = new Logger('security');
-$securityLogger->pushHandler($stream);
-```
-
-You may also reuse the same formatter between multiple handlers and share those
-handlers between multiple loggers.
diff --git a/src/composer/vendor/monolog/monolog/phpunit.xml.dist b/src/composer/vendor/monolog/monolog/phpunit.xml.dist
deleted file mode 100644
index 17545707..00000000
--- a/src/composer/vendor/monolog/monolog/phpunit.xml.dist
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- tests/Monolog/
-
-
-
-
-
- src/Monolog/
-
-
-
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
deleted file mode 100644
index c8923354..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/ErrorHandler.php
+++ /dev/null
@@ -1,208 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use Psr\Log\LoggerInterface;
-use Psr\Log\LogLevel;
-
-/**
- * Monolog error handler
- *
- * A facility to enable logging of runtime errors, exceptions and fatal errors.
- *
- * Quick setup: ErrorHandler::register($logger);
- *
- * @author Jordi Boggiano
- */
-class ErrorHandler
-{
- private $logger;
-
- private $previousExceptionHandler;
- private $uncaughtExceptionLevel;
-
- private $previousErrorHandler;
- private $errorLevelMap;
-
- private $fatalLevel;
- private $reservedMemory;
- private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
-
- public function __construct(LoggerInterface $logger)
- {
- $this->logger = $logger;
- }
-
- /**
- * Registers a new ErrorHandler for a given Logger
- *
- * By default it will handle errors, exceptions and fatal errors
- *
- * @param LoggerInterface $logger
- * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
- * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling
- * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling
- * @return ErrorHandler
- */
- public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null)
- {
- $handler = new static($logger);
- if ($errorLevelMap !== false) {
- $handler->registerErrorHandler($errorLevelMap);
- }
- if ($exceptionLevel !== false) {
- $handler->registerExceptionHandler($exceptionLevel);
- }
- if ($fatalLevel !== false) {
- $handler->registerFatalHandler($fatalLevel);
- }
-
- return $handler;
- }
-
- public function registerExceptionHandler($level = null, $callPrevious = true)
- {
- $prev = set_exception_handler(array($this, 'handleException'));
- $this->uncaughtExceptionLevel = $level;
- if ($callPrevious && $prev) {
- $this->previousExceptionHandler = $prev;
- }
- }
-
- public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1)
- {
- $prev = set_error_handler(array($this, 'handleError'), $errorTypes);
- $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
- if ($callPrevious) {
- $this->previousErrorHandler = $prev ?: true;
- }
- }
-
- public function registerFatalHandler($level = null, $reservedMemorySize = 20)
- {
- register_shutdown_function(array($this, 'handleFatalError'));
-
- $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
- $this->fatalLevel = $level;
- }
-
- protected function defaultErrorLevelMap()
- {
- return array(
- E_ERROR => LogLevel::CRITICAL,
- E_WARNING => LogLevel::WARNING,
- E_PARSE => LogLevel::ALERT,
- E_NOTICE => LogLevel::NOTICE,
- E_CORE_ERROR => LogLevel::CRITICAL,
- E_CORE_WARNING => LogLevel::WARNING,
- E_COMPILE_ERROR => LogLevel::ALERT,
- E_COMPILE_WARNING => LogLevel::WARNING,
- E_USER_ERROR => LogLevel::ERROR,
- E_USER_WARNING => LogLevel::WARNING,
- E_USER_NOTICE => LogLevel::NOTICE,
- E_STRICT => LogLevel::NOTICE,
- E_RECOVERABLE_ERROR => LogLevel::ERROR,
- E_DEPRECATED => LogLevel::NOTICE,
- E_USER_DEPRECATED => LogLevel::NOTICE,
- );
- }
-
- /**
- * @private
- */
- public function handleException(\Exception $e)
- {
- $this->logger->log(
- $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
- sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
- array('exception' => $e)
- );
-
- if ($this->previousExceptionHandler) {
- call_user_func($this->previousExceptionHandler, $e);
- }
- }
-
- /**
- * @private
- */
- public function handleError($code, $message, $file = '', $line = 0, $context = array())
- {
- if (!(error_reporting() & $code)) {
- return;
- }
-
- $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
- $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
-
- if ($this->previousErrorHandler === true) {
- return false;
- } elseif ($this->previousErrorHandler) {
- return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context);
- }
- }
-
- /**
- * @private
- */
- public function handleFatalError()
- {
- $this->reservedMemory = null;
-
- $lastError = error_get_last();
- if ($lastError && in_array($lastError['type'], self::$fatalErrors)) {
- $this->logger->log(
- $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
- 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
- array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
- );
- }
- }
-
- private static function codeToString($code)
- {
- switch ($code) {
- case E_ERROR:
- return 'E_ERROR';
- case E_WARNING:
- return 'E_WARNING';
- case E_PARSE:
- return 'E_PARSE';
- case E_NOTICE:
- return 'E_NOTICE';
- case E_CORE_ERROR:
- return 'E_CORE_ERROR';
- case E_CORE_WARNING:
- return 'E_CORE_WARNING';
- case E_COMPILE_ERROR:
- return 'E_COMPILE_ERROR';
- case E_COMPILE_WARNING:
- return 'E_COMPILE_WARNING';
- case E_USER_ERROR:
- return 'E_USER_ERROR';
- case E_USER_WARNING:
- return 'E_USER_WARNING';
- case E_USER_NOTICE:
- return 'E_USER_NOTICE';
- case E_STRICT:
- return 'E_STRICT';
- case E_RECOVERABLE_ERROR:
- return 'E_RECOVERABLE_ERROR';
- case E_DEPRECATED:
- return 'E_DEPRECATED';
- case E_USER_DEPRECATED:
- return 'E_USER_DEPRECATED';
- }
-
- return 'Unknown PHP error';
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
deleted file mode 100644
index 56d3e278..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-/**
- * Formats a log message according to the ChromePHP array format
- *
- * @author Christophe Coevoet
- */
-class ChromePHPFormatter implements FormatterInterface
-{
- /**
- * Translates Monolog log levels to Wildfire levels.
- */
- private $logLevels = array(
- Logger::DEBUG => 'log',
- Logger::INFO => 'info',
- Logger::NOTICE => 'info',
- Logger::WARNING => 'warn',
- Logger::ERROR => 'error',
- Logger::CRITICAL => 'error',
- Logger::ALERT => 'error',
- Logger::EMERGENCY => 'error',
- );
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- // Retrieve the line and file if set and remove them from the formatted extra
- $backtrace = 'unknown';
- if (isset($record['extra']['file']) && isset($record['extra']['line'])) {
- $backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
- unset($record['extra']['file']);
- unset($record['extra']['line']);
- }
-
- $message = array('message' => $record['message']);
- if ($record['context']) {
- $message['context'] = $record['context'];
- }
- if ($record['extra']) {
- $message['extra'] = $record['extra'];
- }
- if (count($message) === 1) {
- $message = reset($message);
- }
-
- return array(
- $record['channel'],
- $message,
- $backtrace,
- $this->logLevels[$record['level']],
- );
- }
-
- public function formatBatch(array $records)
- {
- $formatted = array();
-
- foreach ($records as $record) {
- $formatted[] = $this->format($record);
- }
-
- return $formatted;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
deleted file mode 100644
index b0b0cf06..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Elastica\Document;
-
-/**
- * Format a log message into an Elastica Document
- *
- * @author Jelle Vink
- */
-class ElasticaFormatter extends NormalizerFormatter
-{
- /**
- * @var string Elastic search index name
- */
- protected $index;
-
- /**
- * @var string Elastic search document type
- */
- protected $type;
-
- /**
- * @param string $index Elastic Search index name
- * @param string $type Elastic Search document type
- */
- public function __construct($index, $type)
- {
- parent::__construct(\DateTime::ISO8601);
- $this->index = $index;
- $this->type = $type;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- $record = parent::format($record);
-
- return $this->getDocument($record);
- }
-
- /**
- * Getter index
- * @return string
- */
- public function getIndex()
- {
- return $this->index;
- }
-
- /**
- * Getter type
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * Convert a log message into an Elastica Document
- *
- * @param array $record Log message
- * @return Document
- */
- protected function getDocument($record)
- {
- $document = new Document();
- $document->setData($record);
- $document->setType($this->type);
- $document->setIndex($this->index);
-
- return $document;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
deleted file mode 100644
index af63d011..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
+++ /dev/null
@@ -1,104 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * formats the record to be used in the FlowdockHandler
- *
- * @author Dominik Liebler
- */
-class FlowdockFormatter implements FormatterInterface
-{
- /**
- * @var string
- */
- private $source;
-
- /**
- * @var string
- */
- private $sourceEmail;
-
- /**
- * @param string $source
- * @param string $sourceEmail
- */
- public function __construct($source, $sourceEmail)
- {
- $this->source = $source;
- $this->sourceEmail = $sourceEmail;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- $tags = array(
- '#logs',
- '#' . strtolower($record['level_name']),
- '#' . $record['channel'],
- );
-
- foreach ($record['extra'] as $value) {
- $tags[] = '#' . $value;
- }
-
- $subject = sprintf(
- 'in %s: %s - %s',
- $this->source,
- $record['level_name'],
- $this->getShortMessage($record['message'])
- );
-
- $record['flowdock'] = array(
- 'source' => $this->source,
- 'from_address' => $this->sourceEmail,
- 'subject' => $subject,
- 'content' => $record['message'],
- 'tags' => $tags,
- 'project' => $this->source,
- );
-
- return $record;
- }
-
- /**
- * {@inheritdoc}
- */
- public function formatBatch(array $records)
- {
- $formatted = array();
-
- foreach ($records as $record) {
- $formatted[] = $this->format($record);
- }
-
- return $formatted;
- }
-
- /**
- * @param string $message
- *
- * @return string
- */
- public function getShortMessage($message)
- {
- $maxLength = 45;
-
- if (strlen($message) > $maxLength) {
- $message = substr($message, 0, $maxLength - 4) . ' ...';
- }
-
- return $message;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
deleted file mode 100644
index b5de7511..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Interface for formatters
- *
- * @author Jordi Boggiano
- */
-interface FormatterInterface
-{
- /**
- * Formats a log record.
- *
- * @param array $record A record to format
- * @return mixed The formatted record
- */
- public function format(array $record);
-
- /**
- * Formats a set of log records.
- *
- * @param array $records A set of records to format
- * @return mixed The formatted set of records
- */
- public function formatBatch(array $records);
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
deleted file mode 100644
index 1e431750..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
+++ /dev/null
@@ -1,111 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-use Gelf\Message;
-
-/**
- * Serializes a log message to GELF
- * @see http://www.graylog2.org/about/gelf
- *
- * @author Matt Lehner
- */
-class GelfMessageFormatter extends NormalizerFormatter
-{
- /**
- * @var string the name of the system for the Gelf log message
- */
- protected $systemName;
-
- /**
- * @var string a prefix for 'extra' fields from the Monolog record (optional)
- */
- protected $extraPrefix;
-
- /**
- * @var string a prefix for 'context' fields from the Monolog record (optional)
- */
- protected $contextPrefix;
-
- /**
- * Translates Monolog log levels to Graylog2 log priorities.
- */
- private $logLevels = array(
- Logger::DEBUG => 7,
- Logger::INFO => 6,
- Logger::NOTICE => 5,
- Logger::WARNING => 4,
- Logger::ERROR => 3,
- Logger::CRITICAL => 2,
- Logger::ALERT => 1,
- Logger::EMERGENCY => 0,
- );
-
- public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_')
- {
- parent::__construct('U.u');
-
- $this->systemName = $systemName ?: gethostname();
-
- $this->extraPrefix = $extraPrefix;
- $this->contextPrefix = $contextPrefix;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- $record = parent::format($record);
-
- if (!isset($record['datetime'], $record['message'], $record['level'])) {
- throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
- }
-
- $message = new Message();
- $message
- ->setTimestamp($record['datetime'])
- ->setShortMessage((string) $record['message'])
- ->setHost($this->systemName)
- ->setLevel($this->logLevels[$record['level']]);
-
- if (isset($record['channel'])) {
- $message->setFacility($record['channel']);
- }
- if (isset($record['extra']['line'])) {
- $message->setLine($record['extra']['line']);
- unset($record['extra']['line']);
- }
- if (isset($record['extra']['file'])) {
- $message->setFile($record['extra']['file']);
- unset($record['extra']['file']);
- }
-
- foreach ($record['extra'] as $key => $val) {
- $message->setAdditional($this->extraPrefix . $key, is_scalar($val) ? $val : $this->toJson($val));
- }
-
- foreach ($record['context'] as $key => $val) {
- $message->setAdditional($this->contextPrefix . $key, is_scalar($val) ? $val : $this->toJson($val));
- }
-
- if (null === $message->getFile() && isset($record['context']['exception']['file'])) {
- if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) {
- $message->setFile($matches[1]);
- $message->setLine($matches[2]);
- }
- }
-
- return $message;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
deleted file mode 100644
index 255d2887..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-/**
- * Formats incoming records into an HTML table
- *
- * This is especially useful for html email logging
- *
- * @author Tiago Brito
- */
-class HtmlFormatter extends NormalizerFormatter
-{
- /**
- * Translates Monolog log levels to html color priorities.
- */
- private $logLevels = array(
- Logger::DEBUG => '#cccccc',
- Logger::INFO => '#468847',
- Logger::NOTICE => '#3a87ad',
- Logger::WARNING => '#c09853',
- Logger::ERROR => '#f0ad4e',
- Logger::CRITICAL => '#FF7708',
- Logger::ALERT => '#C12A19',
- Logger::EMERGENCY => '#000000',
- );
-
- /**
- * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
- */
- public function __construct($dateFormat = null)
- {
- parent::__construct($dateFormat);
- }
-
- /**
- * Creates an HTML table row
- *
- * @param string $th Row header content
- * @param string $td Row standard cell content
- * @param bool $escapeTd false if td content must not be html escaped
- * @return string
- */
- private function addRow($th, $td = ' ', $escapeTd = true)
- {
- $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8');
- if ($escapeTd) {
- $td = ''.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'
';
- }
-
- return "\n$th: \n".$td." \n ";
- }
-
- /**
- * Create a HTML h1 tag
- *
- * @param string $title Text to be in the h1
- * @param integer $level Error level
- * @return string
- */
- private function addTitle($title, $level)
- {
- $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
-
- return ''.$title.'
';
- }
- /**
- * Formats a log record.
- *
- * @param array $record A record to format
- * @return mixed The formatted record
- */
- public function format(array $record)
- {
- $output = $this->addTitle($record['level_name'], $record['level']);
- $output .= '';
-
- $output .= $this->addRow('Message', (string) $record['message']);
- $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat));
- $output .= $this->addRow('Channel', $record['channel']);
- if ($record['context']) {
- $embeddedTable = '';
- foreach ($record['context'] as $key => $value) {
- $embeddedTable .= $this->addRow($key, $this->convertToString($value));
- }
- $embeddedTable .= '
';
- $output .= $this->addRow('Context', $embeddedTable, false);
- }
- if ($record['extra']) {
- $embeddedTable = '';
- foreach ($record['extra'] as $key => $value) {
- $embeddedTable .= $this->addRow($key, $this->convertToString($value));
- }
- $embeddedTable .= '
';
- $output .= $this->addRow('Extra', $embeddedTable, false);
- }
-
- return $output.'
';
- }
-
- /**
- * Formats a set of log records.
- *
- * @param array $records A set of records to format
- * @return mixed The formatted set of records
- */
- public function formatBatch(array $records)
- {
- $message = '';
- foreach ($records as $record) {
- $message .= $this->format($record);
- }
-
- return $message;
- }
-
- protected function convertToString($data)
- {
- if (null === $data || is_scalar($data)) {
- return (string) $data;
- }
-
- $data = $this->normalize($data);
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
- return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- }
-
- return str_replace('\\/', '/', json_encode($data));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
deleted file mode 100644
index e5a1d2c4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
+++ /dev/null
@@ -1,116 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Encodes whatever record data is passed to it as json
- *
- * This can be useful to log to databases or remote APIs
- *
- * @author Jordi Boggiano
- */
-class JsonFormatter implements FormatterInterface
-{
- const BATCH_MODE_JSON = 1;
- const BATCH_MODE_NEWLINES = 2;
-
- protected $batchMode;
- protected $appendNewline;
-
- /**
- * @param int $batchMode
- */
- public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true)
- {
- $this->batchMode = $batchMode;
- $this->appendNewline = $appendNewline;
- }
-
- /**
- * The batch mode option configures the formatting style for
- * multiple records. By default, multiple records will be
- * formatted as a JSON-encoded array. However, for
- * compatibility with some API endpoints, alternative styles
- * are available.
- *
- * @return int
- */
- public function getBatchMode()
- {
- return $this->batchMode;
- }
-
- /**
- * True if newlines are appended to every formatted record
- *
- * @return bool
- */
- public function isAppendingNewlines()
- {
- return $this->appendNewline;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- return json_encode($record) . ($this->appendNewline ? "\n" : '');
- }
-
- /**
- * {@inheritdoc}
- */
- public function formatBatch(array $records)
- {
- switch ($this->batchMode) {
- case static::BATCH_MODE_NEWLINES:
- return $this->formatBatchNewlines($records);
-
- case static::BATCH_MODE_JSON:
- default:
- return $this->formatBatchJson($records);
- }
- }
-
- /**
- * Return a JSON-encoded array of records.
- *
- * @param array $records
- * @return string
- */
- protected function formatBatchJson(array $records)
- {
- return json_encode($records);
- }
-
- /**
- * Use new lines to separate records instead of a
- * JSON-encoded array.
- *
- * @param array $records
- * @return string
- */
- protected function formatBatchNewlines(array $records)
- {
- $instance = $this;
-
- $oldNewline = $this->appendNewline;
- $this->appendNewline = false;
- array_walk($records, function (&$value, $key) use ($instance) {
- $value = $instance->format($value);
- });
- $this->appendNewline = $oldNewline;
-
- return implode("\n", $records);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php
deleted file mode 100644
index 6983d1a5..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php
+++ /dev/null
@@ -1,159 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Exception;
-
-/**
- * Formats incoming records into a one-line string
- *
- * This is especially useful for logging to files
- *
- * @author Jordi Boggiano
- * @author Christophe Coevoet
- */
-class LineFormatter extends NormalizerFormatter
-{
- const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
-
- protected $format;
- protected $allowInlineLineBreaks;
- protected $ignoreEmptyContextAndExtra;
- protected $includeStacktraces;
-
- /**
- * @param string $format The format of the message
- * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
- * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
- * @param bool $ignoreEmptyContextAndExtra
- */
- public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false)
- {
- $this->format = $format ?: static::SIMPLE_FORMAT;
- $this->allowInlineLineBreaks = $allowInlineLineBreaks;
- $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
- parent::__construct($dateFormat);
- }
-
- public function includeStacktraces($include = true)
- {
- $this->includeStacktraces = $include;
- if ($this->includeStacktraces) {
- $this->allowInlineLineBreaks = true;
- }
- }
-
- public function allowInlineLineBreaks($allow = true)
- {
- $this->allowInlineLineBreaks = $allow;
- }
-
- public function ignoreEmptyContextAndExtra($ignore = true)
- {
- $this->ignoreEmptyContextAndExtra = $ignore;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- $vars = parent::format($record);
-
- $output = $this->format;
-
- foreach ($vars['extra'] as $var => $val) {
- if (false !== strpos($output, '%extra.'.$var.'%')) {
- $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
- unset($vars['extra'][$var]);
- }
- }
-
- if ($this->ignoreEmptyContextAndExtra) {
- if (empty($vars['context'])) {
- unset($vars['context']);
- $output = str_replace('%context%', '', $output);
- }
-
- if (empty($vars['extra'])) {
- unset($vars['extra']);
- $output = str_replace('%extra%', '', $output);
- }
- }
-
- foreach ($vars as $var => $val) {
- if (false !== strpos($output, '%'.$var.'%')) {
- $output = str_replace('%'.$var.'%', $this->stringify($val), $output);
- }
- }
-
- return $output;
- }
-
- public function formatBatch(array $records)
- {
- $message = '';
- foreach ($records as $record) {
- $message .= $this->format($record);
- }
-
- return $message;
- }
-
- public function stringify($value)
- {
- return $this->replaceNewlines($this->convertToString($value));
- }
-
- protected function normalizeException(Exception $e)
- {
- $previousText = '';
- if ($previous = $e->getPrevious()) {
- do {
- $previousText .= ', '.get_class($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine();
- } while ($previous = $previous->getPrevious());
- }
-
- $str = '[object] ('.get_class($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')';
- if ($this->includeStacktraces) {
- $str .= "\n[stacktrace]\n".$e->getTraceAsString();
- }
-
- return $str;
- }
-
- protected function convertToString($data)
- {
- if (null === $data || is_bool($data)) {
- return var_export($data, true);
- }
-
- if (is_scalar($data)) {
- return (string) $data;
- }
-
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
- return $this->toJson($data, true);
- }
-
- return str_replace('\\/', '/', @json_encode($data));
- }
-
- protected function replaceNewlines($str)
- {
- if ($this->allowInlineLineBreaks) {
- return $str;
- }
-
- return strtr($str, array("\r\n" => ' ', "\r" => ' ', "\n" => ' '));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php
deleted file mode 100644
index f02bceb0..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Encodes message information into JSON in a format compatible with Loggly.
- *
- * @author Adam Pancutt
- */
-class LogglyFormatter extends JsonFormatter
-{
- /**
- * Overrides the default batch mode to new lines for compatibility with the
- * Loggly bulk API.
- *
- * @param integer $batchMode
- */
- public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false)
- {
- parent::__construct($batchMode, $appendNewline);
- }
-
- /**
- * Appends the 'timestamp' parameter for indexing by Loggly.
- *
- * @see https://www.loggly.com/docs/automated-parsing/#json
- * @see \Monolog\Formatter\JsonFormatter::format()
- */
- public function format(array $record)
- {
- if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
- $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
- // TODO 2.0 unset the 'datetime' parameter, retained for BC
- }
-
- return parent::format($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php
deleted file mode 100644
index 7a7b3b3c..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php
+++ /dev/null
@@ -1,165 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Serializes a log message to Logstash Event Format
- *
- * @see http://logstash.net/
- * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb
- *
- * @author Tim Mower
- */
-class LogstashFormatter extends NormalizerFormatter
-{
- const V0 = 0;
- const V1 = 1;
-
- /**
- * @var string the name of the system for the Logstash log message, used to fill the @source field
- */
- protected $systemName;
-
- /**
- * @var string an application name for the Logstash log message, used to fill the @type field
- */
- protected $applicationName;
-
- /**
- * @var string a prefix for 'extra' fields from the Monolog record (optional)
- */
- protected $extraPrefix;
-
- /**
- * @var string a prefix for 'context' fields from the Monolog record (optional)
- */
- protected $contextPrefix;
-
- /**
- * @var integer logstash format version to use
- */
- protected $version;
-
- /**
- * @param string $applicationName the application that sends the data, used as the "type" field of logstash
- * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
- * @param string $extraPrefix prefix for extra keys inside logstash "fields"
- * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_
- */
- public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0)
- {
- // logstash requires a ISO 8601 format date with optional millisecond precision.
- parent::__construct('Y-m-d\TH:i:s.uP');
-
- $this->systemName = $systemName ?: gethostname();
- $this->applicationName = $applicationName;
- $this->extraPrefix = $extraPrefix;
- $this->contextPrefix = $contextPrefix;
- $this->version = $version;
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- $record = parent::format($record);
-
- if ($this->version === self::V1) {
- $message = $this->formatV1($record);
- } else {
- $message = $this->formatV0($record);
- }
-
- return $this->toJson($message) . "\n";
- }
-
- protected function formatV0(array $record)
- {
- if (empty($record['datetime'])) {
- $record['datetime'] = gmdate('c');
- }
- $message = array(
- '@timestamp' => $record['datetime'],
- '@source' => $this->systemName,
- '@fields' => array()
- );
- if (isset($record['message'])) {
- $message['@message'] = $record['message'];
- }
- if (isset($record['channel'])) {
- $message['@tags'] = array($record['channel']);
- $message['@fields']['channel'] = $record['channel'];
- }
- if (isset($record['level'])) {
- $message['@fields']['level'] = $record['level'];
- }
- if ($this->applicationName) {
- $message['@type'] = $this->applicationName;
- }
- if (isset($record['extra']['server'])) {
- $message['@source_host'] = $record['extra']['server'];
- }
- if (isset($record['extra']['url'])) {
- $message['@source_path'] = $record['extra']['url'];
- }
- if (!empty($record['extra'])) {
- foreach ($record['extra'] as $key => $val) {
- $message['@fields'][$this->extraPrefix . $key] = $val;
- }
- }
- if (!empty($record['context'])) {
- foreach ($record['context'] as $key => $val) {
- $message['@fields'][$this->contextPrefix . $key] = $val;
- }
- }
-
- return $message;
- }
-
- protected function formatV1(array $record)
- {
- if (empty($record['datetime'])) {
- $record['datetime'] = gmdate('c');
- }
- $message = array(
- '@timestamp' => $record['datetime'],
- '@version' => 1,
- 'host' => $this->systemName,
- );
- if (isset($record['message'])) {
- $message['message'] = $record['message'];
- }
- if (isset($record['channel'])) {
- $message['type'] = $record['channel'];
- $message['channel'] = $record['channel'];
- }
- if (isset($record['level_name'])) {
- $message['level'] = $record['level_name'];
- }
- if ($this->applicationName) {
- $message['type'] = $this->applicationName;
- }
- if (!empty($record['extra'])) {
- foreach ($record['extra'] as $key => $val) {
- $message[$this->extraPrefix . $key] = $val;
- }
- }
- if (!empty($record['context'])) {
- foreach ($record['context'] as $key => $val) {
- $message[$this->contextPrefix . $key] = $val;
- }
- }
-
- return $message;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php
deleted file mode 100644
index eb067bb7..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Formats a record for use with the MongoDBHandler.
- *
- * @author Florian Plattner
- */
-class MongoDBFormatter implements FormatterInterface
-{
- private $exceptionTraceAsString;
- private $maxNestingLevel;
-
- /**
- * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
- * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
- */
- public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true)
- {
- $this->maxNestingLevel = max($maxNestingLevel, 0);
- $this->exceptionTraceAsString = (bool) $exceptionTraceAsString;
- }
-
- /**
- * {@inheritDoc}
- */
- public function format(array $record)
- {
- return $this->formatArray($record);
- }
-
- /**
- * {@inheritDoc}
- */
- public function formatBatch(array $records)
- {
- foreach ($records as $key => $record) {
- $records[$key] = $this->format($record);
- }
-
- return $records;
- }
-
- protected function formatArray(array $record, $nestingLevel = 0)
- {
- if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) {
- foreach ($record as $name => $value) {
- if ($value instanceof \DateTime) {
- $record[$name] = $this->formatDate($value, $nestingLevel + 1);
- } elseif ($value instanceof \Exception) {
- $record[$name] = $this->formatException($value, $nestingLevel + 1);
- } elseif (is_array($value)) {
- $record[$name] = $this->formatArray($value, $nestingLevel + 1);
- } elseif (is_object($value)) {
- $record[$name] = $this->formatObject($value, $nestingLevel + 1);
- }
- }
- } else {
- $record = '[...]';
- }
-
- return $record;
- }
-
- protected function formatObject($value, $nestingLevel)
- {
- $objectVars = get_object_vars($value);
- $objectVars['class'] = get_class($value);
-
- return $this->formatArray($objectVars, $nestingLevel);
- }
-
- protected function formatException(\Exception $exception, $nestingLevel)
- {
- $formattedException = array(
- 'class' => get_class($exception),
- 'message' => $exception->getMessage(),
- 'code' => $exception->getCode(),
- 'file' => $exception->getFile() . ':' . $exception->getLine(),
- );
-
- if ($this->exceptionTraceAsString === true) {
- $formattedException['trace'] = $exception->getTraceAsString();
- } else {
- $formattedException['trace'] = $exception->getTrace();
- }
-
- return $this->formatArray($formattedException, $nestingLevel);
- }
-
- protected function formatDate(\DateTime $value, $nestingLevel)
- {
- return new \MongoDate($value->getTimestamp());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
deleted file mode 100644
index 654e7901..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
+++ /dev/null
@@ -1,150 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Exception;
-
-/**
- * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
- *
- * @author Jordi Boggiano
- */
-class NormalizerFormatter implements FormatterInterface
-{
- const SIMPLE_DATE = "Y-m-d H:i:s";
-
- protected $dateFormat;
-
- /**
- * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
- */
- public function __construct($dateFormat = null)
- {
- $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE;
- if (!function_exists('json_encode')) {
- throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- return $this->normalize($record);
- }
-
- /**
- * {@inheritdoc}
- */
- public function formatBatch(array $records)
- {
- foreach ($records as $key => $record) {
- $records[$key] = $this->format($record);
- }
-
- return $records;
- }
-
- protected function normalize($data)
- {
- if (null === $data || is_scalar($data)) {
- if (is_float($data)) {
- if (is_infinite($data)) {
- return ($data > 0 ? '' : '-') . 'INF';
- }
- if (is_nan($data)) {
- return 'NaN';
- }
- }
-
- return $data;
- }
-
- if (is_array($data) || $data instanceof \Traversable) {
- $normalized = array();
-
- $count = 1;
- foreach ($data as $key => $value) {
- if ($count++ >= 1000) {
- $normalized['...'] = 'Over 1000 items, aborting normalization';
- break;
- }
- $normalized[$key] = $this->normalize($value);
- }
-
- return $normalized;
- }
-
- if ($data instanceof \DateTime) {
- return $data->format($this->dateFormat);
- }
-
- if (is_object($data)) {
- if ($data instanceof Exception) {
- return $this->normalizeException($data);
- }
-
- return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data, true));
- }
-
- if (is_resource($data)) {
- return '[resource]';
- }
-
- return '[unknown('.gettype($data).')]';
- }
-
- protected function normalizeException(Exception $e)
- {
- $data = array(
- 'class' => get_class($e),
- 'message' => $e->getMessage(),
- 'code' => $e->getCode(),
- 'file' => $e->getFile().':'.$e->getLine(),
- );
-
- $trace = $e->getTrace();
- foreach ($trace as $frame) {
- if (isset($frame['file'])) {
- $data['trace'][] = $frame['file'].':'.$frame['line'];
- } else {
- // We should again normalize the frames, because it might contain invalid items
- $data['trace'][] = $this->toJson($this->normalize($frame), true);
- }
- }
-
- if ($previous = $e->getPrevious()) {
- $data['previous'] = $this->normalizeException($previous);
- }
-
- return $data;
- }
-
- protected function toJson($data, $ignoreErrors = false)
- {
- // suppress json_encode errors since it's twitchy with some inputs
- if ($ignoreErrors) {
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
- return @json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- }
-
- return @json_encode($data);
- }
-
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
- return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- }
-
- return json_encode($data);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php
deleted file mode 100644
index 5d345d53..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * Formats data into an associative array of scalar values.
- * Objects and arrays will be JSON encoded.
- *
- * @author Andrew Lawson
- */
-class ScalarFormatter extends NormalizerFormatter
-{
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- foreach ($record as $key => $value) {
- $record[$key] = $this->normalizeValue($value);
- }
-
- return $record;
- }
-
- /**
- * @param mixed $value
- * @return mixed
- */
- protected function normalizeValue($value)
- {
- $normalized = $this->normalize($value);
-
- if (is_array($normalized) || is_object($normalized)) {
- return $this->toJson($normalized, true);
- }
-
- return $normalized;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php
deleted file mode 100644
index 654710a8..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php
+++ /dev/null
@@ -1,113 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-/**
- * Serializes a log message according to Wildfire's header requirements
- *
- * @author Eric Clemmons (@ericclemmons)
- * @author Christophe Coevoet
- * @author Kirill chEbba Chebunin
- */
-class WildfireFormatter extends NormalizerFormatter
-{
- const TABLE = 'table';
-
- /**
- * Translates Monolog log levels to Wildfire levels.
- */
- private $logLevels = array(
- Logger::DEBUG => 'LOG',
- Logger::INFO => 'INFO',
- Logger::NOTICE => 'INFO',
- Logger::WARNING => 'WARN',
- Logger::ERROR => 'ERROR',
- Logger::CRITICAL => 'ERROR',
- Logger::ALERT => 'ERROR',
- Logger::EMERGENCY => 'ERROR',
- );
-
- /**
- * {@inheritdoc}
- */
- public function format(array $record)
- {
- // Retrieve the line and file if set and remove them from the formatted extra
- $file = $line = '';
- if (isset($record['extra']['file'])) {
- $file = $record['extra']['file'];
- unset($record['extra']['file']);
- }
- if (isset($record['extra']['line'])) {
- $line = $record['extra']['line'];
- unset($record['extra']['line']);
- }
-
- $record = $this->normalize($record);
- $message = array('message' => $record['message']);
- $handleError = false;
- if ($record['context']) {
- $message['context'] = $record['context'];
- $handleError = true;
- }
- if ($record['extra']) {
- $message['extra'] = $record['extra'];
- $handleError = true;
- }
- if (count($message) === 1) {
- $message = reset($message);
- }
-
- if (isset($record['context'][self::TABLE])) {
- $type = 'TABLE';
- $label = $record['channel'] .': '. $record['message'];
- $message = $record['context'][self::TABLE];
- } else {
- $type = $this->logLevels[$record['level']];
- $label = $record['channel'];
- }
-
- // Create JSON object describing the appearance of the message in the console
- $json = $this->toJson(array(
- array(
- 'Type' => $type,
- 'File' => $file,
- 'Line' => $line,
- 'Label' => $label,
- ),
- $message,
- ), $handleError);
-
- // The message itself is a serialization of the above JSON object + it's length
- return sprintf(
- '%s|%s|',
- strlen($json),
- $json
- );
- }
-
- public function formatBatch(array $records)
- {
- throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter');
- }
-
- protected function normalize($data)
- {
- if (is_object($data) && !$data instanceof \DateTime) {
- return $data;
- }
-
- return parent::normalize($data);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php
deleted file mode 100644
index 69ede49a..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php
+++ /dev/null
@@ -1,184 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\FormatterInterface;
-use Monolog\Formatter\LineFormatter;
-
-/**
- * Base Handler class providing the Handler structure
- *
- * @author Jordi Boggiano
- */
-abstract class AbstractHandler implements HandlerInterface
-{
- protected $level = Logger::DEBUG;
- protected $bubble = true;
-
- /**
- * @var FormatterInterface
- */
- protected $formatter;
- protected $processors = array();
-
- /**
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($level = Logger::DEBUG, $bubble = true)
- {
- $this->setLevel($level);
- $this->bubble = $bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isHandling(array $record)
- {
- return $record['level'] >= $this->level;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- foreach ($records as $record) {
- $this->handle($record);
- }
- }
-
- /**
- * Closes the handler.
- *
- * This will be called automatically when the object is destroyed
- */
- public function close()
- {
- }
-
- /**
- * {@inheritdoc}
- */
- public function pushProcessor($callback)
- {
- if (!is_callable($callback)) {
- throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
- }
- array_unshift($this->processors, $callback);
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function popProcessor()
- {
- if (!$this->processors) {
- throw new \LogicException('You tried to pop from an empty processor stack.');
- }
-
- return array_shift($this->processors);
- }
-
- /**
- * {@inheritdoc}
- */
- public function setFormatter(FormatterInterface $formatter)
- {
- $this->formatter = $formatter;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormatter()
- {
- if (!$this->formatter) {
- $this->formatter = $this->getDefaultFormatter();
- }
-
- return $this->formatter;
- }
-
- /**
- * Sets minimum logging level at which this handler will be triggered.
- *
- * @param integer $level
- * @return self
- */
- public function setLevel($level)
- {
- $this->level = Logger::toMonologLevel($level);
-
- return $this;
- }
-
- /**
- * Gets minimum logging level at which this handler will be triggered.
- *
- * @return integer
- */
- public function getLevel()
- {
- return $this->level;
- }
-
- /**
- * Sets the bubbling behavior.
- *
- * @param Boolean $bubble true means that this handler allows bubbling.
- * false means that bubbling is not permitted.
- * @return self
- */
- public function setBubble($bubble)
- {
- $this->bubble = $bubble;
-
- return $this;
- }
-
- /**
- * Gets the bubbling behavior.
- *
- * @return Boolean true means that this handler allows bubbling.
- * false means that bubbling is not permitted.
- */
- public function getBubble()
- {
- return $this->bubble;
- }
-
- public function __destruct()
- {
- try {
- $this->close();
- } catch (\Exception $e) {
- // do nothing
- }
- }
-
- /**
- * Gets the default formatter.
- *
- * @return FormatterInterface
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php
deleted file mode 100644
index 6f18f72e..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Base Handler class providing the Handler structure
- *
- * Classes extending it should (in most cases) only implement write($record)
- *
- * @author Jordi Boggiano
- * @author Christophe Coevoet
- */
-abstract class AbstractProcessingHandler extends AbstractHandler
-{
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if (!$this->isHandling($record)) {
- return false;
- }
-
- $record = $this->processRecord($record);
-
- $record['formatted'] = $this->getFormatter()->format($record);
-
- $this->write($record);
-
- return false === $this->bubble;
- }
-
- /**
- * Writes the record down to the log of the implementing handler
- *
- * @param array $record
- * @return void
- */
- abstract protected function write(array $record);
-
- /**
- * Processes a record.
- *
- * @param array $record
- * @return array
- */
- protected function processRecord(array $record)
- {
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php
deleted file mode 100644
index 3eb83bd4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php
+++ /dev/null
@@ -1,92 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-/**
- * Common syslog functionality
- */
-abstract class AbstractSyslogHandler extends AbstractProcessingHandler
-{
- protected $facility;
-
- /**
- * Translates Monolog log levels to syslog log priorities.
- */
- protected $logLevels = array(
- Logger::DEBUG => LOG_DEBUG,
- Logger::INFO => LOG_INFO,
- Logger::NOTICE => LOG_NOTICE,
- Logger::WARNING => LOG_WARNING,
- Logger::ERROR => LOG_ERR,
- Logger::CRITICAL => LOG_CRIT,
- Logger::ALERT => LOG_ALERT,
- Logger::EMERGENCY => LOG_EMERG,
- );
-
- /**
- * List of valid log facility names.
- */
- protected $facilities = array(
- 'auth' => LOG_AUTH,
- 'authpriv' => LOG_AUTHPRIV,
- 'cron' => LOG_CRON,
- 'daemon' => LOG_DAEMON,
- 'kern' => LOG_KERN,
- 'lpr' => LOG_LPR,
- 'mail' => LOG_MAIL,
- 'news' => LOG_NEWS,
- 'syslog' => LOG_SYSLOG,
- 'user' => LOG_USER,
- 'uucp' => LOG_UUCP,
- );
-
- /**
- * @param mixed $facility
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
- $this->facilities['local0'] = LOG_LOCAL0;
- $this->facilities['local1'] = LOG_LOCAL1;
- $this->facilities['local2'] = LOG_LOCAL2;
- $this->facilities['local3'] = LOG_LOCAL3;
- $this->facilities['local4'] = LOG_LOCAL4;
- $this->facilities['local5'] = LOG_LOCAL5;
- $this->facilities['local6'] = LOG_LOCAL6;
- $this->facilities['local7'] = LOG_LOCAL7;
- }
-
- // convert textual description of facility to syslog constant
- if (array_key_exists(strtolower($facility), $this->facilities)) {
- $facility = $this->facilities[strtolower($facility)];
- } elseif (!in_array($facility, array_values($this->facilities), true)) {
- throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given');
- }
-
- $this->facility = $facility;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php
deleted file mode 100644
index a28ba02a..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\JsonFormatter;
-use PhpAmqpLib\Message\AMQPMessage;
-use PhpAmqpLib\Channel\AMQPChannel;
-use AMQPExchange;
-
-class AmqpHandler extends AbstractProcessingHandler
-{
- /**
- * @var AMQPExchange|AMQPChannel $exchange
- */
- protected $exchange;
-
- /**
- * @var string
- */
- protected $exchangeName;
-
- /**
- * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use
- * @param string $exchangeName
- * @param int $level
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
- {
- if ($exchange instanceof AMQPExchange) {
- $exchange->setName($exchangeName);
- } elseif ($exchange instanceof AMQPChannel) {
- $this->exchangeName = $exchangeName;
- } else {
- throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
- }
- $this->exchange = $exchange;
-
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- $data = $record["formatted"];
-
- $routingKey = sprintf(
- '%s.%s',
- // TODO 2.0 remove substr call
- substr($record['level_name'], 0, 4),
- $record['channel']
- );
-
- if ($this->exchange instanceof AMQPExchange) {
- $this->exchange->publish(
- $data,
- strtolower($routingKey),
- 0,
- array(
- 'delivery_mode' => 2,
- 'Content-type' => 'application/json'
- )
- );
- } else {
- $this->exchange->basic_publish(
- new AMQPMessage(
- (string) $data,
- array(
- 'delivery_mode' => 2,
- 'content_type' => 'application/json'
- )
- ),
- $this->exchangeName,
- strtolower($routingKey)
- );
- }
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php
deleted file mode 100644
index bee69034..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php
+++ /dev/null
@@ -1,184 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\LineFormatter;
-
-/**
- * Handler sending logs to browser's javascript console with no browser extension required
- *
- * @author Olivier Poitrey
- */
-class BrowserConsoleHandler extends AbstractProcessingHandler
-{
- protected static $initialized = false;
- protected static $records = array();
-
- /**
- * {@inheritDoc}
- *
- * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format.
- *
- * Example of formatted string:
- *
- * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}
- *
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%');
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- // Accumulate records
- self::$records[] = $record;
-
- // Register shutdown handler if not already done
- if (PHP_SAPI !== 'cli' && !self::$initialized) {
- self::$initialized = true;
- register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send'));
- }
- }
-
- /**
- * Convert records to javascript console commands and send it to the browser.
- * This method is automatically called on PHP shutdown if output is HTML.
- */
- public static function send()
- {
- // Check content type
- foreach (headers_list() as $header) {
- if (stripos($header, 'content-type:') === 0) {
- if (stripos($header, 'text/html') === false) {
- // This handler only works with HTML outputs
- return;
- }
- break;
- }
- }
-
- if (count(self::$records)) {
- echo '';
- self::reset();
- }
- }
-
- /**
- * Forget all logged records
- */
- public static function reset()
- {
- self::$records = array();
- }
-
- private static function generateScript()
- {
- $script = array();
- foreach (self::$records as $record) {
- $context = self::dump('Context', $record['context']);
- $extra = self::dump('Extra', $record['extra']);
-
- if (empty($context) && empty($extra)) {
- $script[] = self::call_array('log', self::handleStyles($record['formatted']));
- } else {
- $script = array_merge($script,
- array(self::call_array('groupCollapsed', self::handleStyles($record['formatted']))),
- $context,
- $extra,
- array(self::call('groupEnd'))
- );
- }
- }
-
- return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);";
- }
-
- private static function handleStyles($formatted)
- {
- $args = array(self::quote('font-weight: normal'));
- $format = '%c' . $formatted;
- preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
-
- foreach (array_reverse($matches) as $match) {
- $args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0]));
- $args[] = '"font-weight: normal"';
-
- $pos = $match[0][1];
- $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
- }
-
- array_unshift($args, self::quote($format));
-
- return $args;
- }
-
- private static function handleCustomStyles($style, $string)
- {
- static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey');
- static $labels = array();
-
- return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) {
- if (trim($m[1]) === 'autolabel') {
- // Format the string as a label with consistent auto assigned background color
- if (!isset($labels[$string])) {
- $labels[$string] = $colors[count($labels) % count($colors)];
- }
- $color = $labels[$string];
-
- return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px";
- }
-
- return $m[1];
- }, $style);
- }
-
- private static function dump($title, array $dict)
- {
- $script = array();
- $dict = array_filter($dict);
- if (empty($dict)) {
- return $script;
- }
- $script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title));
- foreach ($dict as $key => $value) {
- $value = json_encode($value);
- if (empty($value)) {
- $value = self::quote('');
- }
- $script[] = self::call('log', self::quote('%s: %o'), self::quote($key), $value);
- }
-
- return $script;
- }
-
- private static function quote($arg)
- {
- return '"' . addcslashes($arg, "\"\n") . '"';
- }
-
- private static function call()
- {
- $args = func_get_args();
- $method = array_shift($args);
-
- return self::call_array($method, $args);
- }
-
- private static function call_array($method, array $args)
- {
- return 'c.' . $method . '(' . implode(', ', $args) . ');';
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php
deleted file mode 100644
index 6d8136f7..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Buffers all records until closing the handler and then pass them as batch.
- *
- * This is useful for a MailHandler to send only one mail per request instead of
- * sending one per log message.
- *
- * @author Christophe Coevoet
- */
-class BufferHandler extends AbstractHandler
-{
- protected $handler;
- protected $bufferSize = 0;
- protected $bufferLimit;
- protected $flushOnOverflow;
- protected $buffer = array();
- protected $initialized = false;
-
- /**
- * @param HandlerInterface $handler Handler.
- * @param integer $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param Boolean $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
- */
- public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
- {
- parent::__construct($level, $bubble);
- $this->handler = $handler;
- $this->bufferLimit = (int) $bufferLimit;
- $this->flushOnOverflow = $flushOnOverflow;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if ($record['level'] < $this->level) {
- return false;
- }
-
- if (!$this->initialized) {
- // __destructor() doesn't get called on Fatal errors
- register_shutdown_function(array($this, 'close'));
- $this->initialized = true;
- }
-
- if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) {
- if ($this->flushOnOverflow) {
- $this->flush();
- } else {
- array_shift($this->buffer);
- $this->bufferSize--;
- }
- }
-
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- $this->buffer[] = $record;
- $this->bufferSize++;
-
- return false === $this->bubble;
- }
-
- public function flush()
- {
- if ($this->bufferSize === 0) {
- return;
- }
-
- $this->handler->handleBatch($this->buffer);
- $this->clear();
- }
-
- public function __destruct()
- {
- // suppress the parent behavior since we already have register_shutdown_function()
- // to call close(), and the reference contained there will prevent this from being
- // GC'd until the end of the request
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- $this->flush();
- }
-
- /**
- * Clears the buffer without flushing any messages down to the wrapped handler.
- */
- public function clear()
- {
- $this->bufferSize = 0;
- $this->buffer = array();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php
deleted file mode 100644
index bc659349..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php
+++ /dev/null
@@ -1,204 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\ChromePHPFormatter;
-use Monolog\Logger;
-
-/**
- * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
- *
- * @author Christophe Coevoet
- */
-class ChromePHPHandler extends AbstractProcessingHandler
-{
- /**
- * Version of the extension
- */
- const VERSION = '4.0';
-
- /**
- * Header name
- */
- const HEADER_NAME = 'X-ChromeLogger-Data';
-
- protected static $initialized = false;
-
- /**
- * Tracks whether we sent too much data
- *
- * Chrome limits the headers to 256KB, so when we sent 240KB we stop sending
- *
- * @var Boolean
- */
- protected static $overflowed = false;
-
- protected static $json = array(
- 'version' => self::VERSION,
- 'columns' => array('label', 'log', 'backtrace', 'type'),
- 'rows' => array(),
- );
-
- protected static $sendHeaders = true;
-
- /**
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
- if (!function_exists('json_encode')) {
- throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- $messages = array();
-
- foreach ($records as $record) {
- if ($record['level'] < $this->level) {
- continue;
- }
- $messages[] = $this->processRecord($record);
- }
-
- if (!empty($messages)) {
- $messages = $this->getFormatter()->formatBatch($messages);
- self::$json['rows'] = array_merge(self::$json['rows'], $messages);
- $this->send();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new ChromePHPFormatter();
- }
-
- /**
- * Creates & sends header for a record
- *
- * @see sendHeader()
- * @see send()
- * @param array $record
- */
- protected function write(array $record)
- {
- self::$json['rows'][] = $record['formatted'];
-
- $this->send();
- }
-
- /**
- * Sends the log header
- *
- * @see sendHeader()
- */
- protected function send()
- {
- if (self::$overflowed || !self::$sendHeaders) {
- return;
- }
-
- if (!self::$initialized) {
- self::$initialized = true;
-
- self::$sendHeaders = $this->headersAccepted();
- if (!self::$sendHeaders) {
- return;
- }
-
- self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
- }
-
- $json = @json_encode(self::$json);
- $data = base64_encode(utf8_encode($json));
- if (strlen($data) > 240*1024) {
- self::$overflowed = true;
-
- $record = array(
- 'message' => 'Incomplete logs, chrome header size limit reached',
- 'context' => array(),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'monolog',
- 'datetime' => new \DateTime(),
- 'extra' => array(),
- );
- self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
- $json = @json_encode(self::$json);
- $data = base64_encode(utf8_encode($json));
- }
-
- if (trim($data) !== '') {
- $this->sendHeader(self::HEADER_NAME, $data);
- }
- }
-
- /**
- * Send header string to the client
- *
- * @param string $header
- * @param string $content
- */
- protected function sendHeader($header, $content)
- {
- if (!headers_sent() && self::$sendHeaders) {
- header(sprintf('%s: %s', $header, $content));
- }
- }
-
- /**
- * Verifies if the headers are accepted by the current user agent
- *
- * @return Boolean
- */
- protected function headersAccepted()
- {
- if (empty($_SERVER['HTTP_USER_AGENT'])) {
- return false;
- }
-
- return preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']);
- }
-
- /**
- * BC getter for the sendHeaders property that has been made static
- */
- public function __get($property)
- {
- if ('sendHeaders' !== $property) {
- throw new \InvalidArgumentException('Undefined property '.$property);
- }
-
- return static::$sendHeaders;
- }
-
- /**
- * BC setter for the sendHeaders property that has been made static
- */
- public function __set($property, $value)
- {
- if ('sendHeaders' !== $property) {
- throw new \InvalidArgumentException('Undefined property '.$property);
- }
-
- static::$sendHeaders = $value;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php
deleted file mode 100644
index b3687c3d..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\JsonFormatter;
-use Monolog\Logger;
-
-/**
- * CouchDB handler
- *
- * @author Markus Bachmann
- */
-class CouchDBHandler extends AbstractProcessingHandler
-{
- private $options;
-
- public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true)
- {
- $this->options = array_merge(array(
- 'host' => 'localhost',
- 'port' => 5984,
- 'dbname' => 'logger',
- 'username' => null,
- 'password' => null,
- ), $options);
-
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- $basicAuth = null;
- if ($this->options['username']) {
- $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']);
- }
-
- $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'POST',
- 'content' => $record['formatted'],
- 'ignore_errors' => true,
- 'max_redirects' => 0,
- 'header' => 'Content-type: application/json',
- )
- ));
-
- if (false === @file_get_contents($url, null, $context)) {
- throw new \RuntimeException(sprintf('Could not connect to %s', $url));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php
deleted file mode 100644
index d968720c..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php
+++ /dev/null
@@ -1,145 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Logs to Cube.
- *
- * @link http://square.github.com/cube/
- * @author Wan Chen
- */
-class CubeHandler extends AbstractProcessingHandler
-{
- private $udpConnection = null;
- private $httpConnection = null;
- private $scheme = null;
- private $host = null;
- private $port = null;
- private $acceptedSchemes = array('http', 'udp');
-
- /**
- * Create a Cube handler
- *
- * @throws UnexpectedValueException when given url is not a valid url.
- * A valid url must consists of three parts : protocol://host:port
- * Only valid protocol used by Cube are http and udp
- */
- public function __construct($url, $level = Logger::DEBUG, $bubble = true)
- {
- $urlInfos = parse_url($url);
-
- if (!isset($urlInfos['scheme']) || !isset($urlInfos['host']) || !isset($urlInfos['port'])) {
- throw new \UnexpectedValueException('URL "'.$url.'" is not valid');
- }
-
- if (!in_array($urlInfos['scheme'], $this->acceptedSchemes)) {
- throw new \UnexpectedValueException(
- 'Invalid protocol (' . $urlInfos['scheme'] . ').'
- . ' Valid options are ' . implode(', ', $this->acceptedSchemes));
- }
-
- $this->scheme = $urlInfos['scheme'];
- $this->host = $urlInfos['host'];
- $this->port = $urlInfos['port'];
-
- parent::__construct($level, $bubble);
- }
-
- /**
- * Establish a connection to an UDP socket
- *
- * @throws LogicException when unable to connect to the socket
- */
- protected function connectUdp()
- {
- if (!extension_loaded('sockets')) {
- throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler');
- }
-
- $this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0);
- if (!$this->udpConnection) {
- throw new \LogicException('Unable to create a socket');
- }
-
- if (!socket_connect($this->udpConnection, $this->host, $this->port)) {
- throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port);
- }
- }
-
- /**
- * Establish a connection to a http server
- */
- protected function connectHttp()
- {
- if (!extension_loaded('curl')) {
- throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler');
- }
-
- $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put');
-
- if (!$this->httpConnection) {
- throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port);
- }
-
- curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $date = $record['datetime'];
-
- $data = array('time' => $date->format('Y-m-d\TH:i:s.uO'));
- unset($record['datetime']);
-
- if (isset($record['context']['type'])) {
- $data['type'] = $record['context']['type'];
- unset($record['context']['type']);
- } else {
- $data['type'] = $record['channel'];
- }
-
- $data['data'] = $record['context'];
- $data['data']['level'] = $record['level'];
-
- $this->{'write'.$this->scheme}(json_encode($data));
- }
-
- private function writeUdp($data)
- {
- if (!$this->udpConnection) {
- $this->connectUdp();
- }
-
- socket_send($this->udpConnection, $data, strlen($data), 0);
- }
-
- private function writeHttp($data)
- {
- if (!$this->httpConnection) {
- $this->connectHttp();
- }
-
- curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');
- curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen('['.$data.']'))
- );
-
- return curl_exec($this->httpConnection);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php
deleted file mode 100644
index b91ffec9..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\NormalizerFormatter;
-use Doctrine\CouchDB\CouchDBClient;
-
-/**
- * CouchDB handler for Doctrine CouchDB ODM
- *
- * @author Markus Bachmann
- */
-class DoctrineCouchDBHandler extends AbstractProcessingHandler
-{
- private $client;
-
- public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true)
- {
- $this->client = $client;
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- $this->client->postDocument($record['formatted']);
- }
-
- protected function getDefaultFormatter()
- {
- return new NormalizerFormatter;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
deleted file mode 100644
index e7f843c8..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Aws\Common\Aws;
-use Aws\DynamoDb\DynamoDbClient;
-use Monolog\Formatter\ScalarFormatter;
-use Monolog\Logger;
-
-/**
- * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/)
- *
- * @link https://github.com/aws/aws-sdk-php/
- * @author Andrew Lawson
- */
-class DynamoDbHandler extends AbstractProcessingHandler
-{
- const DATE_FORMAT = 'Y-m-d\TH:i:s.uO';
-
- /**
- * @var DynamoDbClient
- */
- protected $client;
-
- /**
- * @var string
- */
- protected $table;
-
- /**
- * @param DynamoDbClient $client
- * @param string $table
- * @param integer $level
- * @param boolean $bubble
- */
- public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
- {
- if (!defined('Aws\Common\Aws::VERSION') || version_compare('3.0', Aws::VERSION, '<=')) {
- throw new \RuntimeException('The DynamoDbHandler is only known to work with the AWS SDK 2.x releases');
- }
-
- $this->client = $client;
- $this->table = $table;
-
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $filtered = $this->filterEmptyFields($record['formatted']);
- $formatted = $this->client->formatAttributes($filtered);
-
- $this->client->putItem(array(
- 'TableName' => $this->table,
- 'Item' => $formatted
- ));
- }
-
- /**
- * @param array $record
- * @return array
- */
- protected function filterEmptyFields(array $record)
- {
- return array_filter($record, function ($value) {
- return !empty($value) || false === $value || 0 === $value;
- });
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getDefaultFormatter()
- {
- return new ScalarFormatter(self::DATE_FORMAT);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php
deleted file mode 100644
index 96e5d57f..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php
+++ /dev/null
@@ -1,128 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\FormatterInterface;
-use Monolog\Formatter\ElasticaFormatter;
-use Monolog\Logger;
-use Elastica\Client;
-use Elastica\Exception\ExceptionInterface;
-
-/**
- * Elastic Search handler
- *
- * Usage example:
- *
- * $client = new \Elastica\Client();
- * $options = array(
- * 'index' => 'elastic_index_name',
- * 'type' => 'elastic_doc_type',
- * );
- * $handler = new ElasticSearchHandler($client, $options);
- * $log = new Logger('application');
- * $log->pushHandler($handler);
- *
- * @author Jelle Vink
- */
-class ElasticSearchHandler extends AbstractProcessingHandler
-{
- /**
- * @var Client
- */
- protected $client;
-
- /**
- * @var array Handler config options
- */
- protected $options = array();
-
- /**
- * @param Client $client Elastica Client object
- * @param array $options Handler configuration
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
- $this->client = $client;
- $this->options = array_merge(
- array(
- 'index' => 'monolog', // Elastic index name
- 'type' => 'record', // Elastic document type
- 'ignore_error' => false, // Suppress Elastica exceptions
- ),
- $options
- );
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- $this->bulkSend(array($record['formatted']));
- }
-
- /**
- * {@inheritdoc}
- */
- public function setFormatter(FormatterInterface $formatter)
- {
- if ($formatter instanceof ElasticaFormatter) {
- return parent::setFormatter($formatter);
- }
- throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter');
- }
-
- /**
- * Getter options
- * @return array
- */
- public function getOptions()
- {
- return $this->options;
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new ElasticaFormatter($this->options['index'], $this->options['type']);
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- $documents = $this->getFormatter()->formatBatch($records);
- $this->bulkSend($documents);
- }
-
- /**
- * Use Elasticsearch bulk API to send list of documents
- * @param array $documents
- * @throws \RuntimeException
- */
- protected function bulkSend(array $documents)
- {
- try {
- $this->client->addDocuments($documents);
- } catch (ExceptionInterface $e) {
- if (!$this->options['ignore_error']) {
- throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
- }
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php
deleted file mode 100644
index d1e1ee60..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\LineFormatter;
-use Monolog\Logger;
-
-/**
- * Stores to PHP error_log() handler.
- *
- * @author Elan Ruusamäe
- */
-class ErrorLogHandler extends AbstractProcessingHandler
-{
- const OPERATING_SYSTEM = 0;
- const SAPI = 4;
-
- protected $messageType;
- protected $expandNewlines;
-
- /**
- * @param integer $messageType Says where the error should go.
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param Boolean $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
- */
- public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false)
- {
- parent::__construct($level, $bubble);
-
- if (false === in_array($messageType, self::getAvailableTypes())) {
- $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true));
- throw new \InvalidArgumentException($message);
- }
-
- $this->messageType = $messageType;
- $this->expandNewlines = $expandNewlines;
- }
-
- /**
- * @return array With all available types
- */
- public static function getAvailableTypes()
- {
- return array(
- self::OPERATING_SYSTEM,
- self::SAPI,
- );
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- if ($this->expandNewlines) {
- $lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
- foreach ($lines as $line) {
- error_log($line, $this->messageType);
- }
- } else {
- error_log((string) $record['formatted'], $this->messageType);
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php
deleted file mode 100644
index dad82273..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Simple handler wrapper that filters records based on a list of levels
- *
- * It can be configured with an exact list of levels to allow, or a min/max level.
- *
- * @author Hennadiy Verkh
- * @author Jordi Boggiano
- */
-class FilterHandler extends AbstractHandler
-{
- /**
- * Handler or factory callable($record, $this)
- *
- * @var callable|\Monolog\Handler\HandlerInterface
- */
- protected $handler;
-
- /**
- * Minimum level for logs that are passes to handler
- *
- * @var int[]
- */
- protected $acceptedLevels;
-
- /**
- * Whether the messages that are handled can bubble up the stack or not
- *
- * @var Boolean
- */
- protected $bubble;
-
- /**
- * @param callable|HandlerInterface $handler Handler or factory callable($record, $this).
- * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
- * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true)
- {
- $this->handler = $handler;
- $this->bubble = $bubble;
- $this->setAcceptedLevels($minLevelOrList, $maxLevel);
-
- if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
- throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
- }
- }
-
- /**
- * @return array
- */
- public function getAcceptedLevels()
- {
- return array_flip($this->acceptedLevels);
- }
-
- /**
- * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
- * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
- */
- public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY)
- {
- if (is_array($minLevelOrList)) {
- $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList);
- } else {
- $minLevelOrList = Logger::toMonologLevel($minLevelOrList);
- $maxLevel = Logger::toMonologLevel($maxLevel);
- $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) {
- return $level >= $minLevelOrList && $level <= $maxLevel;
- }));
- }
- $this->acceptedLevels = array_flip($acceptedLevels);
- }
-
- /**
- * {@inheritdoc}
- */
- public function isHandling(array $record)
- {
- return isset($this->acceptedLevels[$record['level']]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if (!$this->isHandling($record)) {
- return false;
- }
-
- // The same logic as in FingersCrossedHandler
- if (!$this->handler instanceof HandlerInterface) {
- $this->handler = call_user_func($this->handler, $record, $this);
- if (!$this->handler instanceof HandlerInterface) {
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
- }
- }
-
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- $this->handler->handle($record);
-
- return false === $this->bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- $filtered = array();
- foreach ($records as $record) {
- if ($this->isHandling($record)) {
- $filtered[] = $record;
- }
- }
-
- $this->handler->handleBatch($filtered);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
deleted file mode 100644
index c3e42efe..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler\FingersCrossed;
-
-/**
- * Interface for activation strategies for the FingersCrossedHandler.
- *
- * @author Johannes M. Schmitt
- */
-interface ActivationStrategyInterface
-{
- /**
- * Returns whether the given record activates the handler.
- *
- * @param array $record
- * @return Boolean
- */
- public function isHandlerActivated(array $record);
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php
deleted file mode 100644
index e3b403f6..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
-*
-* For the full copyright and license information, please view the LICENSE
-* file that was distributed with this source code.
-*/
-
-namespace Monolog\Handler\FingersCrossed;
-
-use Monolog\Logger;
-
-/**
- * Channel and Error level based monolog activation strategy. Allows to trigger activation
- * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except
- * for records of the 'sql' channel; those should trigger activation on level 'WARN'.
- *
- * Example:
- *
- *
- * $activationStrategy = new ChannelLevelActivationStrategy(
- * Logger::CRITICAL,
- * array(
- * 'request' => Logger::ALERT,
- * 'sensitive' => Logger::ERROR,
- * )
- * );
- * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy);
- *
- *
- * @author Mike Meessen
- */
-class ChannelLevelActivationStrategy implements ActivationStrategyInterface
-{
- private $defaultActionLevel;
- private $channelToActionLevel;
-
- /**
- * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any
- * @param array $channelToActionLevel An array that maps channel names to action levels.
- */
- public function __construct($defaultActionLevel, $channelToActionLevel = array())
- {
- $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel);
- $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel);
- }
-
- public function isHandlerActivated(array $record)
- {
- if (isset($this->channelToActionLevel[$record['channel']])) {
- return $record['level'] >= $this->channelToActionLevel[$record['channel']];
- }
-
- return $record['level'] >= $this->defaultActionLevel;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
deleted file mode 100644
index 6e630852..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler\FingersCrossed;
-
-use Monolog\Logger;
-
-/**
- * Error level based activation strategy.
- *
- * @author Johannes M. Schmitt
- */
-class ErrorLevelActivationStrategy implements ActivationStrategyInterface
-{
- private $actionLevel;
-
- public function __construct($actionLevel)
- {
- $this->actionLevel = Logger::toMonologLevel($actionLevel);
- }
-
- public function isHandlerActivated(array $record)
- {
- return $record['level'] >= $this->actionLevel;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php
deleted file mode 100644
index a81c9e64..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php
+++ /dev/null
@@ -1,150 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
-use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
-use Monolog\Logger;
-
-/**
- * Buffers all records until a certain level is reached
- *
- * The advantage of this approach is that you don't get any clutter in your log files.
- * Only requests which actually trigger an error (or whatever your actionLevel is) will be
- * in the logs, but they will contain all records, not only those above the level threshold.
- *
- * You can find the various activation strategies in the
- * Monolog\Handler\FingersCrossed\ namespace.
- *
- * @author Jordi Boggiano
- */
-class FingersCrossedHandler extends AbstractHandler
-{
- protected $handler;
- protected $activationStrategy;
- protected $buffering = true;
- protected $bufferSize;
- protected $buffer = array();
- protected $stopBuffering;
- protected $passthruLevel;
-
- /**
- * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
- * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
- * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true)
- * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered
- */
- public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null)
- {
- if (null === $activationStrategy) {
- $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING);
- }
-
- // convert simple int activationStrategy to an object
- if (!$activationStrategy instanceof ActivationStrategyInterface) {
- $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy);
- }
-
- $this->handler = $handler;
- $this->activationStrategy = $activationStrategy;
- $this->bufferSize = $bufferSize;
- $this->bubble = $bubble;
- $this->stopBuffering = $stopBuffering;
- $this->passthruLevel = $passthruLevel;
-
- if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
- throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function isHandling(array $record)
- {
- return true;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- if ($this->buffering) {
- $this->buffer[] = $record;
- if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) {
- array_shift($this->buffer);
- }
- if ($this->activationStrategy->isHandlerActivated($record)) {
- if ($this->stopBuffering) {
- $this->buffering = false;
- }
- if (!$this->handler instanceof HandlerInterface) {
- $this->handler = call_user_func($this->handler, $record, $this);
- if (!$this->handler instanceof HandlerInterface) {
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
- }
- }
- $this->handler->handleBatch($this->buffer);
- $this->buffer = array();
- }
- } else {
- $this->handler->handle($record);
- }
-
- return false === $this->bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- if (null !== $this->passthruLevel) {
- $level = $this->passthruLevel;
- $this->buffer = array_filter($this->buffer, function ($record) use ($level) {
- return $record['level'] >= $level;
- });
- if (count($this->buffer) > 0) {
- $this->handler->handleBatch($this->buffer);
- $this->buffer = array();
- }
- }
- }
-
- /**
- * Resets the state of the handler. Stops forwarding records to the wrapped handler.
- */
- public function reset()
- {
- $this->buffering = true;
- }
-
- /**
- * Clears the buffer without flushing any messages down to the wrapped handler.
- *
- * It also resets the handler to its initial buffering state.
- */
- public function clear()
- {
- $this->buffer = array();
- $this->reset();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php
deleted file mode 100644
index fee47950..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php
+++ /dev/null
@@ -1,195 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\WildfireFormatter;
-
-/**
- * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol.
- *
- * @author Eric Clemmons (@ericclemmons)
- */
-class FirePHPHandler extends AbstractProcessingHandler
-{
- /**
- * WildFire JSON header message format
- */
- const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2';
-
- /**
- * FirePHP structure for parsing messages & their presentation
- */
- const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1';
-
- /**
- * Must reference a "known" plugin, otherwise headers won't display in FirePHP
- */
- const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3';
-
- /**
- * Header prefix for Wildfire to recognize & parse headers
- */
- const HEADER_PREFIX = 'X-Wf';
-
- /**
- * Whether or not Wildfire vendor-specific headers have been generated & sent yet
- */
- protected static $initialized = false;
-
- /**
- * Shared static message index between potentially multiple handlers
- * @var int
- */
- protected static $messageIndex = 1;
-
- protected static $sendHeaders = true;
-
- /**
- * Base header creation function used by init headers & record headers
- *
- * @param array $meta Wildfire Plugin, Protocol & Structure Indexes
- * @param string $message Log message
- * @return array Complete header string ready for the client as key and message as value
- */
- protected function createHeader(array $meta, $message)
- {
- $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta));
-
- return array($header => $message);
- }
-
- /**
- * Creates message header from record
- *
- * @see createHeader()
- * @param array $record
- * @return string
- */
- protected function createRecordHeader(array $record)
- {
- // Wildfire is extensible to support multiple protocols & plugins in a single request,
- // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake.
- return $this->createHeader(
- array(1, 1, 1, self::$messageIndex++),
- $record['formatted']
- );
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new WildfireFormatter();
- }
-
- /**
- * Wildfire initialization headers to enable message parsing
- *
- * @see createHeader()
- * @see sendHeader()
- * @return array
- */
- protected function getInitHeaders()
- {
- // Initial payload consists of required headers for Wildfire
- return array_merge(
- $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI),
- $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI),
- $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI)
- );
- }
-
- /**
- * Send header string to the client
- *
- * @param string $header
- * @param string $content
- */
- protected function sendHeader($header, $content)
- {
- if (!headers_sent() && self::$sendHeaders) {
- header(sprintf('%s: %s', $header, $content));
- }
- }
-
- /**
- * Creates & sends header for a record, ensuring init headers have been sent prior
- *
- * @see sendHeader()
- * @see sendInitHeaders()
- * @param array $record
- */
- protected function write(array $record)
- {
- if (!self::$sendHeaders) {
- return;
- }
-
- // WildFire-specific headers must be sent prior to any messages
- if (!self::$initialized) {
- self::$initialized = true;
-
- self::$sendHeaders = $this->headersAccepted();
- if (!self::$sendHeaders) {
- return;
- }
-
- foreach ($this->getInitHeaders() as $header => $content) {
- $this->sendHeader($header, $content);
- }
- }
-
- $header = $this->createRecordHeader($record);
- if (trim(current($header)) !== '') {
- $this->sendHeader(key($header), current($header));
- }
- }
-
- /**
- * Verifies if the headers are accepted by the current user agent
- *
- * @return Boolean
- */
- protected function headersAccepted()
- {
- if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) {
- return true;
- }
-
- return isset($_SERVER['HTTP_X_FIREPHP_VERSION']);
- }
-
- /**
- * BC getter for the sendHeaders property that has been made static
- */
- public function __get($property)
- {
- if ('sendHeaders' !== $property) {
- throw new \InvalidArgumentException('Undefined property '.$property);
- }
-
- return static::$sendHeaders;
- }
-
- /**
- * BC setter for the sendHeaders property that has been made static
- */
- public function __set($property, $value)
- {
- if ('sendHeaders' !== $property) {
- throw new \InvalidArgumentException('Undefined property '.$property);
- }
-
- static::$sendHeaders = $value;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php
deleted file mode 100644
index 388692c4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php
+++ /dev/null
@@ -1,126 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\LineFormatter;
-use Monolog\Logger;
-
-/**
- * Sends logs to Fleep.io using Webhook integrations
- *
- * You'll need a Fleep.io account to use this handler.
- *
- * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation
- * @author Ando Roots
- */
-class FleepHookHandler extends SocketHandler
-{
- const FLEEP_HOST = 'fleep.io';
-
- const FLEEP_HOOK_URI = '/hook/';
-
- /**
- * @var string Webhook token (specifies the conversation where logs are sent)
- */
- protected $token;
-
- /**
- * Construct a new Fleep.io Handler.
- *
- * For instructions on how to create a new web hook in your conversations
- * see https://fleep.io/integrations/webhooks/
- *
- * @param string $token Webhook token
- * @param bool|int $level The minimum logging level at which this handler will be triggered
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
- * @throws MissingExtensionException
- */
- public function __construct($token, $level = Logger::DEBUG, $bubble = true)
- {
- if (!extension_loaded('openssl')) {
- throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler');
- }
-
- $this->token = $token;
-
- $connectionString = 'ssl://' . self::FLEEP_HOST . ':443';
- parent::__construct($connectionString, $level, $bubble);
- }
-
- /**
- * Returns the default formatter to use with this handler
- *
- * Overloaded to remove empty context and extra arrays from the end of the log message.
- *
- * @return LineFormatter
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter(null, null, true, true);
- }
-
- /**
- * Handles a log record
- *
- * @param array $record
- */
- public function write(array $record)
- {
- parent::write($record);
- $this->closeSocket();
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- * @return string
- */
- protected function generateDataStream($record)
- {
- $content = $this->buildContent($record);
-
- return $this->buildHeader($content) . $content;
- }
-
- /**
- * Builds the header of the API Call
- *
- * @param string $content
- * @return string
- */
- private function buildHeader($content)
- {
- $header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
- $header .= "Host: " . self::FLEEP_HOST . "\r\n";
- $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-Length: " . strlen($content) . "\r\n";
- $header .= "\r\n";
-
- return $header;
- }
-
- /**
- * Builds the body of API call
- *
- * @param array $record
- * @return string
- */
- private function buildContent($record)
- {
- $dataArray = array(
- 'message' => $record['formatted']
- );
-
- return http_build_query($dataArray);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php
deleted file mode 100644
index 6eaaa9d4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Sends notifications through the Flowdock push API
- *
- * This must be configured with a FlowdockFormatter instance via setFormatter()
- *
- * Notes:
- * API token - Flowdock API token
- *
- * @author Dominik Liebler
- * @see https://www.flowdock.com/api/push
- */
-class FlowdockHandler extends SocketHandler
-{
- /**
- * @var string
- */
- protected $apiToken;
-
- /**
- * @param string $apiToken
- * @param bool|int $level The minimum logging level at which this handler will be triggered
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
- *
- * @throws MissingExtensionException if OpenSSL is missing
- */
- public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true)
- {
- if (!extension_loaded('openssl')) {
- throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
- }
-
- parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
- $this->apiToken = $apiToken;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- */
- protected function write(array $record)
- {
- parent::write($record);
-
- $this->closeSocket();
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- * @return string
- */
- protected function generateDataStream($record)
- {
- $content = $this->buildContent($record);
-
- return $this->buildHeader($content) . $content;
- }
-
- /**
- * Builds the body of API call
- *
- * @param array $record
- * @return string
- */
- private function buildContent($record)
- {
- return json_encode($record['formatted']['flowdock']);
- }
-
- /**
- * Builds the header of the API Call
- *
- * @param string $content
- * @return string
- */
- private function buildHeader($content)
- {
- $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n";
- $header .= "Host: api.flowdock.com\r\n";
- $header .= "Content-Type: application/json\r\n";
- $header .= "Content-Length: " . strlen($content) . "\r\n";
- $header .= "\r\n";
-
- return $header;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php
deleted file mode 100644
index 790f6364..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php
+++ /dev/null
@@ -1,72 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Gelf\IMessagePublisher;
-use Gelf\PublisherInterface;
-use InvalidArgumentException;
-use Monolog\Logger;
-use Monolog\Formatter\GelfMessageFormatter;
-
-/**
- * Handler to send messages to a Graylog2 (http://www.graylog2.org) server
- *
- * @author Matt Lehner
- * @author Benjamin Zikarsky
- */
-class GelfHandler extends AbstractProcessingHandler
-{
- /**
- * @var Publisher the publisher object that sends the message to the server
- */
- protected $publisher;
-
- /**
- * @param PublisherInterface|IMessagePublisher $publisher a publisher object
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- if (!$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
- throw new InvalidArgumentException("Invalid publisher, expected a Gelf\IMessagePublisher or Gelf\PublisherInterface instance");
- }
-
- $this->publisher = $publisher;
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- $this->publisher = null;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $this->publisher->publish($record['formatted']);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new GelfMessageFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php
deleted file mode 100644
index 99384d35..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Forwards records to multiple handlers
- *
- * @author Lenar Lõhmus
- */
-class GroupHandler extends AbstractHandler
-{
- protected $handlers;
-
- /**
- * @param array $handlers Array of Handlers.
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(array $handlers, $bubble = true)
- {
- foreach ($handlers as $handler) {
- if (!$handler instanceof HandlerInterface) {
- throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.');
- }
- }
-
- $this->handlers = $handlers;
- $this->bubble = $bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isHandling(array $record)
- {
- foreach ($this->handlers as $handler) {
- if ($handler->isHandling($record)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- foreach ($this->handlers as $handler) {
- $handler->handle($record);
- }
-
- return false === $this->bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- foreach ($this->handlers as $handler) {
- $handler->handleBatch($records);
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php
deleted file mode 100644
index d920c4ba..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php
+++ /dev/null
@@ -1,90 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\FormatterInterface;
-
-/**
- * Interface that all Monolog Handlers must implement
- *
- * @author Jordi Boggiano
- */
-interface HandlerInterface
-{
- /**
- * Checks whether the given record will be handled by this handler.
- *
- * This is mostly done for performance reasons, to avoid calling processors for nothing.
- *
- * Handlers should still check the record levels within handle(), returning false in isHandling()
- * is no guarantee that handle() will not be called, and isHandling() might not be called
- * for a given record.
- *
- * @param array $record Partial log record containing only a level key
- *
- * @return Boolean
- */
- public function isHandling(array $record);
-
- /**
- * Handles a record.
- *
- * All records may be passed to this method, and the handler should discard
- * those that it does not want to handle.
- *
- * The return value of this function controls the bubbling process of the handler stack.
- * Unless the bubbling is interrupted (by returning true), the Logger class will keep on
- * calling further handlers in the stack with a given log record.
- *
- * @param array $record The record to handle
- * @return Boolean true means that this handler handled the record, and that bubbling is not permitted.
- * false means the record was either not processed or that this handler allows bubbling.
- */
- public function handle(array $record);
-
- /**
- * Handles a set of records at once.
- *
- * @param array $records The records to handle (an array of record arrays)
- */
- public function handleBatch(array $records);
-
- /**
- * Adds a processor in the stack.
- *
- * @param callable $callback
- * @return self
- */
- public function pushProcessor($callback);
-
- /**
- * Removes the processor on top of the stack and returns it.
- *
- * @return callable
- */
- public function popProcessor();
-
- /**
- * Sets the formatter.
- *
- * @param FormatterInterface $formatter
- * @return self
- */
- public function setFormatter(FormatterInterface $formatter);
-
- /**
- * Gets the formatter.
- *
- * @return FormatterInterface
- */
- public function getFormatter();
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php
deleted file mode 100644
index 185e86e0..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php
+++ /dev/null
@@ -1,306 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Sends notifications through the hipchat api to a hipchat room
- *
- * Notes:
- * API token - HipChat API token
- * Room - HipChat Room Id or name, where messages are sent
- * Name - Name used to send the message (from)
- * notify - Should the message trigger a notification in the clients
- *
- * @author Rafael Dohms
- * @see https://www.hipchat.com/docs/api
- */
-class HipChatHandler extends SocketHandler
-{
- /**
- * The maximum allowed length for the name used in the "from" field.
- */
- const MAXIMUM_NAME_LENGTH = 15;
-
- /**
- * The maximum allowed length for the message.
- */
- const MAXIMUM_MESSAGE_LENGTH = 9500;
-
- /**
- * @var string
- */
- private $token;
-
- /**
- * @var string
- */
- private $room;
-
- /**
- * @var string
- */
- private $name;
-
- /**
- * @var bool
- */
- private $notify;
-
- /**
- * @var string
- */
- private $format;
-
- /**
- * @var string
- */
- private $host;
-
- /**
- * @param string $token HipChat API Token
- * @param string $room The room that should be alerted of the message (Id or Name)
- * @param string $name Name used in the "from" field
- * @param bool $notify Trigger a notification in clients or not
- * @param int $level The minimum logging level at which this handler will be triggered
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
- * @param bool $useSSL Whether to connect via SSL.
- * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
- * @param string $host The HipChat server hostname.
- */
- public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com')
- {
- if (!$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
- throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
- }
-
- $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80';
- parent::__construct($connectionString, $level, $bubble);
-
- $this->token = $token;
- $this->name = $name;
- $this->notify = $notify;
- $this->room = $room;
- $this->format = $format;
- $this->host = $host;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- * @return string
- */
- protected function generateDataStream($record)
- {
- $content = $this->buildContent($record);
-
- return $this->buildHeader($content) . $content;
- }
-
- /**
- * Builds the body of API call
- *
- * @param array $record
- * @return string
- */
- private function buildContent($record)
- {
- $dataArray = array(
- 'from' => $this->name,
- 'room_id' => $this->room,
- 'notify' => $this->notify,
- 'message' => $record['formatted'],
- 'message_format' => $this->format,
- 'color' => $this->getAlertColor($record['level']),
- );
-
- return http_build_query($dataArray);
- }
-
- /**
- * Builds the header of the API Call
- *
- * @param string $content
- * @return string
- */
- private function buildHeader($content)
- {
- $header = "POST /v1/rooms/message?format=json&auth_token=".$this->token." HTTP/1.1\r\n";
- $header .= "Host: {$this->host}\r\n";
- $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-Length: " . strlen($content) . "\r\n";
- $header .= "\r\n";
-
- return $header;
- }
-
- /**
- * Assigns a color to each level of log records.
- *
- * @param integer $level
- * @return string
- */
- protected function getAlertColor($level)
- {
- switch (true) {
- case $level >= Logger::ERROR:
- return 'red';
- case $level >= Logger::WARNING:
- return 'yellow';
- case $level >= Logger::INFO:
- return 'green';
- case $level == Logger::DEBUG:
- return 'gray';
- default:
- return 'yellow';
- }
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- */
- protected function write(array $record)
- {
- parent::write($record);
- $this->closeSocket();
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- if (count($records) == 0) {
- return true;
- }
-
- $batchRecords = $this->combineRecords($records);
-
- $handled = false;
- foreach ($batchRecords as $batchRecord) {
- if ($this->isHandling($batchRecord)) {
- $this->write($batchRecord);
- $handled = true;
- }
- }
-
- if (!$handled) {
- return false;
- }
-
- return false === $this->bubble;
- }
-
- /**
- * Combines multiple records into one. Error level of the combined record
- * will be the highest level from the given records. Datetime will be taken
- * from the first record.
- *
- * @param $records
- * @return array
- */
- private function combineRecords($records)
- {
- $batchRecord = null;
- $batchRecords = array();
- $messages = array();
- $formattedMessages = array();
- $level = 0;
- $levelName = null;
- $datetime = null;
-
- foreach ($records as $record) {
- $record = $this->processRecord($record);
-
- if ($record['level'] > $level) {
- $level = $record['level'];
- $levelName = $record['level_name'];
- }
-
- if (null === $datetime) {
- $datetime = $record['datetime'];
- }
-
- $messages[] = $record['message'];
- $messageStr = implode(PHP_EOL, $messages);
- $formattedMessages[] = $this->getFormatter()->format($record);
- $formattedMessageStr = implode('', $formattedMessages);
-
- $batchRecord = array(
- 'message' => $messageStr,
- 'formatted' => $formattedMessageStr,
- 'context' => array(),
- 'extra' => array(),
- );
-
- if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) {
- // Pop the last message and implode the remaining messages
- $lastMessage = array_pop($messages);
- $lastFormattedMessage = array_pop($formattedMessages);
- $batchRecord['message'] = implode(PHP_EOL, $messages);
- $batchRecord['formatted'] = implode('', $formattedMessages);
-
- $batchRecords[] = $batchRecord;
- $messages = array($lastMessage);
- $formattedMessages = array($lastFormattedMessage);
-
- $batchRecord = null;
- }
- }
-
- if (null !== $batchRecord) {
- $batchRecords[] = $batchRecord;
- }
-
- // Set the max level and datetime for all records
- foreach ($batchRecords as &$batchRecord) {
- $batchRecord = array_merge(
- $batchRecord,
- array(
- 'level' => $level,
- 'level_name' => $levelName,
- 'datetime' => $datetime
- )
- );
- }
-
- return $batchRecords;
- }
-
- /**
- * Validates the length of a string.
- *
- * If the `mb_strlen()` function is available, it will use that, as HipChat
- * allows UTF-8 characters. Otherwise, it will fall back to `strlen()`.
- *
- * Note that this might cause false failures in the specific case of using
- * a valid name with less than 16 characters, but 16 or more bytes, on a
- * system where `mb_strlen()` is unavailable.
- *
- * @param string $str
- * @param int $length
- *
- * @return bool
- */
- private function validateStringLength($str, $length)
- {
- if (function_exists('mb_strlen')) {
- return (mb_strlen($str) <= $length);
- }
-
- return (strlen($str) <= $length);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php
deleted file mode 100644
index bd56230f..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * @author Robert Kaufmann III
- */
-class LogEntriesHandler extends SocketHandler
-{
- /**
- * @var string
- */
- protected $logToken;
-
- /**
- * @param string $token Log token supplied by LogEntries
- * @param boolean $useSSL Whether or not SSL encryption should be used.
- * @param int $level The minimum logging level to trigger this handler
- * @param boolean $bubble Whether or not messages that are handled should bubble up the stack.
- *
- * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
- */
- public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true)
- {
- if ($useSSL && !extension_loaded('openssl')) {
- throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
- }
-
- $endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80';
- parent::__construct($endpoint, $level, $bubble);
- $this->logToken = $token;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- * @return string
- */
- protected function generateDataStream($record)
- {
- return $this->logToken . ' ' . $record['formatted'];
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php
deleted file mode 100644
index efd94d30..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\LogglyFormatter;
-
-/**
- * Sends errors to Loggly.
- *
- * @author Przemek Sobstel
- * @author Adam Pancutt
- */
-class LogglyHandler extends AbstractProcessingHandler
-{
- const HOST = 'logs-01.loggly.com';
- const ENDPOINT_SINGLE = 'inputs';
- const ENDPOINT_BATCH = 'bulk';
-
- protected $token;
-
- protected $tag;
-
- public function __construct($token, $level = Logger::DEBUG, $bubble = true)
- {
- if (!extension_loaded('curl')) {
- throw new \LogicException('The curl extension is needed to use the LogglyHandler');
- }
-
- $this->token = $token;
-
- parent::__construct($level, $bubble);
- }
-
- public function setTag($tag)
- {
- $this->tag = $tag;
- }
-
- public function addTag($tag)
- {
- $this->tag = (strlen($this->tag) > 0) ? $this->tag .','. $tag : $tag;
- }
-
- protected function write(array $record)
- {
- $this->send($record["formatted"], self::ENDPOINT_SINGLE);
- }
-
- public function handleBatch(array $records)
- {
- $level = $this->level;
-
- $records = array_filter($records, function ($record) use ($level) {
- return ($record['level'] >= $level);
- });
-
- if ($records) {
- $this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH);
- }
- }
-
- protected function send($data, $endpoint)
- {
- $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token);
-
- $headers = array('Content-Type: application/json');
-
- if ($this->tag) {
- $headers[] = "X-LOGGLY-TAG: {$this->tag}";
- }
-
- $ch = curl_init();
-
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
- curl_exec($ch);
- curl_close($ch);
- }
-
- protected function getDefaultFormatter()
- {
- return new LogglyFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php
deleted file mode 100644
index 50ed6380..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Base class for all mail handlers
- *
- * @author Gyula Sallai
- */
-abstract class MailHandler extends AbstractProcessingHandler
-{
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- $messages = array();
-
- foreach ($records as $record) {
- if ($record['level'] < $this->level) {
- continue;
- }
- $messages[] = $this->processRecord($record);
- }
-
- if (!empty($messages)) {
- $this->send((string) $this->getFormatter()->formatBatch($messages), $messages);
- }
- }
-
- /**
- * Send a mail with the given content
- *
- * @param string $content formatted email body to be sent
- * @param array $records the array of log records that formed this content
- */
- abstract protected function send($content, array $records);
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $this->send((string) $record['formatted'], array($record));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php
deleted file mode 100644
index 60a2901e..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * MandrillHandler uses cURL to send the emails to the Mandrill API
- *
- * @author Adam Nicholson
- */
-class MandrillHandler extends MailHandler
-{
- protected $client;
- protected $message;
-
- /**
- * @param string $apiKey A valid Mandrill API key
- * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- if (!$message instanceof \Swift_Message && is_callable($message)) {
- $message = call_user_func($message);
- }
- if (!$message instanceof \Swift_Message) {
- throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it');
- }
- $this->message = $message;
- $this->apiKey = $apiKey;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function send($content, array $records)
- {
- $message = clone $this->message;
- $message->setBody($content);
- $message->setDate(time());
-
- $ch = curl_init();
-
- curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json');
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
- 'key' => $this->apiKey,
- 'raw_message' => (string) $message,
- 'async' => false,
- )));
-
- curl_exec($ch);
- curl_close($ch);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php
deleted file mode 100644
index 4724a7e2..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Exception can be thrown if an extension for an handler is missing
- *
- * @author Christian Bergau
- */
-class MissingExtensionException extends \Exception
-{
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php
deleted file mode 100644
index 6c431f2b..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\NormalizerFormatter;
-
-/**
- * Logs to a MongoDB database.
- *
- * usage example:
- *
- * $log = new Logger('application');
- * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod");
- * $log->pushHandler($mongodb);
- *
- * @author Thomas Tourlourat
- */
-class MongoDBHandler extends AbstractProcessingHandler
-{
- protected $mongoCollection;
-
- public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true)
- {
- if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) {
- throw new \InvalidArgumentException('MongoClient or Mongo instance required');
- }
-
- $this->mongoCollection = $mongo->selectCollection($database, $collection);
-
- parent::__construct($level, $bubble);
- }
-
- protected function write(array $record)
- {
- $this->mongoCollection->save($record["formatted"]);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new NormalizerFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php
deleted file mode 100644
index 5118a0e2..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php
+++ /dev/null
@@ -1,176 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * NativeMailerHandler uses the mail() function to send the emails
- *
- * @author Christophe Coevoet
- * @author Mark Garrett
- */
-class NativeMailerHandler extends MailHandler
-{
- /**
- * The email addresses to which the message will be sent
- * @var array
- */
- protected $to;
-
- /**
- * The subject of the email
- * @var string
- */
- protected $subject;
-
- /**
- * Optional headers for the message
- * @var array
- */
- protected $headers = array();
-
- /**
- * Optional parameters for the message
- * @var array
- */
- protected $parameters = array();
-
- /**
- * The wordwrap length for the message
- * @var integer
- */
- protected $maxColumnWidth;
-
- /**
- * The Content-type for the message
- * @var string
- */
- protected $contentType = 'text/plain';
-
- /**
- * The encoding for the message
- * @var string
- */
- protected $encoding = 'utf-8';
-
- /**
- * @param string|array $to The receiver of the mail
- * @param string $subject The subject of the mail
- * @param string $from The sender of the mail
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param int $maxColumnWidth The maximum column width that the message lines will have
- */
- public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
- {
- parent::__construct($level, $bubble);
- $this->to = is_array($to) ? $to : array($to);
- $this->subject = $subject;
- $this->addHeader(sprintf('From: %s', $from));
- $this->maxColumnWidth = $maxColumnWidth;
- }
-
- /**
- * Add headers to the message
- *
- * @param string|array $headers Custom added headers
- * @return self
- */
- public function addHeader($headers)
- {
- foreach ((array) $headers as $header) {
- if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
- throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
- }
- $this->headers[] = $header;
- }
-
- return $this;
- }
-
- /**
- * Add parameters to the message
- *
- * @param string|array $parameters Custom added parameters
- * @return self
- */
- public function addParameter($parameters)
- {
- $this->parameters = array_merge($this->parameters, (array) $parameters);
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function send($content, array $records)
- {
- $content = wordwrap($content, $this->maxColumnWidth);
- $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n");
- $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n";
- if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) {
- $headers .= 'MIME-Version: 1.0' . "\r\n";
- }
- foreach ($this->to as $to) {
- mail($to, $this->subject, $content, $headers, implode(' ', $this->parameters));
- }
- }
-
- /**
- * @return string $contentType
- */
- public function getContentType()
- {
- return $this->contentType;
- }
-
- /**
- * @return string $encoding
- */
- public function getEncoding()
- {
- return $this->encoding;
- }
-
- /**
- * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML
- * messages.
- * @return self
- */
- public function setContentType($contentType)
- {
- if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) {
- throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection');
- }
-
- $this->contentType = $contentType;
-
- return $this;
- }
-
- /**
- * @param string $encoding
- * @return self
- */
- public function setEncoding($encoding)
- {
- if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) {
- throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection');
- }
-
- $this->encoding = $encoding;
-
- return $this;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php
deleted file mode 100644
index 0c26794d..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php
+++ /dev/null
@@ -1,176 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Class to record a log on a NewRelic application.
- * Enabling New Relic High Security mode may prevent capture of useful information.
- *
- * @see https://docs.newrelic.com/docs/agents/php-agent
- * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
- */
-class NewRelicHandler extends AbstractProcessingHandler
-{
- /**
- * Name of the New Relic application that will receive logs from this handler.
- *
- * @var string
- */
- protected $appName;
-
- /**
- * Name of the current transaction
- *
- * @var string
- */
- protected $transactionName;
-
- /**
- * Some context and extra data is passed into the handler as arrays of values. Do we send them as is
- * (useful if we are using the API), or explode them for display on the NewRelic RPM website?
- *
- * @var boolean
- */
- protected $explodeArrays;
-
- /**
- * {@inheritDoc}
- *
- * @param string $appName
- * @param boolean $explodeArrays
- * @param string $transactionName
- */
- public function __construct(
- $level = Logger::ERROR,
- $bubble = true,
- $appName = null,
- $explodeArrays = false,
- $transactionName = null
- ) {
- parent::__construct($level, $bubble);
-
- $this->appName = $appName;
- $this->explodeArrays = $explodeArrays;
- $this->transactionName = $transactionName;
- }
-
- /**
- * {@inheritDoc}
- */
- protected function write(array $record)
- {
- if (!$this->isNewRelicEnabled()) {
- throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');
- }
-
- if ($appName = $this->getAppName($record['context'])) {
- $this->setNewRelicAppName($appName);
- }
-
- if ($transactionName = $this->getTransactionName($record['context'])) {
- $this->setNewRelicTransactionName($transactionName);
- unset($record['context']['transaction_name']);
- }
-
- if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
- newrelic_notice_error($record['message'], $record['context']['exception']);
- unset($record['context']['exception']);
- } else {
- newrelic_notice_error($record['message']);
- }
-
- foreach ($record['context'] as $key => $parameter) {
- if (is_array($parameter) && $this->explodeArrays) {
- foreach ($parameter as $paramKey => $paramValue) {
- newrelic_add_custom_parameter('context_' . $key . '_' . $paramKey, $paramValue);
- }
- } else {
- newrelic_add_custom_parameter('context_' . $key, $parameter);
- }
- }
-
- foreach ($record['extra'] as $key => $parameter) {
- if (is_array($parameter) && $this->explodeArrays) {
- foreach ($parameter as $paramKey => $paramValue) {
- newrelic_add_custom_parameter('extra_' . $key . '_' . $paramKey, $paramValue);
- }
- } else {
- newrelic_add_custom_parameter('extra_' . $key, $parameter);
- }
- }
- }
-
- /**
- * Checks whether the NewRelic extension is enabled in the system.
- *
- * @return bool
- */
- protected function isNewRelicEnabled()
- {
- return extension_loaded('newrelic');
- }
-
- /**
- * Returns the appname where this log should be sent. Each log can override the default appname, set in this
- * handler's constructor, by providing the appname in it's context.
- *
- * @param array $context
- * @return null|string
- */
- protected function getAppName(array $context)
- {
- if (isset($context['appname'])) {
- return $context['appname'];
- }
-
- return $this->appName;
- }
-
- /**
- * Returns the name of the current transaction. Each log can override the default transaction name, set in this
- * handler's constructor, by providing the transaction_name in it's context
- *
- * @param array $context
- *
- * @return null|string
- */
- protected function getTransactionName(array $context)
- {
- if (isset($context['transaction_name'])) {
- return $context['transaction_name'];
- }
-
- return $this->transactionName;
- }
-
- /**
- * Sets the NewRelic application that should receive this log.
- *
- * @param string $appName
- */
- protected function setNewRelicAppName($appName)
- {
- newrelic_set_appname($appName);
- }
-
- /**
- * Overwrites the name of the current transaction
- *
- * @param $transactionName
- */
- protected function setNewRelicTransactionName($transactionName)
- {
- newrelic_name_transaction($transactionName);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php
deleted file mode 100644
index 3754e45d..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Blackhole
- *
- * Any record it can handle will be thrown away. This can be used
- * to put on top of an existing stack to override it temporarily.
- *
- * @author Jordi Boggiano
- */
-class NullHandler extends AbstractHandler
-{
- /**
- * @param integer $level The minimum logging level at which this handler will be triggered
- */
- public function __construct($level = Logger::DEBUG)
- {
- parent::__construct($level, false);
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if ($record['level'] < $this->level) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php
deleted file mode 100644
index 1ae85845..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Psr\Log\LoggerInterface;
-
-/**
- * Proxies log messages to an existing PSR-3 compliant logger.
- *
- * @author Michael Moussa
- */
-class PsrHandler extends AbstractHandler
-{
- /**
- * PSR-3 compliant logger
- *
- * @var LoggerInterface
- */
- protected $logger;
-
- /**
- * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied
- * @param int $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- $this->logger = $logger;
- }
-
- /**
- * {@inheritDoc}
- */
- public function handle(array $record)
- {
- if (!$this->isHandling($record)) {
- return false;
- }
-
- $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']);
-
- return false === $this->bubble;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php
deleted file mode 100644
index cd2fcfa3..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php
+++ /dev/null
@@ -1,172 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Sends notifications through the pushover api to mobile phones
- *
- * @author Sebastian Göttschkes
- * @see https://www.pushover.net/api
- */
-class PushoverHandler extends SocketHandler
-{
- private $token;
- private $users;
- private $title;
- private $user;
- private $retry;
- private $expire;
-
- private $highPriorityLevel;
- private $emergencyLevel;
-
- /**
- * All parameters that can be sent to Pushover
- * @see https://pushover.net/api
- * @var array
- */
- private $parameterNames = array(
- 'token' => true,
- 'user' => true,
- 'message' => true,
- 'device' => true,
- 'title' => true,
- 'url' => true,
- 'url_title' => true,
- 'priority' => true,
- 'timestamp' => true,
- 'sound' => true,
- 'retry' => true,
- 'expire' => true,
- 'callback' => true,
- );
-
- /**
- * Sounds the api supports by default
- * @see https://pushover.net/api#sounds
- * @var array
- */
- private $sounds = array(
- 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
- 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
- 'persistent', 'echo', 'updown', 'none',
- );
-
- /**
- * @param string $token Pushover api token
- * @param string|array $users Pushover user id or array of ids the message will be sent to
- * @param string $title Title sent to the Pushover API
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
- * the pushover.net app owner. OpenSSL is required for this option.
- * @param integer $highPriorityLevel The minimum logging level at which this handler will start
- * sending "high priority" requests to the Pushover API
- * @param integer $emergencyLevel The minimum logging level at which this handler will start
- * sending "emergency" requests to the Pushover API
- * @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
- * @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
- */
- public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
- {
- $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
- parent::__construct($connectionString, $level, $bubble);
-
- $this->token = $token;
- $this->users = (array) $users;
- $this->title = $title ?: gethostname();
- $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel);
- $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel);
- $this->retry = $retry;
- $this->expire = $expire;
- }
-
- protected function generateDataStream($record)
- {
- $content = $this->buildContent($record);
-
- return $this->buildHeader($content) . $content;
- }
-
- private function buildContent($record)
- {
- // Pushover has a limit of 512 characters on title and message combined.
- $maxMessageLength = 512 - strlen($this->title);
- $message = substr($record['message'], 0, $maxMessageLength);
- $timestamp = $record['datetime']->getTimestamp();
-
- $dataArray = array(
- 'token' => $this->token,
- 'user' => $this->user,
- 'message' => $message,
- 'title' => $this->title,
- 'timestamp' => $timestamp
- );
-
- if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) {
- $dataArray['priority'] = 2;
- $dataArray['retry'] = $this->retry;
- $dataArray['expire'] = $this->expire;
- } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) {
- $dataArray['priority'] = 1;
- }
-
- // First determine the available parameters
- $context = array_intersect_key($record['context'], $this->parameterNames);
- $extra = array_intersect_key($record['extra'], $this->parameterNames);
-
- // Least important info should be merged with subsequent info
- $dataArray = array_merge($extra, $context, $dataArray);
-
- // Only pass sounds that are supported by the API
- if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) {
- unset($dataArray['sound']);
- }
-
- return http_build_query($dataArray);
- }
-
- private function buildHeader($content)
- {
- $header = "POST /1/messages.json HTTP/1.1\r\n";
- $header .= "Host: api.pushover.net\r\n";
- $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-Length: " . strlen($content) . "\r\n";
- $header .= "\r\n";
-
- return $header;
- }
-
- protected function write(array $record)
- {
- foreach ($this->users as $user) {
- $this->user = $user;
-
- parent::write($record);
- $this->closeSocket();
- }
-
- $this->user = null;
- }
-
- public function setHighPriorityLevel($value)
- {
- $this->highPriorityLevel = $value;
- }
-
- public function setEmergencyLevel($value)
- {
- $this->emergencyLevel = $value;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php
deleted file mode 100644
index 69da8cae..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php
+++ /dev/null
@@ -1,187 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\LineFormatter;
-use Monolog\Formatter\FormatterInterface;
-use Monolog\Logger;
-use Raven_Client;
-
-/**
- * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server
- * using raven-php (https://github.com/getsentry/raven-php)
- *
- * @author Marc Abramowitz
- */
-class RavenHandler extends AbstractProcessingHandler
-{
- /**
- * Translates Monolog log levels to Raven log levels.
- */
- private $logLevels = array(
- Logger::DEBUG => Raven_Client::DEBUG,
- Logger::INFO => Raven_Client::INFO,
- Logger::NOTICE => Raven_Client::INFO,
- Logger::WARNING => Raven_Client::WARNING,
- Logger::ERROR => Raven_Client::ERROR,
- Logger::CRITICAL => Raven_Client::FATAL,
- Logger::ALERT => Raven_Client::FATAL,
- Logger::EMERGENCY => Raven_Client::FATAL,
- );
-
- /**
- * @var Raven_Client the client object that sends the message to the server
- */
- protected $ravenClient;
-
- /**
- * @var LineFormatter The formatter to use for the logs generated via handleBatch()
- */
- protected $batchFormatter;
-
- /**
- * @param Raven_Client $ravenClient
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- $this->ravenClient = $ravenClient;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- $level = $this->level;
-
- // filter records based on their level
- $records = array_filter($records, function ($record) use ($level) {
- return $record['level'] >= $level;
- });
-
- if (!$records) {
- return;
- }
-
- // the record with the highest severity is the "main" one
- $record = array_reduce($records, function ($highest, $record) {
- if ($record['level'] >= $highest['level']) {
- return $record;
- }
-
- return $highest;
- });
-
- // the other ones are added as a context item
- $logs = array();
- foreach ($records as $r) {
- $logs[] = $this->processRecord($r);
- }
-
- if ($logs) {
- $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs);
- }
-
- $this->handle($record);
- }
-
- /**
- * Sets the formatter for the logs generated by handleBatch().
- *
- * @param FormatterInterface $formatter
- */
- public function setBatchFormatter(FormatterInterface $formatter)
- {
- $this->batchFormatter = $formatter;
- }
-
- /**
- * Gets the formatter for the logs generated by handleBatch().
- *
- * @return FormatterInterface
- */
- public function getBatchFormatter()
- {
- if (!$this->batchFormatter) {
- $this->batchFormatter = $this->getDefaultBatchFormatter();
- }
-
- return $this->batchFormatter;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- // ensures user context is empty
- $this->ravenClient->user_context(null);
- $options = array();
- $options['level'] = $this->logLevels[$record['level']];
- $options['tags'] = array();
- if (!empty($record['extra']['tags'])) {
- $options['tags'] = array_merge($options['tags'], $record['extra']['tags']);
- unset($record['extra']['tags']);
- }
- if (!empty($record['context']['tags'])) {
- $options['tags'] = array_merge($options['tags'], $record['context']['tags']);
- unset($record['context']['tags']);
- }
- if (!empty($record['context']['logger'])) {
- $options['logger'] = $record['context']['logger'];
- unset($record['context']['logger']);
- } else {
- $options['logger'] = $record['channel'];
- }
- if (!empty($record['context'])) {
- $options['extra']['context'] = $record['context'];
- if (!empty($record['context']['user'])) {
- $this->ravenClient->user_context($record['context']['user']);
- unset($options['extra']['context']['user']);
- }
- }
- if (!empty($record['extra'])) {
- $options['extra']['extra'] = $record['extra'];
- }
-
- if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
- $options['extra']['message'] = $record['formatted'];
- $this->ravenClient->captureException($record['context']['exception'], $options);
-
- return;
- }
-
- $this->ravenClient->captureMessage($record['formatted'], array(), $options);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter('[%channel%] %message%');
- }
-
- /**
- * Gets the default formatter for the logs generated by handleBatch().
- *
- * @return FormatterInterface
- */
- protected function getDefaultBatchFormatter()
- {
- return new LineFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php
deleted file mode 100644
index 3fc7f34b..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-/**
- * Logs to a Redis key using rpush
- *
- * usage example:
- *
- * $log = new Logger('application');
- * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod");
- * $log->pushHandler($redis);
- *
- * @author Thomas Tourlourat
- */
-class RedisHandler extends AbstractProcessingHandler
-{
- private $redisClient;
- private $redisKey;
-
- # redis instance, key to use
- public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true)
- {
- if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) {
- throw new \InvalidArgumentException('Predis\Client or Redis instance required');
- }
-
- $this->redisClient = $redis;
- $this->redisKey = $key;
-
- parent::__construct($level, $bubble);
- }
-
- protected function write(array $record)
- {
- $this->redisClient->rpush($this->redisKey, $record["formatted"]);
- }
-
- /**
- * {@inheritDoc}
- */
- protected function getDefaultFormatter()
- {
- return new LineFormatter();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php
deleted file mode 100644
index 81abf086..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use RollbarNotifier;
-use Exception;
-use Monolog\Logger;
-
-/**
- * Sends errors to Rollbar
- *
- * @author Paul Statezny
- */
-class RollbarHandler extends AbstractProcessingHandler
-{
- /**
- * Rollbar notifier
- *
- * @var RollbarNotifier
- */
- protected $rollbarNotifier;
-
- /**
- * @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true)
- {
- $this->rollbarNotifier = $rollbarNotifier;
-
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- if (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
- $this->rollbarNotifier->report_exception($record['context']['exception']);
- } else {
- $extraData = array(
- 'level' => $record['level'],
- 'channel' => $record['channel'],
- 'datetime' => $record['datetime']->format('U'),
- );
-
- $this->rollbarNotifier->report_message(
- $record['message'],
- $record['level_name'],
- array_merge($record['context'], $record['extra'], $extraData)
- );
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- $this->rollbarNotifier->flush();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
deleted file mode 100644
index 4168c32f..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
+++ /dev/null
@@ -1,153 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Stores logs to files that are rotated every day and a limited number of files are kept.
- *
- * This rotation is only intended to be used as a workaround. Using logrotate to
- * handle the rotation is strongly encouraged when you can use it.
- *
- * @author Christophe Coevoet
- * @author Jordi Boggiano
- */
-class RotatingFileHandler extends StreamHandler
-{
- protected $filename;
- protected $maxFiles;
- protected $mustRotate;
- protected $nextRotation;
- protected $filenameFormat;
- protected $dateFormat;
-
- /**
- * @param string $filename
- * @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
- * @param Boolean $useLocking Try to lock log file before doing any writes
- */
- public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
- {
- $this->filename = $filename;
- $this->maxFiles = (int) $maxFiles;
- $this->nextRotation = new \DateTime('tomorrow');
- $this->filenameFormat = '{filename}-{date}';
- $this->dateFormat = 'Y-m-d';
-
- parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking);
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- parent::close();
-
- if (true === $this->mustRotate) {
- $this->rotate();
- }
- }
-
- public function setFilenameFormat($filenameFormat, $dateFormat)
- {
- $this->filenameFormat = $filenameFormat;
- $this->dateFormat = $dateFormat;
- $this->url = $this->getTimedFilename();
- $this->close();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- // on the first record written, if the log is new, we should rotate (once per day)
- if (null === $this->mustRotate) {
- $this->mustRotate = !file_exists($this->url);
- }
-
- if ($this->nextRotation < $record['datetime']) {
- $this->mustRotate = true;
- $this->close();
- }
-
- parent::write($record);
- }
-
- /**
- * Rotates the files.
- */
- protected function rotate()
- {
- // update filename
- $this->url = $this->getTimedFilename();
- $this->nextRotation = new \DateTime('tomorrow');
-
- // skip GC of old logs if files are unlimited
- if (0 === $this->maxFiles) {
- return;
- }
-
- $logFiles = glob($this->getGlobPattern());
- if ($this->maxFiles >= count($logFiles)) {
- // no files to remove
- return;
- }
-
- // Sorting the files by name to remove the older ones
- usort($logFiles, function ($a, $b) {
- return strcmp($b, $a);
- });
-
- foreach (array_slice($logFiles, $this->maxFiles) as $file) {
- if (is_writable($file)) {
- unlink($file);
- }
- }
- }
-
- protected function getTimedFilename()
- {
- $fileInfo = pathinfo($this->filename);
- $timedFilename = str_replace(
- array('{filename}', '{date}'),
- array($fileInfo['filename'], date($this->dateFormat)),
- $fileInfo['dirname'] . '/' . $this->filenameFormat
- );
-
- if (!empty($fileInfo['extension'])) {
- $timedFilename .= '.'.$fileInfo['extension'];
- }
-
- return $timedFilename;
- }
-
- protected function getGlobPattern()
- {
- $fileInfo = pathinfo($this->filename);
- $glob = str_replace(
- array('{filename}', '{date}'),
- array($fileInfo['filename'], '*'),
- $fileInfo['dirname'] . '/' . $this->filenameFormat
- );
- if (!empty($fileInfo['extension'])) {
- $glob .= '.'.$fileInfo['extension'];
- }
-
- return $glob;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php
deleted file mode 100644
index 9509ae37..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Sampling handler
- *
- * A sampled event stream can be useful for logging high frequency events in
- * a production environment where you only need an idea of what is happening
- * and are not concerned with capturing every occurrence. Since the decision to
- * handle or not handle a particular event is determined randomly, the
- * resulting sampled log is not guaranteed to contain 1/N of the events that
- * occurred in the application, but based on the Law of large numbers, it will
- * tend to be close to this ratio with a large number of attempts.
- *
- * @author Bryan Davis
- * @author Kunal Mehta
- */
-class SamplingHandler extends AbstractHandler
-{
- /**
- * @var callable|HandlerInterface $handler
- */
- protected $handler;
-
- /**
- * @var int $factor
- */
- protected $factor;
-
- /**
- * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
- * @param int $factor Sample factor
- */
- public function __construct($handler, $factor)
- {
- parent::__construct();
- $this->handler = $handler;
- $this->factor = $factor;
-
- if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
- throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
- }
- }
-
- public function isHandling(array $record)
- {
- return $this->handler->isHandling($record);
- }
-
- public function handle(array $record)
- {
- if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
- // The same logic as in FingersCrossedHandler
- if (!$this->handler instanceof HandlerInterface) {
- $this->handler = call_user_func($this->handler, $record, $this);
- if (!$this->handler instanceof HandlerInterface) {
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
- }
- }
-
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- $this->handler->handle($record);
- }
-
- return false === $this->bubble;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
deleted file mode 100644
index 7328deee..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
+++ /dev/null
@@ -1,280 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-/**
- * Sends notifications through Slack API
- *
- * @author Greg Kedzierski
- * @see https://api.slack.com/
- */
-class SlackHandler extends SocketHandler
-{
- /**
- * Slack API token
- * @var string
- */
- private $token;
-
- /**
- * Slack channel (encoded ID or name)
- * @var string
- */
- private $channel;
-
- /**
- * Name of a bot
- * @var string
- */
- private $username;
-
- /**
- * Emoji icon name
- * @var string
- */
- private $iconEmoji;
-
- /**
- * Whether the message should be added to Slack as attachment (plain text otherwise)
- * @var bool
- */
- private $useAttachment;
-
- /**
- * Whether the the context/extra messages added to Slack as attachments are in a short style
- * @var bool
- */
- private $useShortAttachment;
-
- /**
- * Whether the attachment should include context and extra data
- * @var bool
- */
- private $includeContextAndExtra;
-
- /**
- * @var LineFormatter
- */
- private $lineFormatter;
-
- /**
- * @param string $token Slack API token
- * @param string $channel Slack channel (encoded ID or name)
- * @param string $username Name of a bot
- * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
- * @param string|null $iconEmoji The emoji name to use (or null)
- * @param int $level The minimum logging level at which this handler will be triggered
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
- * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
- * @param bool $includeContextAndExtra Whether the attachment should include context and extra data
- */
- public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
- {
- if (!extension_loaded('openssl')) {
- throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
- }
-
- parent::__construct('ssl://slack.com:443', $level, $bubble);
-
- $this->token = $token;
- $this->channel = $channel;
- $this->username = $username;
- $this->iconEmoji = trim($iconEmoji, ':');
- $this->useAttachment = $useAttachment;
- $this->useShortAttachment = $useShortAttachment;
- $this->includeContextAndExtra = $includeContextAndExtra;
- if ($this->includeContextAndExtra) {
- $this->lineFormatter = new LineFormatter;
- }
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- * @return string
- */
- protected function generateDataStream($record)
- {
- $content = $this->buildContent($record);
-
- return $this->buildHeader($content) . $content;
- }
-
- /**
- * Builds the body of API call
- *
- * @param array $record
- * @return string
- */
- private function buildContent($record)
- {
- $dataArray = array(
- 'token' => $this->token,
- 'channel' => $this->channel,
- 'username' => $this->username,
- 'text' => '',
- 'attachments' => array()
- );
-
- if ($this->useAttachment) {
- $attachment = array(
- 'fallback' => $record['message'],
- 'color' => $this->getAttachmentColor($record['level'])
- );
-
- if ($this->useShortAttachment) {
- $attachment['fields'] = array(
- array(
- 'title' => $record['level_name'],
- 'value' => $record['message'],
- 'short' => false
- )
- );
- } else {
- $attachment['fields'] = array(
- array(
- 'title' => 'Message',
- 'value' => $record['message'],
- 'short' => false
- ),
- array(
- 'title' => 'Level',
- 'value' => $record['level_name'],
- 'short' => true
- )
- );
- }
-
- if ($this->includeContextAndExtra) {
- if (!empty($record['extra'])) {
- if ($this->useShortAttachment) {
- $attachment['fields'][] = array(
- 'title' => "Extra",
- 'value' => $this->stringify($record['extra']),
- 'short' => $this->useShortAttachment
- );
- } else {
- // Add all extra fields as individual fields in attachment
- foreach ($record['extra'] as $var => $val) {
- $attachment['fields'][] = array(
- 'title' => $var,
- 'value' => $val,
- 'short' => $this->useShortAttachment
- );
- }
- }
- }
-
- if (!empty($record['context'])) {
- if ($this->useShortAttachment) {
- $attachment['fields'][] = array(
- 'title' => "Context",
- 'value' => $this->stringify($record['context']),
- 'short' => $this->useShortAttachment
- );
- } else {
- // Add all context fields as individual fields in attachment
- foreach ($record['context'] as $var => $val) {
- $attachment['fields'][] = array(
- 'title' => $var,
- 'value' => $val,
- 'short' => $this->useShortAttachment
- );
- }
- }
- }
- }
-
- $dataArray['attachments'] = json_encode(array($attachment));
- } else {
- $dataArray['text'] = $record['message'];
- }
-
- if ($this->iconEmoji) {
- $dataArray['icon_emoji'] = ":{$this->iconEmoji}:";
- }
-
- return http_build_query($dataArray);
- }
-
- /**
- * Builds the header of the API Call
- *
- * @param string $content
- * @return string
- */
- private function buildHeader($content)
- {
- $header = "POST /api/chat.postMessage HTTP/1.1\r\n";
- $header .= "Host: slack.com\r\n";
- $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $header .= "Content-Length: " . strlen($content) . "\r\n";
- $header .= "\r\n";
-
- return $header;
- }
-
- /**
- * {@inheritdoc}
- *
- * @param array $record
- */
- protected function write(array $record)
- {
- parent::write($record);
- $this->closeSocket();
- }
-
- /**
- * Returned a Slack message attachment color associated with
- * provided level.
- *
- * @param int $level
- * @return string
- */
- protected function getAttachmentColor($level)
- {
- switch (true) {
- case $level >= Logger::ERROR:
- return 'danger';
- case $level >= Logger::WARNING:
- return 'warning';
- case $level >= Logger::INFO:
- return 'good';
- default:
- return '#e3e4e6';
- }
- }
-
- /**
- * Stringifies an array of key/value pairs to be used in attachment fields
- *
- * @param array $fields
- * @access protected
- * @return string
- */
- protected function stringify($fields)
- {
- $string = '';
- foreach ($fields as $var => $val) {
- $string .= $var.': '.$this->lineFormatter->stringify($val)." | ";
- }
-
- $string = rtrim($string, " |");
-
- return $string;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
deleted file mode 100644
index ee486f69..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
+++ /dev/null
@@ -1,284 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Stores to any socket - uses fsockopen() or pfsockopen().
- *
- * @author Pablo de Leon Belloc
- * @see http://php.net/manual/en/function.fsockopen.php
- */
-class SocketHandler extends AbstractProcessingHandler
-{
- private $connectionString;
- private $connectionTimeout;
- private $resource;
- private $timeout = 0;
- private $persistent = false;
- private $errno;
- private $errstr;
-
- /**
- * @param string $connectionString Socket connection string
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($level, $bubble);
- $this->connectionString = $connectionString;
- $this->connectionTimeout = (float) ini_get('default_socket_timeout');
- }
-
- /**
- * Connect (if necessary) and write to the socket
- *
- * @param array $record
- *
- * @throws \UnexpectedValueException
- * @throws \RuntimeException
- */
- protected function write(array $record)
- {
- $this->connectIfNotConnected();
- $data = $this->generateDataStream($record);
- $this->writeToSocket($data);
- }
-
- /**
- * We will not close a PersistentSocket instance so it can be reused in other requests.
- */
- public function close()
- {
- if (!$this->isPersistent()) {
- $this->closeSocket();
- }
- }
-
- /**
- * Close socket, if open
- */
- public function closeSocket()
- {
- if (is_resource($this->resource)) {
- fclose($this->resource);
- $this->resource = null;
- }
- }
-
- /**
- * Set socket connection to nbe persistent. It only has effect before the connection is initiated.
- *
- * @param type $boolean
- */
- public function setPersistent($boolean)
- {
- $this->persistent = (boolean) $boolean;
- }
-
- /**
- * Set connection timeout. Only has effect before we connect.
- *
- * @param float $seconds
- *
- * @see http://php.net/manual/en/function.fsockopen.php
- */
- public function setConnectionTimeout($seconds)
- {
- $this->validateTimeout($seconds);
- $this->connectionTimeout = (float) $seconds;
- }
-
- /**
- * Set write timeout. Only has effect before we connect.
- *
- * @param float $seconds
- *
- * @see http://php.net/manual/en/function.stream-set-timeout.php
- */
- public function setTimeout($seconds)
- {
- $this->validateTimeout($seconds);
- $this->timeout = (float) $seconds;
- }
-
- /**
- * Get current connection string
- *
- * @return string
- */
- public function getConnectionString()
- {
- return $this->connectionString;
- }
-
- /**
- * Get persistent setting
- *
- * @return boolean
- */
- public function isPersistent()
- {
- return $this->persistent;
- }
-
- /**
- * Get current connection timeout setting
- *
- * @return float
- */
- public function getConnectionTimeout()
- {
- return $this->connectionTimeout;
- }
-
- /**
- * Get current in-transfer timeout
- *
- * @return float
- */
- public function getTimeout()
- {
- return $this->timeout;
- }
-
- /**
- * Check to see if the socket is currently available.
- *
- * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
- *
- * @return boolean
- */
- public function isConnected()
- {
- return is_resource($this->resource)
- && !feof($this->resource); // on TCP - other party can close connection.
- }
-
- /**
- * Wrapper to allow mocking
- */
- protected function pfsockopen()
- {
- return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
- }
-
- /**
- * Wrapper to allow mocking
- */
- protected function fsockopen()
- {
- return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
- }
-
- /**
- * Wrapper to allow mocking
- *
- * @see http://php.net/manual/en/function.stream-set-timeout.php
- */
- protected function streamSetTimeout()
- {
- $seconds = floor($this->timeout);
- $microseconds = round(($this->timeout - $seconds)*1e6);
-
- return stream_set_timeout($this->resource, $seconds, $microseconds);
- }
-
- /**
- * Wrapper to allow mocking
- */
- protected function fwrite($data)
- {
- return @fwrite($this->resource, $data);
- }
-
- /**
- * Wrapper to allow mocking
- */
- protected function streamGetMetadata()
- {
- return stream_get_meta_data($this->resource);
- }
-
- private function validateTimeout($value)
- {
- $ok = filter_var($value, FILTER_VALIDATE_FLOAT);
- if ($ok === false || $value < 0) {
- throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)");
- }
- }
-
- private function connectIfNotConnected()
- {
- if ($this->isConnected()) {
- return;
- }
- $this->connect();
- }
-
- protected function generateDataStream($record)
- {
- return (string) $record['formatted'];
- }
-
- private function connect()
- {
- $this->createSocketResource();
- $this->setSocketTimeout();
- }
-
- private function createSocketResource()
- {
- if ($this->isPersistent()) {
- $resource = $this->pfsockopen();
- } else {
- $resource = $this->fsockopen();
- }
- if (!$resource) {
- throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)");
- }
- $this->resource = $resource;
- }
-
- private function setSocketTimeout()
- {
- if (!$this->streamSetTimeout()) {
- throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()");
- }
- }
-
- private function writeToSocket($data)
- {
- $length = strlen($data);
- $sent = 0;
- while ($this->isConnected() && $sent < $length) {
- if (0 == $sent) {
- $chunk = $this->fwrite($data);
- } else {
- $chunk = $this->fwrite(substr($data, $sent));
- }
- if ($chunk === false) {
- throw new \RuntimeException("Could not write to socket");
- }
- $sent += $chunk;
- $socketInfo = $this->streamGetMetadata();
- if ($socketInfo['timed_out']) {
- throw new \RuntimeException("Write timed-out");
- }
- }
- if (!$this->isConnected() && $sent < $length) {
- throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)");
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
deleted file mode 100644
index 7965db74..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
+++ /dev/null
@@ -1,104 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Stores to any stream resource
- *
- * Can be used to store into php://stderr, remote and local files, etc.
- *
- * @author Jordi Boggiano
- */
-class StreamHandler extends AbstractProcessingHandler
-{
- protected $stream;
- protected $url;
- private $errorMessage;
- protected $filePermission;
- protected $useLocking;
-
- /**
- * @param resource|string $stream
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
- * @param Boolean $useLocking Try to lock log file before doing any writes
- *
- * @throws \InvalidArgumentException If stream is not a resource or string
- */
- public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
- {
- parent::__construct($level, $bubble);
- if (is_resource($stream)) {
- $this->stream = $stream;
- } elseif (is_string($stream)) {
- $this->url = $stream;
- } else {
- throw new \InvalidArgumentException('A stream must either be a resource or a string.');
- }
-
- $this->filePermission = $filePermission;
- $this->useLocking = $useLocking;
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- if (is_resource($this->stream)) {
- fclose($this->stream);
- }
- $this->stream = null;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- if (!is_resource($this->stream)) {
- if (!$this->url) {
- throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
- }
- $this->errorMessage = null;
- set_error_handler(array($this, 'customErrorHandler'));
- $this->stream = fopen($this->url, 'a');
- if ($this->filePermission !== null) {
- @chmod($this->url, $this->filePermission);
- }
- restore_error_handler();
- if (!is_resource($this->stream)) {
- $this->stream = null;
- throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url));
- }
- }
-
- if ($this->useLocking) {
- // ignoring errors here, there's not much we can do about them
- flock($this->stream, LOCK_EX);
- }
-
- fwrite($this->stream, (string) $record['formatted']);
-
- if ($this->useLocking) {
- flock($this->stream, LOCK_UN);
- }
- }
-
- private function customErrorHandler($code, $msg)
- {
- $this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php
deleted file mode 100644
index 003a1a2a..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * SwiftMailerHandler uses Swift_Mailer to send the emails
- *
- * @author Gyula Sallai
- */
-class SwiftMailerHandler extends MailHandler
-{
- protected $mailer;
- private $messageTemplate;
-
- /**
- * @param \Swift_Mailer $mailer The mailer to use
- * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
- {
- parent::__construct($level, $bubble);
-
- $this->mailer = $mailer;
- $this->messageTemplate = $message;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function send($content, array $records)
- {
- $this->mailer->send($this->buildMessage($content, $records));
- }
-
- /**
- * Creates instance of Swift_Message to be sent
- *
- * @param string $content formatted email body to be sent
- * @param array $records Log records that formed the content
- * @return \Swift_Message
- */
- protected function buildMessage($content, array $records)
- {
- $message = null;
- if ($this->messageTemplate instanceof \Swift_Message) {
- $message = clone $this->messageTemplate;
- } else if (is_callable($this->messageTemplate)) {
- $message = call_user_func($this->messageTemplate, $content, $records);
- }
-
- if (!$message instanceof \Swift_Message) {
- throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it');
- }
-
- $message->setBody($content);
- $message->setDate(time());
-
- return $message;
- }
-
- /**
- * BC getter, to be removed in 2.0
- */
- public function __get($name)
- {
- if ($name === 'message') {
- trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED);
-
- return $this->buildMessage(null, array());
- }
-
- throw new \InvalidArgumentException('Invalid property '.$name);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php
deleted file mode 100644
index 47c73e12..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Logs to syslog service.
- *
- * usage example:
- *
- * $log = new Logger('application');
- * $syslog = new SyslogHandler('myfacility', 'local6');
- * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%");
- * $syslog->setFormatter($formatter);
- * $log->pushHandler($syslog);
- *
- * @author Sven Paulus
- */
-class SyslogHandler extends AbstractSyslogHandler
-{
- protected $ident;
- protected $logopts;
-
- /**
- * @param string $ident
- * @param mixed $facility
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID
- */
- public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
- {
- parent::__construct($facility, $level, $bubble);
-
- $this->ident = $ident;
- $this->logopts = $logopts;
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- closelog();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- if (!openlog($this->ident, $this->logopts, $this->facility)) {
- throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"');
- }
- syslog($this->logLevels[$record['level']], (string) $record['formatted']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php
deleted file mode 100644
index dcf3f1f9..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler\SyslogUdp;
-
-class UdpSocket
-{
- const DATAGRAM_MAX_LENGTH = 65023;
-
- public function __construct($ip, $port = 514)
- {
- $this->ip = $ip;
- $this->port = $port;
- $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
- }
-
- public function write($line, $header = "")
- {
- $this->send($this->assembleMessage($line, $header));
- }
-
- public function close()
- {
- socket_close($this->socket);
- }
-
- protected function send($chunk)
- {
- socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);
- }
-
- protected function assembleMessage($line, $header)
- {
- $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header);
-
- return $header . substr($line, 0, $chunkSize);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php
deleted file mode 100644
index aa047c07..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\Handler\SyslogUdp\UdpSocket;
-
-/**
- * A Handler for logging to a remote syslogd server.
- *
- * @author Jesper Skovgaard Nielsen
- */
-class SyslogUdpHandler extends AbstractSyslogHandler
-{
- /**
- * @param string $host
- * @param int $port
- * @param mixed $facility
- * @param integer $level The minimum logging level at which this handler will be triggered
- * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
- */
- public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
- {
- parent::__construct($facility, $level, $bubble);
-
- $this->socket = new UdpSocket($host, $port ?: 514);
- }
-
- protected function write(array $record)
- {
- $lines = $this->splitMessageIntoLines($record['formatted']);
-
- $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]);
-
- foreach ($lines as $line) {
- $this->socket->write($line, $header);
- }
- }
-
- public function close()
- {
- $this->socket->close();
- }
-
- private function splitMessageIntoLines($message)
- {
- if (is_array($message)) {
- $message = implode("\n", $message);
- }
-
- return preg_split('/$\R?^/m', $message);
- }
-
- /**
- * Make common syslog header (see rfc5424)
- */
- protected function makeCommonSyslogHeader($severity)
- {
- $priority = $severity + $this->facility;
-
- return "<$priority>1 ";
- }
-
- /**
- * Inject your own socket, mainly used for testing
- */
- public function setSocket($socket)
- {
- $this->socket = $socket;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php
deleted file mode 100644
index 085d9e17..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-/**
- * Used for testing purposes.
- *
- * It records all records and gives you access to them for verification.
- *
- * @author Jordi Boggiano
- */
-class TestHandler extends AbstractProcessingHandler
-{
- protected $records = array();
- protected $recordsByLevel = array();
-
- public function getRecords()
- {
- return $this->records;
- }
-
- public function hasEmergency($record)
- {
- return $this->hasRecord($record, Logger::EMERGENCY);
- }
-
- public function hasAlert($record)
- {
- return $this->hasRecord($record, Logger::ALERT);
- }
-
- public function hasCritical($record)
- {
- return $this->hasRecord($record, Logger::CRITICAL);
- }
-
- public function hasError($record)
- {
- return $this->hasRecord($record, Logger::ERROR);
- }
-
- public function hasWarning($record)
- {
- return $this->hasRecord($record, Logger::WARNING);
- }
-
- public function hasNotice($record)
- {
- return $this->hasRecord($record, Logger::NOTICE);
- }
-
- public function hasInfo($record)
- {
- return $this->hasRecord($record, Logger::INFO);
- }
-
- public function hasDebug($record)
- {
- return $this->hasRecord($record, Logger::DEBUG);
- }
-
- public function hasEmergencyRecords()
- {
- return isset($this->recordsByLevel[Logger::EMERGENCY]);
- }
-
- public function hasAlertRecords()
- {
- return isset($this->recordsByLevel[Logger::ALERT]);
- }
-
- public function hasCriticalRecords()
- {
- return isset($this->recordsByLevel[Logger::CRITICAL]);
- }
-
- public function hasErrorRecords()
- {
- return isset($this->recordsByLevel[Logger::ERROR]);
- }
-
- public function hasWarningRecords()
- {
- return isset($this->recordsByLevel[Logger::WARNING]);
- }
-
- public function hasNoticeRecords()
- {
- return isset($this->recordsByLevel[Logger::NOTICE]);
- }
-
- public function hasInfoRecords()
- {
- return isset($this->recordsByLevel[Logger::INFO]);
- }
-
- public function hasDebugRecords()
- {
- return isset($this->recordsByLevel[Logger::DEBUG]);
- }
-
- protected function hasRecord($record, $level)
- {
- if (!isset($this->recordsByLevel[$level])) {
- return false;
- }
-
- if (is_array($record)) {
- $record = $record['message'];
- }
-
- foreach ($this->recordsByLevel[$level] as $rec) {
- if ($rec['message'] === $record) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $this->recordsByLevel[$record['level']][] = $record;
- $this->records[] = $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php
deleted file mode 100644
index 05a88173..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * Forwards records to multiple handlers suppressing failures of each handler
- * and continuing through to give every handler a chance to succeed.
- *
- * @author Craig D'Amelio
- */
-class WhatFailureGroupHandler extends GroupHandler
-{
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- if ($this->processors) {
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- }
-
- foreach ($this->handlers as $handler) {
- try {
- $handler->handle($record);
- } catch (\Exception $e) {
- // What failure?
- }
- }
-
- return false === $this->bubble;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handleBatch(array $records)
- {
- foreach ($this->handlers as $handler) {
- try {
- $handler->handleBatch($records);
- } catch (\Exception $e) {
- // What failure?
- }
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php
deleted file mode 100644
index f22cf218..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\NormalizerFormatter;
-use Monolog\Logger;
-
-/**
- * Handler sending logs to Zend Monitor
- *
- * @author Christian Bergau
- */
-class ZendMonitorHandler extends AbstractProcessingHandler
-{
- /**
- * Monolog level / ZendMonitor Custom Event priority map
- *
- * @var array
- */
- protected $levelMap = array(
- Logger::DEBUG => 1,
- Logger::INFO => 2,
- Logger::NOTICE => 3,
- Logger::WARNING => 4,
- Logger::ERROR => 5,
- Logger::CRITICAL => 6,
- Logger::ALERT => 7,
- Logger::EMERGENCY => 0,
- );
-
- /**
- * Construct
- *
- * @param int $level
- * @param bool $bubble
- * @throws MissingExtensionException
- */
- public function __construct($level = Logger::DEBUG, $bubble = true)
- {
- if (!function_exists('zend_monitor_custom_event')) {
- throw new MissingExtensionException('You must have Zend Server installed in order to use this handler');
- }
- parent::__construct($level, $bubble);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function write(array $record)
- {
- $this->writeZendMonitorCustomEvent(
- $this->levelMap[$record['level']],
- $record['message'],
- $record['formatted']
- );
- }
-
- /**
- * Write a record to Zend Monitor
- *
- * @param int $level
- * @param string $message
- * @param array $formatted
- */
- protected function writeZendMonitorCustomEvent($level, $message, $formatted)
- {
- zend_monitor_custom_event($level, $message, $formatted);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDefaultFormatter()
- {
- return new NormalizerFormatter();
- }
-
- /**
- * Get the level map
- *
- * @return array
- */
- public function getLevelMap()
- {
- return $this->levelMap;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Logger.php b/src/composer/vendor/monolog/monolog/src/Monolog/Logger.php
deleted file mode 100644
index 4a38de7f..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Logger.php
+++ /dev/null
@@ -1,615 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use Monolog\Handler\HandlerInterface;
-use Monolog\Handler\StreamHandler;
-use Psr\Log\LoggerInterface;
-use Psr\Log\InvalidArgumentException;
-
-/**
- * Monolog log channel
- *
- * It contains a stack of Handlers and a stack of Processors,
- * and uses them to store records that are added to it.
- *
- * @author Jordi Boggiano
- */
-class Logger implements LoggerInterface
-{
- /**
- * Detailed debug information
- */
- const DEBUG = 100;
-
- /**
- * Interesting events
- *
- * Examples: User logs in, SQL logs.
- */
- const INFO = 200;
-
- /**
- * Uncommon events
- */
- const NOTICE = 250;
-
- /**
- * Exceptional occurrences that are not errors
- *
- * Examples: Use of deprecated APIs, poor use of an API,
- * undesirable things that are not necessarily wrong.
- */
- const WARNING = 300;
-
- /**
- * Runtime errors
- */
- const ERROR = 400;
-
- /**
- * Critical conditions
- *
- * Example: Application component unavailable, unexpected exception.
- */
- const CRITICAL = 500;
-
- /**
- * Action must be taken immediately
- *
- * Example: Entire website down, database unavailable, etc.
- * This should trigger the SMS alerts and wake you up.
- */
- const ALERT = 550;
-
- /**
- * Urgent alert.
- */
- const EMERGENCY = 600;
-
- /**
- * Monolog API version
- *
- * This is only bumped when API breaks are done and should
- * follow the major version of the library
- *
- * @var int
- */
- const API = 1;
-
- /**
- * Logging levels from syslog protocol defined in RFC 5424
- *
- * @var array $levels Logging levels
- */
- protected static $levels = array(
- 100 => 'DEBUG',
- 200 => 'INFO',
- 250 => 'NOTICE',
- 300 => 'WARNING',
- 400 => 'ERROR',
- 500 => 'CRITICAL',
- 550 => 'ALERT',
- 600 => 'EMERGENCY',
- );
-
- /**
- * @var \DateTimeZone
- */
- protected static $timezone;
-
- /**
- * @var string
- */
- protected $name;
-
- /**
- * The handler stack
- *
- * @var HandlerInterface[]
- */
- protected $handlers;
-
- /**
- * Processors that will process all log records
- *
- * To process records of a single handler instead, add the processor on that specific handler
- *
- * @var callable[]
- */
- protected $processors;
-
- /**
- * @param string $name The logging channel
- * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
- * @param callable[] $processors Optional array of processors
- */
- public function __construct($name, array $handlers = array(), array $processors = array())
- {
- $this->name = $name;
- $this->handlers = $handlers;
- $this->processors = $processors;
- }
-
- /**
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Pushes a handler on to the stack.
- *
- * @param HandlerInterface $handler
- */
- public function pushHandler(HandlerInterface $handler)
- {
- array_unshift($this->handlers, $handler);
- }
-
- /**
- * Pops a handler from the stack
- *
- * @return HandlerInterface
- */
- public function popHandler()
- {
- if (!$this->handlers) {
- throw new \LogicException('You tried to pop from an empty handler stack.');
- }
-
- return array_shift($this->handlers);
- }
-
- /**
- * @return HandlerInterface[]
- */
- public function getHandlers()
- {
- return $this->handlers;
- }
-
- /**
- * Adds a processor on to the stack.
- *
- * @param callable $callback
- */
- public function pushProcessor($callback)
- {
- if (!is_callable($callback)) {
- throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
- }
- array_unshift($this->processors, $callback);
- }
-
- /**
- * Removes the processor on top of the stack and returns it.
- *
- * @return callable
- */
- public function popProcessor()
- {
- if (!$this->processors) {
- throw new \LogicException('You tried to pop from an empty processor stack.');
- }
-
- return array_shift($this->processors);
- }
-
- /**
- * @return callable[]
- */
- public function getProcessors()
- {
- return $this->processors;
- }
-
- /**
- * Adds a log record.
- *
- * @param integer $level The logging level
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addRecord($level, $message, array $context = array())
- {
- if (!$this->handlers) {
- $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
- }
-
- $levelName = static::getLevelName($level);
-
- // check if any handler will handle this message so we can return early and save cycles
- $handlerKey = null;
- foreach ($this->handlers as $key => $handler) {
- if ($handler->isHandling(array('level' => $level))) {
- $handlerKey = $key;
- break;
- }
- }
-
- if (null === $handlerKey) {
- return false;
- }
-
- if (!static::$timezone) {
- static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
- }
-
- $record = array(
- 'message' => (string) $message,
- 'context' => $context,
- 'level' => $level,
- 'level_name' => $levelName,
- 'channel' => $this->name,
- 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone),
- 'extra' => array(),
- );
-
- foreach ($this->processors as $processor) {
- $record = call_user_func($processor, $record);
- }
- while (isset($this->handlers[$handlerKey]) &&
- false === $this->handlers[$handlerKey]->handle($record)) {
- $handlerKey++;
- }
-
- return true;
- }
-
- /**
- * Adds a log record at the DEBUG level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addDebug($message, array $context = array())
- {
- return $this->addRecord(static::DEBUG, $message, $context);
- }
-
- /**
- * Adds a log record at the INFO level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addInfo($message, array $context = array())
- {
- return $this->addRecord(static::INFO, $message, $context);
- }
-
- /**
- * Adds a log record at the NOTICE level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addNotice($message, array $context = array())
- {
- return $this->addRecord(static::NOTICE, $message, $context);
- }
-
- /**
- * Adds a log record at the WARNING level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addWarning($message, array $context = array())
- {
- return $this->addRecord(static::WARNING, $message, $context);
- }
-
- /**
- * Adds a log record at the ERROR level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addError($message, array $context = array())
- {
- return $this->addRecord(static::ERROR, $message, $context);
- }
-
- /**
- * Adds a log record at the CRITICAL level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addCritical($message, array $context = array())
- {
- return $this->addRecord(static::CRITICAL, $message, $context);
- }
-
- /**
- * Adds a log record at the ALERT level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addAlert($message, array $context = array())
- {
- return $this->addRecord(static::ALERT, $message, $context);
- }
-
- /**
- * Adds a log record at the EMERGENCY level.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function addEmergency($message, array $context = array())
- {
- return $this->addRecord(static::EMERGENCY, $message, $context);
- }
-
- /**
- * Gets all supported logging levels.
- *
- * @return array Assoc array with human-readable level names => level codes.
- */
- public static function getLevels()
- {
- return array_flip(static::$levels);
- }
-
- /**
- * Gets the name of the logging level.
- *
- * @param integer $level
- * @return string
- */
- public static function getLevelName($level)
- {
- if (!isset(static::$levels[$level])) {
- throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
- }
-
- return static::$levels[$level];
- }
-
- /**
- * Converts PSR-3 levels to Monolog ones if necessary
- *
- * @param string|int Level number (monolog) or name (PSR-3)
- * @return int
- */
- public static function toMonologLevel($level)
- {
- if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
- return constant(__CLASS__.'::'.strtoupper($level));
- }
-
- return $level;
- }
-
- /**
- * Checks whether the Logger has a handler that listens on the given level
- *
- * @param integer $level
- * @return Boolean
- */
- public function isHandling($level)
- {
- $record = array(
- 'level' => $level,
- );
-
- foreach ($this->handlers as $handler) {
- if ($handler->isHandling($record)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Adds a log record at an arbitrary level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param mixed $level The log level
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function log($level, $message, array $context = array())
- {
- if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
- $level = constant(__CLASS__.'::'.strtoupper($level));
- }
-
- return $this->addRecord($level, $message, $context);
- }
-
- /**
- * Adds a log record at the DEBUG level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function debug($message, array $context = array())
- {
- return $this->addRecord(static::DEBUG, $message, $context);
- }
-
- /**
- * Adds a log record at the INFO level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function info($message, array $context = array())
- {
- return $this->addRecord(static::INFO, $message, $context);
- }
-
- /**
- * Adds a log record at the NOTICE level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function notice($message, array $context = array())
- {
- return $this->addRecord(static::NOTICE, $message, $context);
- }
-
- /**
- * Adds a log record at the WARNING level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function warn($message, array $context = array())
- {
- return $this->addRecord(static::WARNING, $message, $context);
- }
-
- /**
- * Adds a log record at the WARNING level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function warning($message, array $context = array())
- {
- return $this->addRecord(static::WARNING, $message, $context);
- }
-
- /**
- * Adds a log record at the ERROR level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function err($message, array $context = array())
- {
- return $this->addRecord(static::ERROR, $message, $context);
- }
-
- /**
- * Adds a log record at the ERROR level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function error($message, array $context = array())
- {
- return $this->addRecord(static::ERROR, $message, $context);
- }
-
- /**
- * Adds a log record at the CRITICAL level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function crit($message, array $context = array())
- {
- return $this->addRecord(static::CRITICAL, $message, $context);
- }
-
- /**
- * Adds a log record at the CRITICAL level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function critical($message, array $context = array())
- {
- return $this->addRecord(static::CRITICAL, $message, $context);
- }
-
- /**
- * Adds a log record at the ALERT level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function alert($message, array $context = array())
- {
- return $this->addRecord(static::ALERT, $message, $context);
- }
-
- /**
- * Adds a log record at the EMERGENCY level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function emerg($message, array $context = array())
- {
- return $this->addRecord(static::EMERGENCY, $message, $context);
- }
-
- /**
- * Adds a log record at the EMERGENCY level.
- *
- * This method allows for compatibility with common interfaces.
- *
- * @param string $message The log message
- * @param array $context The log context
- * @return Boolean Whether the record has been processed
- */
- public function emergency($message, array $context = array())
- {
- return $this->addRecord(static::EMERGENCY, $message, $context);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php
deleted file mode 100644
index 1899400d..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\Logger;
-
-/**
- * Injects Git branch and Git commit SHA in all records
- *
- * @author Nick Otter
- * @author Jordi Boggiano
- */
-class GitProcessor
-{
- private $level;
- private static $cache;
-
- public function __construct($level = Logger::DEBUG)
- {
- $this->level = Logger::toMonologLevel($level);
- }
-
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- // return if the level is not high enough
- if ($record['level'] < $this->level) {
- return $record;
- }
-
- $record['extra']['git'] = self::getGitInfo();
-
- return $record;
- }
-
- private static function getGitInfo()
- {
- if (self::$cache) {
- return self::$cache;
- }
-
- $branches = `git branch -v --no-abbrev`;
- if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
- return self::$cache = array(
- 'branch' => $matches[1],
- 'commit' => $matches[2],
- );
- }
-
- return self::$cache = array();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php
deleted file mode 100644
index 294a295c..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\Logger;
-
-/**
- * Injects line/file:class/function where the log message came from
- *
- * Warning: This only works if the handler processes the logs directly.
- * If you put the processor on a handler that is behind a FingersCrossedHandler
- * for example, the processor will only be called once the trigger level is reached,
- * and all the log records will have the same file/line/.. data from the call that
- * triggered the FingersCrossedHandler.
- *
- * @author Jordi Boggiano
- */
-class IntrospectionProcessor
-{
- private $level;
-
- private $skipClassesPartials;
-
- public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\'))
- {
- $this->level = Logger::toMonologLevel($level);
- $this->skipClassesPartials = $skipClassesPartials;
- }
-
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- // return if the level is not high enough
- if ($record['level'] < $this->level) {
- return $record;
- }
-
- $trace = debug_backtrace();
-
- // skip first since it's always the current method
- array_shift($trace);
- // the call_user_func call is also skipped
- array_shift($trace);
-
- $i = 0;
-
- while (isset($trace[$i]['class'])) {
- foreach ($this->skipClassesPartials as $part) {
- if (strpos($trace[$i]['class'], $part) !== false) {
- $i++;
- continue 2;
- }
- }
- break;
- }
-
- // we should have the call source now
- $record['extra'] = array_merge(
- $record['extra'],
- array(
- 'file' => isset($trace[$i-1]['file']) ? $trace[$i-1]['file'] : null,
- 'line' => isset($trace[$i-1]['line']) ? $trace[$i-1]['line'] : null,
- 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null,
- 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null,
- )
- );
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php
deleted file mode 100644
index 552fd709..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Injects memory_get_peak_usage in all records
- *
- * @see Monolog\Processor\MemoryProcessor::__construct() for options
- * @author Rob Jensen
- */
-class MemoryPeakUsageProcessor extends MemoryProcessor
-{
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- $bytes = memory_get_peak_usage($this->realUsage);
- $formatted = $this->formatBytes($bytes);
-
- $record['extra'] = array_merge(
- $record['extra'],
- array(
- 'memory_peak_usage' => $formatted,
- )
- );
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php
deleted file mode 100644
index 0820def4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Some methods that are common for all memory processors
- *
- * @author Rob Jensen
- */
-abstract class MemoryProcessor
-{
- /**
- * @var boolean If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
- */
- protected $realUsage;
-
- /**
- * @var boolean If true, then format memory size to human readable string (MB, KB, B depending on size)
- */
- protected $useFormatting;
-
- /**
- * @param boolean $realUsage Set this to true to get the real size of memory allocated from system.
- * @param boolean $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
- */
- public function __construct($realUsage = true, $useFormatting = true)
- {
- $this->realUsage = (boolean) $realUsage;
- $this->useFormatting = (boolean) $useFormatting;
- }
-
- /**
- * Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
- *
- * @param int $bytes
- * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
- */
- protected function formatBytes($bytes)
- {
- $bytes = (int) $bytes;
-
- if (!$this->useFormatting) {
- return $bytes;
- }
-
- if ($bytes > 1024*1024) {
- return round($bytes/1024/1024, 2).' MB';
- } elseif ($bytes > 1024) {
- return round($bytes/1024, 2).' KB';
- }
-
- return $bytes . ' B';
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php
deleted file mode 100644
index 0c4dd9ab..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Injects memory_get_usage in all records
- *
- * @see Monolog\Processor\MemoryProcessor::__construct() for options
- * @author Rob Jensen
- */
-class MemoryUsageProcessor extends MemoryProcessor
-{
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- $bytes = memory_get_usage($this->realUsage);
- $formatted = $this->formatBytes($bytes);
-
- $record['extra'] = array_merge(
- $record['extra'],
- array(
- 'memory_usage' => $formatted,
- )
- );
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
deleted file mode 100644
index 9d3f5590..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Adds value of getmypid into records
- *
- * @author Andreas Hörnicke
- */
-class ProcessIdProcessor
-{
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- $record['extra']['process_id'] = getmypid();
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
deleted file mode 100644
index c2686ce5..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Processes a record's message according to PSR-3 rules
- *
- * It replaces {foo} with the value from $context['foo']
- *
- * @author Jordi Boggiano
- */
-class PsrLogMessageProcessor
-{
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- if (false === strpos($record['message'], '{')) {
- return $record;
- }
-
- $replacements = array();
- foreach ($record['context'] as $key => $val) {
- if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
- $replacements['{'.$key.'}'] = $val;
- } elseif (is_object($val)) {
- $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
- } else {
- $replacements['{'.$key.'}'] = '['.gettype($val).']';
- }
- }
-
- $record['message'] = strtr($record['message'], $replacements);
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
deleted file mode 100644
index 2784cef4..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Adds a tags array into record
- *
- * @author Martijn Riemers
- */
-class TagProcessor
-{
- private $tags;
-
- public function __construct(array $tags = array())
- {
- $this->tags = $tags;
- }
-
- public function __invoke(array $record)
- {
- $record['extra']['tags'] = $this->tags;
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
deleted file mode 100644
index 80270d08..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Adds a unique identifier into records
- *
- * @author Simon Mönch
- */
-class UidProcessor
-{
- private $uid;
-
- public function __construct($length = 7)
- {
- if (!is_int($length) || $length > 32 || $length < 1) {
- throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
- }
-
- $this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
- }
-
- public function __invoke(array $record)
- {
- $record['extra']['uid'] = $this->uid;
-
- return $record;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/src/composer/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
deleted file mode 100644
index 21f22a6e..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-/**
- * Injects url/method and remote IP of the current web request in all records
- *
- * @author Jordi Boggiano
- */
-class WebProcessor
-{
- /**
- * @var array|\ArrayAccess
- */
- protected $serverData;
-
- /**
- * @var array
- */
- protected $extraFields = array(
- 'url' => 'REQUEST_URI',
- 'ip' => 'REMOTE_ADDR',
- 'http_method' => 'REQUEST_METHOD',
- 'server' => 'SERVER_NAME',
- 'referrer' => 'HTTP_REFERER',
- );
-
- /**
- * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data
- * @param array|null $extraFields Extra field names to be added (all available by default)
- */
- public function __construct($serverData = null, array $extraFields = null)
- {
- if (null === $serverData) {
- $this->serverData = &$_SERVER;
- } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) {
- $this->serverData = $serverData;
- } else {
- throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.');
- }
-
- if (null !== $extraFields) {
- foreach (array_keys($this->extraFields) as $fieldName) {
- if (!in_array($fieldName, $extraFields)) {
- unset($this->extraFields[$fieldName]);
- }
- }
- }
- }
-
- /**
- * @param array $record
- * @return array
- */
- public function __invoke(array $record)
- {
- // skip processing if for some reason request data
- // is not present (CLI or wonky SAPIs)
- if (!isset($this->serverData['REQUEST_URI'])) {
- return $record;
- }
-
- $record['extra'] = $this->appendExtraFields($record['extra']);
-
- return $record;
- }
-
- /**
- * @param string $extraName
- * @param string $serverName
- * @return $this
- */
- public function addExtraField($extraName, $serverName)
- {
- $this->extraFields[$extraName] = $serverName;
-
- return $this;
- }
-
- /**
- * @param array $extra
- * @return array
- */
- private function appendExtraFields(array $extra)
- {
- foreach ($this->extraFields as $extraName => $serverName) {
- $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
- }
-
- if (isset($this->serverData['UNIQUE_ID'])) {
- $extra['unique_id'] = $this->serverData['UNIQUE_ID'];
- }
-
- return $extra;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/src/Monolog/Registry.php b/src/composer/vendor/monolog/monolog/src/Monolog/Registry.php
deleted file mode 100644
index 923b7745..00000000
--- a/src/composer/vendor/monolog/monolog/src/Monolog/Registry.php
+++ /dev/null
@@ -1,134 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use InvalidArgumentException;
-
-/**
- * Monolog log registry
- *
- * Allows to get `Logger` instances in the global scope
- * via static method calls on this class.
- *
- *
- * $application = new Monolog\Logger('application');
- * $api = new Monolog\Logger('api');
- *
- * Monolog\Registry::addLogger($application);
- * Monolog\Registry::addLogger($api);
- *
- * function testLogger()
- * {
- * Monolog\Registry::api()->addError('Sent to $api Logger instance');
- * Monolog\Registry::application()->addError('Sent to $application Logger instance');
- * }
- *
- *
- * @author Tomas Tatarko
- */
-class Registry
-{
- /**
- * List of all loggers in the registry (ba named indexes)
- *
- * @var Logger[]
- */
- private static $loggers = array();
-
- /**
- * Adds new logging channel to the registry
- *
- * @param Logger $logger Instance of the logging channel
- * @param string|null $name Name of the logging channel ($logger->getName() by default)
- * @param boolean $overwrite Overwrite instance in the registry if the given name already exists?
- * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
- */
- public static function addLogger(Logger $logger, $name = null, $overwrite = false)
- {
- $name = $name ?: $logger->getName();
-
- if (isset(self::$loggers[$name]) && !$overwrite) {
- throw new InvalidArgumentException('Logger with the given name already exists');
- }
-
- self::$loggers[$name] = $logger;
- }
-
- /**
- * Checks if such logging channel exists by name or instance
- *
- * @param string|Logger $logger Name or logger instance
- */
- public static function hasLogger($logger)
- {
- if ($logger instanceof Logger) {
- $index = array_search($logger, self::$loggers, true);
-
- return false !== $index;
- } else {
- return isset(self::$loggers[$logger]);
- }
- }
-
- /**
- * Removes instance from registry by name or instance
- *
- * @param string|Logger $logger Name or logger instance
- */
- public static function removeLogger($logger)
- {
- if ($logger instanceof Logger) {
- if (false !== ($idx = array_search($logger, self::$loggers, true))) {
- unset(self::$loggers[$idx]);
- }
- } else {
- unset(self::$loggers[$logger]);
- }
- }
-
- /**
- * Clears the registry
- */
- public static function clear()
- {
- self::$loggers = array();
- }
-
- /**
- * Gets Logger instance from the registry
- *
- * @param string $name Name of the requested Logger instance
- * @return Logger Requested instance of Logger
- * @throws \InvalidArgumentException If named Logger instance is not in the registry
- */
- public static function getInstance($name)
- {
- if (!isset(self::$loggers[$name])) {
- throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name));
- }
-
- return self::$loggers[$name];
- }
-
- /**
- * Gets Logger instance from the registry via static method call
- *
- * @param string $name Name of the requested Logger instance
- * @param array $arguments Arguments passed to static method call
- * @return Logger Requested instance of Logger
- * @throws \InvalidArgumentException If named Logger instance is not in the registry
- */
- public static function __callStatic($name, $arguments)
- {
- return self::getInstance($name);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php
deleted file mode 100644
index a9a3f301..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use Monolog\Handler\TestHandler;
-
-class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
-{
- public function testHandleError()
- {
- $logger = new Logger('test', array($handler = new TestHandler));
- $errHandler = new ErrorHandler($logger);
-
- $errHandler->registerErrorHandler(array(E_USER_NOTICE => Logger::EMERGENCY), false);
- trigger_error('Foo', E_USER_ERROR);
- $this->assertCount(1, $handler->getRecords());
- $this->assertTrue($handler->hasErrorRecords());
- trigger_error('Foo', E_USER_NOTICE);
- $this->assertCount(2, $handler->getRecords());
- $this->assertTrue($handler->hasEmergencyRecords());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php
deleted file mode 100644
index e7f7334e..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @covers Monolog\Formatter\ChromePHPFormatter::format
- */
- public function testDefaultFormat()
- {
- $formatter = new ChromePHPFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('ip' => '127.0.0.1'),
- 'message' => 'log',
- );
-
- $message = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'meh',
- array(
- 'message' => 'log',
- 'context' => array('from' => 'logger'),
- 'extra' => array('ip' => '127.0.0.1'),
- ),
- 'unknown',
- 'error'
- ),
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\ChromePHPFormatter::format
- */
- public function testFormatWithFileAndLine()
- {
- $formatter = new ChromePHPFormatter();
- $record = array(
- 'level' => Logger::CRITICAL,
- 'level_name' => 'CRITICAL',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14),
- 'message' => 'log',
- );
-
- $message = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'meh',
- array(
- 'message' => 'log',
- 'context' => array('from' => 'logger'),
- 'extra' => array('ip' => '127.0.0.1'),
- ),
- 'test : 14',
- 'error'
- ),
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\ChromePHPFormatter::format
- */
- public function testFormatWithoutContext()
- {
- $formatter = new ChromePHPFormatter();
- $record = array(
- 'level' => Logger::DEBUG,
- 'level_name' => 'DEBUG',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $message = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'meh',
- 'log',
- 'unknown',
- 'log'
- ),
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\ChromePHPFormatter::formatBatch
- */
- public function testBatchFormatThrowException()
- {
- $formatter = new ChromePHPFormatter();
- $records = array(
- array(
- 'level' => Logger::INFO,
- 'level_name' => 'INFO',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- ),
- array(
- 'level' => Logger::WARNING,
- 'level_name' => 'WARNING',
- 'channel' => 'foo',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log2',
- ),
- );
-
- $this->assertEquals(
- array(
- array(
- 'meh',
- 'log',
- 'unknown',
- 'info'
- ),
- array(
- 'foo',
- 'log2',
- 'unknown',
- 'warn'
- ),
- ),
- $formatter->formatBatch($records)
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php
deleted file mode 100644
index 546e5c26..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- if (!class_exists("Elastica\Document")) {
- $this->markTestSkipped("ruflin/elastica not installed");
- }
- }
-
- /**
- * @covers Monolog\Formatter\ElasticaFormatter::__construct
- * @covers Monolog\Formatter\ElasticaFormatter::format
- * @covers Monolog\Formatter\ElasticaFormatter::getDocument
- */
- public function testFormat()
- {
- // test log message
- $msg = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- // expected values
- $expected = $msg;
- $expected['datetime'] = '1970-01-01T00:00:00+0000';
- $expected['context'] = array(
- 'class' => '[object] (stdClass: {})',
- 'foo' => 7,
- 0 => 'bar',
- );
-
- // format log message
- $formatter = new ElasticaFormatter('my_index', 'doc_type');
- $doc = $formatter->format($msg);
- $this->assertInstanceOf('Elastica\Document', $doc);
-
- // Document parameters
- $params = $doc->getParams();
- $this->assertEquals('my_index', $params['_index']);
- $this->assertEquals('doc_type', $params['_type']);
-
- // Document data values
- $data = $doc->getData();
- foreach (array_keys($expected) as $key) {
- $this->assertEquals($expected[$key], $data[$key]);
- }
- }
-
- /**
- * @covers Monolog\Formatter\ElasticaFormatter::getIndex
- * @covers Monolog\Formatter\ElasticaFormatter::getType
- */
- public function testGetters()
- {
- $formatter = new ElasticaFormatter('my_index', 'doc_type');
- $this->assertEquals('my_index', $formatter->getIndex());
- $this->assertEquals('doc_type', $formatter->getType());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php
deleted file mode 100644
index 1b2fd97a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-use Monolog\TestCase;
-
-class FlowdockFormatterTest extends TestCase
-{
- /**
- * @covers Monolog\Formatter\FlowdockFormatter::format
- */
- public function testFormat()
- {
- $formatter = new FlowdockFormatter('test_source', 'source@test.com');
- $record = $this->getRecord();
-
- $expected = array(
- 'source' => 'test_source',
- 'from_address' => 'source@test.com',
- 'subject' => 'in test_source: WARNING - test',
- 'content' => 'test',
- 'tags' => array('#logs', '#warning', '#test'),
- 'project' => 'test_source',
- );
- $formatted = $formatter->format($record);
-
- $this->assertEquals($expected, $formatted['flowdock']);
- }
-
- /**
- * @ covers Monolog\Formatter\FlowdockFormatter::formatBatch
- */
- public function testFormatBatch()
- {
- $formatter = new FlowdockFormatter('test_source', 'source@test.com');
- $records = array(
- $this->getRecord(Logger::WARNING),
- $this->getRecord(Logger::DEBUG),
- );
- $formatted = $formatter->formatBatch($records);
-
- $this->assertArrayHasKey('flowdock', $formatted[0]);
- $this->assertArrayHasKey('flowdock', $formatted[1]);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php
deleted file mode 100644
index 6ac14854..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php
+++ /dev/null
@@ -1,204 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- if (!class_exists('\Gelf\Message')) {
- $this->markTestSkipped("graylog2/gelf-php or mlehner/gelf-php is not installed");
- }
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- */
- public function testDefaultFormatter()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
- $this->assertEquals(0, $message->getTimestamp());
- $this->assertEquals('log', $message->getShortMessage());
- $this->assertEquals('meh', $message->getFacility());
- $this->assertEquals(null, $message->getLine());
- $this->assertEquals(null, $message->getFile());
- $this->assertEquals($this->isLegacy() ? 3 : 'error', $message->getLevel());
- $this->assertNotEmpty($message->getHost());
-
- $formatter = new GelfMessageFormatter('mysystem');
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
- $this->assertEquals('mysystem', $message->getHost());
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- */
- public function testFormatWithFileAndLine()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('file' => 'test', 'line' => 14),
- 'message' => 'log',
- );
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
- $this->assertEquals('test', $message->getFile());
- $this->assertEquals(14, $message->getLine());
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- * @expectedException InvalidArgumentException
- */
- public function testFormatInvalidFails()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- );
-
- $formatter->format($record);
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- */
- public function testFormatWithContext()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
-
- $message_array = $message->toArray();
-
- $this->assertArrayHasKey('_ctxt_from', $message_array);
- $this->assertEquals('logger', $message_array['_ctxt_from']);
-
- // Test with extraPrefix
- $formatter = new GelfMessageFormatter(null, null, 'CTX');
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
-
- $message_array = $message->toArray();
-
- $this->assertArrayHasKey('_CTXfrom', $message_array);
- $this->assertEquals('logger', $message_array['_CTXfrom']);
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- */
- public function testFormatWithContextContainingException()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger', 'exception' => array(
- 'class' => '\Exception',
- 'file' => '/some/file/in/dir.php:56',
- 'trace' => array('/some/file/1.php:23', '/some/file/2.php:3')
- )),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log'
- );
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
-
- $this->assertEquals("/some/file/in/dir.php", $message->getFile());
- $this->assertEquals("56", $message->getLine());
- }
-
- /**
- * @covers Monolog\Formatter\GelfMessageFormatter::format
- */
- public function testFormatWithExtra()
- {
- $formatter = new GelfMessageFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
-
- $message_array = $message->toArray();
-
- $this->assertArrayHasKey('_key', $message_array);
- $this->assertEquals('pair', $message_array['_key']);
-
- // Test with extraPrefix
- $formatter = new GelfMessageFormatter(null, 'EXT');
- $message = $formatter->format($record);
-
- $this->assertInstanceOf('Gelf\Message', $message);
-
- $message_array = $message->toArray();
-
- $this->assertArrayHasKey('_EXTkey', $message_array);
- $this->assertEquals('pair', $message_array['_EXTkey']);
- }
-
- private function isLegacy()
- {
- return interface_exists('\Gelf\IMessagePublisher');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php
deleted file mode 100644
index 69e20077..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-use Monolog\TestCase;
-
-class JsonFormatterTest extends TestCase
-{
- /**
- * @covers Monolog\Formatter\JsonFormatter::__construct
- * @covers Monolog\Formatter\JsonFormatter::getBatchMode
- * @covers Monolog\Formatter\JsonFormatter::isAppendingNewlines
- */
- public function testConstruct()
- {
- $formatter = new JsonFormatter();
- $this->assertEquals(JsonFormatter::BATCH_MODE_JSON, $formatter->getBatchMode());
- $this->assertEquals(true, $formatter->isAppendingNewlines());
- $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES, false);
- $this->assertEquals(JsonFormatter::BATCH_MODE_NEWLINES, $formatter->getBatchMode());
- $this->assertEquals(false, $formatter->isAppendingNewlines());
- }
-
- /**
- * @covers Monolog\Formatter\JsonFormatter::format
- */
- public function testFormat()
- {
- $formatter = new JsonFormatter();
- $record = $this->getRecord();
- $this->assertEquals(json_encode($record)."\n", $formatter->format($record));
-
- $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
- $record = $this->getRecord();
- $this->assertEquals(json_encode($record), $formatter->format($record));
- }
-
- /**
- * @covers Monolog\Formatter\JsonFormatter::formatBatch
- * @covers Monolog\Formatter\JsonFormatter::formatBatchJson
- */
- public function testFormatBatch()
- {
- $formatter = new JsonFormatter();
- $records = array(
- $this->getRecord(Logger::WARNING),
- $this->getRecord(Logger::DEBUG),
- );
- $this->assertEquals(json_encode($records), $formatter->formatBatch($records));
- }
-
- /**
- * @covers Monolog\Formatter\JsonFormatter::formatBatch
- * @covers Monolog\Formatter\JsonFormatter::formatBatchNewlines
- */
- public function testFormatBatchNewlines()
- {
- $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES);
- $records = $expected = array(
- $this->getRecord(Logger::WARNING),
- $this->getRecord(Logger::DEBUG),
- );
- array_walk($expected, function (&$value, $key) {
- $value = json_encode($value);
- });
- $this->assertEquals(implode("\n", $expected), $formatter->formatBatch($records));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php
deleted file mode 100644
index 89e1ca2e..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php
+++ /dev/null
@@ -1,208 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * @covers Monolog\Formatter\LineFormatter
- */
-class LineFormatterTest extends \PHPUnit_Framework_TestCase
-{
- public function testDefFormatWithString()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'WARNING',
- 'channel' => 'log',
- 'context' => array(),
- 'message' => 'foo',
- 'datetime' => new \DateTime,
- 'extra' => array(),
- ));
- $this->assertEquals('['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message);
- }
-
- public function testDefFormatWithArrayContext()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'message' => 'foo',
- 'datetime' => new \DateTime,
- 'extra' => array(),
- 'context' => array(
- 'foo' => 'bar',
- 'baz' => 'qux',
- 'bool' => false,
- 'null' => null,
- )
- ));
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foo {"foo":"bar","baz":"qux","bool":false,"null":null} []'."\n", $message);
- }
-
- public function testDefFormatExtras()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array('ip' => '127.0.0.1'),
- 'message' => 'log',
- ));
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] {"ip":"127.0.0.1"}'."\n", $message);
- }
-
- public function testFormatExtras()
- {
- $formatter = new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra.file% %extra%\n", 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array('ip' => '127.0.0.1', 'file' => 'test'),
- 'message' => 'log',
- ));
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] test {"ip":"127.0.0.1"}'."\n", $message);
- }
-
- public function testContextAndExtraOptionallyNotShownIfEmpty()
- {
- $formatter = new LineFormatter(null, 'Y-m-d', false, true);
- $message = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- 'message' => 'log',
- ));
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log '."\n", $message);
- }
-
- public function testDefFormatWithObject()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array('foo' => new TestFoo, 'bar' => new TestBar, 'baz' => array(), 'res' => fopen('php://memory', 'rb')),
- 'message' => 'foobar',
- ));
-
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foobar [] {"foo":"[object] (Monolog\\\\Formatter\\\\TestFoo: {\\"foo\\":\\"foo\\"})","bar":"[object] (Monolog\\\\Formatter\\\\TestBar: {})","baz":[],"res":"[resource]"}'."\n", $message);
- }
-
- public function testDefFormatWithException()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(array(
- 'level_name' => 'CRITICAL',
- 'channel' => 'core',
- 'context' => array('exception' => new \RuntimeException('Foo')),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- 'message' => 'foobar',
- ));
-
- $path = str_replace('\\/', '/', json_encode(__FILE__));
-
- $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__-8).')"} []'."\n", $message);
- }
-
- public function testDefFormatWithPreviousException()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $previous = new \LogicException('Wut?');
- $message = $formatter->format(array(
- 'level_name' => 'CRITICAL',
- 'channel' => 'core',
- 'context' => array('exception' => new \RuntimeException('Foo', 0, $previous)),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- 'message' => 'foobar',
- ));
-
- $path = str_replace('\\/', '/', json_encode(__FILE__));
-
- $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__-8).', LogicException(code: 0): Wut? at '.substr($path, 1, -1).':'.(__LINE__-12).')"} []'."\n", $message);
- }
-
- public function testBatchFormat()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->formatBatch(array(
- array(
- 'level_name' => 'CRITICAL',
- 'channel' => 'test',
- 'message' => 'bar',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- ),
- array(
- 'level_name' => 'WARNING',
- 'channel' => 'log',
- 'message' => 'foo',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- ),
- ));
- $this->assertEquals('['.date('Y-m-d').'] test.CRITICAL: bar [] []'."\n".'['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message);
- }
-
- public function testFormatShouldStripInlineLineBreaks()
- {
- $formatter = new LineFormatter(null, 'Y-m-d');
- $message = $formatter->format(
- array(
- 'message' => "foo\nbar",
- 'context' => array(),
- 'extra' => array(),
- )
- );
-
- $this->assertRegExp('/foo bar/', $message);
- }
-
- public function testFormatShouldNotStripInlineLineBreaksWhenFlagIsSet()
- {
- $formatter = new LineFormatter(null, 'Y-m-d', true);
- $message = $formatter->format(
- array(
- 'message' => "foo\nbar",
- 'context' => array(),
- 'extra' => array(),
- )
- );
-
- $this->assertRegExp('/foo\nbar/', $message);
- }
-}
-
-class TestFoo
-{
- public $foo = 'foo';
-}
-
-class TestBar
-{
- public function __toString()
- {
- return 'bar';
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php
deleted file mode 100644
index 6d59b3f3..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\TestCase;
-
-class LogglyFormatterTest extends TestCase
-{
- /**
- * @covers Monolog\Formatter\LogglyFormatter::__construct
- */
- public function testConstruct()
- {
- $formatter = new LogglyFormatter();
- $this->assertEquals(LogglyFormatter::BATCH_MODE_NEWLINES, $formatter->getBatchMode());
- $formatter = new LogglyFormatter(LogglyFormatter::BATCH_MODE_JSON);
- $this->assertEquals(LogglyFormatter::BATCH_MODE_JSON, $formatter->getBatchMode());
- }
-
- /**
- * @covers Monolog\Formatter\LogglyFormatter::format
- */
- public function testFormat()
- {
- $formatter = new LogglyFormatter();
- $record = $this->getRecord();
- $formatted_decoded = json_decode($formatter->format($record), true);
- $this->assertArrayHasKey("timestamp", $formatted_decoded);
- $this->assertEquals(new \DateTime($formatted_decoded["timestamp"]), $record["datetime"]);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php
deleted file mode 100644
index de4a3c2c..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php
+++ /dev/null
@@ -1,289 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testDefaultFormatter()
- {
- $formatter = new LogstashFormatter('test', 'hostname');
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']);
- $this->assertEquals('log', $message['@message']);
- $this->assertEquals('meh', $message['@fields']['channel']);
- $this->assertContains('meh', $message['@tags']);
- $this->assertEquals(Logger::ERROR, $message['@fields']['level']);
- $this->assertEquals('test', $message['@type']);
- $this->assertEquals('hostname', $message['@source']);
-
- $formatter = new LogstashFormatter('mysystem');
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals('mysystem', $message['@type']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithFileAndLine()
- {
- $formatter = new LogstashFormatter('test');
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('file' => 'test', 'line' => 14),
- 'message' => 'log',
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals('test', $message['@fields']['file']);
- $this->assertEquals(14, $message['@fields']['line']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithContext()
- {
- $formatter = new LogstashFormatter('test');
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $message_array = $message['@fields'];
-
- $this->assertArrayHasKey('ctxt_from', $message_array);
- $this->assertEquals('logger', $message_array['ctxt_from']);
-
- // Test with extraPrefix
- $formatter = new LogstashFormatter('test', null, null, 'CTX');
- $message = json_decode($formatter->format($record), true);
-
- $message_array = $message['@fields'];
-
- $this->assertArrayHasKey('CTXfrom', $message_array);
- $this->assertEquals('logger', $message_array['CTXfrom']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithExtra()
- {
- $formatter = new LogstashFormatter('test');
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $message_array = $message['@fields'];
-
- $this->assertArrayHasKey('key', $message_array);
- $this->assertEquals('pair', $message_array['key']);
-
- // Test with extraPrefix
- $formatter = new LogstashFormatter('test', null, 'EXT');
- $message = json_decode($formatter->format($record), true);
-
- $message_array = $message['@fields'];
-
- $this->assertArrayHasKey('EXTkey', $message_array);
- $this->assertEquals('pair', $message_array['EXTkey']);
- }
-
- public function testFormatWithApplicationName()
- {
- $formatter = new LogstashFormatter('app', 'test');
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('@type', $message);
- $this->assertEquals('app', $message['@type']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testDefaultFormatterV1()
- {
- $formatter = new LogstashFormatter('test', 'hostname', null, 'ctxt_', LogstashFormatter::V1);
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']);
- $this->assertEquals("1", $message['@version']);
- $this->assertEquals('log', $message['message']);
- $this->assertEquals('meh', $message['channel']);
- $this->assertEquals('ERROR', $message['level']);
- $this->assertEquals('test', $message['type']);
- $this->assertEquals('hostname', $message['host']);
-
- $formatter = new LogstashFormatter('mysystem', null, null, 'ctxt_', LogstashFormatter::V1);
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals('mysystem', $message['type']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithFileAndLineV1()
- {
- $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1);
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('file' => 'test', 'line' => 14),
- 'message' => 'log',
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertEquals('test', $message['file']);
- $this->assertEquals(14, $message['line']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithContextV1()
- {
- $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1);
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('ctxt_from', $message);
- $this->assertEquals('logger', $message['ctxt_from']);
-
- // Test with extraPrefix
- $formatter = new LogstashFormatter('test', null, null, 'CTX', LogstashFormatter::V1);
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('CTXfrom', $message);
- $this->assertEquals('logger', $message['CTXfrom']);
- }
-
- /**
- * @covers Monolog\Formatter\LogstashFormatter::format
- */
- public function testFormatWithExtraV1()
- {
- $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1);
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('key', $message);
- $this->assertEquals('pair', $message['key']);
-
- // Test with extraPrefix
- $formatter = new LogstashFormatter('test', null, 'EXT', 'ctxt_', LogstashFormatter::V1);
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('EXTkey', $message);
- $this->assertEquals('pair', $message['EXTkey']);
- }
-
- public function testFormatWithApplicationNameV1()
- {
- $formatter = new LogstashFormatter('app', 'test', null, 'ctxt_', LogstashFormatter::V1);
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('key' => 'pair'),
- 'message' => 'log'
- );
-
- $message = json_decode($formatter->format($record), true);
-
- $this->assertArrayHasKey('type', $message);
- $this->assertEquals('app', $message['type']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php
deleted file mode 100644
index 1554ef46..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php
+++ /dev/null
@@ -1,253 +0,0 @@
-
- */
-class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- if (!class_exists('MongoDate')) {
- $this->markTestSkipped('mongo extension not installed');
- }
- }
-
- public function constructArgumentProvider()
- {
- return array(
- array(1, true, 1, true),
- array(0, false, 0, false),
- );
- }
-
- /**
- * @param $traceDepth
- * @param $traceAsString
- * @param $expectedTraceDepth
- * @param $expectedTraceAsString
- *
- * @dataProvider constructArgumentProvider
- */
- public function testConstruct($traceDepth, $traceAsString, $expectedTraceDepth, $expectedTraceAsString)
- {
- $formatter = new MongoDBFormatter($traceDepth, $traceAsString);
-
- $reflTrace = new \ReflectionProperty($formatter, 'exceptionTraceAsString');
- $reflTrace->setAccessible(true);
- $this->assertEquals($expectedTraceAsString, $reflTrace->getValue($formatter));
-
- $reflDepth = new\ReflectionProperty($formatter, 'maxNestingLevel');
- $reflDepth->setAccessible(true);
- $this->assertEquals($expectedTraceDepth, $reflDepth->getValue($formatter));
- }
-
- public function testSimpleFormat()
- {
- $record = array(
- 'message' => 'some log message',
- 'context' => array(),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter();
- $formattedRecord = $formatter->format($record);
-
- $this->assertCount(7, $formattedRecord);
- $this->assertEquals('some log message', $formattedRecord['message']);
- $this->assertEquals(array(), $formattedRecord['context']);
- $this->assertEquals(Logger::WARNING, $formattedRecord['level']);
- $this->assertEquals(Logger::getLevelName(Logger::WARNING), $formattedRecord['level_name']);
- $this->assertEquals('test', $formattedRecord['channel']);
- $this->assertInstanceOf('\MongoDate', $formattedRecord['datetime']);
- $this->assertEquals('0.00000000 1391212800', $formattedRecord['datetime']->__toString());
- $this->assertEquals(array(), $formattedRecord['extra']);
- }
-
- public function testRecursiveFormat()
- {
- $someObject = new \stdClass();
- $someObject->foo = 'something';
- $someObject->bar = 'stuff';
-
- $record = array(
- 'message' => 'some log message',
- 'context' => array(
- 'stuff' => new \DateTime('2014-02-01 02:31:33'),
- 'some_object' => $someObject,
- 'context_string' => 'some string',
- 'context_int' => 123456,
- 'except' => new \Exception('exception message', 987),
- ),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter();
- $formattedRecord = $formatter->format($record);
-
- $this->assertCount(5, $formattedRecord['context']);
- $this->assertInstanceOf('\MongoDate', $formattedRecord['context']['stuff']);
- $this->assertEquals('0.00000000 1391221893', $formattedRecord['context']['stuff']->__toString());
- $this->assertEquals(
- array(
- 'foo' => 'something',
- 'bar' => 'stuff',
- 'class' => 'stdClass',
- ),
- $formattedRecord['context']['some_object']
- );
- $this->assertEquals('some string', $formattedRecord['context']['context_string']);
- $this->assertEquals(123456, $formattedRecord['context']['context_int']);
-
- $this->assertCount(5, $formattedRecord['context']['except']);
- $this->assertEquals('exception message', $formattedRecord['context']['except']['message']);
- $this->assertEquals(987, $formattedRecord['context']['except']['code']);
- $this->assertInternalType('string', $formattedRecord['context']['except']['file']);
- $this->assertInternalType('integer', $formattedRecord['context']['except']['code']);
- $this->assertInternalType('string', $formattedRecord['context']['except']['trace']);
- $this->assertEquals('Exception', $formattedRecord['context']['except']['class']);
- }
-
- public function testFormatDepthArray()
- {
- $record = array(
- 'message' => 'some log message',
- 'context' => array(
- 'nest2' => array(
- 'property' => 'anything',
- 'nest3' => array(
- 'nest4' => 'value',
- 'property' => 'nothing'
- )
- )
- ),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter(2);
- $formattedResult = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'nest2' => array(
- 'property' => 'anything',
- 'nest3' => '[...]',
- )
- ),
- $formattedResult['context']
- );
- }
-
- public function testFormatDepthArrayInfiniteNesting()
- {
- $record = array(
- 'message' => 'some log message',
- 'context' => array(
- 'nest2' => array(
- 'property' => 'something',
- 'nest3' => array(
- 'property' => 'anything',
- 'nest4' => array(
- 'property' => 'nothing',
- ),
- )
- )
- ),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter(0);
- $formattedResult = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'nest2' => array(
- 'property' => 'something',
- 'nest3' => array(
- 'property' => 'anything',
- 'nest4' => array(
- 'property' => 'nothing',
- )
- ),
- )
- ),
- $formattedResult['context']
- );
- }
-
- public function testFormatDepthObjects()
- {
- $someObject = new \stdClass();
- $someObject->property = 'anything';
- $someObject->nest3 = new \stdClass();
- $someObject->nest3->property = 'nothing';
- $someObject->nest3->nest4 = 'invisible';
-
- $record = array(
- 'message' => 'some log message',
- 'context' => array(
- 'nest2' => $someObject
- ),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter(2, true);
- $formattedResult = $formatter->format($record);
-
- $this->assertEquals(
- array(
- 'nest2' => array(
- 'property' => 'anything',
- 'nest3' => '[...]',
- 'class' => 'stdClass',
- ),
- ),
- $formattedResult['context']
- );
- }
-
- public function testFormatDepthException()
- {
- $record = array(
- 'message' => 'some log message',
- 'context' => array(
- 'nest2' => new \Exception('exception message', 987),
- ),
- 'level' => Logger::WARNING,
- 'level_name' => Logger::getLevelName(Logger::WARNING),
- 'channel' => 'test',
- 'datetime' => new \DateTime('2014-02-01 00:00:00'),
- 'extra' => array(),
- );
-
- $formatter = new MongoDBFormatter(2, false);
- $formattedRecord = $formatter->format($record);
-
- $this->assertEquals('exception message', $formattedRecord['context']['nest2']['message']);
- $this->assertEquals(987, $formattedRecord['context']['nest2']['code']);
- $this->assertEquals('[...]', $formattedRecord['context']['nest2']['trace']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php
deleted file mode 100644
index 75dae895..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php
+++ /dev/null
@@ -1,253 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-/**
- * @covers Monolog\Formatter\NormalizerFormatter
- */
-class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
-{
- public function testFormat()
- {
- $formatter = new NormalizerFormatter('Y-m-d');
- $formatted = $formatter->format(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'message' => 'foo',
- 'datetime' => new \DateTime,
- 'extra' => array('foo' => new TestFooNorm, 'bar' => new TestBarNorm, 'baz' => array(), 'res' => fopen('php://memory', 'rb')),
- 'context' => array(
- 'foo' => 'bar',
- 'baz' => 'qux',
- 'inf' => INF,
- '-inf' => -INF,
- 'nan' => acos(4),
- ),
- ));
-
- $this->assertEquals(array(
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'message' => 'foo',
- 'datetime' => date('Y-m-d'),
- 'extra' => array(
- 'foo' => '[object] (Monolog\\Formatter\\TestFooNorm: {"foo":"foo"})',
- 'bar' => '[object] (Monolog\\Formatter\\TestBarNorm: {})',
- 'baz' => array(),
- 'res' => '[resource]',
- ),
- 'context' => array(
- 'foo' => 'bar',
- 'baz' => 'qux',
- 'inf' => 'INF',
- '-inf' => '-INF',
- 'nan' => 'NaN',
- )
- ), $formatted);
- }
-
- public function testFormatExceptions()
- {
- $formatter = new NormalizerFormatter('Y-m-d');
- $e = new \LogicException('bar');
- $e2 = new \RuntimeException('foo', 0, $e);
- $formatted = $formatter->format(array(
- 'exception' => $e2,
- ));
-
- $this->assertGreaterThan(5, count($formatted['exception']['trace']));
- $this->assertTrue(isset($formatted['exception']['previous']));
- unset($formatted['exception']['trace'], $formatted['exception']['previous']);
-
- $this->assertEquals(array(
- 'exception' => array(
- 'class' => get_class($e2),
- 'message' => $e2->getMessage(),
- 'code' => $e2->getCode(),
- 'file' => $e2->getFile().':'.$e2->getLine(),
- )
- ), $formatted);
- }
-
- public function testBatchFormat()
- {
- $formatter = new NormalizerFormatter('Y-m-d');
- $formatted = $formatter->formatBatch(array(
- array(
- 'level_name' => 'CRITICAL',
- 'channel' => 'test',
- 'message' => 'bar',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- ),
- array(
- 'level_name' => 'WARNING',
- 'channel' => 'log',
- 'message' => 'foo',
- 'context' => array(),
- 'datetime' => new \DateTime,
- 'extra' => array(),
- ),
- ));
- $this->assertEquals(array(
- array(
- 'level_name' => 'CRITICAL',
- 'channel' => 'test',
- 'message' => 'bar',
- 'context' => array(),
- 'datetime' => date('Y-m-d'),
- 'extra' => array(),
- ),
- array(
- 'level_name' => 'WARNING',
- 'channel' => 'log',
- 'message' => 'foo',
- 'context' => array(),
- 'datetime' => date('Y-m-d'),
- 'extra' => array(),
- ),
- ), $formatted);
- }
-
- /**
- * Test issue #137
- */
- public function testIgnoresRecursiveObjectReferences()
- {
- // set up the recursion
- $foo = new \stdClass();
- $bar = new \stdClass();
-
- $foo->bar = $bar;
- $bar->foo = $foo;
-
- // set an error handler to assert that the error is not raised anymore
- $that = $this;
- set_error_handler(function ($level, $message, $file, $line, $context) use ($that) {
- if (error_reporting() & $level) {
- restore_error_handler();
- $that->fail("$message should not be raised");
- }
- });
-
- $formatter = new NormalizerFormatter();
- $reflMethod = new \ReflectionMethod($formatter, 'toJson');
- $reflMethod->setAccessible(true);
- $res = $reflMethod->invoke($formatter, array($foo, $bar), true);
-
- restore_error_handler();
-
- $this->assertEquals(@json_encode(array($foo, $bar)), $res);
- }
-
- public function testIgnoresInvalidTypes()
- {
- // set up the recursion
- $resource = fopen(__FILE__, 'r');
-
- // set an error handler to assert that the error is not raised anymore
- $that = $this;
- set_error_handler(function ($level, $message, $file, $line, $context) use ($that) {
- if (error_reporting() & $level) {
- restore_error_handler();
- $that->fail("$message should not be raised");
- }
- });
-
- $formatter = new NormalizerFormatter();
- $reflMethod = new \ReflectionMethod($formatter, 'toJson');
- $reflMethod->setAccessible(true);
- $res = $reflMethod->invoke($formatter, array($resource), true);
-
- restore_error_handler();
-
- $this->assertEquals(@json_encode(array($resource)), $res);
- }
-
- public function testExceptionTraceWithArgs()
- {
- if (defined('HHVM_VERSION')) {
- $this->markTestSkipped('Not supported in HHVM since it detects errors differently');
- }
-
- // This happens i.e. in React promises or Guzzle streams where stream wrappers are registered
- // and no file or line are included in the trace because it's treated as internal function
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
- });
-
- try {
- // This will contain $resource and $wrappedResource as arguments in the trace item
- $resource = fopen('php://memory', 'rw+');
- fwrite($resource, 'test_resource');
- $wrappedResource = new TestStreamFoo($resource);
- // Just do something stupid with a resource/wrapped resource as argument
- array_keys($wrappedResource);
- } catch (\Exception $e) {
- restore_error_handler();
- }
-
- $formatter = new NormalizerFormatter();
- $record = array('context' => array('exception' => $e));
- $result = $formatter->format($record);
-
- $this->assertRegExp(
- '%"resource":"\[resource\]"%',
- $result['context']['exception']['trace'][0]
- );
-
- if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
- $pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: \)"%';
- } else {
- $pattern = '%\\\\"resource\\\\":null%';
- }
-
- // Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4
- $this->assertRegExp(
- $pattern,
- $result['context']['exception']['trace'][0]
- );
- }
-}
-
-class TestFooNorm
-{
- public $foo = 'foo';
-}
-
-class TestBarNorm
-{
- public function __toString()
- {
- return 'bar';
- }
-}
-
-class TestStreamFoo
-{
- public $foo;
- public $resource;
-
- public function __construct($resource)
- {
- $this->resource = $resource;
- $this->foo = 'BAR';
- }
-
- public function __toString()
- {
- fseek($this->resource, 0);
-
- return $this->foo . ' - ' . (string) stream_get_contents($this->resource);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php
deleted file mode 100644
index c5a4ebb5..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-formatter = new ScalarFormatter();
- }
-
- public function buildTrace(\Exception $e)
- {
- $data = array();
- $trace = $e->getTrace();
- foreach ($trace as $frame) {
- if (isset($frame['file'])) {
- $data[] = $frame['file'].':'.$frame['line'];
- } else {
- $data[] = json_encode($frame);
- }
- }
-
- return $data;
- }
-
- public function encodeJson($data)
- {
- if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
- return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- }
-
- return json_encode($data);
- }
-
- public function testFormat()
- {
- $exception = new \Exception('foo');
- $formatted = $this->formatter->format(array(
- 'foo' => 'string',
- 'bar' => 1,
- 'baz' => false,
- 'bam' => array(1, 2, 3),
- 'bat' => array('foo' => 'bar'),
- 'bap' => \DateTime::createFromFormat(\DateTime::ISO8601, '1970-01-01T00:00:00+0000'),
- 'ban' => $exception
- ));
-
- $this->assertSame(array(
- 'foo' => 'string',
- 'bar' => 1,
- 'baz' => false,
- 'bam' => $this->encodeJson(array(1, 2, 3)),
- 'bat' => $this->encodeJson(array('foo' => 'bar')),
- 'bap' => '1970-01-01 00:00:00',
- 'ban' => $this->encodeJson(array(
- 'class' => get_class($exception),
- 'message' => $exception->getMessage(),
- 'code' => $exception->getCode(),
- 'file' => $exception->getFile() . ':' . $exception->getLine(),
- 'trace' => $this->buildTrace($exception)
- ))
- ), $formatted);
- }
-
- public function testFormatWithErrorContext()
- {
- $context = array('file' => 'foo', 'line' => 1);
- $formatted = $this->formatter->format(array(
- 'context' => $context
- ));
-
- $this->assertSame(array(
- 'context' => $this->encodeJson($context)
- ), $formatted);
- }
-
- public function testFormatWithExceptionContext()
- {
- $exception = new \Exception('foo');
- $formatted = $this->formatter->format(array(
- 'context' => array(
- 'exception' => $exception
- )
- ));
-
- $this->assertSame(array(
- 'context' => $this->encodeJson(array(
- 'exception' => array(
- 'class' => get_class($exception),
- 'message' => $exception->getMessage(),
- 'code' => $exception->getCode(),
- 'file' => $exception->getFile() . ':' . $exception->getLine(),
- 'trace' => $this->buildTrace($exception)
- )
- ))
- ), $formatted);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php
deleted file mode 100644
index 52f15a36..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Formatter;
-
-use Monolog\Logger;
-
-class WildfireFormatterTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @covers Monolog\Formatter\WildfireFormatter::format
- */
- public function testDefaultFormat()
- {
- $wildfire = new WildfireFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('ip' => '127.0.0.1'),
- 'message' => 'log',
- );
-
- $message = $wildfire->format($record);
-
- $this->assertEquals(
- '125|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},'
- .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|',
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\WildfireFormatter::format
- */
- public function testFormatWithFileAndLine()
- {
- $wildfire = new WildfireFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('from' => 'logger'),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14),
- 'message' => 'log',
- );
-
- $message = $wildfire->format($record);
-
- $this->assertEquals(
- '129|[{"Type":"ERROR","File":"test","Line":14,"Label":"meh"},'
- .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|',
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\WildfireFormatter::format
- */
- public function testFormatWithoutContext()
- {
- $wildfire = new WildfireFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $message = $wildfire->format($record);
-
- $this->assertEquals(
- '58|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},"log"]|',
- $message
- );
- }
-
- /**
- * @covers Monolog\Formatter\WildfireFormatter::formatBatch
- * @expectedException BadMethodCallException
- */
- public function testBatchFormatThrowException()
- {
- $wildfire = new WildfireFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array(),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $wildfire->formatBatch(array($record));
- }
-
- /**
- * @covers Monolog\Formatter\WildfireFormatter::format
- */
- public function testTableFormat()
- {
- $wildfire = new WildfireFormatter();
- $record = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'table-channel',
- 'context' => array(
- WildfireFormatter::TABLE => array(
- array('col1', 'col2', 'col3'),
- array('val1', 'val2', 'val3'),
- array('foo1', 'foo2', 'foo3'),
- array('bar1', 'bar2', 'bar3'),
- ),
- ),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'table-message',
- );
-
- $message = $wildfire->format($record);
-
- $this->assertEquals(
- '171|[{"Type":"TABLE","File":"","Line":"","Label":"table-channel: table-message"},[["col1","col2","col3"],["val1","val2","val3"],["foo1","foo2","foo3"],["bar1","bar2","bar3"]]]|',
- $message
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php
deleted file mode 100644
index 568eb9da..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php
+++ /dev/null
@@ -1,115 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-use Monolog\Processor\WebProcessor;
-
-class AbstractHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\AbstractHandler::__construct
- * @covers Monolog\Handler\AbstractHandler::getLevel
- * @covers Monolog\Handler\AbstractHandler::setLevel
- * @covers Monolog\Handler\AbstractHandler::getBubble
- * @covers Monolog\Handler\AbstractHandler::setBubble
- * @covers Monolog\Handler\AbstractHandler::getFormatter
- * @covers Monolog\Handler\AbstractHandler::setFormatter
- */
- public function testConstructAndGetSet()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false));
- $this->assertEquals(Logger::WARNING, $handler->getLevel());
- $this->assertEquals(false, $handler->getBubble());
-
- $handler->setLevel(Logger::ERROR);
- $handler->setBubble(true);
- $handler->setFormatter($formatter = new LineFormatter);
- $this->assertEquals(Logger::ERROR, $handler->getLevel());
- $this->assertEquals(true, $handler->getBubble());
- $this->assertSame($formatter, $handler->getFormatter());
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::handleBatch
- */
- public function testHandleBatch()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
- $handler->expects($this->exactly(2))
- ->method('handle');
- $handler->handleBatch(array($this->getRecord(), $this->getRecord()));
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::isHandling
- */
- public function testIsHandling()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false));
- $this->assertTrue($handler->isHandling($this->getRecord()));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::__construct
- */
- public function testHandlesPsrStyleLevels()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array('warning', false));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
- $handler->setLevel('debug');
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::getFormatter
- * @covers Monolog\Handler\AbstractHandler::getDefaultFormatter
- */
- public function testGetFormatterInitializesDefault()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
- $this->assertInstanceOf('Monolog\Formatter\LineFormatter', $handler->getFormatter());
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::pushProcessor
- * @covers Monolog\Handler\AbstractHandler::popProcessor
- * @expectedException LogicException
- */
- public function testPushPopProcessor()
- {
- $logger = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
- $processor1 = new WebProcessor;
- $processor2 = new WebProcessor;
-
- $logger->pushProcessor($processor1);
- $logger->pushProcessor($processor2);
-
- $this->assertEquals($processor2, $logger->popProcessor());
- $this->assertEquals($processor1, $logger->popProcessor());
- $logger->popProcessor();
- }
-
- /**
- * @covers Monolog\Handler\AbstractHandler::pushProcessor
- * @expectedException InvalidArgumentException
- */
- public function testPushProcessorWithNonCallable()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
-
- $handler->pushProcessor(new \stdClass());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php
deleted file mode 100644
index 24d4f63c..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Processor\WebProcessor;
-
-class AbstractProcessingHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\AbstractProcessingHandler::handle
- */
- public function testHandleLowerLevelMessage()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, true));
- $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\AbstractProcessingHandler::handle
- */
- public function testHandleBubbling()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, true));
- $this->assertFalse($handler->handle($this->getRecord()));
- }
-
- /**
- * @covers Monolog\Handler\AbstractProcessingHandler::handle
- */
- public function testHandleNotBubbling()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, false));
- $this->assertTrue($handler->handle($this->getRecord()));
- }
-
- /**
- * @covers Monolog\Handler\AbstractProcessingHandler::handle
- */
- public function testHandleIsFalseWhenNotHandled()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, false));
- $this->assertTrue($handler->handle($this->getRecord()));
- $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\AbstractProcessingHandler::processRecord
- */
- public function testProcessRecord()
- {
- $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler');
- $handler->pushProcessor(new WebProcessor(array(
- 'REQUEST_URI' => '',
- 'REQUEST_METHOD' => '',
- 'REMOTE_ADDR' => '',
- 'SERVER_NAME' => '',
- 'UNIQUE_ID' => '',
- )));
- $handledRecord = null;
- $handler->expects($this->once())
- ->method('write')
- ->will($this->returnCallback(function ($record) use (&$handledRecord) {
- $handledRecord = $record;
- }))
- ;
- $handler->handle($this->getRecord());
- $this->assertEquals(6, count($handledRecord['extra']));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php
deleted file mode 100644
index 074d50c6..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use PhpAmqpLib\Message\AMQPMessage;
-use PhpAmqpLib\Channel\AMQPChannel;
-use PhpAmqpLib\Connection\AMQPConnection;
-
-/**
- * @covers Monolog\Handler\RotatingFileHandler
- */
-class AmqpHandlerTest extends TestCase
-{
- public function testHandleAmqpExt()
- {
- if (!class_exists('AMQPConnection') || !class_exists('AMQPExchange')) {
- $this->markTestSkipped("amqp-php not installed");
- }
-
- if (!class_exists('AMQPChannel')) {
- $this->markTestSkipped("Please update AMQP to version >= 1.0");
- }
-
- $messages = array();
-
- $exchange = $this->getMock('AMQPExchange', array('publish', 'setName'), array(), '', false);
- $exchange->expects($this->once())
- ->method('setName')
- ->with('log')
- ;
- $exchange->expects($this->any())
- ->method('publish')
- ->will($this->returnCallback(function ($message, $routing_key, $flags = 0, $attributes = array()) use (&$messages) {
- $messages[] = array($message, $routing_key, $flags, $attributes);
- }))
- ;
-
- $handler = new AmqpHandler($exchange, 'log');
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $expected = array(
- array(
- 'message' => 'test',
- 'context' => array(
- 'data' => array(),
- 'foo' => 34,
- ),
- 'level' => 300,
- 'level_name' => 'WARNING',
- 'channel' => 'test',
- 'extra' => array(),
- ),
- 'warn.test',
- 0,
- array(
- 'delivery_mode' => 2,
- 'Content-type' => 'application/json'
- )
- );
-
- $handler->handle($record);
-
- $this->assertCount(1, $messages);
- $messages[0][0] = json_decode($messages[0][0], true);
- unset($messages[0][0]['datetime']);
- $this->assertEquals($expected, $messages[0]);
- }
-
- public function testHandlePhpAmqpLib()
- {
- if (!class_exists('PhpAmqpLib\Connection\AMQPConnection')) {
- $this->markTestSkipped("php-amqplib not installed");
- }
-
- $messages = array();
-
- $exchange = $this->getMock('PhpAmqpLib\Channel\AMQPChannel', array('basic_publish', '__destruct'), array(), '', false);
-
- $exchange->expects($this->any())
- ->method('basic_publish')
- ->will($this->returnCallback(function (AMQPMessage $msg, $exchange = "", $routing_key = "", $mandatory = false, $immediate = false, $ticket = null) use (&$messages) {
- $messages[] = array($msg, $exchange, $routing_key, $mandatory, $immediate, $ticket);
- }))
- ;
-
- $handler = new AmqpHandler($exchange, 'log');
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $expected = array(
- array(
- 'message' => 'test',
- 'context' => array(
- 'data' => array(),
- 'foo' => 34,
- ),
- 'level' => 300,
- 'level_name' => 'WARNING',
- 'channel' => 'test',
- 'extra' => array(),
- ),
- 'log',
- 'warn.test',
- false,
- false,
- null,
- array(
- 'delivery_mode' => 2,
- 'content_type' => 'application/json'
- )
- );
-
- $handler->handle($record);
-
- $this->assertCount(1, $messages);
-
- /* @var $msg AMQPMessage */
- $msg = $messages[0][0];
- $messages[0][0] = json_decode($msg->body, true);
- $messages[0][] = $msg->get_properties();
- unset($messages[0][0]['datetime']);
-
- $this->assertEquals($expected, $messages[0]);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php
deleted file mode 100644
index ffb1d746..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php
+++ /dev/null
@@ -1,130 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\BrowserConsoleHandlerTest
- */
-class BrowserConsoleHandlerTest extends TestCase
-{
- protected function setUp()
- {
- BrowserConsoleHandler::reset();
- }
-
- protected function generateScript()
- {
- $reflMethod = new \ReflectionMethod('Monolog\Handler\BrowserConsoleHandler', 'generateScript');
- $reflMethod->setAccessible(true);
-
- return $reflMethod->invoke(null);
- }
-
- public function testStyling()
- {
- $handler = new BrowserConsoleHandler();
- $handler->setFormatter($this->getIdentityFormatter());
-
- $handler->handle($this->getRecord(Logger::DEBUG, 'foo[[bar]]{color: red}'));
-
- $expected = <<assertEquals($expected, $this->generateScript());
- }
-
- public function testEscaping()
- {
- $handler = new BrowserConsoleHandler();
- $handler->setFormatter($this->getIdentityFormatter());
-
- $handler->handle($this->getRecord(Logger::DEBUG, "[foo] [[\"bar\n[baz]\"]]{color: red}"));
-
- $expected = <<assertEquals($expected, $this->generateScript());
- }
-
- public function testAutolabel()
- {
- $handler = new BrowserConsoleHandler();
- $handler->setFormatter($this->getIdentityFormatter());
-
- $handler->handle($this->getRecord(Logger::DEBUG, '[[foo]]{macro: autolabel}'));
- $handler->handle($this->getRecord(Logger::DEBUG, '[[bar]]{macro: autolabel}'));
- $handler->handle($this->getRecord(Logger::DEBUG, '[[foo]]{macro: autolabel}'));
-
- $expected = <<assertEquals($expected, $this->generateScript());
- }
-
- public function testContext()
- {
- $handler = new BrowserConsoleHandler();
- $handler->setFormatter($this->getIdentityFormatter());
-
- $handler->handle($this->getRecord(Logger::DEBUG, 'test', array('foo' => 'bar')));
-
- $expected = <<assertEquals($expected, $this->generateScript());
- }
-
- public function testConcurrentHandlers()
- {
- $handler1 = new BrowserConsoleHandler();
- $handler1->setFormatter($this->getIdentityFormatter());
-
- $handler2 = new BrowserConsoleHandler();
- $handler2->setFormatter($this->getIdentityFormatter());
-
- $handler1->handle($this->getRecord(Logger::DEBUG, 'test1'));
- $handler2->handle($this->getRecord(Logger::DEBUG, 'test2'));
- $handler1->handle($this->getRecord(Logger::DEBUG, 'test3'));
- $handler2->handle($this->getRecord(Logger::DEBUG, 'test4'));
-
- $expected = <<assertEquals($expected, $this->generateScript());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php
deleted file mode 100644
index da8b3c39..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class BufferHandlerTest extends TestCase
-{
- private $shutdownCheckHandler;
-
- /**
- * @covers Monolog\Handler\BufferHandler::__construct
- * @covers Monolog\Handler\BufferHandler::handle
- * @covers Monolog\Handler\BufferHandler::close
- */
- public function testHandleBuffers()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertFalse($test->hasDebugRecords());
- $this->assertFalse($test->hasInfoRecords());
- $handler->close();
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 2);
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::close
- * @covers Monolog\Handler\BufferHandler::flush
- */
- public function testPropagatesRecordsAtEndOfRequest()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test);
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->shutdownCheckHandler = $test;
- register_shutdown_function(array($this, 'checkPropagation'));
- }
-
- public function checkPropagation()
- {
- if (!$this->shutdownCheckHandler->hasWarningRecords() || !$this->shutdownCheckHandler->hasDebugRecords()) {
- echo '!!! BufferHandlerTest::testPropagatesRecordsAtEndOfRequest failed to verify that the messages have been propagated' . PHP_EOL;
- exit(1);
- }
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::handle
- */
- public function testHandleBufferLimit()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test, 2);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->close();
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertFalse($test->hasDebugRecords());
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::handle
- */
- public function testHandleBufferLimitWithFlushOnOverflow()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test, 3, Logger::DEBUG, true, true);
-
- // send two records
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->assertFalse($test->hasDebugRecords());
- $this->assertCount(0, $test->getRecords());
-
- // overflow
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertTrue($test->hasDebugRecords());
- $this->assertCount(3, $test->getRecords());
-
- // should buffer again
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertCount(3, $test->getRecords());
-
- $handler->close();
- $this->assertCount(5, $test->getRecords());
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasInfoRecords());
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::handle
- */
- public function testHandleLevel()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test, 0, Logger::INFO);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->close();
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertFalse($test->hasDebugRecords());
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::flush
- */
- public function testFlush()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test, 0);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->flush();
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue($test->hasDebugRecords());
- $this->assertFalse($test->hasWarningRecords());
- }
-
- /**
- * @covers Monolog\Handler\BufferHandler::handle
- */
- public function testHandleUsesProcessors()
- {
- $test = new TestHandler();
- $handler = new BufferHandler($test);
- $handler->pushProcessor(function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->flush();
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php
deleted file mode 100644
index 2f55faf8..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\ChromePHPHandler
- */
-class ChromePHPHandlerTest extends TestCase
-{
- protected function setUp()
- {
- TestChromePHPHandler::reset();
- $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0';
- }
-
- public function testHeaders()
- {
- $handler = new TestChromePHPHandler();
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING));
-
- $expected = array(
- 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
- 'version' => ChromePHPHandler::VERSION,
- 'columns' => array('label', 'log', 'backtrace', 'type'),
- 'rows' => array(
- 'test',
- 'test',
- ),
- 'request_uri' => '',
- ))))
- );
-
- $this->assertEquals($expected, $handler->getHeaders());
- }
-
- public function testHeadersOverflow()
- {
- $handler = new TestChromePHPHandler();
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 150*1024)));
-
- // overflow chrome headers limit
- $handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 100*1024)));
-
- $expected = array(
- 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
- 'version' => ChromePHPHandler::VERSION,
- 'columns' => array('label', 'log', 'backtrace', 'type'),
- 'rows' => array(
- array(
- 'test',
- 'test',
- 'unknown',
- 'log',
- ),
- array(
- 'test',
- str_repeat('a', 150*1024),
- 'unknown',
- 'warn',
- ),
- array(
- 'monolog',
- 'Incomplete logs, chrome header size limit reached',
- 'unknown',
- 'warn',
- ),
- ),
- 'request_uri' => '',
- ))))
- );
-
- $this->assertEquals($expected, $handler->getHeaders());
- }
-
- public function testConcurrentHandlers()
- {
- $handler = new TestChromePHPHandler();
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING));
-
- $handler2 = new TestChromePHPHandler();
- $handler2->setFormatter($this->getIdentityFormatter());
- $handler2->handle($this->getRecord(Logger::DEBUG));
- $handler2->handle($this->getRecord(Logger::WARNING));
-
- $expected = array(
- 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
- 'version' => ChromePHPHandler::VERSION,
- 'columns' => array('label', 'log', 'backtrace', 'type'),
- 'rows' => array(
- 'test',
- 'test',
- 'test',
- 'test',
- ),
- 'request_uri' => '',
- ))))
- );
-
- $this->assertEquals($expected, $handler2->getHeaders());
- }
-}
-
-class TestChromePHPHandler extends ChromePHPHandler
-{
- protected $headers = array();
-
- public static function reset()
- {
- self::$initialized = false;
- self::$overflowed = false;
- self::$sendHeaders = true;
- self::$json['rows'] = array();
- }
-
- protected function sendHeader($header, $content)
- {
- $this->headers[$header] = $content;
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php
deleted file mode 100644
index 78a1d15c..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class CouchDBHandlerTest extends TestCase
-{
- public function testHandle()
- {
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $expected = array(
- 'message' => 'test',
- 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34),
- 'level' => Logger::WARNING,
- 'level_name' => 'WARNING',
- 'channel' => 'test',
- 'datetime' => $record['datetime']->format('Y-m-d H:i:s'),
- 'extra' => array(),
- );
-
- $handler = new CouchDBHandler();
-
- try {
- $handler->handle($record);
- } catch (\RuntimeException $e) {
- $this->markTestSkipped('Could not connect to couchdb server on http://localhost:5984');
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php
deleted file mode 100644
index d67da90a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class DoctrineCouchDBHandlerTest extends TestCase
-{
- protected function setup()
- {
- if (!class_exists('Doctrine\CouchDB\CouchDBClient')) {
- $this->markTestSkipped('The "doctrine/couchdb" package is not installed');
- }
- }
-
- public function testHandle()
- {
- $client = $this->getMockBuilder('Doctrine\\CouchDB\\CouchDBClient')
- ->setMethods(array('postDocument'))
- ->disableOriginalConstructor()
- ->getMock();
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $expected = array(
- 'message' => 'test',
- 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34),
- 'level' => Logger::WARNING,
- 'level_name' => 'WARNING',
- 'channel' => 'test',
- 'datetime' => $record['datetime']->format('Y-m-d H:i:s'),
- 'extra' => array(),
- );
-
- $client->expects($this->once())
- ->method('postDocument')
- ->with($expected);
-
- $handler = new DoctrineCouchDBHandler($client);
- $handler->handle($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php
deleted file mode 100644
index a38a8cb7..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-class DynamoDbHandlerTest extends TestCase
-{
- public function setUp()
- {
- if (!class_exists('Aws\DynamoDb\DynamoDbClient')) {
- $this->markTestSkipped('aws/aws-sdk-php not installed');
- }
-
- $this->client = $this->getMockBuilder('Aws\DynamoDb\DynamoDbClient')
- ->setMethods(array('formatAttributes', '__call'))
- ->disableOriginalConstructor()->getMock();
- }
-
- public function testConstruct()
- {
- $this->assertInstanceOf('Monolog\Handler\DynamoDbHandler', new DynamoDbHandler($this->client, 'foo'));
- }
-
- public function testInterface()
- {
- $this->assertInstanceOf('Monolog\Handler\HandlerInterface', new DynamoDbHandler($this->client, 'foo'));
- }
-
- public function testGetFormatter()
- {
- $handler = new DynamoDbHandler($this->client, 'foo');
- $this->assertInstanceOf('Monolog\Formatter\ScalarFormatter', $handler->getFormatter());
- }
-
- public function testHandle()
- {
- $record = $this->getRecord();
- $formatter = $this->getMock('Monolog\Formatter\FormatterInterface');
- $formatted = array('foo' => 1, 'bar' => 2);
- $handler = new DynamoDbHandler($this->client, 'foo');
- $handler->setFormatter($formatter);
-
- $formatter
- ->expects($this->once())
- ->method('format')
- ->with($record)
- ->will($this->returnValue($formatted));
- $this->client
- ->expects($this->once())
- ->method('formatAttributes')
- ->with($this->isType('array'))
- ->will($this->returnValue($formatted));
- $this->client
- ->expects($this->once())
- ->method('__call')
- ->with('putItem', array(array(
- 'TableName' => 'foo',
- 'Item' => $formatted
- )));
-
- $handler->handle($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php
deleted file mode 100644
index 1687074b..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php
+++ /dev/null
@@ -1,239 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\ElasticaFormatter;
-use Monolog\Formatter\NormalizerFormatter;
-use Monolog\TestCase;
-use Monolog\Logger;
-use Elastica\Client;
-use Elastica\Request;
-use Elastica\Response;
-
-class ElasticSearchHandlerTest extends TestCase
-{
- /**
- * @var Client mock
- */
- protected $client;
-
- /**
- * @var array Default handler options
- */
- protected $options = array(
- 'index' => 'my_index',
- 'type' => 'doc_type',
- );
-
- public function setUp()
- {
- // Elastica lib required
- if (!class_exists("Elastica\Client")) {
- $this->markTestSkipped("ruflin/elastica not installed");
- }
-
- // base mock Elastica Client object
- $this->client = $this->getMockBuilder('Elastica\Client')
- ->setMethods(array('addDocuments'))
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- /**
- * @covers Monolog\Handler\ElasticSearchHandler::write
- * @covers Monolog\Handler\ElasticSearchHandler::handleBatch
- * @covers Monolog\Handler\ElasticSearchHandler::bulkSend
- * @covers Monolog\Handler\ElasticSearchHandler::getDefaultFormatter
- */
- public function testHandle()
- {
- // log message
- $msg = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- // format expected result
- $formatter = new ElasticaFormatter($this->options['index'], $this->options['type']);
- $expected = array($formatter->format($msg));
-
- // setup ES client mock
- $this->client->expects($this->any())
- ->method('addDocuments')
- ->with($expected);
-
- // perform tests
- $handler = new ElasticSearchHandler($this->client, $this->options);
- $handler->handle($msg);
- $handler->handleBatch(array($msg));
- }
-
- /**
- * @covers Monolog\Handler\ElasticSearchHandler::setFormatter
- */
- public function testSetFormatter()
- {
- $handler = new ElasticSearchHandler($this->client);
- $formatter = new ElasticaFormatter('index_new', 'type_new');
- $handler->setFormatter($formatter);
- $this->assertInstanceOf('Monolog\Formatter\ElasticaFormatter', $handler->getFormatter());
- $this->assertEquals('index_new', $handler->getFormatter()->getIndex());
- $this->assertEquals('type_new', $handler->getFormatter()->getType());
- }
-
- /**
- * @covers Monolog\Handler\ElasticSearchHandler::setFormatter
- * @expectedException InvalidArgumentException
- * @expectedExceptionMessage ElasticSearchHandler is only compatible with ElasticaFormatter
- */
- public function testSetFormatterInvalid()
- {
- $handler = new ElasticSearchHandler($this->client);
- $formatter = new NormalizerFormatter();
- $handler->setFormatter($formatter);
- }
-
- /**
- * @covers Monolog\Handler\ElasticSearchHandler::__construct
- * @covers Monolog\Handler\ElasticSearchHandler::getOptions
- */
- public function testOptions()
- {
- $expected = array(
- 'index' => $this->options['index'],
- 'type' => $this->options['type'],
- 'ignore_error' => false,
- );
- $handler = new ElasticSearchHandler($this->client, $this->options);
- $this->assertEquals($expected, $handler->getOptions());
- }
-
- /**
- * @covers Monolog\Handler\ElasticSearchHandler::bulkSend
- * @dataProvider providerTestConnectionErrors
- */
- public function testConnectionErrors($ignore, $expectedError)
- {
- $clientOpts = array('host' => '127.0.0.1', 'port' => 1);
- $client = new Client($clientOpts);
- $handlerOpts = array('ignore_error' => $ignore);
- $handler = new ElasticSearchHandler($client, $handlerOpts);
-
- if ($expectedError) {
- $this->setExpectedException($expectedError[0], $expectedError[1]);
- $handler->handle($this->getRecord());
- } else {
- $this->assertFalse($handler->handle($this->getRecord()));
- }
- }
-
- /**
- * @return array
- */
- public function providerTestConnectionErrors()
- {
- return array(
- array(false, array('RuntimeException', 'Error sending messages to Elasticsearch')),
- array(true, false),
- );
- }
-
- /**
- * Integration test using localhost Elastic Search server
- *
- * @covers Monolog\Handler\ElasticSearchHandler::__construct
- * @covers Monolog\Handler\ElasticSearchHandler::handleBatch
- * @covers Monolog\Handler\ElasticSearchHandler::bulkSend
- * @covers Monolog\Handler\ElasticSearchHandler::getDefaultFormatter
- */
- public function testHandleIntegration()
- {
- $msg = array(
- 'level' => Logger::ERROR,
- 'level_name' => 'ERROR',
- 'channel' => 'meh',
- 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass),
- 'datetime' => new \DateTime("@0"),
- 'extra' => array(),
- 'message' => 'log',
- );
-
- $expected = $msg;
- $expected['datetime'] = $msg['datetime']->format(\DateTime::ISO8601);
- $expected['context'] = array(
- 'class' => '[object] (stdClass: {})',
- 'foo' => 7,
- 0 => 'bar',
- );
-
- $client = new Client();
- $handler = new ElasticSearchHandler($client, $this->options);
- try {
- $handler->handleBatch(array($msg));
- } catch (\RuntimeException $e) {
- $this->markTestSkipped("Cannot connect to Elastic Search server on localhost");
- }
-
- // check document id from ES server response
- $documentId = $this->getCreatedDocId($client->getLastResponse());
- $this->assertNotEmpty($documentId, 'No elastic document id received');
-
- // retrieve document source from ES and validate
- $document = $this->getDocSourceFromElastic(
- $client,
- $this->options['index'],
- $this->options['type'],
- $documentId
- );
- $this->assertEquals($expected, $document);
-
- // remove test index from ES
- $client->request("/{$this->options['index']}", Request::DELETE);
- }
-
- /**
- * Return last created document id from ES response
- * @param Response $response Elastica Response object
- * @return string|null
- */
- protected function getCreatedDocId(Response $response)
- {
- $data = $response->getData();
- if (!empty($data['items'][0]['create']['_id'])) {
- return $data['items'][0]['create']['_id'];
- }
- }
-
- /**
- * Retrieve document by id from Elasticsearch
- * @param Client $client Elastica client
- * @param string $index
- * @param string $type
- * @param string $documentId
- * @return array
- */
- protected function getDocSourceFromElastic(Client $client, $index, $type, $documentId)
- {
- $resp = $client->request("/{$index}/{$type}/{$documentId}", Request::GET);
- $data = $resp->getData();
- if (!empty($data['_source'])) {
- return $data['_source'];
- }
-
- return array();
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php
deleted file mode 100644
index 99785cbb..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-function error_log()
-{
- $GLOBALS['error_log'][] = func_get_args();
-}
-
-class ErrorLogHandlerTest extends TestCase
-{
- protected function setUp()
- {
- $GLOBALS['error_log'] = array();
- }
-
- /**
- * @covers Monolog\Handler\ErrorLogHandler::__construct
- * @expectedException InvalidArgumentException
- * @expectedExceptionMessage The given message type "42" is not supported
- */
- public function testShouldNotAcceptAnInvalidTypeOnContructor()
- {
- new ErrorLogHandler(42);
- }
-
- /**
- * @covers Monolog\Handler\ErrorLogHandler::write
- */
- public function testShouldLogMessagesUsingErrorLogFuncion()
- {
- $type = ErrorLogHandler::OPERATING_SYSTEM;
- $handler = new ErrorLogHandler($type);
- $handler->setFormatter(new LineFormatter('%channel%.%level_name%: %message% %context% %extra%', null, true));
- $handler->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz"));
-
- $this->assertSame("test.ERROR: Foo\nBar\r\n\r\nBaz [] []", $GLOBALS['error_log'][0][0]);
- $this->assertSame($GLOBALS['error_log'][0][1], $type);
-
- $handler = new ErrorLogHandler($type, Logger::DEBUG, true, true);
- $handler->setFormatter(new LineFormatter(null, null, true));
- $handler->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz"));
-
- $this->assertStringMatchesFormat('[%s] test.ERROR: Foo', $GLOBALS['error_log'][1][0]);
- $this->assertSame($GLOBALS['error_log'][1][1], $type);
-
- $this->assertStringMatchesFormat('Bar', $GLOBALS['error_log'][2][0]);
- $this->assertSame($GLOBALS['error_log'][2][1], $type);
-
- $this->assertStringMatchesFormat('Baz [] []', $GLOBALS['error_log'][3][0]);
- $this->assertSame($GLOBALS['error_log'][3][1], $type);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php
deleted file mode 100644
index 31b7686a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php
+++ /dev/null
@@ -1,170 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\TestCase;
-
-class FilterHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\FilterHandler::isHandling
- */
- public function testIsHandling()
- {
- $test = new TestHandler();
- $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE);
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::INFO)));
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::NOTICE)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::WARNING)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::ERROR)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::CRITICAL)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::ALERT)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::EMERGENCY)));
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::handle
- * @covers Monolog\Handler\FilterHandler::setAcceptedLevels
- * @covers Monolog\Handler\FilterHandler::isHandling
- */
- public function testHandleProcessOnlyNeededLevels()
- {
- $test = new TestHandler();
- $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE);
-
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->assertFalse($test->hasDebugRecords());
-
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertTrue($test->hasInfoRecords());
- $handler->handle($this->getRecord(Logger::NOTICE));
- $this->assertTrue($test->hasNoticeRecords());
-
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertFalse($test->hasWarningRecords());
- $handler->handle($this->getRecord(Logger::ERROR));
- $this->assertFalse($test->hasErrorRecords());
- $handler->handle($this->getRecord(Logger::CRITICAL));
- $this->assertFalse($test->hasCriticalRecords());
- $handler->handle($this->getRecord(Logger::ALERT));
- $this->assertFalse($test->hasAlertRecords());
- $handler->handle($this->getRecord(Logger::EMERGENCY));
- $this->assertFalse($test->hasEmergencyRecords());
-
- $test = new TestHandler();
- $handler = new FilterHandler($test, array(Logger::INFO, Logger::ERROR));
-
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->assertFalse($test->hasDebugRecords());
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertTrue($test->hasInfoRecords());
- $handler->handle($this->getRecord(Logger::NOTICE));
- $this->assertFalse($test->hasNoticeRecords());
- $handler->handle($this->getRecord(Logger::ERROR));
- $this->assertTrue($test->hasErrorRecords());
- $handler->handle($this->getRecord(Logger::CRITICAL));
- $this->assertFalse($test->hasCriticalRecords());
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::setAcceptedLevels
- * @covers Monolog\Handler\FilterHandler::getAcceptedLevels
- */
- public function testAcceptedLevelApi()
- {
- $test = new TestHandler();
- $handler = new FilterHandler($test);
-
- $levels = array(Logger::INFO, Logger::ERROR);
- $handler->setAcceptedLevels($levels);
- $this->assertSame($levels, $handler->getAcceptedLevels());
-
- $handler->setAcceptedLevels(array('info', 'error'));
- $this->assertSame($levels, $handler->getAcceptedLevels());
-
- $levels = array(Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY);
- $handler->setAcceptedLevels(Logger::CRITICAL, Logger::EMERGENCY);
- $this->assertSame($levels, $handler->getAcceptedLevels());
-
- $handler->setAcceptedLevels('critical', 'emergency');
- $this->assertSame($levels, $handler->getAcceptedLevels());
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::handle
- */
- public function testHandleUsesProcessors()
- {
- $test = new TestHandler();
- $handler = new FilterHandler($test, Logger::DEBUG, Logger::EMERGENCY);
- $handler->pushProcessor(
- function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- }
- );
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::handle
- */
- public function testHandleRespectsBubble()
- {
- $test = new TestHandler();
-
- $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE, false);
- $this->assertTrue($handler->handle($this->getRecord(Logger::INFO)));
- $this->assertFalse($handler->handle($this->getRecord(Logger::WARNING)));
-
- $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE, true);
- $this->assertFalse($handler->handle($this->getRecord(Logger::INFO)));
- $this->assertFalse($handler->handle($this->getRecord(Logger::WARNING)));
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::handle
- */
- public function testHandleWithCallback()
- {
- $test = new TestHandler();
- $handler = new FilterHandler(
- function ($record, $handler) use ($test) {
- return $test;
- }, Logger::INFO, Logger::NOTICE, false
- );
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertFalse($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- }
-
- /**
- * @covers Monolog\Handler\FilterHandler::handle
- * @expectedException \RuntimeException
- */
- public function testHandleWithBadCallbackThrowsException()
- {
- $handler = new FilterHandler(
- function ($record, $handler) {
- return 'foo';
- }
- );
- $handler->handle($this->getRecord(Logger::WARNING));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php
deleted file mode 100644
index a3d350d5..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php
+++ /dev/null
@@ -1,240 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
-use Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy;
-
-class FingersCrossedHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::__construct
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleBuffers()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertFalse($test->hasDebugRecords());
- $this->assertFalse($test->hasInfoRecords());
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->close();
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 3);
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleStopsBufferingAfterTrigger()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test);
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->close();
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasDebugRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- * @covers Monolog\Handler\FingersCrossedHandler::reset
- */
- public function testHandleRestartBufferingAfterReset()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test);
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->reset();
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->close();
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasDebugRecords());
- $this->assertFalse($test->hasInfoRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleRestartBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->close();
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasDebugRecords());
- $this->assertFalse($test->hasInfoRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleBufferLimit()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, Logger::WARNING, 2);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertFalse($test->hasDebugRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleWithCallback()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler(function ($record, $handler) use ($test) {
- return $test;
- });
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $this->assertFalse($test->hasDebugRecords());
- $this->assertFalse($test->hasInfoRecords());
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 3);
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- * @expectedException RuntimeException
- */
- public function testHandleWithBadCallbackThrowsException()
- {
- $handler = new FingersCrossedHandler(function ($record, $handler) {
- return 'foo';
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::isHandling
- */
- public function testIsHandlingAlways()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, Logger::ERROR);
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::__construct
- * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::__construct
- * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::isHandlerActivated
- */
- public function testErrorLevelActivationStrategy()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->assertFalse($test->hasDebugRecords());
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasWarningRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::__construct
- * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::__construct
- * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::isHandlerActivated
- */
- public function testErrorLevelActivationStrategyWithPsrLevel()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy('warning'));
- $handler->handle($this->getRecord(Logger::DEBUG));
- $this->assertFalse($test->hasDebugRecords());
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasWarningRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::__construct
- * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::isHandlerActivated
- */
- public function testChannelLevelActivationStrategy()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, new ChannelLevelActivationStrategy(Logger::ERROR, array('othertest' => Logger::DEBUG)));
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertFalse($test->hasWarningRecords());
- $record = $this->getRecord(Logger::DEBUG);
- $record['channel'] = 'othertest';
- $handler->handle($record);
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasWarningRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::__construct
- * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::isHandlerActivated
- */
- public function testChannelLevelActivationStrategyWithPsrLevels()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, new ChannelLevelActivationStrategy('error', array('othertest' => 'debug')));
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertFalse($test->hasWarningRecords());
- $record = $this->getRecord(Logger::DEBUG);
- $record['channel'] = 'othertest';
- $handler->handle($record);
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasWarningRecords());
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::handle
- */
- public function testHandleUsesProcessors()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, Logger::INFO);
- $handler->pushProcessor(function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-
- /**
- * @covers Monolog\Handler\FingersCrossedHandler::close
- */
- public function testPassthruOnClose()
- {
- $test = new TestHandler();
- $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING), 0, true, true, Logger::INFO);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- $handler->close();
- $this->assertFalse($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php
deleted file mode 100644
index 0eb10a63..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\FirePHPHandler
- */
-class FirePHPHandlerTest extends TestCase
-{
- public function setUp()
- {
- TestFirePHPHandler::reset();
- $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; FirePHP/1.0';
- }
-
- public function testHeaders()
- {
- $handler = new TestFirePHPHandler;
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING));
-
- $expected = array(
- 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2',
- 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1',
- 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3',
- 'X-Wf-1-1-1-1' => 'test',
- 'X-Wf-1-1-1-2' => 'test',
- );
-
- $this->assertEquals($expected, $handler->getHeaders());
- }
-
- public function testConcurrentHandlers()
- {
- $handler = new TestFirePHPHandler;
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::WARNING));
-
- $handler2 = new TestFirePHPHandler;
- $handler2->setFormatter($this->getIdentityFormatter());
- $handler2->handle($this->getRecord(Logger::DEBUG));
- $handler2->handle($this->getRecord(Logger::WARNING));
-
- $expected = array(
- 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2',
- 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1',
- 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3',
- 'X-Wf-1-1-1-1' => 'test',
- 'X-Wf-1-1-1-2' => 'test',
- );
-
- $expected2 = array(
- 'X-Wf-1-1-1-3' => 'test',
- 'X-Wf-1-1-1-4' => 'test',
- );
-
- $this->assertEquals($expected, $handler->getHeaders());
- $this->assertEquals($expected2, $handler2->getHeaders());
- }
-}
-
-class TestFirePHPHandler extends FirePHPHandler
-{
- protected $headers = array();
-
- public static function reset()
- {
- self::$initialized = false;
- self::$sendHeaders = true;
- self::$messageIndex = 1;
- }
-
- protected function sendHeader($header, $content)
- {
- $this->headers[$header] = $content;
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/Fixtures/.gitkeep b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/Fixtures/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php
deleted file mode 100644
index 91cdd312..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\LineFormatter;
-use Monolog\Logger;
-use Monolog\TestCase;
-
-/**
- * @coversDefaultClass \Monolog\Handler\FleepHookHandler
- */
-class FleepHookHandlerTest extends TestCase
-{
- /**
- * Default token to use in tests
- */
- const TOKEN = '123abc';
-
- /**
- * @var FleepHookHandler
- */
- private $handler;
-
- public function setUp()
- {
- parent::setUp();
-
- if (!extension_loaded('openssl')) {
- $this->markTestSkipped('This test requires openssl extension to run');
- }
-
- // Create instances of the handler and logger for convenience
- $this->handler = new FleepHookHandler(self::TOKEN);
- }
-
- /**
- * @covers ::__construct
- */
- public function testConstructorSetsExpectedDefaults()
- {
- $this->assertEquals(Logger::DEBUG, $this->handler->getLevel());
- $this->assertEquals(true, $this->handler->getBubble());
- }
-
- /**
- * @covers ::getDefaultFormatter
- */
- public function testHandlerUsesLineFormatterWhichIgnoresEmptyArrays()
- {
- $record = array(
- 'message' => 'msg',
- 'context' => array(),
- 'level' => Logger::DEBUG,
- 'level_name' => Logger::getLevelName(Logger::DEBUG),
- 'channel' => 'channel',
- 'datetime' => new \DateTime(),
- 'extra' => array(),
- );
-
- $expectedFormatter = new LineFormatter(null, null, true, true);
- $expected = $expectedFormatter->format($record);
-
- $handlerFormatter = $this->handler->getFormatter();
- $actual = $handlerFormatter->format($record);
-
- $this->assertEquals($expected, $actual, 'Empty context and extra arrays should not be rendered');
- }
-
- /**
- * @covers ::__construct
- */
- public function testConnectionStringisConstructedCorrectly()
- {
- $this->assertEquals('ssl://' . FleepHookHandler::FLEEP_HOST . ':443', $this->handler->getConnectionString());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php
deleted file mode 100644
index 4b120d51..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Formatter\FlowdockFormatter;
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @author Dominik Liebler
- * @see https://www.hipchat.com/docs/api
- */
-class FlowdockHandlerTest extends TestCase
-{
- /**
- * @var resource
- */
- private $res;
-
- /**
- * @var FlowdockHandler
- */
- private $handler;
-
- public function setUp()
- {
- if (!extension_loaded('openssl')) {
- $this->markTestSkipped('This test requires openssl to run');
- }
- }
-
- public function testWriteHeader()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/POST \/v1\/messages\/team_inbox\/.* HTTP\/1.1\\r\\nHost: api.flowdock.com\\r\\nContent-Type: application\/json\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
-
- return $content;
- }
-
- /**
- * @depends testWriteHeader
- */
- public function testWriteContent($content)
- {
- $this->assertRegexp('/"source":"test_source"/', $content);
- $this->assertRegexp('/"from_address":"source@test\.com"/', $content);
- }
-
- private function createHandler($token = 'myToken')
- {
- $constructorArgs = array($token, Logger::DEBUG);
- $this->res = fopen('php://memory', 'a');
- $this->handler = $this->getMock(
- '\Monolog\Handler\FlowdockHandler',
- array('fsockopen', 'streamSetTimeout', 'closeSocket'),
- $constructorArgs
- );
-
- $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
- $reflectionProperty->setAccessible(true);
- $reflectionProperty->setValue($this->handler, 'localhost:1234');
-
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- $this->handler->expects($this->any())
- ->method('closeSocket')
- ->will($this->returnValue(true));
-
- $this->handler->setFormatter(new FlowdockFormatter('test_source', 'source@test.com'));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php
deleted file mode 100644
index 9d007b13..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Gelf\Message;
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\GelfMessageFormatter;
-
-class GelfHandlerLegacyTest extends TestCase
-{
- public function setUp()
- {
- if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) {
- $this->markTestSkipped("mlehner/gelf-php not installed");
- }
-
- require_once __DIR__ . '/GelfMockMessagePublisher.php';
- }
-
- /**
- * @covers Monolog\Handler\GelfHandler::__construct
- */
- public function testConstruct()
- {
- $handler = new GelfHandler($this->getMessagePublisher());
- $this->assertInstanceOf('Monolog\Handler\GelfHandler', $handler);
- }
-
- protected function getHandler($messagePublisher)
- {
- $handler = new GelfHandler($messagePublisher);
-
- return $handler;
- }
-
- protected function getMessagePublisher()
- {
- return new GelfMockMessagePublisher('localhost');
- }
-
- public function testDebug()
- {
- $messagePublisher = $this->getMessagePublisher();
- $handler = $this->getHandler($messagePublisher);
-
- $record = $this->getRecord(Logger::DEBUG, "A test debug message");
- $handler->handle($record);
-
- $this->assertEquals(7, $messagePublisher->lastMessage->getLevel());
- $this->assertEquals('test', $messagePublisher->lastMessage->getFacility());
- $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage());
- $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage());
- }
-
- public function testWarning()
- {
- $messagePublisher = $this->getMessagePublisher();
- $handler = $this->getHandler($messagePublisher);
-
- $record = $this->getRecord(Logger::WARNING, "A test warning message");
- $handler->handle($record);
-
- $this->assertEquals(4, $messagePublisher->lastMessage->getLevel());
- $this->assertEquals('test', $messagePublisher->lastMessage->getFacility());
- $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage());
- $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage());
- }
-
- public function testInjectedGelfMessageFormatter()
- {
- $messagePublisher = $this->getMessagePublisher();
- $handler = $this->getHandler($messagePublisher);
-
- $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX'));
-
- $record = $this->getRecord(Logger::WARNING, "A test warning message");
- $record['extra']['blarg'] = 'yep';
- $record['context']['from'] = 'logger';
- $handler->handle($record);
-
- $this->assertEquals('mysystem', $messagePublisher->lastMessage->getHost());
- $this->assertArrayHasKey('_EXTblarg', $messagePublisher->lastMessage->toArray());
- $this->assertArrayHasKey('_CTXfrom', $messagePublisher->lastMessage->toArray());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php
deleted file mode 100644
index 8cdd64f4..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php
+++ /dev/null
@@ -1,117 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Gelf\Message;
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\GelfMessageFormatter;
-
-class GelfHandlerTest extends TestCase
-{
- public function setUp()
- {
- if (!class_exists('Gelf\Publisher') || !class_exists('Gelf\Message')) {
- $this->markTestSkipped("graylog2/gelf-php not installed");
- }
- }
-
- /**
- * @covers Monolog\Handler\GelfHandler::__construct
- */
- public function testConstruct()
- {
- $handler = new GelfHandler($this->getMessagePublisher());
- $this->assertInstanceOf('Monolog\Handler\GelfHandler', $handler);
- }
-
- protected function getHandler($messagePublisher)
- {
- $handler = new GelfHandler($messagePublisher);
-
- return $handler;
- }
-
- protected function getMessagePublisher()
- {
- return $this->getMock('Gelf\Publisher', array('publish'), array(), '', false);
- }
-
- public function testDebug()
- {
- $record = $this->getRecord(Logger::DEBUG, "A test debug message");
- $expectedMessage = new Message();
- $expectedMessage
- ->setLevel(7)
- ->setFacility("test")
- ->setShortMessage($record['message'])
- ->setTimestamp($record['datetime'])
- ;
-
- $messagePublisher = $this->getMessagePublisher();
- $messagePublisher->expects($this->once())
- ->method('publish')
- ->with($expectedMessage);
-
- $handler = $this->getHandler($messagePublisher);
-
- $handler->handle($record);
- }
-
- public function testWarning()
- {
- $record = $this->getRecord(Logger::WARNING, "A test warning message");
- $expectedMessage = new Message();
- $expectedMessage
- ->setLevel(4)
- ->setFacility("test")
- ->setShortMessage($record['message'])
- ->setTimestamp($record['datetime'])
- ;
-
- $messagePublisher = $this->getMessagePublisher();
- $messagePublisher->expects($this->once())
- ->method('publish')
- ->with($expectedMessage);
-
- $handler = $this->getHandler($messagePublisher);
-
- $handler->handle($record);
- }
-
- public function testInjectedGelfMessageFormatter()
- {
- $record = $this->getRecord(Logger::WARNING, "A test warning message");
- $record['extra']['blarg'] = 'yep';
- $record['context']['from'] = 'logger';
-
- $expectedMessage = new Message();
- $expectedMessage
- ->setLevel(4)
- ->setFacility("test")
- ->setHost("mysystem")
- ->setShortMessage($record['message'])
- ->setTimestamp($record['datetime'])
- ->setAdditional("EXTblarg", 'yep')
- ->setAdditional("CTXfrom", 'logger')
- ;
-
- $messagePublisher = $this->getMessagePublisher();
- $messagePublisher->expects($this->once())
- ->method('publish')
- ->with($expectedMessage);
-
- $handler = $this->getHandler($messagePublisher);
- $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX'));
- $handler->handle($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php
deleted file mode 100644
index 873d92fb..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Gelf\MessagePublisher;
-use Gelf\Message;
-
-class GelfMockMessagePublisher extends MessagePublisher
-{
- public function publish(Message $message)
- {
- $this->lastMessage = $message;
- }
-
- public $lastMessage = null;
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php
deleted file mode 100644
index c6298a6e..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class GroupHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\GroupHandler::__construct
- * @expectedException InvalidArgumentException
- */
- public function testConstructorOnlyTakesHandler()
- {
- new GroupHandler(array(new TestHandler(), "foo"));
- }
-
- /**
- * @covers Monolog\Handler\GroupHandler::__construct
- * @covers Monolog\Handler\GroupHandler::handle
- */
- public function testHandle()
- {
- $testHandlers = array(new TestHandler(), new TestHandler());
- $handler = new GroupHandler($testHandlers);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- foreach ($testHandlers as $test) {
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 2);
- }
- }
-
- /**
- * @covers Monolog\Handler\GroupHandler::handleBatch
- */
- public function testHandleBatch()
- {
- $testHandlers = array(new TestHandler(), new TestHandler());
- $handler = new GroupHandler($testHandlers);
- $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
- foreach ($testHandlers as $test) {
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 2);
- }
- }
-
- /**
- * @covers Monolog\Handler\GroupHandler::isHandling
- */
- public function testIsHandling()
- {
- $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING));
- $handler = new GroupHandler($testHandlers);
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR)));
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\GroupHandler::handle
- */
- public function testHandleUsesProcessors()
- {
- $test = new TestHandler();
- $handler = new GroupHandler(array($test));
- $handler->pushProcessor(function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php
deleted file mode 100644
index 49f1dfbd..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php
+++ /dev/null
@@ -1,178 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @author Rafael Dohms
- * @see https://www.hipchat.com/docs/api
- */
-class HipChatHandlerTest extends TestCase
-{
- private $res;
- private $handler;
-
- public function testWriteHeader()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: api.hipchat.com\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
-
- return $content;
- }
-
- public function testWriteCustomHostHeader()
- {
- $this->createHandler('myToken', 'room1', 'Monolog', false, 'hipchat.foo.bar');
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
-
- return $content;
- }
-
- /**
- * @depends testWriteHeader
- */
- public function testWriteContent($content)
- {
- $this->assertRegexp('/from=Monolog&room_id=room1¬ify=0&message=test1&message_format=text&color=red$/', $content);
- }
-
- public function testWriteWithComplexMessage()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Backup of database "example" finished in 16 minutes.'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/message=Backup\+of\+database\+%22example%22\+finished\+in\+16\+minutes\./', $content);
- }
-
- /**
- * @dataProvider provideLevelColors
- */
- public function testWriteWithErrorLevelsAndColors($level, $expectedColor)
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord($level, 'Backup of database "example" finished in 16 minutes.'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/color='.$expectedColor.'/', $content);
- }
-
- public function provideLevelColors()
- {
- return array(
- array(Logger::DEBUG, 'gray'),
- array(Logger::INFO, 'green'),
- array(Logger::WARNING, 'yellow'),
- array(Logger::ERROR, 'red'),
- array(Logger::CRITICAL, 'red'),
- array(Logger::ALERT, 'red'),
- array(Logger::EMERGENCY,'red'),
- array(Logger::NOTICE, 'green'),
- );
- }
-
- /**
- * @dataProvider provideBatchRecords
- */
- public function testHandleBatch($records, $expectedColor)
- {
- $this->createHandler();
-
- $this->handler->handleBatch($records);
-
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/color='.$expectedColor.'/', $content);
- }
-
- public function provideBatchRecords()
- {
- return array(
- array(
- array(
- array('level' => Logger::WARNING, 'message' => 'Oh bugger!', 'level_name' => 'warning', 'datetime' => new \DateTime()),
- array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()),
- array('level' => Logger::CRITICAL, 'message' => 'Everything is broken!', 'level_name' => 'critical', 'datetime' => new \DateTime())
- ),
- 'red',
- ),
- array(
- array(
- array('level' => Logger::WARNING, 'message' => 'Oh bugger!', 'level_name' => 'warning', 'datetime' => new \DateTime()),
- array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()),
- ),
- 'yellow',
- ),
- array(
- array(
- array('level' => Logger::DEBUG, 'message' => 'Just debugging.', 'level_name' => 'debug', 'datetime' => new \DateTime()),
- array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()),
- ),
- 'green',
- ),
- array(
- array(
- array('level' => Logger::DEBUG, 'message' => 'Just debugging.', 'level_name' => 'debug', 'datetime' => new \DateTime()),
- ),
- 'gray',
- ),
- );
- }
-
- private function createHandler($token = 'myToken', $room = 'room1', $name = 'Monolog', $notify = false, $host = 'api.hipchat.com')
- {
- $constructorArgs = array($token, $room, $name, $notify, Logger::DEBUG, true, true, 'text', $host);
- $this->res = fopen('php://memory', 'a');
- $this->handler = $this->getMock(
- '\Monolog\Handler\HipChatHandler',
- array('fsockopen', 'streamSetTimeout', 'closeSocket'),
- $constructorArgs
- );
-
- $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
- $reflectionProperty->setAccessible(true);
- $reflectionProperty->setValue($this->handler, 'localhost:1234');
-
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- $this->handler->expects($this->any())
- ->method('closeSocket')
- ->will($this->returnValue(true));
-
- $this->handler->setFormatter($this->getIdentityFormatter());
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testCreateWithTooLongName()
- {
- $hipChatHandler = new \Monolog\Handler\HipChatHandler('token', 'room', 'SixteenCharsHere');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php
deleted file mode 100644
index 7af60be8..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @author Robert Kaufmann III
- */
-class LogEntriesHandlerTest extends TestCase
-{
- /**
- * @var resource
- */
- private $res;
-
- /**
- * @var LogEntriesHandler
- */
- private $handler;
-
- public function testWriteContent()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Critical write test'));
-
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content);
- }
-
- public function testWriteBatchContent()
- {
- $records = array(
- $this->getRecord(),
- $this->getRecord(),
- $this->getRecord()
- );
- $this->createHandler();
- $this->handler->handleBatch($records);
-
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content);
- }
-
- private function createHandler()
- {
- $useSSL = extension_loaded('openssl');
- $args = array('testToken', $useSSL, Logger::DEBUG, true);
- $this->res = fopen('php://memory', 'a');
- $this->handler = $this->getMock(
- '\Monolog\Handler\LogEntriesHandler',
- array('fsockopen', 'streamSetTimeout', 'closeSocket'),
- $args
- );
-
- $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
- $reflectionProperty->setAccessible(true);
- $reflectionProperty->setValue($this->handler, 'localhost:1234');
-
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- $this->handler->expects($this->any())
- ->method('closeSocket')
- ->will($this->returnValue(true));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php
deleted file mode 100644
index 6754f3d6..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-use Monolog\TestCase;
-
-class MailHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\MailHandler::handleBatch
- */
- public function testHandleBatch()
- {
- $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
- $formatter->expects($this->once())
- ->method('formatBatch'); // Each record is formatted
-
- $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler');
- $handler->expects($this->once())
- ->method('send');
- $handler->expects($this->never())
- ->method('write'); // write is for individual records
-
- $handler->setFormatter($formatter);
-
- $handler->handleBatch($this->getMultipleRecords());
- }
-
- /**
- * @covers Monolog\Handler\MailHandler::handleBatch
- */
- public function testHandleBatchNotSendsMailIfMessagesAreBelowLevel()
- {
- $records = array(
- $this->getRecord(Logger::DEBUG, 'debug message 1'),
- $this->getRecord(Logger::DEBUG, 'debug message 2'),
- $this->getRecord(Logger::INFO, 'information'),
- );
-
- $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler');
- $handler->expects($this->never())
- ->method('send');
- $handler->setLevel(Logger::ERROR);
-
- $handler->handleBatch($records);
- }
-
- /**
- * @covers Monolog\Handler\MailHandler::write
- */
- public function testHandle()
- {
- $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler');
-
- $record = $this->getRecord();
- $records = array($record);
- $records[0]['formatted'] = '['.$record['datetime']->format('Y-m-d H:i:s').'] test.WARNING: test [] []'."\n";
-
- $handler->expects($this->once())
- ->method('send')
- ->with($records[0]['formatted'], $records);
-
- $handler->handle($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php
deleted file mode 100644
index fbaab9bc..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Raven_Client;
-
-class MockRavenClient extends Raven_Client
-{
- public function capture($data, $stack, $vars = null)
- {
- $this->lastData = $data;
- $this->lastStack = $stack;
- }
-
- public $lastData;
- public $lastStack;
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php
deleted file mode 100644
index 0fdef63a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class MongoDBHandlerTest extends TestCase
-{
- /**
- * @expectedException InvalidArgumentException
- */
- public function testConstructorShouldThrowExceptionForInvalidMongo()
- {
- new MongoDBHandler(new \stdClass(), 'DB', 'Collection');
- }
-
- public function testHandle()
- {
- $mongo = $this->getMock('Mongo', array('selectCollection'), array(), '', false);
- $collection = $this->getMock('stdClass', array('save'));
-
- $mongo->expects($this->once())
- ->method('selectCollection')
- ->with('DB', 'Collection')
- ->will($this->returnValue($collection));
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $expected = array(
- 'message' => 'test',
- 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34),
- 'level' => Logger::WARNING,
- 'level_name' => 'WARNING',
- 'channel' => 'test',
- 'datetime' => $record['datetime']->format('Y-m-d H:i:s'),
- 'extra' => array(),
- );
-
- $collection->expects($this->once())
- ->method('save')
- ->with($expected);
-
- $handler = new MongoDBHandler($mongo, 'DB', 'Collection');
- $handler->handle($record);
- }
-}
-
-if (!class_exists('Mongo')) {
- class Mongo
- {
- public function selectCollection()
- {
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php
deleted file mode 100644
index c2553ee4..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-class NativeMailerHandlerTest extends TestCase
-{
- /**
- * @expectedException InvalidArgumentException
- */
- public function testConstructorHeaderInjection()
- {
- $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', "receiver@example.org\r\nFrom: faked@attacker.org");
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testSetterHeaderInjection()
- {
- $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
- $mailer->addHeader("Content-Type: text/html\r\nFrom: faked@attacker.org");
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testSetterArrayHeaderInjection()
- {
- $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
- $mailer->addHeader(array("Content-Type: text/html\r\nFrom: faked@attacker.org"));
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testSetterContentTypeInjection()
- {
- $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
- $mailer->setContentType("text/html\r\nFrom: faked@attacker.org");
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- public function testSetterEncodingInjection()
- {
- $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
- $mailer->setEncoding("utf-8\r\nFrom: faked@attacker.org");
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php
deleted file mode 100644
index 4eda6155..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php
+++ /dev/null
@@ -1,192 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class NewRelicHandlerTest extends TestCase
-{
- public static $appname;
- public static $customParameters;
- public static $transactionName;
-
- public function setUp()
- {
- self::$appname = null;
- self::$customParameters = array();
- self::$transactionName = null;
- }
-
- /**
- * @expectedException Monolog\Handler\MissingExtensionException
- */
- public function testThehandlerThrowsAnExceptionIfTheNRExtensionIsNotLoaded()
- {
- $handler = new StubNewRelicHandlerWithoutExtension();
- $handler->handle($this->getRecord(Logger::ERROR));
- }
-
- public function testThehandlerCanHandleTheRecord()
- {
- $handler = new StubNewRelicHandler();
- $handler->handle($this->getRecord(Logger::ERROR));
- }
-
- public function testThehandlerCanAddContextParamsToTheNewRelicTrace()
- {
- $handler = new StubNewRelicHandler();
- $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('a' => 'b')));
- $this->assertEquals(array('context_a' => 'b'), self::$customParameters);
- }
-
- public function testThehandlerCanAddExplodedContextParamsToTheNewRelicTrace()
- {
- $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true);
- $handler->handle($this->getRecord(
- Logger::ERROR,
- 'log message',
- array('a' => array('key1' => 'value1', 'key2' => 'value2'))
- ));
- $this->assertEquals(
- array('context_a_key1' => 'value1', 'context_a_key2' => 'value2'),
- self::$customParameters
- );
- }
-
- public function testThehandlerCanAddExtraParamsToTheNewRelicTrace()
- {
- $record = $this->getRecord(Logger::ERROR, 'log message');
- $record['extra'] = array('c' => 'd');
-
- $handler = new StubNewRelicHandler();
- $handler->handle($record);
-
- $this->assertEquals(array('extra_c' => 'd'), self::$customParameters);
- }
-
- public function testThehandlerCanAddExplodedExtraParamsToTheNewRelicTrace()
- {
- $record = $this->getRecord(Logger::ERROR, 'log message');
- $record['extra'] = array('c' => array('key1' => 'value1', 'key2' => 'value2'));
-
- $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true);
- $handler->handle($record);
-
- $this->assertEquals(
- array('extra_c_key1' => 'value1', 'extra_c_key2' => 'value2'),
- self::$customParameters
- );
- }
-
- public function testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace()
- {
- $record = $this->getRecord(Logger::ERROR, 'log message', array('a' => 'b'));
- $record['extra'] = array('c' => 'd');
-
- $handler = new StubNewRelicHandler();
- $handler->handle($record);
-
- $expected = array(
- 'context_a' => 'b',
- 'extra_c' => 'd',
- );
-
- $this->assertEquals($expected, self::$customParameters);
- }
-
- public function testTheAppNameIsNullByDefault()
- {
- $handler = new StubNewRelicHandler();
- $handler->handle($this->getRecord(Logger::ERROR, 'log message'));
-
- $this->assertEquals(null, self::$appname);
- }
-
- public function testTheAppNameCanBeInjectedFromtheConstructor()
- {
- $handler = new StubNewRelicHandler(Logger::DEBUG, false, 'myAppName');
- $handler->handle($this->getRecord(Logger::ERROR, 'log message'));
-
- $this->assertEquals('myAppName', self::$appname);
- }
-
- public function testTheAppNameCanBeOverriddenFromEachLog()
- {
- $handler = new StubNewRelicHandler(Logger::DEBUG, false, 'myAppName');
- $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('appname' => 'logAppName')));
-
- $this->assertEquals('logAppName', self::$appname);
- }
-
- public function testTheTransactionNameIsNullByDefault()
- {
- $handler = new StubNewRelicHandler();
- $handler->handle($this->getRecord(Logger::ERROR, 'log message'));
-
- $this->assertEquals(null, self::$transactionName);
- }
-
- public function testTheTransactionNameCanBeInjectedFromTheConstructor()
- {
- $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction');
- $handler->handle($this->getRecord(Logger::ERROR, 'log message'));
-
- $this->assertEquals('myTransaction', self::$transactionName);
- }
-
- public function testTheTransactionNameCanBeOverriddenFromEachLog()
- {
- $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction');
- $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('transaction_name' => 'logTransactName')));
-
- $this->assertEquals('logTransactName', self::$transactionName);
- }
-}
-
-class StubNewRelicHandlerWithoutExtension extends NewRelicHandler
-{
- protected function isNewRelicEnabled()
- {
- return false;
- }
-}
-
-class StubNewRelicHandler extends NewRelicHandler
-{
- protected function isNewRelicEnabled()
- {
- return true;
- }
-}
-
-function newrelic_notice_error()
-{
- return true;
-}
-
-function newrelic_set_appname($appname)
-{
- return NewRelicHandlerTest::$appname = $appname;
-}
-
-function newrelic_name_transaction($transactionName)
-{
- return NewRelicHandlerTest::$transactionName = $transactionName;
-}
-
-function newrelic_add_custom_parameter($key, $value)
-{
- NewRelicHandlerTest::$customParameters[$key] = $value;
-
- return true;
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php
deleted file mode 100644
index 292df78c..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\NullHandler::handle
- */
-class NullHandlerTest extends TestCase
-{
- public function testHandle()
- {
- $handler = new NullHandler();
- $this->assertTrue($handler->handle($this->getRecord()));
- }
-
- public function testHandleLowerLevelRecord()
- {
- $handler = new NullHandler(Logger::WARNING);
- $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php
deleted file mode 100644
index 64eaab16..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\PsrHandler::handle
- */
-class PsrHandlerTest extends TestCase
-{
- public function logLevelProvider()
- {
- $levels = array();
- $monologLogger = new Logger('');
-
- foreach ($monologLogger->getLevels() as $levelName => $level) {
- $levels[] = array($levelName, $level);
- }
-
- return $levels;
- }
-
- /**
- * @dataProvider logLevelProvider
- */
- public function testHandlesAllLevels($levelName, $level)
- {
- $message = 'Hello, world! ' . $level;
- $context = array('foo' => 'bar', 'level' => $level);
-
- $psrLogger = $this->getMock('Psr\Log\NullLogger');
- $psrLogger->expects($this->once())
- ->method('log')
- ->with(strtolower($levelName), $message, $context);
-
- $handler = new PsrHandler($psrLogger);
- $handler->handle(array('level' => $level, 'level_name' => $levelName, 'message' => $message, 'context' => $context));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php
deleted file mode 100644
index 89408236..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * Almost all examples (expected header, titles, messages) taken from
- * https://www.pushover.net/api
- * @author Sebastian Göttschkes
- * @see https://www.pushover.net/api
- */
-class PushoverHandlerTest extends TestCase
-{
- private $res;
- private $handler;
-
- public function testWriteHeader()
- {
- $this->createHandler();
- $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/POST \/1\/messages.json HTTP\/1.1\\r\\nHost: api.pushover.net\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
-
- return $content;
- }
-
- /**
- * @depends testWriteHeader
- */
- public function testWriteContent($content)
- {
- $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}$/', $content);
- }
-
- public function testWriteWithComplexTitle()
- {
- $this->createHandler('myToken', 'myUser', 'Backup finished - SQL1', Logger::EMERGENCY);
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/title=Backup\+finished\+-\+SQL1/', $content);
- }
-
- public function testWriteWithComplexMessage()
- {
- $this->createHandler();
- $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Backup of database "example" finished in 16 minutes.'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/message=Backup\+of\+database\+%22example%22\+finished\+in\+16\+minutes\./', $content);
- }
-
- public function testWriteWithTooLongMessage()
- {
- $message = str_pad('test', 520, 'a');
- $this->createHandler();
- $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications
- $this->handler->handle($this->getRecord(Logger::CRITICAL, $message));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $expectedMessage = substr($message, 0, 505);
-
- $this->assertRegexp('/message=' . $expectedMessage . '&title/', $content);
- }
-
- public function testWriteWithHighPriority()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=1$/', $content);
- }
-
- public function testWriteWithEmergencyPriority()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200$/', $content);
- }
-
- public function testWriteToMultipleUsers()
- {
- $this->createHandler('myToken', array('userA', 'userB'));
- $this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/token=myToken&user=userA&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200POST/', $content);
- $this->assertRegexp('/token=myToken&user=userB&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200$/', $content);
- }
-
- private function createHandler($token = 'myToken', $user = 'myUser', $title = 'Monolog')
- {
- $constructorArgs = array($token, $user, $title);
- $this->res = fopen('php://memory', 'a');
- $this->handler = $this->getMock(
- '\Monolog\Handler\PushoverHandler',
- array('fsockopen', 'streamSetTimeout', 'closeSocket'),
- $constructorArgs
- );
-
- $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
- $reflectionProperty->setAccessible(true);
- $reflectionProperty->setValue($this->handler, 'localhost:1234');
-
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- $this->handler->expects($this->any())
- ->method('closeSocket')
- ->will($this->returnValue(true));
-
- $this->handler->setFormatter($this->getIdentityFormatter());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php
deleted file mode 100644
index c7b4136c..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php
+++ /dev/null
@@ -1,170 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-class RavenHandlerTest extends TestCase
-{
- public function setUp()
- {
- if (!class_exists("Raven_Client")) {
- $this->markTestSkipped("raven/raven not installed");
- }
-
- require_once __DIR__ . '/MockRavenClient.php';
- }
-
- /**
- * @covers Monolog\Handler\RavenHandler::__construct
- */
- public function testConstruct()
- {
- $handler = new RavenHandler($this->getRavenClient());
- $this->assertInstanceOf('Monolog\Handler\RavenHandler', $handler);
- }
-
- protected function getHandler($ravenClient)
- {
- $handler = new RavenHandler($ravenClient);
-
- return $handler;
- }
-
- protected function getRavenClient()
- {
- $dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1';
-
- return new MockRavenClient($dsn);
- }
-
- public function testDebug()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- $record = $this->getRecord(Logger::DEBUG, "A test debug message");
- $handler->handle($record);
-
- $this->assertEquals($ravenClient::DEBUG, $ravenClient->lastData['level']);
- $this->assertContains($record['message'], $ravenClient->lastData['message']);
- }
-
- public function testWarning()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- $record = $this->getRecord(Logger::WARNING, "A test warning message");
- $handler->handle($record);
-
- $this->assertEquals($ravenClient::WARNING, $ravenClient->lastData['level']);
- $this->assertContains($record['message'], $ravenClient->lastData['message']);
- }
-
- public function testTag()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- $tags = array(1, 2, 'foo');
- $record = $this->getRecord(Logger::INFO, "test", array('tags' => $tags));
- $handler->handle($record);
-
- $this->assertEquals($tags, $ravenClient->lastData['tags']);
- }
-
- public function testUserContext()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- $user = array(
- 'id' => '123',
- 'email' => 'test@test.com'
- );
- $record = $this->getRecord(Logger::INFO, "test", array('user' => $user));
-
- $handler->handle($record);
- $this->assertEquals($user, $ravenClient->context->user);
-
- $secondRecord = $this->getRecord(Logger::INFO, "test without user");
-
- $handler->handle($secondRecord);
- $this->assertNull($ravenClient->context->user);
- }
-
- public function testException()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- try {
- $this->methodThatThrowsAnException();
- } catch (\Exception $e) {
- $record = $this->getRecord(Logger::ERROR, $e->getMessage(), array('exception' => $e));
- $handler->handle($record);
- }
-
- $this->assertEquals($record['message'], $ravenClient->lastData['message']);
- }
-
- public function testHandleBatch()
- {
- $records = $this->getMultipleRecords();
- $records[] = $this->getRecord(Logger::WARNING, 'warning');
- $records[] = $this->getRecord(Logger::WARNING, 'warning');
-
- $logFormatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
- $logFormatter->expects($this->once())->method('formatBatch');
-
- $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
- $formatter->expects($this->once())->method('format')->with($this->callback(function ($record) {
- return $record['level'] == 400;
- }));
-
- $handler = $this->getHandler($this->getRavenClient());
- $handler->setBatchFormatter($logFormatter);
- $handler->setFormatter($formatter);
- $handler->handleBatch($records);
- }
-
- public function testHandleBatchDoNothingIfRecordsAreBelowLevel()
- {
- $records = array(
- $this->getRecord(Logger::DEBUG, 'debug message 1'),
- $this->getRecord(Logger::DEBUG, 'debug message 2'),
- $this->getRecord(Logger::INFO, 'information'),
- );
-
- $handler = $this->getMock('Monolog\Handler\RavenHandler', null, array($this->getRavenClient()));
- $handler->expects($this->never())->method('handle');
- $handler->setLevel(Logger::ERROR);
- $handler->handleBatch($records);
- }
-
- public function testGetSetBatchFormatter()
- {
- $ravenClient = $this->getRavenClient();
- $handler = $this->getHandler($ravenClient);
-
- $handler->setBatchFormatter($formatter = new LineFormatter());
- $this->assertSame($formatter, $handler->getBatchFormatter());
- }
-
- private function methodThatThrowsAnException()
- {
- throw new \Exception('This is an exception');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php
deleted file mode 100644
index 3629f8a2..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-use Monolog\Formatter\LineFormatter;
-
-class RedisHandlerTest extends TestCase
-{
- /**
- * @expectedException InvalidArgumentException
- */
- public function testConstructorShouldThrowExceptionForInvalidRedis()
- {
- new RedisHandler(new \stdClass(), 'key');
- }
-
- public function testConstructorShouldWorkWithPredis()
- {
- $redis = $this->getMock('Predis\Client');
- $this->assertInstanceof('Monolog\Handler\RedisHandler', new RedisHandler($redis, 'key'));
- }
-
- public function testConstructorShouldWorkWithRedis()
- {
- $redis = $this->getMock('Redis');
- $this->assertInstanceof('Monolog\Handler\RedisHandler', new RedisHandler($redis, 'key'));
- }
-
- public function testPredisHandle()
- {
- $redis = $this->getMock('Predis\Client', array('rpush'));
-
- // Predis\Client uses rpush
- $redis->expects($this->once())
- ->method('rpush')
- ->with('key', 'test');
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $handler = new RedisHandler($redis, 'key');
- $handler->setFormatter(new LineFormatter("%message%"));
- $handler->handle($record);
- }
-
- public function testRedisHandle()
- {
- $redis = $this->getMock('Redis', array('rpush'));
-
- // Redis uses rPush
- $redis->expects($this->once())
- ->method('rPush')
- ->with('key', 'test');
-
- $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34));
-
- $handler = new RedisHandler($redis, 'key');
- $handler->setFormatter(new LineFormatter("%message%"));
- $handler->handle($record);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php
deleted file mode 100644
index f4cefda1..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-/**
- * @covers Monolog\Handler\RotatingFileHandler
- */
-class RotatingFileHandlerTest extends TestCase
-{
- public function setUp()
- {
- $dir = __DIR__.'/Fixtures';
- chmod($dir, 0777);
- if (!is_writable($dir)) {
- $this->markTestSkipped($dir.' must be writeable to test the RotatingFileHandler.');
- }
- }
-
- public function testRotationCreatesNewFile()
- {
- touch(__DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400).'.rot');
-
- $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot');
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord());
-
- $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot';
- $this->assertTrue(file_exists($log));
- $this->assertEquals('test', file_get_contents($log));
- }
-
- /**
- * @dataProvider rotationTests
- */
- public function testRotation($createFile)
- {
- touch($old1 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400).'.rot');
- touch($old2 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 2).'.rot');
- touch($old3 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 3).'.rot');
- touch($old4 = __DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400 * 4).'.rot');
-
- $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot';
-
- if ($createFile) {
- touch($log);
- }
-
- $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2);
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord());
-
- $handler->close();
-
- $this->assertTrue(file_exists($log));
- $this->assertTrue(file_exists($old1));
- $this->assertEquals($createFile, file_exists($old2));
- $this->assertEquals($createFile, file_exists($old3));
- $this->assertEquals($createFile, file_exists($old4));
- $this->assertEquals('test', file_get_contents($log));
- }
-
- public function rotationTests()
- {
- return array(
- 'Rotation is triggered when the file of the current day is not present'
- => array(true),
- 'Rotation is not triggered when the file is already present'
- => array(false),
- );
- }
-
- public function testReuseCurrentFile()
- {
- $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot';
- file_put_contents($log, "foo");
- $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot');
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord());
- $this->assertEquals('footest', file_get_contents($log));
- }
-
- public function tearDown()
- {
- foreach (glob(__DIR__.'/Fixtures/*.rot') as $file) {
- unlink($file);
- }
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php
deleted file mode 100644
index b354cee1..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-/**
- * @covers Monolog\Handler\SamplingHandler::handle
- */
-class SamplingHandlerTest extends TestCase
-{
- public function testHandle()
- {
- $testHandler = new TestHandler();
- $handler = new SamplingHandler($testHandler, 2);
- for ($i = 0; $i < 10000; $i++) {
- $handler->handle($this->getRecord());
- }
- $count = count($testHandler->getRecords());
- // $count should be half of 10k, so between 4k and 6k
- $this->assertLessThan(6000, $count);
- $this->assertGreaterThan(4000, $count);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php
deleted file mode 100644
index d657fae3..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @author Greg Kedzierski
- * @see https://api.slack.com/
- */
-class SlackHandlerTest extends TestCase
-{
- /**
- * @var resource
- */
- private $res;
-
- /**
- * @var SlackHandler
- */
- private $handler;
-
- public function setUp()
- {
- if (!extension_loaded('openssl')) {
- $this->markTestSkipped('This test requires openssl to run');
- }
- }
-
- public function testWriteHeader()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/POST \/api\/chat.postMessage HTTP\/1.1\\r\\nHost: slack.com\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content);
- }
-
- public function testWriteContent()
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=&attachments=.*$/', $content);
- }
-
- public function testWriteContentWithEmoji()
- {
- $this->createHandler('myToken', 'channel1', 'Monolog', true, 'alien');
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/icon_emoji=%3Aalien%3A$/', $content);
- }
-
- /**
- * @dataProvider provideLevelColors
- */
- public function testWriteContentWithColors($level, $expectedColor)
- {
- $this->createHandler();
- $this->handler->handle($this->getRecord($level, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/color%22%3A%22'.$expectedColor.'/', $content);
- }
-
- public function testWriteContentWithPlainTextMessage()
- {
- $this->createHandler('myToken', 'channel1', 'Monolog', false);
- $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1'));
- fseek($this->res, 0);
- $content = fread($this->res, 1024);
-
- $this->assertRegexp('/text=test1/', $content);
- }
-
- public function provideLevelColors()
- {
- return array(
- array(Logger::DEBUG, '%23e3e4e6'), // escaped #e3e4e6
- array(Logger::INFO, 'good'),
- array(Logger::NOTICE, 'good'),
- array(Logger::WARNING, 'warning'),
- array(Logger::ERROR, 'danger'),
- array(Logger::CRITICAL, 'danger'),
- array(Logger::ALERT, 'danger'),
- array(Logger::EMERGENCY,'danger'),
- );
- }
-
- private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeExtra = false)
- {
- $constructorArgs = array($token, $channel, $username, $useAttachment, $iconEmoji, Logger::DEBUG, true, $useShortAttachment, $includeExtra);
- $this->res = fopen('php://memory', 'a');
- $this->handler = $this->getMock(
- '\Monolog\Handler\SlackHandler',
- array('fsockopen', 'streamSetTimeout', 'closeSocket'),
- $constructorArgs
- );
-
- $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
- $reflectionProperty->setAccessible(true);
- $reflectionProperty->setValue($this->handler, 'localhost:1234');
-
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- $this->handler->expects($this->any())
- ->method('closeSocket')
- ->will($this->returnValue(true));
-
- $this->handler->setFormatter($this->getIdentityFormatter());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php
deleted file mode 100644
index 2e3d504a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php
+++ /dev/null
@@ -1,282 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @author Pablo de Leon Belloc
- */
-class SocketHandlerTest extends TestCase
-{
- /**
- * @var Monolog\Handler\SocketHandler
- */
- private $handler;
-
- /**
- * @var resource
- */
- private $res;
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testInvalidHostname()
- {
- $this->createHandler('garbage://here');
- $this->writeRecord('data');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testBadConnectionTimeout()
- {
- $this->createHandler('localhost:1234');
- $this->handler->setConnectionTimeout(-1);
- }
-
- public function testSetConnectionTimeout()
- {
- $this->createHandler('localhost:1234');
- $this->handler->setConnectionTimeout(10.1);
- $this->assertEquals(10.1, $this->handler->getConnectionTimeout());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testBadTimeout()
- {
- $this->createHandler('localhost:1234');
- $this->handler->setTimeout(-1);
- }
-
- public function testSetTimeout()
- {
- $this->createHandler('localhost:1234');
- $this->handler->setTimeout(10.25);
- $this->assertEquals(10.25, $this->handler->getTimeout());
- }
-
- public function testSetConnectionString()
- {
- $this->createHandler('tcp://localhost:9090');
- $this->assertEquals('tcp://localhost:9090', $this->handler->getConnectionString());
- }
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testExceptionIsThrownOnFsockopenError()
- {
- $this->setMockHandler(array('fsockopen'));
- $this->handler->expects($this->once())
- ->method('fsockopen')
- ->will($this->returnValue(false));
- $this->writeRecord('Hello world');
- }
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testExceptionIsThrownOnPfsockopenError()
- {
- $this->setMockHandler(array('pfsockopen'));
- $this->handler->expects($this->once())
- ->method('pfsockopen')
- ->will($this->returnValue(false));
- $this->handler->setPersistent(true);
- $this->writeRecord('Hello world');
- }
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testExceptionIsThrownIfCannotSetTimeout()
- {
- $this->setMockHandler(array('streamSetTimeout'));
- $this->handler->expects($this->once())
- ->method('streamSetTimeout')
- ->will($this->returnValue(false));
- $this->writeRecord('Hello world');
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testWriteFailsOnIfFwriteReturnsFalse()
- {
- $this->setMockHandler(array('fwrite'));
-
- $callback = function ($arg) {
- $map = array(
- 'Hello world' => 6,
- 'world' => false,
- );
-
- return $map[$arg];
- };
-
- $this->handler->expects($this->exactly(2))
- ->method('fwrite')
- ->will($this->returnCallback($callback));
-
- $this->writeRecord('Hello world');
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testWriteFailsIfStreamTimesOut()
- {
- $this->setMockHandler(array('fwrite', 'streamGetMetadata'));
-
- $callback = function ($arg) {
- $map = array(
- 'Hello world' => 6,
- 'world' => 5,
- );
-
- return $map[$arg];
- };
-
- $this->handler->expects($this->exactly(1))
- ->method('fwrite')
- ->will($this->returnCallback($callback));
- $this->handler->expects($this->exactly(1))
- ->method('streamGetMetadata')
- ->will($this->returnValue(array('timed_out' => true)));
-
- $this->writeRecord('Hello world');
- }
-
- /**
- * @expectedException RuntimeException
- */
- public function testWriteFailsOnIncompleteWrite()
- {
- $this->setMockHandler(array('fwrite', 'streamGetMetadata'));
-
- $res = $this->res;
- $callback = function ($string) use ($res) {
- fclose($res);
-
- return strlen('Hello');
- };
-
- $this->handler->expects($this->exactly(1))
- ->method('fwrite')
- ->will($this->returnCallback($callback));
- $this->handler->expects($this->exactly(1))
- ->method('streamGetMetadata')
- ->will($this->returnValue(array('timed_out' => false)));
-
- $this->writeRecord('Hello world');
- }
-
- public function testWriteWithMemoryFile()
- {
- $this->setMockHandler();
- $this->writeRecord('test1');
- $this->writeRecord('test2');
- $this->writeRecord('test3');
- fseek($this->res, 0);
- $this->assertEquals('test1test2test3', fread($this->res, 1024));
- }
-
- public function testWriteWithMock()
- {
- $this->setMockHandler(array('fwrite'));
-
- $callback = function ($arg) {
- $map = array(
- 'Hello world' => 6,
- 'world' => 5,
- );
-
- return $map[$arg];
- };
-
- $this->handler->expects($this->exactly(2))
- ->method('fwrite')
- ->will($this->returnCallback($callback));
-
- $this->writeRecord('Hello world');
- }
-
- public function testClose()
- {
- $this->setMockHandler();
- $this->writeRecord('Hello world');
- $this->assertInternalType('resource', $this->res);
- $this->handler->close();
- $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler");
- }
-
- public function testCloseDoesNotClosePersistentSocket()
- {
- $this->setMockHandler();
- $this->handler->setPersistent(true);
- $this->writeRecord('Hello world');
- $this->assertTrue(is_resource($this->res));
- $this->handler->close();
- $this->assertTrue(is_resource($this->res));
- }
-
- private function createHandler($connectionString)
- {
- $this->handler = new SocketHandler($connectionString);
- $this->handler->setFormatter($this->getIdentityFormatter());
- }
-
- private function writeRecord($string)
- {
- $this->handler->handle($this->getRecord(Logger::WARNING, $string));
- }
-
- private function setMockHandler(array $methods = array())
- {
- $this->res = fopen('php://memory', 'a');
-
- $defaultMethods = array('fsockopen', 'pfsockopen', 'streamSetTimeout');
- $newMethods = array_diff($methods, $defaultMethods);
-
- $finalMethods = array_merge($defaultMethods, $newMethods);
-
- $this->handler = $this->getMock(
- '\Monolog\Handler\SocketHandler', $finalMethods, array('localhost:1234')
- );
-
- if (!in_array('fsockopen', $methods)) {
- $this->handler->expects($this->any())
- ->method('fsockopen')
- ->will($this->returnValue($this->res));
- }
-
- if (!in_array('pfsockopen', $methods)) {
- $this->handler->expects($this->any())
- ->method('pfsockopen')
- ->will($this->returnValue($this->res));
- }
-
- if (!in_array('streamSetTimeout', $methods)) {
- $this->handler->expects($this->any())
- ->method('streamSetTimeout')
- ->will($this->returnValue(true));
- }
-
- $this->handler->setFormatter($this->getIdentityFormatter());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php
deleted file mode 100644
index 44d3d9f1..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class StreamHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\StreamHandler::__construct
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWrite()
- {
- $handle = fopen('php://memory', 'a+');
- $handler = new StreamHandler($handle);
- $handler->setFormatter($this->getIdentityFormatter());
- $handler->handle($this->getRecord(Logger::WARNING, 'test'));
- $handler->handle($this->getRecord(Logger::WARNING, 'test2'));
- $handler->handle($this->getRecord(Logger::WARNING, 'test3'));
- fseek($handle, 0);
- $this->assertEquals('testtest2test3', fread($handle, 100));
- }
-
- /**
- * @covers Monolog\Handler\StreamHandler::close
- */
- public function testClose()
- {
- $handle = fopen('php://memory', 'a+');
- $handler = new StreamHandler($handle);
- $this->assertTrue(is_resource($handle));
- $handler->close();
- $this->assertFalse(is_resource($handle));
- }
-
- /**
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWriteCreatesTheStreamResource()
- {
- $handler = new StreamHandler('php://memory');
- $handler->handle($this->getRecord());
- }
-
- /**
- * @covers Monolog\Handler\StreamHandler::__construct
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWriteLocking()
- {
- $temp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'monolog_locked_log';
- $handler = new StreamHandler($temp, Logger::DEBUG, true, null, true);
- $handler->handle($this->getRecord());
- }
-
- /**
- * @expectedException LogicException
- * @covers Monolog\Handler\StreamHandler::__construct
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWriteMissingResource()
- {
- $handler = new StreamHandler(null);
- $handler->handle($this->getRecord());
- }
-
- public function invalidArgumentProvider()
- {
- return array(
- array(1),
- array(array()),
- array(array('bogus://url')),
- );
- }
-
- /**
- * @dataProvider invalidArgumentProvider
- * @expectedException InvalidArgumentException
- * @covers Monolog\Handler\StreamHandler::__construct
- */
- public function testWriteInvalidArgument($invalidArgument)
- {
- $handler = new StreamHandler($invalidArgument);
- }
-
- /**
- * @expectedException UnexpectedValueException
- * @covers Monolog\Handler\StreamHandler::__construct
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWriteInvalidResource()
- {
- $handler = new StreamHandler('bogus://url');
- $handler->handle($this->getRecord());
- }
-
- /**
- * @expectedException UnexpectedValueException
- * @covers Monolog\Handler\StreamHandler::__construct
- * @covers Monolog\Handler\StreamHandler::write
- */
- public function testWriteNonExistingResource()
- {
- $handler = new StreamHandler('/foo/bar/baz/'.rand(0, 10000));
- $handler->handle($this->getRecord());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php
deleted file mode 100644
index ac885220..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-mailer = $this
- ->getMockBuilder('Swift_Mailer')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- public function testMessageCreationIsLazyWhenUsingCallback()
- {
- $this->mailer->expects($this->never())
- ->method('send');
-
- $callback = function () {
- throw new \RuntimeException('Swift_Message creation callback should not have been called in this test');
- };
- $handler = new SwiftMailerHandler($this->mailer, $callback);
-
- $records = array(
- $this->getRecord(Logger::DEBUG),
- $this->getRecord(Logger::INFO),
- );
- $handler->handleBatch($records);
- }
-
- public function testMessageCanBeCustomizedGivenLoggedData()
- {
- // Wire Mailer to expect a specific Swift_Message with a customized Subject
- $expectedMessage = new \Swift_Message();
- $this->mailer->expects($this->once())
- ->method('send')
- ->with($this->callback(function ($value) use ($expectedMessage) {
- return $value instanceof \Swift_Message
- && $value->getSubject() === 'Emergency'
- && $value === $expectedMessage;
- }));
-
- // Callback dynamically changes subject based on number of logged records
- $callback = function ($content, array $records) use ($expectedMessage) {
- $subject = count($records) > 0 ? 'Emergency' : 'Normal';
- $expectedMessage->setSubject($subject);
-
- return $expectedMessage;
- };
- $handler = new SwiftMailerHandler($this->mailer, $callback);
-
- // Logging 1 record makes this an Emergency
- $records = array(
- $this->getRecord(Logger::EMERGENCY),
- );
- $handler->handleBatch($records);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php
deleted file mode 100644
index 8f9e46bf..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\Logger;
-
-class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @covers Monolog\Handler\SyslogHandler::__construct
- */
- public function testConstruct()
- {
- $handler = new SyslogHandler('test');
- $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
-
- $handler = new SyslogHandler('test', LOG_USER);
- $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
-
- $handler = new SyslogHandler('test', 'user');
- $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
-
- $handler = new SyslogHandler('test', LOG_USER, Logger::DEBUG, true, LOG_PERROR);
- $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
- }
-
- /**
- * @covers Monolog\Handler\SyslogHandler::__construct
- */
- public function testConstructInvalidFacility()
- {
- $this->setExpectedException('UnexpectedValueException');
- $handler = new SyslogHandler('test', 'unknown');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php
deleted file mode 100644
index 497812b3..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-/**
- * @requires extension sockets
- */
-class SyslogUdpHandlerTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @expectedException UnexpectedValueException
- */
- public function testWeValidateFacilities()
- {
- $handler = new SyslogUdpHandler("ip", null, "invalidFacility");
- }
-
- public function testWeSplitIntoLines()
- {
- $handler = new SyslogUdpHandler("127.0.0.1", 514, "authpriv");
- $handler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter());
-
- $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol'));
- $socket->expects($this->at(0))
- ->method('write')
- ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
- $socket->expects($this->at(1))
- ->method('write')
- ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
-
- $handler->setSocket($socket);
-
- $handler->handle($this->getRecordWithMessage("hej\nlol"));
- }
-
- protected function getRecordWithMessage($msg)
- {
- return array('message' => $msg, 'level' => \Monolog\Logger::WARNING, 'context' => null, 'extra' => array(), 'channel' => 'lol');
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php
deleted file mode 100644
index 801d80a9..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-/**
- * @covers Monolog\Handler\TestHandler
- */
-class TestHandlerTest extends TestCase
-{
- /**
- * @dataProvider methodProvider
- */
- public function testHandler($method, $level)
- {
- $handler = new TestHandler;
- $record = $this->getRecord($level, 'test'.$method);
- $this->assertFalse($handler->{'has'.$method}($record));
- $this->assertFalse($handler->{'has'.$method.'Records'}());
- $handler->handle($record);
-
- $this->assertFalse($handler->{'has'.$method}('bar'));
- $this->assertTrue($handler->{'has'.$method}($record));
- $this->assertTrue($handler->{'has'.$method}('test'.$method));
- $this->assertTrue($handler->{'has'.$method.'Records'}());
-
- $records = $handler->getRecords();
- unset($records[0]['formatted']);
- $this->assertEquals(array($record), $records);
- }
-
- public function methodProvider()
- {
- return array(
- array('Emergency', Logger::EMERGENCY),
- array('Alert' , Logger::ALERT),
- array('Critical' , Logger::CRITICAL),
- array('Error' , Logger::ERROR),
- array('Warning' , Logger::WARNING),
- array('Info' , Logger::INFO),
- array('Notice' , Logger::NOTICE),
- array('Debug' , Logger::DEBUG),
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php
deleted file mode 100644
index bcaf52b3..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-/**
- * @requires extension sockets
- */
-class UdpSocketTest extends TestCase
-{
- public function testWeDoNotTruncateShortMessages()
- {
- $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol'));
-
- $socket->expects($this->at(0))
- ->method('send')
- ->with("HEADER: The quick brown fox jumps over the lazy dog");
-
- $socket->write("The quick brown fox jumps over the lazy dog", "HEADER: ");
- }
-
- public function testLongMessagesAreTruncated()
- {
- $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol'));
-
- $truncatedString = str_repeat("derp", 16254).'d';
-
- $socket->expects($this->exactly(1))
- ->method('send')
- ->with("HEADER" . $truncatedString);
-
- $longString = str_repeat("derp", 20000);
-
- $socket->write($longString, "HEADER");
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
deleted file mode 100644
index 8d37a1fc..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-use Monolog\Logger;
-
-class WhatFailureGroupHandlerTest extends TestCase
-{
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::__construct
- * @expectedException InvalidArgumentException
- */
- public function testConstructorOnlyTakesHandler()
- {
- new WhatFailureGroupHandler(array(new TestHandler(), "foo"));
- }
-
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::__construct
- * @covers Monolog\Handler\WhatFailureGroupHandler::handle
- */
- public function testHandle()
- {
- $testHandlers = array(new TestHandler(), new TestHandler());
- $handler = new WhatFailureGroupHandler($testHandlers);
- $handler->handle($this->getRecord(Logger::DEBUG));
- $handler->handle($this->getRecord(Logger::INFO));
- foreach ($testHandlers as $test) {
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 2);
- }
- }
-
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::handleBatch
- */
- public function testHandleBatch()
- {
- $testHandlers = array(new TestHandler(), new TestHandler());
- $handler = new WhatFailureGroupHandler($testHandlers);
- $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
- foreach ($testHandlers as $test) {
- $this->assertTrue($test->hasDebugRecords());
- $this->assertTrue($test->hasInfoRecords());
- $this->assertTrue(count($test->getRecords()) === 2);
- }
- }
-
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::isHandling
- */
- public function testIsHandling()
- {
- $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING));
- $handler = new WhatFailureGroupHandler($testHandlers);
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR)));
- $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING)));
- $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
- }
-
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::handle
- */
- public function testHandleUsesProcessors()
- {
- $test = new TestHandler();
- $handler = new WhatFailureGroupHandler(array($test));
- $handler->pushProcessor(function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-
- /**
- * @covers Monolog\Handler\WhatFailureGroupHandler::handle
- */
- public function testHandleException()
- {
- $test = new TestHandler();
- $exception = new ExceptionTestHandler();
- $handler = new WhatFailureGroupHandler(array($exception, $test, $exception));
- $handler->pushProcessor(function ($record) {
- $record['extra']['foo'] = true;
-
- return $record;
- });
- $handler->handle($this->getRecord(Logger::WARNING));
- $this->assertTrue($test->hasWarningRecords());
- $records = $test->getRecords();
- $this->assertTrue($records[0]['extra']['foo']);
- }
-}
-
-class ExceptionTestHandler extends TestHandler
-{
- /**
- * {@inheritdoc}
- */
- public function handle(array $record)
- {
- parent::handle($record);
-
- throw new \Exception("ExceptionTestHandler::handle");
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php
deleted file mode 100644
index 416039e6..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Handler;
-
-use Monolog\TestCase;
-
-class ZendMonitorHandlerTest extends TestCase
-{
- protected $zendMonitorHandler;
-
- public function setUp()
- {
- if (!function_exists('zend_monitor_custom_event')) {
- $this->markTestSkipped('ZendServer is not installed');
- }
- }
-
- /**
- * @covers Monolog\Handler\ZendMonitorHandler::write
- */
- public function testWrite()
- {
- $record = $this->getRecord();
- $formatterResult = array(
- 'message' => $record['message']
- );
-
- $zendMonitor = $this->getMockBuilder('Monolog\Handler\ZendMonitorHandler')
- ->setMethods(array('writeZendMonitorCustomEvent', 'getDefaultFormatter'))
- ->getMock();
-
- $formatterMock = $this->getMockBuilder('Monolog\Formatter\NormalizerFormatter')
- ->disableOriginalConstructor()
- ->getMock();
-
- $formatterMock->expects($this->once())
- ->method('format')
- ->will($this->returnValue($formatterResult));
-
- $zendMonitor->expects($this->once())
- ->method('getDefaultFormatter')
- ->will($this->returnValue($formatterMock));
-
- $levelMap = $zendMonitor->getLevelMap();
-
- $zendMonitor->expects($this->once())
- ->method('writeZendMonitorCustomEvent')
- ->with($levelMap[$record['level']], $record['message'], $formatterResult);
-
- $zendMonitor->handle($record);
- }
-
- /**
- * @covers Monolog\Handler\ZendMonitorHandler::getDefaultFormatter
- */
- public function testGetDefaultFormatterReturnsNormalizerFormatter()
- {
- $zendMonitor = new ZendMonitorHandler();
- $this->assertInstanceOf('Monolog\Formatter\NormalizerFormatter', $zendMonitor->getDefaultFormatter());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/LoggerTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/LoggerTest.php
deleted file mode 100644
index 7a19c0b4..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/LoggerTest.php
+++ /dev/null
@@ -1,409 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use Monolog\Processor\WebProcessor;
-use Monolog\Handler\TestHandler;
-
-class LoggerTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @covers Monolog\Logger::getName
- */
- public function testGetName()
- {
- $logger = new Logger('foo');
- $this->assertEquals('foo', $logger->getName());
- }
-
- /**
- * @covers Monolog\Logger::getLevelName
- */
- public function testGetLevelName()
- {
- $this->assertEquals('ERROR', Logger::getLevelName(Logger::ERROR));
- }
-
- /**
- * @covers Monolog\Logger::getLevelName
- * @expectedException InvalidArgumentException
- */
- public function testGetLevelNameThrows()
- {
- Logger::getLevelName(5);
- }
-
- /**
- * @covers Monolog\Logger::__construct
- */
- public function testChannel()
- {
- $logger = new Logger('foo');
- $handler = new TestHandler;
- $logger->pushHandler($handler);
- $logger->addWarning('test');
- list($record) = $handler->getRecords();
- $this->assertEquals('foo', $record['channel']);
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testLog()
- {
- $logger = new Logger(__METHOD__);
-
- $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle'));
- $handler->expects($this->once())
- ->method('handle');
- $logger->pushHandler($handler);
-
- $this->assertTrue($logger->addWarning('test'));
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testLogNotHandled()
- {
- $logger = new Logger(__METHOD__);
-
- $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle'), array(Logger::ERROR));
- $handler->expects($this->never())
- ->method('handle');
- $logger->pushHandler($handler);
-
- $this->assertFalse($logger->addWarning('test'));
- }
-
- public function testHandlersInCtor()
- {
- $handler1 = new TestHandler;
- $handler2 = new TestHandler;
- $logger = new Logger(__METHOD__, array($handler1, $handler2));
-
- $this->assertEquals($handler1, $logger->popHandler());
- $this->assertEquals($handler2, $logger->popHandler());
- }
-
- public function testProcessorsInCtor()
- {
- $processor1 = new WebProcessor;
- $processor2 = new WebProcessor;
- $logger = new Logger(__METHOD__, array(), array($processor1, $processor2));
-
- $this->assertEquals($processor1, $logger->popProcessor());
- $this->assertEquals($processor2, $logger->popProcessor());
- }
-
- /**
- * @covers Monolog\Logger::pushHandler
- * @covers Monolog\Logger::popHandler
- * @expectedException LogicException
- */
- public function testPushPopHandler()
- {
- $logger = new Logger(__METHOD__);
- $handler1 = new TestHandler;
- $handler2 = new TestHandler;
-
- $logger->pushHandler($handler1);
- $logger->pushHandler($handler2);
-
- $this->assertEquals($handler2, $logger->popHandler());
- $this->assertEquals($handler1, $logger->popHandler());
- $logger->popHandler();
- }
-
- /**
- * @covers Monolog\Logger::pushProcessor
- * @covers Monolog\Logger::popProcessor
- * @expectedException LogicException
- */
- public function testPushPopProcessor()
- {
- $logger = new Logger(__METHOD__);
- $processor1 = new WebProcessor;
- $processor2 = new WebProcessor;
-
- $logger->pushProcessor($processor1);
- $logger->pushProcessor($processor2);
-
- $this->assertEquals($processor2, $logger->popProcessor());
- $this->assertEquals($processor1, $logger->popProcessor());
- $logger->popProcessor();
- }
-
- /**
- * @covers Monolog\Logger::pushProcessor
- * @expectedException InvalidArgumentException
- */
- public function testPushProcessorWithNonCallable()
- {
- $logger = new Logger(__METHOD__);
-
- $logger->pushProcessor(new \stdClass());
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testProcessorsAreExecuted()
- {
- $logger = new Logger(__METHOD__);
- $handler = new TestHandler;
- $logger->pushHandler($handler);
- $logger->pushProcessor(function ($record) {
- $record['extra']['win'] = true;
-
- return $record;
- });
- $logger->addError('test');
- list($record) = $handler->getRecords();
- $this->assertTrue($record['extra']['win']);
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testProcessorsAreCalledOnlyOnce()
- {
- $logger = new Logger(__METHOD__);
- $handler = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler->expects($this->any())
- ->method('handle')
- ->will($this->returnValue(true))
- ;
- $logger->pushHandler($handler);
-
- $processor = $this->getMockBuilder('Monolog\Processor\WebProcessor')
- ->disableOriginalConstructor()
- ->setMethods(array('__invoke'))
- ->getMock()
- ;
- $processor->expects($this->once())
- ->method('__invoke')
- ->will($this->returnArgument(0))
- ;
- $logger->pushProcessor($processor);
-
- $logger->addError('test');
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testProcessorsNotCalledWhenNotHandled()
- {
- $logger = new Logger(__METHOD__);
- $handler = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler->expects($this->once())
- ->method('isHandling')
- ->will($this->returnValue(false))
- ;
- $logger->pushHandler($handler);
- $that = $this;
- $logger->pushProcessor(function ($record) use ($that) {
- $that->fail('The processor should not be called');
- });
- $logger->addAlert('test');
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testHandlersNotCalledBeforeFirstHandling()
- {
- $logger = new Logger(__METHOD__);
-
- $handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler1->expects($this->never())
- ->method('isHandling')
- ->will($this->returnValue(false))
- ;
- $handler1->expects($this->once())
- ->method('handle')
- ->will($this->returnValue(false))
- ;
- $logger->pushHandler($handler1);
-
- $handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler2->expects($this->once())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler2->expects($this->once())
- ->method('handle')
- ->will($this->returnValue(false))
- ;
- $logger->pushHandler($handler2);
-
- $handler3 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler3->expects($this->once())
- ->method('isHandling')
- ->will($this->returnValue(false))
- ;
- $handler3->expects($this->never())
- ->method('handle')
- ;
- $logger->pushHandler($handler3);
-
- $logger->debug('test');
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testBubblingWhenTheHandlerReturnsFalse()
- {
- $logger = new Logger(__METHOD__);
-
- $handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler1->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler1->expects($this->once())
- ->method('handle')
- ->will($this->returnValue(false))
- ;
- $logger->pushHandler($handler1);
-
- $handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler2->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler2->expects($this->once())
- ->method('handle')
- ->will($this->returnValue(false))
- ;
- $logger->pushHandler($handler2);
-
- $logger->debug('test');
- }
-
- /**
- * @covers Monolog\Logger::addRecord
- */
- public function testNotBubblingWhenTheHandlerReturnsTrue()
- {
- $logger = new Logger(__METHOD__);
-
- $handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler1->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler1->expects($this->never())
- ->method('handle')
- ;
- $logger->pushHandler($handler1);
-
- $handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler2->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
- $handler2->expects($this->once())
- ->method('handle')
- ->will($this->returnValue(true))
- ;
- $logger->pushHandler($handler2);
-
- $logger->debug('test');
- }
-
- /**
- * @covers Monolog\Logger::isHandling
- */
- public function testIsHandling()
- {
- $logger = new Logger(__METHOD__);
-
- $handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler1->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(false))
- ;
-
- $logger->pushHandler($handler1);
- $this->assertFalse($logger->isHandling(Logger::DEBUG));
-
- $handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
- $handler2->expects($this->any())
- ->method('isHandling')
- ->will($this->returnValue(true))
- ;
-
- $logger->pushHandler($handler2);
- $this->assertTrue($logger->isHandling(Logger::DEBUG));
- }
-
- /**
- * @dataProvider logMethodProvider
- * @covers Monolog\Logger::addDebug
- * @covers Monolog\Logger::addInfo
- * @covers Monolog\Logger::addNotice
- * @covers Monolog\Logger::addWarning
- * @covers Monolog\Logger::addError
- * @covers Monolog\Logger::addCritical
- * @covers Monolog\Logger::addAlert
- * @covers Monolog\Logger::addEmergency
- * @covers Monolog\Logger::debug
- * @covers Monolog\Logger::info
- * @covers Monolog\Logger::notice
- * @covers Monolog\Logger::warn
- * @covers Monolog\Logger::err
- * @covers Monolog\Logger::crit
- * @covers Monolog\Logger::alert
- * @covers Monolog\Logger::emerg
- */
- public function testLogMethods($method, $expectedLevel)
- {
- $logger = new Logger('foo');
- $handler = new TestHandler;
- $logger->pushHandler($handler);
- $logger->{$method}('test');
- list($record) = $handler->getRecords();
- $this->assertEquals($expectedLevel, $record['level']);
- }
-
- public function logMethodProvider()
- {
- return array(
- // monolog methods
- array('addDebug', Logger::DEBUG),
- array('addInfo', Logger::INFO),
- array('addNotice', Logger::NOTICE),
- array('addWarning', Logger::WARNING),
- array('addError', Logger::ERROR),
- array('addCritical', Logger::CRITICAL),
- array('addAlert', Logger::ALERT),
- array('addEmergency', Logger::EMERGENCY),
-
- // ZF/Sf2 compat methods
- array('debug', Logger::DEBUG),
- array('info', Logger::INFO),
- array('notice', Logger::NOTICE),
- array('warn', Logger::WARNING),
- array('err', Logger::ERROR),
- array('crit', Logger::CRITICAL),
- array('alert', Logger::ALERT),
- array('emerg', Logger::EMERGENCY),
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/GitProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/GitProcessorTest.php
deleted file mode 100644
index 5adb505d..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/GitProcessorTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class GitProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\GitProcessor::__invoke
- */
- public function testProcessor()
- {
- $processor = new GitProcessor();
- $record = $processor($this->getRecord());
-
- $this->assertArrayHasKey('git', $record['extra']);
- $this->assertTrue(!is_array($record['extra']['git']['branch']));
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php
deleted file mode 100644
index 0dd411d7..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Acme;
-
-class Tester
-{
- public function test($handler, $record)
- {
- $handler->handle($record);
- }
-}
-
-function tester($handler, $record)
-{
- $handler->handle($record);
-}
-
-namespace Monolog\Processor;
-
-use Monolog\Logger;
-use Monolog\TestCase;
-use Monolog\Handler\TestHandler;
-
-class IntrospectionProcessorTest extends TestCase
-{
- public function getHandler()
- {
- $processor = new IntrospectionProcessor();
- $handler = new TestHandler();
- $handler->pushProcessor($processor);
-
- return $handler;
- }
-
- public function testProcessorFromClass()
- {
- $handler = $this->getHandler();
- $tester = new \Acme\Tester;
- $tester->test($handler, $this->getRecord());
- list($record) = $handler->getRecords();
- $this->assertEquals(__FILE__, $record['extra']['file']);
- $this->assertEquals(18, $record['extra']['line']);
- $this->assertEquals('Acme\Tester', $record['extra']['class']);
- $this->assertEquals('test', $record['extra']['function']);
- }
-
- public function testProcessorFromFunc()
- {
- $handler = $this->getHandler();
- \Acme\tester($handler, $this->getRecord());
- list($record) = $handler->getRecords();
- $this->assertEquals(__FILE__, $record['extra']['file']);
- $this->assertEquals(24, $record['extra']['line']);
- $this->assertEquals(null, $record['extra']['class']);
- $this->assertEquals('Acme\tester', $record['extra']['function']);
- }
-
- public function testLevelTooLow()
- {
- $input = array(
- 'level' => Logger::DEBUG,
- 'extra' => array(),
- );
-
- $expected = $input;
-
- $processor = new IntrospectionProcessor(Logger::CRITICAL);
- $actual = $processor($input);
-
- $this->assertEquals($expected, $actual);
- }
-
- public function testLevelEqual()
- {
- $input = array(
- 'level' => Logger::CRITICAL,
- 'extra' => array(),
- );
-
- $expected = $input;
- $expected['extra'] = array(
- 'file' => null,
- 'line' => null,
- 'class' => 'ReflectionMethod',
- 'function' => 'invokeArgs',
- );
-
- $processor = new IntrospectionProcessor(Logger::CRITICAL);
- $actual = $processor($input);
-
- $this->assertEquals($expected, $actual);
- }
-
- public function testLevelHigher()
- {
- $input = array(
- 'level' => Logger::EMERGENCY,
- 'extra' => array(),
- );
-
- $expected = $input;
- $expected['extra'] = array(
- 'file' => null,
- 'line' => null,
- 'class' => 'ReflectionMethod',
- 'function' => 'invokeArgs',
- );
-
- $processor = new IntrospectionProcessor(Logger::CRITICAL);
- $actual = $processor($input);
-
- $this->assertEquals($expected, $actual);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
deleted file mode 100644
index eb666144..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class MemoryPeakUsageProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke
- * @covers Monolog\Processor\MemoryProcessor::formatBytes
- */
- public function testProcessor()
- {
- $processor = new MemoryPeakUsageProcessor();
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('memory_peak_usage', $record['extra']);
- $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_peak_usage']);
- }
-
- /**
- * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke
- * @covers Monolog\Processor\MemoryProcessor::formatBytes
- */
- public function testProcessorWithoutFormatting()
- {
- $processor = new MemoryPeakUsageProcessor(true, false);
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('memory_peak_usage', $record['extra']);
- $this->assertInternalType('int', $record['extra']['memory_peak_usage']);
- $this->assertGreaterThan(0, $record['extra']['memory_peak_usage']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php
deleted file mode 100644
index 4692dbfc..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class MemoryUsageProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\MemoryUsageProcessor::__invoke
- * @covers Monolog\Processor\MemoryProcessor::formatBytes
- */
- public function testProcessor()
- {
- $processor = new MemoryUsageProcessor();
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('memory_usage', $record['extra']);
- $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_usage']);
- }
-
- /**
- * @covers Monolog\Processor\MemoryUsageProcessor::__invoke
- * @covers Monolog\Processor\MemoryProcessor::formatBytes
- */
- public function testProcessorWithoutFormatting()
- {
- $processor = new MemoryUsageProcessor(true, false);
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('memory_usage', $record['extra']);
- $this->assertInternalType('int', $record['extra']['memory_usage']);
- $this->assertGreaterThan(0, $record['extra']['memory_usage']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php
deleted file mode 100644
index 458d2a33..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class ProcessIdProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\ProcessIdProcessor::__invoke
- */
- public function testProcessor()
- {
- $processor = new ProcessIdProcessor();
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('process_id', $record['extra']);
- $this->assertInternalType('int', $record['extra']['process_id']);
- $this->assertGreaterThan(0, $record['extra']['process_id']);
- $this->assertEquals(getmypid(), $record['extra']['process_id']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php
deleted file mode 100644
index 81bfbdc3..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-class PsrLogMessageProcessorTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @dataProvider getPairs
- */
- public function testReplacement($val, $expected)
- {
- $proc = new PsrLogMessageProcessor;
-
- $message = $proc(array(
- 'message' => '{foo}',
- 'context' => array('foo' => $val)
- ));
- $this->assertEquals($expected, $message['message']);
- }
-
- public function getPairs()
- {
- return array(
- array('foo', 'foo'),
- array('3', '3'),
- array(3, '3'),
- array(null, ''),
- array(true, '1'),
- array(false, ''),
- array(new \stdClass, '[object stdClass]'),
- array(array(), '[array]'),
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php
deleted file mode 100644
index 851a9dc2..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class TagProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\TagProcessor::__invoke
- */
- public function testProcessor()
- {
- $tags = array(1, 2, 3);
- $processor = new TagProcessor($tags);
- $record = $processor($this->getRecord());
-
- $this->assertEquals($tags, $record['extra']['tags']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php
deleted file mode 100644
index 7ced62ca..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class UidProcessorTest extends TestCase
-{
- /**
- * @covers Monolog\Processor\UidProcessor::__invoke
- */
- public function testProcessor()
- {
- $processor = new UidProcessor();
- $record = $processor($this->getRecord());
- $this->assertArrayHasKey('uid', $record['extra']);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php
deleted file mode 100644
index dba89412..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog\Processor;
-
-use Monolog\TestCase;
-
-class WebProcessorTest extends TestCase
-{
- public function testProcessor()
- {
- $server = array(
- 'REQUEST_URI' => 'A',
- 'REMOTE_ADDR' => 'B',
- 'REQUEST_METHOD' => 'C',
- 'HTTP_REFERER' => 'D',
- 'SERVER_NAME' => 'F',
- 'UNIQUE_ID' => 'G',
- );
-
- $processor = new WebProcessor($server);
- $record = $processor($this->getRecord());
- $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']);
- $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']);
- $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']);
- $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']);
- $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']);
- $this->assertEquals($server['UNIQUE_ID'], $record['extra']['unique_id']);
- }
-
- public function testProcessorDoNothingIfNoRequestUri()
- {
- $server = array(
- 'REMOTE_ADDR' => 'B',
- 'REQUEST_METHOD' => 'C',
- );
- $processor = new WebProcessor($server);
- $record = $processor($this->getRecord());
- $this->assertEmpty($record['extra']);
- }
-
- public function testProcessorReturnNullIfNoHttpReferer()
- {
- $server = array(
- 'REQUEST_URI' => 'A',
- 'REMOTE_ADDR' => 'B',
- 'REQUEST_METHOD' => 'C',
- 'SERVER_NAME' => 'F',
- );
- $processor = new WebProcessor($server);
- $record = $processor($this->getRecord());
- $this->assertNull($record['extra']['referrer']);
- }
-
- public function testProcessorDoesNotAddUniqueIdIfNotPresent()
- {
- $server = array(
- 'REQUEST_URI' => 'A',
- 'REMOTE_ADDR' => 'B',
- 'REQUEST_METHOD' => 'C',
- 'SERVER_NAME' => 'F',
- );
- $processor = new WebProcessor($server);
- $record = $processor($this->getRecord());
- $this->assertFalse(isset($record['extra']['unique_id']));
- }
-
- public function testProcessorAddsOnlyRequestedExtraFields()
- {
- $server = array(
- 'REQUEST_URI' => 'A',
- 'REMOTE_ADDR' => 'B',
- 'REQUEST_METHOD' => 'C',
- 'SERVER_NAME' => 'F',
- );
-
- $processor = new WebProcessor($server, array('url', 'http_method'));
- $record = $processor($this->getRecord());
-
- $this->assertSame(array('url' => 'A', 'http_method' => 'C'), $record['extra']);
- }
-
- /**
- * @expectedException UnexpectedValueException
- */
- public function testInvalidData()
- {
- new WebProcessor(new \stdClass);
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php
deleted file mode 100644
index ab899449..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-use Monolog\Handler\TestHandler;
-use Monolog\Formatter\LineFormatter;
-use Monolog\Processor\PsrLogMessageProcessor;
-use Psr\Log\Test\LoggerInterfaceTest;
-
-class PsrLogCompatTest extends LoggerInterfaceTest
-{
- private $handler;
-
- public function getLogger()
- {
- $logger = new Logger('foo');
- $logger->pushHandler($handler = new TestHandler);
- $logger->pushProcessor(new PsrLogMessageProcessor);
- $handler->setFormatter(new LineFormatter('%level_name% %message%'));
-
- $this->handler = $handler;
-
- return $logger;
- }
-
- public function getLogs()
- {
- $convert = function ($record) {
- $lower = function ($match) {
- return strtolower($match[0]);
- };
-
- return preg_replace_callback('{^[A-Z]+}', $lower, $record['formatted']);
- };
-
- return array_map($convert, $this->handler->getRecords());
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/RegistryTest.php b/src/composer/vendor/monolog/monolog/tests/Monolog/RegistryTest.php
deleted file mode 100644
index 29925f8a..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/RegistryTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-
-class RegistryTest extends \PHPUnit_Framework_TestCase
-{
- protected function setUp()
- {
- Registry::clear();
- }
-
- /**
- * @dataProvider hasLoggerProvider
- * @covers Monolog\Registry::hasLogger
- */
- public function testHasLogger(array $loggersToAdd, array $loggersToCheck, array $expectedResult)
- {
- foreach ($loggersToAdd as $loggerToAdd) {
- Registry::addLogger($loggerToAdd);
- }
- foreach ($loggersToCheck as $index => $loggerToCheck) {
- $this->assertSame($expectedResult[$index], Registry::hasLogger($loggerToCheck));
- }
- }
-
- public function hasLoggerProvider()
- {
- $logger1 = new Logger('test1');
- $logger2 = new Logger('test2');
- $logger3 = new Logger('test3');
-
- return array(
- // only instances
- array(
- array($logger1),
- array($logger1, $logger2),
- array(true, false),
- ),
- // only names
- array(
- array($logger1),
- array('test1', 'test2'),
- array(true, false),
- ),
- // mixed case
- array(
- array($logger1, $logger2),
- array('test1', $logger2, 'test3', $logger3),
- array(true, true, false, false),
- ),
- );
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/Monolog/TestCase.php b/src/composer/vendor/monolog/monolog/tests/Monolog/TestCase.php
deleted file mode 100644
index cae79340..00000000
--- a/src/composer/vendor/monolog/monolog/tests/Monolog/TestCase.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Monolog;
-
-class TestCase extends \PHPUnit_Framework_TestCase
-{
- /**
- * @return array Record
- */
- protected function getRecord($level = Logger::WARNING, $message = 'test', $context = array())
- {
- return array(
- 'message' => $message,
- 'context' => $context,
- 'level' => $level,
- 'level_name' => Logger::getLevelName($level),
- 'channel' => 'test',
- 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))),
- 'extra' => array(),
- );
- }
-
- /**
- * @return array
- */
- protected function getMultipleRecords()
- {
- return array(
- $this->getRecord(Logger::DEBUG, 'debug message 1'),
- $this->getRecord(Logger::DEBUG, 'debug message 2'),
- $this->getRecord(Logger::INFO, 'information'),
- $this->getRecord(Logger::WARNING, 'warning'),
- $this->getRecord(Logger::ERROR, 'error')
- );
- }
-
- /**
- * @return Monolog\Formatter\FormatterInterface
- */
- protected function getIdentityFormatter()
- {
- $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
- $formatter->expects($this->any())
- ->method('format')
- ->will($this->returnCallback(function ($record) { return $record['message']; }));
-
- return $formatter;
- }
-}
diff --git a/src/composer/vendor/monolog/monolog/tests/bootstrap.php b/src/composer/vendor/monolog/monolog/tests/bootstrap.php
deleted file mode 100644
index b78740e2..00000000
--- a/src/composer/vendor/monolog/monolog/tests/bootstrap.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-$loader = require __DIR__ . "/../vendor/autoload.php";
-$loader->addPsr4('Monolog\\', __DIR__.'/Monolog');
-
-date_default_timezone_set('UTC');
diff --git a/src/composer/vendor/psr/log/.gitignore b/src/composer/vendor/psr/log/.gitignore
deleted file mode 100644
index 22d0d82f..00000000
--- a/src/composer/vendor/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/src/composer/vendor/psr/log/LICENSE b/src/composer/vendor/psr/log/LICENSE
deleted file mode 100644
index 474c952b..00000000
--- a/src/composer/vendor/psr/log/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2012 PHP Framework Interoperability Group
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/src/composer/vendor/psr/log/Psr/Log/AbstractLogger.php b/src/composer/vendor/psr/log/Psr/Log/AbstractLogger.php
deleted file mode 100644
index 00f90345..00000000
--- a/src/composer/vendor/psr/log/Psr/Log/AbstractLogger.php
+++ /dev/null
@@ -1,120 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/src/composer/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/src/composer/vendor/psr/log/Psr/Log/InvalidArgumentException.php
deleted file mode 100644
index 67f852d1..00000000
--- a/src/composer/vendor/psr/log/Psr/Log/InvalidArgumentException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-logger = $logger;
- }
-}
diff --git a/src/composer/vendor/psr/log/Psr/Log/LoggerInterface.php b/src/composer/vendor/psr/log/Psr/Log/LoggerInterface.php
deleted file mode 100644
index 476bb962..00000000
--- a/src/composer/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ /dev/null
@@ -1,114 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- * @return null
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return null
- */
- abstract public function log($level, $message, array $context = array());
-}
diff --git a/src/composer/vendor/psr/log/Psr/Log/NullLogger.php b/src/composer/vendor/psr/log/Psr/Log/NullLogger.php
deleted file mode 100644
index 553a3c59..00000000
--- a/src/composer/vendor/psr/log/Psr/Log/NullLogger.php
+++ /dev/null
@@ -1,27 +0,0 @@
-logger) { }`
- * blocks.
- */
-class NullLogger extends AbstractLogger
-{
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- * @return null
- */
- public function log($level, $message, array $context = array())
- {
- // noop
- }
-}
diff --git a/src/composer/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/src/composer/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a9328151..00000000
--- a/src/composer/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
- "
- *
- * Example ->error('Foo') would yield "error Foo"
- *
- * @return string[]
- */
- abstract function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $this->getLogger()->warning('Random message', array('exception' => 'oops'));
- $this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
- }
-}
-
-class DummyTest
-{
-}
\ No newline at end of file
diff --git a/src/composer/vendor/psr/log/README.md b/src/composer/vendor/psr/log/README.md
deleted file mode 100644
index 574bc1cb..00000000
--- a/src/composer/vendor/psr/log/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-PSR Log
-=======
-
-This repository holds all interfaces/classes/traits related to
-[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
-
-Note that this is not a logger of its own. It is merely an interface that
-describes a logger. See the specification for more details.
-
-Usage
------
-
-If you need a logger, you can use the interface like this:
-
-```php
-logger = $logger;
- }
-
- public function doSomething()
- {
- if ($this->logger) {
- $this->logger->info('Doing work');
- }
-
- // do something useful
- }
-}
-```
-
-You can then pick one of the implementations of the interface to get a logger.
-
-If you want to implement the interface, you can require this package and
-implement `Psr\Log\LoggerInterface` in your code. Please read the
-[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
-for details.
diff --git a/src/composer/vendor/psr/log/composer.json b/src/composer/vendor/psr/log/composer.json
deleted file mode 100644
index 6bdcc219..00000000
--- a/src/composer/vendor/psr/log/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "psr/log",
- "description": "Common interface for logging libraries",
- "keywords": ["psr", "psr-3", "log"],
- "license": "MIT",
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "autoload": {
- "psr-0": {
- "Psr\\Log\\": ""
- }
- }
-}
diff --git a/src/composer/vendor/twig/twig/.editorconfig b/src/composer/vendor/twig/twig/.editorconfig
deleted file mode 100644
index 270f1d1b..00000000
--- a/src/composer/vendor/twig/twig/.editorconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-; top-most EditorConfig file
-root = true
-
-; Unix-style newlines
-[*]
-end_of_line = LF
-
-[*.php]
-indent_style = space
-indent_size = 4
-
-[*.test]
-indent_style = space
-indent_size = 4
-
-[*.rst]
-indent_style = space
-indent_size = 4
diff --git a/src/composer/vendor/twig/twig/.gitignore b/src/composer/vendor/twig/twig/.gitignore
deleted file mode 100644
index 31103621..00000000
--- a/src/composer/vendor/twig/twig/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/build
-/composer.lock
-/ext/twig/autom4te.cache/
-/phpunit.xml
-/vendor
diff --git a/src/composer/vendor/twig/twig/.travis.yml b/src/composer/vendor/twig/twig/.travis.yml
deleted file mode 100644
index 37262da2..00000000
--- a/src/composer/vendor/twig/twig/.travis.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-language: php
-
-sudo: false
-
-cache:
- directories:
- - vendor
- - $HOME/.composer/cache
-
-php:
- - 5.2
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - 7.0
- - hhvm
-
-env:
- - TWIG_EXT=no
- - TWIG_EXT=yes
-
-install:
- # Composer is not available on PHP 5.2
- - if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
-
-before_script:
- - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
- - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
- - if [ ${TRAVIS_PHP_VERSION:0:3} == "5.2" ]; then sed -i.bak "s|vendor/autoload.php|test/bootstrap.php|" phpunit.xml.dist; fi
-
-matrix:
- fast_finish: true
- exclude:
- - php: hhvm
- env: TWIG_EXT=yes
- allow_failures:
- - php: 7.0
- env: TWIG_EXT=yes
diff --git a/src/composer/vendor/twig/twig/CHANGELOG b/src/composer/vendor/twig/twig/CHANGELOG
deleted file mode 100644
index e01334f6..00000000
--- a/src/composer/vendor/twig/twig/CHANGELOG
+++ /dev/null
@@ -1,821 +0,0 @@
-* 1.23.3 (2016-01-11)
-
- * fixed typo
-
-* 1.23.2 (2015-01-11)
-
- * added versions in deprecated messages
- * made file cache tolerant for trailing (back)slashes on directory configuration
- * deprecated unused Twig_Node_Expression_ExtensionReference class
-
-* 1.23.1 (2015-11-05)
-
- * fixed some exception messages which triggered PHP warnings
- * fixed BC on Twig_Test_NodeTestCase
-
-* 1.23.0 (2015-10-29)
-
- * deprecated the possibility to override an extension by registering another one with the same name
- * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC)
- * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC)
- * deprecated Twig_Environment::computeAlternatives()
-
-* 1.22.3 (2015-10-13)
-
- * fixed regression when using null as a cache strategy
- * improved performance when checking template freshness
- * fixed warnings when loaded templates do not exist
- * fixed template class name generation to prevent possible collisions
- * fixed logic for custom escapers to call them even on integers and null values
- * changed template cache names to take into account the Twig C extension
-
-* 1.22.2 (2015-09-22)
-
- * fixed a race condition in template loading
-
-* 1.22.1 (2015-09-15)
-
- * fixed regression in template_from_string
-
-* 1.22.0 (2015-09-13)
-
- * made Twig_Test_IntegrationTestCase more flexible
- * added an option to force PHP bytecode invalidation when writing a compiled template into the cache
- * fixed the profiler duration for the root node
- * changed template cache names to take into account enabled extensions
- * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(),
- Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
- * added a way to override the filesystem template cache system
- * added a way to get the original template source from Twig_Template
-
-* 1.21.2 (2015-09-09)
-
- * fixed variable names for the deprecation triggering code
- * fixed escaping strategy detection based on filename
- * added Traversable support for replace, merge, and sort
- * deprecated support for character by character replacement for the "replace" filter
-
-* 1.21.1 (2015-08-26)
-
- * fixed regression when using the deprecated Twig_Test_* classes
-
-* 1.21.0 (2015-08-24)
-
- * added deprecation notices for deprecated features
- * added a deprecation "framework" for filters/functions/tests and test fixtures
-
-* 1.20.0 (2015-08-12)
-
- * forbid access to the Twig environment from templates and internal parts of Twig_Template
- * fixed limited RCEs when in sandbox mode
- * deprecated Twig_Template::getEnvironment()
- * deprecated the _self variable for usage outside of the from and import tags
- * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
- between 1.x and 2.x
-
-* 1.19.0 (2015-07-31)
-
- * fixed wrong error message when including an undefined template in a child template
- * added support for variadic filters, functions, and tests
- * added support for extra positional arguments in macros
- * added ignore_missing flag to the source function
- * fixed batch filter with zero items
- * deprecated Twig_Environment::clearTemplateCache()
- * fixed sandbox disabling when using the include function
-
-* 1.18.2 (2015-06-06)
-
- * fixed template/line guessing in exceptions for nested templates
- * optimized the number of inodes and the size of realpath cache when using the cache
-
-* 1.18.1 (2015-04-19)
-
- * fixed memory leaks in the C extension
- * deprecated Twig_Loader_String
- * fixed the slice filter when used with a SimpleXMLElement object
- * fixed filesystem loader when trying to load non-files (like directories)
-
-* 1.18.0 (2015-01-25)
-
- * fixed some error messages where the line was wrong (unknown variables or argument names)
- * added a new way to customize the main Module node (via empty nodes)
- * added Twig_Environment::createTemplate() to create a template from a string
- * added a profiler
- * fixed filesystem loader cache when different file paths are used for the same template
-
-* 1.17.0 (2015-01-14)
-
- * added a 'filename' autoescaping strategy, which dynamically chooses the
- autoescaping strategy for a template based on template file extension.
-
-* 1.16.3 (2014-12-25)
-
- * fixed regression for dynamic parent templates
- * fixed cache management with statcache
- * fixed a regression in the slice filter
-
-* 1.16.2 (2014-10-17)
-
- * fixed timezone on dates as strings
- * fixed 2-words test names when a custom node class is not used
- * fixed macros when using an argument named like a PHP super global (like GET or POST)
- * fixed date_modify when working with DateTimeImmutable
- * optimized for loops
- * fixed multi-byte characters handling in the split filter
- * fixed a regression in the in operator
- * fixed a regression in the slice filter
-
-* 1.16.1 (2014-10-10)
-
- * improved error reporting in a sandboxed template
- * fixed missing error file/line information under certain circumstances
- * fixed wrong error line number in some error messages
- * fixed the in operator to use strict comparisons
- * sped up the slice filter
- * fixed for mb function overload mb_substr acting different
- * fixed the attribute() function when passing a variable for the arguments
-
-* 1.16.0 (2014-07-05)
-
- * changed url_encode to always encode according to RFC 3986
- * fixed inheritance in a 'use'-hierarchy
- * removed the __toString policy check when the sandbox is disabled
- * fixed recursively calling blocks in templates with inheritance
-
-* 1.15.1 (2014-02-13)
-
- * fixed the conversion of the special '0000-00-00 00:00' date
- * added an error message when trying to import an undefined block from a trait
- * fixed a C extension crash when accessing defined but uninitialized property.
-
-* 1.15.0 (2013-12-06)
-
- * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
- * added min and max functions
- * added the round filter
- * fixed a bug that prevented the optimizers to be enabled/disabled selectively
- * fixed first and last filters for UTF-8 strings
- * added a source function to include the content of a template without rendering it
- * fixed the C extension sandbox behavior when get or set is prepend to method name
-
-* 1.14.2 (2013-10-30)
-
- * fixed error filename/line when an error occurs in an included file
- * allowed operators that contain whitespaces to have more than one whitespace
- * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")
-
-* 1.14.1 (2013-10-15)
-
- * made it possible to use named operators as variables
- * fixed the possibility to have a variable named 'matches'
- * added support for PHP 5.5 DateTimeInterface
-
-* 1.14.0 (2013-10-03)
-
- * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
- * added new operators: ends with, starts with, and matches
- * fixed some compatibility issues with HHVM
- * added a way to add custom escaping strategies
- * fixed the C extension compilation on Windows
- * fixed the batch filter when using a fill argument with an exact match of elements to batch
- * fixed the filesystem loader cache when a template name exists in several namespaces
- * fixed template_from_string when the template includes or extends other ones
- * fixed a crash of the C extension on an edge case
-
-* 1.13.2 (2013-08-03)
-
- * fixed the error line number for an error occurs in and embedded template
- * fixed crashes of the C extension on some edge cases
-
-* 1.13.1 (2013-06-06)
-
- * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
- * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
- * adjusted backtrace call to reduce memory usage when an error occurs
- * added support for object instances as the second argument of the constant test
- * fixed the include function when used in an assignment
-
-* 1.13.0 (2013-05-10)
-
- * fixed getting a numeric-like item on a variable ('09' for instance)
- * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
- `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
- * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
- * changed ☃ to § in tests
- * enforced usage of named arguments after positional ones
-
-* 1.12.3 (2013-04-08)
-
- * fixed a security issue in the filesystem loader where it was possible to include a template one
- level above the configured path
- * fixed fatal error that should be an exception when adding a filter/function/test too late
- * added a batch filter
- * added support for encoding an array as query string in the url_encode filter
-
-* 1.12.2 (2013-02-09)
-
- * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
- * fixed globals when getGlobals is called early on
- * added the first and last filter
-
-* 1.12.1 (2013-01-15)
-
- * added support for object instances as the second argument of the constant function
- * relaxed globals management to avoid a BC break
- * added support for {{ some_string[:2] }}
-
-* 1.12.0 (2013-01-08)
-
- * added verbatim as an alias for the raw tag to avoid confusion with the raw filter
- * fixed registration of tests and functions as anonymous functions
- * fixed globals management
-
-* 1.12.0-RC1 (2012-12-29)
-
- * added an include function (does the same as the include tag but in a more flexible way)
- * added the ability to use any PHP callable to define filters, functions, and tests
- * added a syntax error when using a loop variable that is not defined
- * added the ability to set default values for macro arguments
- * added support for named arguments for filters, tests, and functions
- * moved filters/functions/tests syntax errors to the parser
- * added support for extended ternary operator syntaxes
-
-* 1.11.1 (2012-11-11)
-
- * fixed debug info line numbering (was off by 2)
- * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
- * optimized variable access on PHP 5.4
- * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
-
-* 1.11.0 (2012-11-07)
-
- * fixed macro compilation when a variable name is a PHP reserved keyword
- * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
- * fixed bitwise operator precedences
- * added the template_from_string function
- * fixed default timezone usage for the date function
- * optimized the way Twig exceptions are managed (to make them faster)
- * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
-
-* 1.10.3 (2012-10-19)
-
- * fixed wrong template location in some error messages
- * reverted a BC break introduced in 1.10.2
- * added a split filter
-
-* 1.10.2 (2012-10-15)
-
- * fixed macro calls on PHP 5.4
-
-* 1.10.1 (2012-10-15)
-
- * made a speed optimization to macro calls when imported via the "import" tag
- * fixed C extension compilation on Windows
- * fixed a segfault in the C extension when using DateTime objects
-
-* 1.10.0 (2012-09-28)
-
- * extracted functional tests framework to make it reusable for third-party extensions
- * added namespaced templates support in Twig_Loader_Filesystem
- * added Twig_Loader_Filesystem::prependPath()
- * fixed an error when a token parser pass a closure as a test to the subparse() method
-
-* 1.9.2 (2012-08-25)
-
- * fixed the in operator for objects that contain circular references
- * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
-
-* 1.9.1 (2012-07-22)
-
- * optimized macro calls when auto-escaping is on
- * fixed wrong parent class for Twig_Function_Node
- * made Twig_Loader_Chain more explicit about problems
-
-* 1.9.0 (2012-07-13)
-
- * made the parsing independent of the template loaders
- * fixed exception trace when an error occurs when rendering a child template
- * added escaping strategies for CSS, URL, and HTML attributes
- * fixed nested embed tag calls
- * added the date_modify filter
-
-* 1.8.3 (2012-06-17)
-
- * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
- * fixed escaping when a project defines a function named html or js
- * fixed chmod mode to apply the umask correctly
-
-* 1.8.2 (2012-05-30)
-
- * added the abs filter
- * fixed a regression when using a number in template attributes
- * fixed compiler when mbstring.func_overload is set to 2
- * fixed DateTimeZone support in date filter
-
-* 1.8.1 (2012-05-17)
-
- * fixed a regression when dealing with SimpleXMLElement instances in templates
- * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
- * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
-
-* 1.8.0 (2012-05-08)
-
- * enforced interface when adding tests, filters, functions, and node visitors from extensions
- * fixed a side-effect of the date filter where the timezone might be changed
- * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
- * added a way to dynamically change the auto-escaping strategy according to the template "filename"
- * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
- * added an embed tag
-
-* 1.7.0 (2012-04-24)
-
- * fixed a PHP warning when using CIFS
- * fixed template line number in some exceptions
- * added an iterable test
- * added an error when defining two blocks with the same name in a template
- * added the preserves_safety option for filters
- * fixed a PHP notice when trying to access a key on a non-object/array variable
- * enhanced error reporting when the template file is an instance of SplFileInfo
- * added Twig_Environment::mergeGlobals()
- * added compilation checks to avoid misuses of the sandbox tag
- * fixed filesystem loader freshness logic for high traffic websites
- * fixed random function when charset is null
-
-* 1.6.5 (2012-04-11)
-
- * fixed a regression when a template only extends another one without defining any blocks
-
-* 1.6.4 (2012-04-02)
-
- * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
- * fixed performance when compiling large files
- * optimized parent template creation when the template does not use dynamic inheritance
-
-* 1.6.3 (2012-03-22)
-
- * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
- * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
- * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
-
-* 1.6.2 (2012-03-18)
-
- * fixed sandbox mode when used with inheritance
- * added preserveKeys support for the slice filter
- * fixed the date filter when a DateTime instance is passed with a specific timezone
- * added a trim filter
-
-* 1.6.1 (2012-02-29)
-
- * fixed Twig C extension
- * removed the creation of Twig_Markup instances when not needed
- * added a way to set the default global timezone for dates
- * fixed the slice filter on strings when the length is not specified
- * fixed the creation of the cache directory in case of a race condition
-
-* 1.6.0 (2012-02-04)
-
- * fixed raw blocks when used with the whitespace trim option
- * made a speed optimization to macro calls when imported via the "from" tag
- * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
- * fixed the attribute function when passing arguments
- * added slice notation support for the [] operator (syntactic sugar for the slice operator)
- * added a slice filter
- * added string support for the reverse filter
- * fixed the empty test and the length filter for Twig_Markup instances
- * added a date function to ease date comparison
- * fixed unary operators precedence
- * added recursive parsing support in the parser
- * added string and integer handling for the random function
-
-* 1.5.1 (2012-01-05)
-
- * fixed a regression when parsing strings
-
-* 1.5.0 (2012-01-04)
-
- * added Traversable objects support for the join filter
-
-* 1.5.0-RC2 (2011-12-30)
-
- * added a way to set the default global date interval format
- * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
- * refactored Twig_Template::display() to ease its extension
- * added a number_format filter
-
-* 1.5.0-RC1 (2011-12-26)
-
- * removed the need to quote hash keys
- * allowed hash keys to be any expression
- * added a do tag
- * added a flush tag
- * added support for dynamically named filters and functions
- * added a dump function to help debugging templates
- * added a nl2br filter
- * added a random function
- * added a way to change the default format for the date filter
- * fixed the lexer when an operator ending with a letter ends a line
- * added string interpolation support
- * enhanced exceptions for unknown filters, functions, tests, and tags
-
-* 1.4.0 (2011-12-07)
-
- * fixed lexer when using big numbers (> PHP_INT_MAX)
- * added missing preserveKeys argument to the reverse filter
- * fixed macros containing filter tag calls
-
-* 1.4.0-RC2 (2011-11-27)
-
- * removed usage of Reflection in Twig_Template::getAttribute()
- * added a C extension that can optionally replace Twig_Template::getAttribute()
- * added negative timestamp support to the date filter
-
-* 1.4.0-RC1 (2011-11-20)
-
- * optimized variable access when using PHP 5.4
- * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
- * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
- * added Twig_Function_Node to allow more complex functions to have their own Node class
- * added Twig_Filter_Node to allow more complex filters to have their own Node class
- * added Twig_Test_Node to allow more complex tests to have their own Node class
- * added a better error message when a template is empty but contain a BOM
- * fixed "in" operator for empty strings
- * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
- * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
- * added Twig_Environment::display()
- * made the escape filter smarter when the encoding is not supported by PHP
- * added a convert_encoding filter
- * moved all node manipulations outside the compile() Node method
- * made several speed optimizations
-
-* 1.3.0 (2011-10-08)
-
-no changes
-
-* 1.3.0-RC1 (2011-10-04)
-
- * added an optimization for the parent() function
- * added cache reloading when auto_reload is true and an extension has been modified
- * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
- * allowed empty templates to be used as traits
- * added traits support for the "parent" function
-
-* 1.2.0 (2011-09-13)
-
-no changes
-
-* 1.2.0-RC1 (2011-09-10)
-
- * enhanced the exception when a tag remains unclosed
- * added support for empty Countable objects for the "empty" test
- * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
- * added better support for encoding problems when escaping a string (available as of PHP 5.4)
- * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
- * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
- * added support for bitwise operators in expressions
- * added the "attribute" function to allow getting dynamic attributes on variables
- * added Twig_Loader_Chain
- * added Twig_Loader_Array::setTemplate()
- * added an optimization for the set tag when used to capture a large chunk of static text
- * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
- * removed the possibility to use the "extends" tag from a block
- * added "if" modifier support to "for" loops
-
-* 1.1.2 (2011-07-30)
-
- * fixed json_encode filter on PHP 5.2
- * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
- * fixed inheritance when using conditional parents
- * fixed compilation of templates when the body of a child template is not empty
- * fixed output when a macro throws an exception
- * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
- * added PHPDoc for all Token parsers and Core extension functions
-
-* 1.1.1 (2011-07-17)
-
- * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
- * made some performance improvement for some edge cases
-
-* 1.1.0 (2011-06-28)
-
- * fixed json_encode filter
-
-* 1.1.0-RC3 (2011-06-24)
-
- * fixed method case-sensitivity when using the sandbox mode
- * added timezone support for the date filter
- * fixed possible security problems with NUL bytes
-
-* 1.1.0-RC2 (2011-06-16)
-
- * added an exception when the template passed to "use" is not a string
- * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
- * added {% line \d+ %} directive
-
-* 1.1.0-RC1 (2011-05-28)
-
-Flush your cache after upgrading.
-
- * fixed date filter when using a timestamp
- * fixed the defined test for some cases
- * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
- * added support for horizontal reuse of template blocks (see docs for more information)
- * added whitespace control modifier to all tags (see docs for more information)
- * added null as an alias for none (the null test is also an alias for the none test now)
- * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
- * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
- * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
-
-* 1.0.0 (2011-03-27)
-
- * fixed output when using mbstring
- * fixed duplicate call of methods when using the sandbox
- * made the charset configurable for the escape filter
-
-* 1.0.0-RC2 (2011-02-21)
-
- * changed the way {% set %} works when capturing (the content is now marked as safe)
- * added support for macro name in the endmacro tag
- * make Twig_Error compatible with PHP 5.3.0 >
- * fixed an infinite loop on some Windows configurations
- * fixed the "length" filter for numbers
- * fixed Template::getAttribute() as properties in PHP are case sensitive
- * removed coupling between Twig_Node and Twig_Template
- * fixed the ternary operator precedence rule
-
-* 1.0.0-RC1 (2011-01-09)
-
-Backward incompatibilities:
-
- * the "items" filter, which has been deprecated for quite a long time now, has been removed
- * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
- * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
- * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
- * the "for" tag does not support "joined by" anymore
- * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
- * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
- * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
- * removed the grammar and simple token parser (moved to the Twig Extensions repository)
-
-Changes:
-
- * added "needs_context" option for filters and functions (the context is then passed as a first argument)
- * added global variables support
- * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
- * added the "from" tag to import macros as functions
- * added support for functions (a function is just syntactic sugar for a getAttribute() call)
- * made macros callable when sandbox mode is enabled
- * added an exception when a macro uses a reserved name
- * the "default" filter now uses the "empty" test instead of just checking for null
- * added the "empty" test
-
-* 0.9.10 (2010-12-16)
-
-Backward incompatibilities:
-
- * The Escaper extension is enabled by default, which means that all displayed
- variables are now automatically escaped. You can revert to the previous
- behavior by removing the extension via $env->removeExtension('escaper')
- or just set the 'autoescape' option to 'false'.
- * removed the "without loop" attribute for the "for" tag (not needed anymore
- as the Optimizer take care of that for most cases)
- * arrays and hashes have now a different syntax
- * arrays keep the same syntax with square brackets: [1, 2]
- * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
- * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
- * the i18n extension is now part of the Twig Extensions repository
-
-Changes:
-
- * added the merge filter
- * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
- * fixed usage of operators as method names (like is, in, and not)
- * changed the order of execution for node visitors
- * fixed default() filter behavior when used with strict_variables set to on
- * fixed filesystem loader compatibility with PHAR files
- * enhanced error messages when an unexpected token is parsed in an expression
- * fixed filename not being added to syntax error messages
- * added the autoescape option to enable/disable autoescaping
- * removed the newline after a comment (mimics PHP behavior)
- * added a syntax error exception when parent block is used on a template that does not extend another one
- * made the Escaper extension enabled by default
- * fixed sandbox extension when used with auto output escaping
- * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
- * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
- * added priority to node visitors
-
-* 0.9.9 (2010-11-28)
-
-Backward incompatibilities:
- * the self special variable has been renamed to _self
- * the odd and even filters are now tests:
- {{ foo|odd }} must now be written {{ foo is odd }}
- * the "safe" filter has been renamed to "raw"
- * in Node classes,
- sub-nodes are now accessed via getNode() (instead of property access)
- attributes via getAttribute() (instead of array access)
- * the urlencode filter had been renamed to url_encode
- * the include tag now merges the passed variables with the current context by default
- (the old behavior is still possible by adding the "only" keyword)
- * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
- * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
- * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
-
-Changes:
- * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
- * changed trans tag to accept any variable for the plural count
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
- * added the ** (power) operator
- * changed the algorithm used for parsing expressions
- * added the spaceless tag
- * removed trim_blocks option
- * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
- * changed all exceptions to extend Twig_Error
- * fixed unary expressions ({{ not(1 or 0) }})
- * fixed child templates (with an extend tag) that uses one or more imports
- * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
- * escaping has been rewritten
- * the implementation of template inheritance has been rewritten
- (blocks can now be called individually and still work with inheritance)
- * fixed error handling for if tag when a syntax error occurs within a subparse process
- * added a way to implement custom logic for resolving token parsers given a tag name
- * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
- * added the following filers: "constant", "trans", "replace", "json_encode"
- * added a "constant" test
- * fixed objects with __toString() not being autoescaped
- * fixed subscript expressions when calling __call() (methods now keep the case)
- * added "test" feature (accessible via the "is" operator)
- * removed the debug tag (should be done in an extension)
- * fixed trans tag when no vars are used in plural form
- * fixed race condition when writing template cache
- * added the special _charset variable to reference the current charset
- * added the special _context variable to reference the current context
- * renamed self to _self (to avoid conflict)
- * fixed Twig_Template::getAttribute() for protected properties
-
-* 0.9.8 (2010-06-28)
-
-Backward incompatibilities:
- * the trans tag plural count is now attached to the plural tag:
- old: `{% trans count %}...{% plural %}...{% endtrans %}`
- new: `{% trans %}...{% plural count %}...{% endtrans %}`
-
- * added a way to translate strings coming from a variable ({% trans var %})
- * fixed trans tag when used with the Escaper extension
- * fixed default cache umask
- * removed Twig_Template instances from the debug tag output
- * fixed objects with __isset() defined
- * fixed set tag when used with a capture
- * fixed type hinting for Twig_Environment::addFilter() method
-
-* 0.9.7 (2010-06-12)
-
-Backward incompatibilities:
- * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
- * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
- * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
-
- * added self as a special variable that refers to the current template (useful for importing macros from the current template)
- * added Twig_Template instance support to the include tag
- * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
- * added a grammar sub-framework to ease the creation of custom tags
- * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
- * removed the Twig_Resource::resolveMissingFilter() method
- * fixed the filter tag which did not apply filtering to included files
- * added a bunch of unit tests
- * added a bunch of phpdoc
- * added a sandbox tag in the sandbox extension
- * changed the date filter to support any date format supported by DateTime
- * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
- * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
- * changed the cache option to only accepts an explicit path to a cache directory or false
- * added a way to add token parsers, filters, and visitors without creating an extension
- * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
- * changed the generated code to match the new coding standards
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
- * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
-
-* 0.9.6 (2010-05-12)
-
- * fixed variables defined outside a loop and for which the value changes in a for loop
- * fixed the test suite for PHP 5.2 and older versions of PHPUnit
- * added support for __call() in expression resolution
- * fixed node visiting for macros (macros are now visited by visitors as any other node)
- * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
- * added the cycle filter
- * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
- * added a long-syntax for the set tag ({% set foo %}...{% endset %})
- * unit tests are now powered by PHPUnit
- * added support for gettext via the `i18n` extension
- * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
- * added a more useful exception if an if tag is not closed properly
- * added support for escaping strategy in the autoescape tag
- * fixed lexer when a template has a big chunk of text between/in a block
-
-* 0.9.5 (2010-01-20)
-
-As for any new release, don't forget to remove all cached templates after
-upgrading.
-
-If you have defined custom filters, you MUST upgrade them for this release. To
-upgrade, replace "array" with "new Twig_Filter_Function", and replace the
-environment constant by the "needs_environment" option:
-
- // before
- 'even' => array('twig_is_even_filter', false),
- 'escape' => array('twig_escape_filter', true),
-
- // after
- 'even' => new Twig_Filter_Function('twig_is_even_filter'),
- 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
-
-If you have created NodeTransformer classes, you will need to upgrade them to
-the new interface (please note that the interface is not yet considered
-stable).
-
- * fixed list nodes that did not extend the Twig_NodeListInterface
- * added the "without loop" option to the for tag (it disables the generation of the loop variable)
- * refactored node transformers to node visitors
- * fixed automatic-escaping for blocks
- * added a way to specify variables to pass to an included template
- * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
- * improved the filter system to allow object methods to be used as filters
- * changed the Array and String loaders to actually make use of the cache mechanism
- * included the default filter function definitions in the extension class files directly (Core, Escaper)
- * added the // operator (like the floor() PHP function)
- * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
- * added the in operator (as a syntactic sugar for the in filter)
- * added the following filters in the Core extension: in, range
- * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
- * enhanced some error messages to provide better feedback in case of parsing errors
-
-* 0.9.4 (2009-12-02)
-
-If you have custom loaders, you MUST upgrade them for this release: The
-Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
-been changed (see the source code for more information or the documentation).
-
- * added support for DateTime instances for the date filter
- * fixed loop.last when the array only has one item
- * made it possible to insert newlines in tag and variable blocks
- * fixed a bug when a literal '\n' were present in a template text
- * fixed bug when the filename of a template contains */
- * refactored loaders
-
-* 0.9.3 (2009-11-11)
-
-This release is NOT backward compatible with the previous releases.
-
- The loaders do not take the cache and autoReload arguments anymore. Instead,
- the Twig_Environment class has two new options: cache and auto_reload.
- Upgrading your code means changing this kind of code:
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
- $twig = new Twig_Environment($loader);
-
- to something like this:
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- 'auto_reload' => true,
- ));
-
- * deprecated the "items" filter as it is not needed anymore
- * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
- * optimized template loading speed
- * removed output when an error occurs in a template and render() is used
- * made major speed improvements for loops (up to 300% on even the smallest loops)
- * added properties as part of the sandbox mode
- * added public properties support (obj.item can now be the item property on the obj object)
- * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
- * fixed bug when \ was used in HTML
-
-* 0.9.2 (2009-10-29)
-
- * made some speed optimizations
- * changed the cache extension to .php
- * added a js escaping strategy
- * added support for short block tag
- * changed the filter tag to allow chained filters
- * made lexer more flexible as you can now change the default delimiters
- * added set tag
- * changed default directory permission when cache dir does not exist (more secure)
- * added macro support
- * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
- * made Twig_Autoloader::autoload() a static method
- * avoid writing template file if an error occurs
- * added $ escaping when outputting raw strings
- * enhanced some error messages to ease debugging
- * fixed empty cache files when the template contains an error
-
-* 0.9.1 (2009-10-14)
-
- * fixed a bug in PHP 5.2.6
- * fixed numbers with one than one decimal
- * added support for method calls with arguments ({{ foo.bar('a', 43) }})
- * made small speed optimizations
- * made minor tweaks to allow better extensibility and flexibility
-
-* 0.9.0 (2009-10-12)
-
- * Initial release
diff --git a/src/composer/vendor/twig/twig/LICENSE b/src/composer/vendor/twig/twig/LICENSE
deleted file mode 100644
index cc74f810..00000000
--- a/src/composer/vendor/twig/twig/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 2009-2016 by the Twig Team.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * The names of the contributors may not be used to endorse or
- promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/composer/vendor/twig/twig/README.rst b/src/composer/vendor/twig/twig/README.rst
deleted file mode 100644
index 81737b0b..00000000
--- a/src/composer/vendor/twig/twig/README.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-Twig, the flexible, fast, and secure template language for PHP
-==============================================================
-
-Twig is a template language for PHP, released under the new BSD license (code
-and documentation).
-
-Twig uses a syntax similar to the Django and Jinja template languages which
-inspired the Twig runtime environment.
-
-More Information
-----------------
-
-Read the `documentation`_ for more information.
-
-.. _documentation: http://twig.sensiolabs.org/documentation
diff --git a/src/composer/vendor/twig/twig/composer.json b/src/composer/vendor/twig/twig/composer.json
deleted file mode 100644
index 339a5d4d..00000000
--- a/src/composer/vendor/twig/twig/composer.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "twig/twig",
- "type": "library",
- "description": "Twig, the flexible, fast, and secure template language for PHP",
- "keywords": ["templating"],
- "homepage": "http://twig.sensiolabs.org",
- "license": "BSD-3-Clause",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
- {
- "name": "Twig Team",
- "homepage": "http://twig.sensiolabs.org/contributors",
- "role": "Contributors"
- },
- {
- "name": "Armin Ronacher",
- "email": "armin.ronacher@active-4.com",
- "role": "Project Founder"
- }
- ],
- "support": {
- "forum": "https://groups.google.com/forum/#!forum/twig-users"
- },
- "require": {
- "php": ">=5.2.7"
- },
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7",
- "symfony/debug": "~2.7"
- },
- "autoload": {
- "psr-0" : {
- "Twig_" : "lib/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.23-dev"
- }
- }
-}
diff --git a/src/composer/vendor/twig/twig/doc/advanced.rst b/src/composer/vendor/twig/twig/doc/advanced.rst
deleted file mode 100644
index 5b436ff2..00000000
--- a/src/composer/vendor/twig/twig/doc/advanced.rst
+++ /dev/null
@@ -1,872 +0,0 @@
-Extending Twig
-==============
-
-.. caution::
-
- This section describes how to extend Twig as of **Twig 1.12**. If you are
- using an older version, read the :doc:`legacy` chapter
- instead.
-
-Twig can be extended in many ways; you can add extra tags, filters, tests,
-operators, global variables, and functions. You can even extend the parser
-itself with node visitors.
-
-.. note::
-
- The first section of this chapter describes how to extend Twig easily. If
- you want to reuse your changes in different projects or if you want to
- share them with others, you should then create an extension as described
- in the following section.
-
-.. caution::
-
- When extending Twig without creating an extension, Twig won't be able to
- recompile your templates when the PHP code is updated. To see your changes
- in real-time, either disable template caching or package your code into an
- extension (see the next section of this chapter).
-
-Before extending Twig, you must understand the differences between all the
-different possible extension points and when to use them.
-
-First, remember that Twig has two main language constructs:
-
-* ``{{ }}``: used to print the result of an expression evaluation;
-
-* ``{% %}``: used to execute statements.
-
-To understand why Twig exposes so many extension points, let's see how to
-implement a *Lorem ipsum* generator (it needs to know the number of words to
-generate).
-
-You can use a ``lipsum`` *tag*:
-
-.. code-block:: jinja
-
- {% lipsum 40 %}
-
-That works, but using a tag for ``lipsum`` is not a good idea for at least
-three main reasons:
-
-* ``lipsum`` is not a language construct;
-* The tag outputs something;
-* The tag is not flexible as you cannot use it in an expression:
-
- .. code-block:: jinja
-
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
-
-In fact, you rarely need to create tags; and that's good news because tags are
-the most complex extension point of Twig.
-
-Now, let's use a ``lipsum`` *filter*:
-
-.. code-block:: jinja
-
- {{ 40|lipsum }}
-
-Again, it works, but it looks weird. A filter transforms the passed value to
-something else but here we use the value to indicate the number of words to
-generate (so, ``40`` is an argument of the filter, not the value we want to
-transform).
-
-Next, let's use a ``lipsum`` *function*:
-
-.. code-block:: jinja
-
- {{ lipsum(40) }}
-
-Here we go. For this specific example, the creation of a function is the
-extension point to use. And you can use it anywhere an expression is accepted:
-
-.. code-block:: jinja
-
- {{ 'some text' ~ lipsum(40) ~ 'some more text' }}
-
- {% set lipsum = lipsum(40) %}
-
-Last but not the least, you can also use a *global* object with a method able
-to generate lorem ipsum text:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-As a rule of thumb, use functions for frequently used features and global
-objects for everything else.
-
-Keep in mind the following when you want to extend Twig:
-
-========== ========================== ========== =========================
-What? Implementation difficulty? How often? When?
-========== ========================== ========== =========================
-*macro* trivial frequent Content generation
-*global* trivial frequent Helper object
-*function* trivial frequent Content generation
-*filter* trivial frequent Value transformation
-*tag* complex rare DSL language construct
-*test* trivial rare Boolean decision
-*operator* trivial rare Values transformation
-========== ========================== ========== =========================
-
-Globals
--------
-
-A global variable is like any other template variable, except that it's
-available in all templates and macros::
-
- $twig = new Twig_Environment($loader);
- $twig->addGlobal('text', new Text());
-
-You can then use the ``text`` variable anywhere in a template:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-Filters
--------
-
-Creating a filter is as simple as associating a name with a PHP callable::
-
- // an anonymous function
- $filter = new Twig_SimpleFilter('rot13', function ($string) {
- return str_rot13($string);
- });
-
- // or a simple PHP function
- $filter = new Twig_SimpleFilter('rot13', 'str_rot13');
-
- // or a class method
- $filter = new Twig_SimpleFilter('rot13', array('SomeClass', 'rot13Filter'));
-
-The first argument passed to the ``Twig_SimpleFilter`` constructor is the name
-of the filter you will use in templates and the second one is the PHP callable
-to associate with it.
-
-Then, add the filter to your Twig environment::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter($filter);
-
-And here is how to use it in a template:
-
-.. code-block:: jinja
-
- {{ 'Twig'|rot13 }}
-
- {# will output Gjvt #}
-
-When called by Twig, the PHP callable receives the left side of the filter
-(before the pipe ``|``) as the first argument and the extra arguments passed
-to the filter (within parentheses ``()``) as extra arguments.
-
-For instance, the following code:
-
-.. code-block:: jinja
-
- {{ 'TWIG'|lower }}
- {{ now|date('d/m/Y') }}
-
-is compiled to something like the following::
-
-
-
-
-The ``Twig_SimpleFilter`` class takes an array of options as its last
-argument::
-
- $filter = new Twig_SimpleFilter('rot13', 'str_rot13', $options);
-
-Environment-aware Filters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you want to access the current environment instance in your filter, set the
-``needs_environment`` option to ``true``; Twig will pass the current
-environment as the first argument to the filter call::
-
- $filter = new Twig_SimpleFilter('rot13', function (Twig_Environment $env, $string) {
- // get the current charset for instance
- $charset = $env->getCharset();
-
- return str_rot13($string);
- }, array('needs_environment' => true));
-
-Context-aware Filters
-~~~~~~~~~~~~~~~~~~~~~
-
-If you want to access the current context in your filter, set the
-``needs_context`` option to ``true``; Twig will pass the current context as
-the first argument to the filter call (or the second one if
-``needs_environment`` is also set to ``true``)::
-
- $filter = new Twig_SimpleFilter('rot13', function ($context, $string) {
- // ...
- }, array('needs_context' => true));
-
- $filter = new Twig_SimpleFilter('rot13', function (Twig_Environment $env, $context, $string) {
- // ...
- }, array('needs_context' => true, 'needs_environment' => true));
-
-Automatic Escaping
-~~~~~~~~~~~~~~~~~~
-
-If automatic escaping is enabled, the output of the filter may be escaped
-before printing. If your filter acts as an escaper (or explicitly outputs HTML
-or JavaScript code), you will want the raw output to be printed. In such a
-case, set the ``is_safe`` option::
-
- $filter = new Twig_SimpleFilter('nl2br', 'nl2br', array('is_safe' => array('html')));
-
-Some filters may need to work on input that is already escaped or safe, for
-example when adding (safe) HTML tags to originally unsafe output. In such a
-case, set the ``pre_escape`` option to escape the input data before it is run
-through your filter::
-
- $filter = new Twig_SimpleFilter('somefilter', 'somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));
-
-Variadic Filters
-~~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.19
- Support for variadic filters was added in Twig 1.19.
-
-When a filter should accept an arbitrary number of arguments, set the
-``is_variadic`` option to ``true``; Twig will pass the extra arguments as the
-last argument to the filter call as an array::
-
- $filter = new Twig_SimpleFilter('thumbnail', function ($file, array $options = array()) {
- // ...
- }, array('is_variadic' => true));
-
-Be warned that named arguments passed to a variadic filter cannot be checked
-for validity as they will automatically end up in the option array.
-
-Dynamic Filters
-~~~~~~~~~~~~~~~
-
-A filter name containing the special ``*`` character is a dynamic filter as
-the ``*`` can be any string::
-
- $filter = new Twig_SimpleFilter('*_path', function ($name, $arguments) {
- // ...
- });
-
-The following filters will be matched by the above defined dynamic filter:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic filter can define more than one dynamic parts::
-
- $filter = new Twig_SimpleFilter('*_path_*', function ($name, $suffix, $arguments) {
- // ...
- });
-
-The filter will receive all dynamic part values before the normal filter
-arguments, but after the environment and the context. For instance, a call to
-``'foo'|a_path_b()`` will result in the following arguments to be passed to
-the filter: ``('a', 'b', 'foo')``.
-
-Deprecated Filters
-~~~~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.21
- Support for deprecated filters was added in Twig 1.21.
-
-You can mark a filter as being deprecated by setting the ``deprecated`` option
-to ``true``. You can also give an alternative filter that replaces the
-deprecated one when that makes sense::
-
- $filter = new Twig_SimpleFilter('obsolete', function () {
- // ...
- }, array('deprecated' => true, 'alternative' => 'new_one'));
-
-When a filter is deprecated, Twig emits a deprecation notice when compiling a
-template using it. See :ref:`deprecation-notices` for more information.
-
-Functions
----------
-
-Functions are defined in the exact same way as filters, but you need to create
-an instance of ``Twig_SimpleFunction``::
-
- $twig = new Twig_Environment($loader);
- $function = new Twig_SimpleFunction('function_name', function () {
- // ...
- });
- $twig->addFunction($function);
-
-Functions support the same features as filters, except for the ``pre_escape``
-and ``preserves_safety`` options.
-
-Tests
------
-
-Tests are defined in the exact same way as filters and functions, but you need
-to create an instance of ``Twig_SimpleTest``::
-
- $twig = new Twig_Environment($loader);
- $test = new Twig_SimpleTest('test_name', function () {
- // ...
- });
- $twig->addTest($test);
-
-Tests allow you to create custom application specific logic for evaluating
-boolean conditions. As a simple example, let's create a Twig test that checks if
-objects are 'red'::
-
- $twig = new Twig_Environment($loader);
- $test = new Twig_SimpleTest('red', function ($value) {
- if (isset($value->color) && $value->color == 'red') {
- return true;
- }
- if (isset($value->paint) && $value->paint == 'red') {
- return true;
- }
- return false;
- });
- $twig->addTest($test);
-
-Test functions should always return true/false.
-
-When creating tests you can use the ``node_class`` option to provide custom test
-compilation. This is useful if your test can be compiled into PHP primitives.
-This is used by many of the tests built into Twig::
-
- $twig = new Twig_Environment($loader);
- $test = new Twig_SimpleTest(
- 'odd',
- null,
- array('node_class' => 'Twig_Node_Expression_Test_Odd'));
- $twig->addTest($test);
-
- class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test
- {
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->raw('(')
- ->subcompile($this->getNode('node'))
- ->raw(' % 2 == 1')
- ->raw(')')
- ;
- }
- }
-
-The above example shows how you can create tests that use a node class. The
-node class has access to one sub-node called 'node'. This sub-node contains the
-value that is being tested. When the ``odd`` filter is used in code such as:
-
-.. code-block:: jinja
-
- {% if my_value is odd %}
-
-The ``node`` sub-node will contain an expression of ``my_value``. Node-based
-tests also have access to the ``arguments`` node. This node will contain the
-various other arguments that have been provided to your test.
-
-If you want to pass a variable number of positional or named arguments to the
-test, set the ``is_variadic`` option to ``true``. Tests also support dynamic
-name feature as filters and functions.
-
-Tags
-----
-
-One of the most exciting features of a template engine like Twig is the
-possibility to define new language constructs. This is also the most complex
-feature as you need to understand how Twig's internals work.
-
-Let's create a simple ``set`` tag that allows the definition of simple
-variables from within a template. The tag can be used like follows:
-
-.. code-block:: jinja
-
- {% set name = "value" %}
-
- {{ name }}
-
- {# should output value #}
-
-.. note::
-
- The ``set`` tag is part of the Core extension and as such is always
- available. The built-in version is slightly more powerful and supports
- multiple assignments by default (cf. the template designers chapter for
- more information).
-
-Three steps are needed to define a new tag:
-
-* Defining a Token Parser class (responsible for parsing the template code);
-
-* Defining a Node class (responsible for converting the parsed code to PHP);
-
-* Registering the tag.
-
-Registering a new tag
-~~~~~~~~~~~~~~~~~~~~~
-
-Adding a tag is as simple as calling the ``addTokenParser`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addTokenParser(new Project_Set_TokenParser());
-
-Defining a Token Parser
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Now, let's see the actual code of this class::
-
- class Project_Set_TokenParser extends Twig_TokenParser
- {
- public function parse(Twig_Token $token)
- {
- $parser = $this->parser;
- $stream = $parser->getStream();
-
- $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
- $stream->expect(Twig_Token::OPERATOR_TYPE, '=');
- $value = $parser->getExpressionParser()->parseExpression();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
- return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag());
- }
-
- public function getTag()
- {
- return 'set';
- }
- }
-
-The ``getTag()`` method must return the tag we want to parse, here ``set``.
-
-The ``parse()`` method is invoked whenever the parser encounters a ``set``
-tag. It should return a ``Twig_Node`` instance that represents the node (the
-``Project_Set_Node`` calls creating is explained in the next section).
-
-The parsing process is simplified thanks to a bunch of methods you can call
-from the token stream (``$this->parser->getStream()``):
-
-* ``getCurrent()``: Gets the current token in the stream.
-
-* ``next()``: Moves to the next token in the stream, *but returns the old one*.
-
-* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
- the current token is of a particular type or value (or both). The value may be an
- array of several possible values.
-
-* ``expect($type[, $value[, $message]])``: If the current token isn't of the given
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
- the token is returned and the stream moves to the next token.
-
-* ``look()``: Looks a the next token without consuming it.
-
-Parsing expressions is done by calling the ``parseExpression()`` like we did for
-the ``set`` tag.
-
-.. tip::
-
- Reading the existing ``TokenParser`` classes is the best way to learn all
- the nitty-gritty details of the parsing process.
-
-Defining a Node
-~~~~~~~~~~~~~~~
-
-The ``Project_Set_Node`` class itself is rather simple::
-
- class Project_Set_Node extends Twig_Node
- {
- public function __construct($name, Twig_Node_Expression $value, $line, $tag = null)
- {
- parent::__construct(array('value' => $value), array('name' => $name), $line, $tag);
- }
-
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->addDebugInfo($this)
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
- ->subcompile($this->getNode('value'))
- ->raw(";\n")
- ;
- }
- }
-
-The compiler implements a fluid interface and provides methods that helps the
-developer generate beautiful and readable PHP code:
-
-* ``subcompile()``: Compiles a node.
-
-* ``raw()``: Writes the given string as is.
-
-* ``write()``: Writes the given string by adding indentation at the beginning
- of each line.
-
-* ``string()``: Writes a quoted string.
-
-* ``repr()``: Writes a PHP representation of a given value (see
- ``Twig_Node_For`` for a usage example).
-
-* ``addDebugInfo()``: Adds the line of the original template file related to
- the current node as a comment.
-
-* ``indent()``: Indents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-.. _creating_extensions:
-
-Creating an Extension
----------------------
-
-The main motivation for writing an extension is to move often used code into a
-reusable class like adding support for internationalization. An extension can
-define tags, filters, tests, operators, global variables, functions, and node
-visitors.
-
-Creating an extension also makes for a better separation of code that is
-executed at compilation time and code needed at runtime. As such, it makes
-your code faster.
-
-Most of the time, it is useful to create a single extension for your project,
-to host all the specific tags and filters you want to add to Twig.
-
-.. tip::
-
- When packaging your code into an extension, Twig is smart enough to
- recompile your templates whenever you make a change to it (when
- ``auto_reload`` is enabled).
-
-.. note::
-
- Before writing your own extensions, have a look at the Twig official
- extension repository: http://github.com/twigphp/Twig-extensions.
-
-An extension is a class that implements the following interface::
-
- interface Twig_ExtensionInterface
- {
- /**
- * Initializes the runtime environment.
- *
- * This is where you can load some file that contains filter functions for instance.
- *
- * @param Twig_Environment $environment The current Twig_Environment instance
- *
- * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
- */
- function initRuntime(Twig_Environment $environment);
-
- /**
- * Returns the token parser instances to add to the existing list.
- *
- * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
- */
- function getTokenParsers();
-
- /**
- * Returns the node visitor instances to add to the existing list.
- *
- * @return array An array of Twig_NodeVisitorInterface instances
- */
- function getNodeVisitors();
-
- /**
- * Returns a list of filters to add to the existing list.
- *
- * @return array An array of filters
- */
- function getFilters();
-
- /**
- * Returns a list of tests to add to the existing list.
- *
- * @return array An array of tests
- */
- function getTests();
-
- /**
- * Returns a list of functions to add to the existing list.
- *
- * @return array An array of functions
- */
- function getFunctions();
-
- /**
- * Returns a list of operators to add to the existing list.
- *
- * @return array An array of operators
- */
- function getOperators();
-
- /**
- * Returns a list of global variables to add to the existing list.
- *
- * @return array An array of global variables
- *
- * @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
- */
- function getGlobals();
-
- /**
- * Returns the name of the extension.
- *
- * @return string The extension name
- */
- function getName();
- }
-
-To keep your extension class clean and lean, it can inherit from the built-in
-``Twig_Extension`` class instead of implementing the whole interface. That
-way, you just need to implement the ``getName()`` method as the
-``Twig_Extension`` provides empty implementations for all other methods.
-
-The ``getName()`` method must return a unique identifier for your extension.
-
-Now, with this information in mind, let's create the most basic extension
-possible::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getName()
- {
- return 'project';
- }
- }
-
-.. note::
-
- Of course, this extension does nothing for now. We will customize it in
- the next sections.
-
-Twig does not care where you save your extension on the filesystem, as all
-extensions must be registered explicitly to be available in your templates.
-
-You can register an extension by using the ``addExtension()`` method on your
-main ``Environment`` object::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new Project_Twig_Extension());
-
-.. tip::
-
- The bundled extensions are great examples of how extensions work.
-
-Globals
-~~~~~~~
-
-Global variables can be registered in an extension via the ``getGlobals()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getGlobals()
- {
- return array(
- 'text' => new Text(),
- );
- }
-
- // ...
- }
-
-Functions
-~~~~~~~~~
-
-Functions can be registered in an extension via the ``getFunctions()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFunctions()
- {
- return array(
- new Twig_SimpleFunction('lipsum', 'generate_lipsum'),
- );
- }
-
- // ...
- }
-
-Filters
-~~~~~~~
-
-To add a filter to an extension, you need to override the ``getFilters()``
-method. This method must return an array of filters to add to the Twig
-environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- new Twig_SimpleFilter('rot13', 'str_rot13'),
- );
- }
-
- // ...
- }
-
-Tags
-~~~~
-
-Adding a tag in an extension can be done by overriding the
-``getTokenParsers()`` method. This method must return an array of tags to add
-to the Twig environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTokenParsers()
- {
- return array(new Project_Set_TokenParser());
- }
-
- // ...
- }
-
-In the above code, we have added a single new tag, defined by the
-``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
-responsible for parsing the tag and compiling it to PHP.
-
-Operators
-~~~~~~~~~
-
-The ``getOperators()`` methods lets you add new operators. Here is how to add
-``!``, ``||``, and ``&&`` operators::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getOperators()
- {
- return array(
- array(
- '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
- ),
- array(
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- ),
- );
- }
-
- // ...
- }
-
-Tests
-~~~~~
-
-The ``getTests()`` method lets you add new test functions::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTests()
- {
- return array(
- new Twig_SimpleTest('even', 'twig_test_even'),
- );
- }
-
- // ...
- }
-
-Overloading
------------
-
-To overload an already defined filter, test, operator, global variable, or
-function, re-define it in an extension and register it **as late as
-possible** (order matters)::
-
- class MyCoreExtension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- new Twig_SimpleFilter('date', array($this, 'dateFilter')),
- );
- }
-
- public function dateFilter($timestamp, $format = 'F j, Y H:i')
- {
- // do something different from the built-in date filter
- }
-
- public function getName()
- {
- return 'project';
- }
- }
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new MyCoreExtension());
-
-Here, we have overloaded the built-in ``date`` filter with a custom one.
-
-If you do the same on the Twig_Environment itself, beware that it takes
-precedence over any other registered extensions::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter(new Twig_SimpleFilter('date', function ($timestamp, $format = 'F j, Y H:i') {
- // do something different from the built-in date filter
- }));
- // the date filter will come from the above registration, not
- // from the registered extension below
- $twig->addExtension(new MyCoreExtension());
-
-.. caution::
-
- Note that overloading the built-in Twig elements is not recommended as it
- might be confusing.
-
-Testing an Extension
---------------------
-
-Functional Tests
-~~~~~~~~~~~~~~~~
-
-You can create functional tests for extensions simply by creating the
-following file structure in your test directory::
-
- Fixtures/
- filters/
- foo.test
- bar.test
- functions/
- foo.test
- bar.test
- tags/
- foo.test
- bar.test
- IntegrationTest.php
-
-The ``IntegrationTest.php`` file should look like this::
-
- class Project_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase
- {
- public function getExtensions()
- {
- return array(
- new Project_Twig_Extension1(),
- new Project_Twig_Extension2(),
- );
- }
-
- public function getFixturesDir()
- {
- return dirname(__FILE__).'/Fixtures/';
- }
- }
-
-Fixtures examples can be found within the Twig repository
-`tests/Twig/Fixtures`_ directory.
-
-Node Tests
-~~~~~~~~~~
-
-Testing the node visitors can be complex, so extend your test cases from
-``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
-`tests/Twig/Node`_ directory.
-
-.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
-.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures
-.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node
diff --git a/src/composer/vendor/twig/twig/doc/advanced_legacy.rst b/src/composer/vendor/twig/twig/doc/advanced_legacy.rst
deleted file mode 100644
index 2ef6bfde..00000000
--- a/src/composer/vendor/twig/twig/doc/advanced_legacy.rst
+++ /dev/null
@@ -1,887 +0,0 @@
-Extending Twig
-==============
-
-.. caution::
-
- This section describes how to extends Twig for versions **older than
- 1.12**. If you are using a newer version, read the :doc:`newer`
- chapter instead.
-
-Twig can be extended in many ways; you can add extra tags, filters, tests,
-operators, global variables, and functions. You can even extend the parser
-itself with node visitors.
-
-.. note::
-
- The first section of this chapter describes how to extend Twig easily. If
- you want to reuse your changes in different projects or if you want to
- share them with others, you should then create an extension as described
- in the following section.
-
-.. caution::
-
- When extending Twig by calling methods on the Twig environment instance,
- Twig won't be able to recompile your templates when the PHP code is
- updated. To see your changes in real-time, either disable template caching
- or package your code into an extension (see the next section of this
- chapter).
-
-Before extending Twig, you must understand the differences between all the
-different possible extension points and when to use them.
-
-First, remember that Twig has two main language constructs:
-
-* ``{{ }}``: used to print the result of an expression evaluation;
-
-* ``{% %}``: used to execute statements.
-
-To understand why Twig exposes so many extension points, let's see how to
-implement a *Lorem ipsum* generator (it needs to know the number of words to
-generate).
-
-You can use a ``lipsum`` *tag*:
-
-.. code-block:: jinja
-
- {% lipsum 40 %}
-
-That works, but using a tag for ``lipsum`` is not a good idea for at least
-three main reasons:
-
-* ``lipsum`` is not a language construct;
-* The tag outputs something;
-* The tag is not flexible as you cannot use it in an expression:
-
- .. code-block:: jinja
-
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
-
-In fact, you rarely need to create tags; and that's good news because tags are
-the most complex extension point of Twig.
-
-Now, let's use a ``lipsum`` *filter*:
-
-.. code-block:: jinja
-
- {{ 40|lipsum }}
-
-Again, it works, but it looks weird. A filter transforms the passed value to
-something else but here we use the value to indicate the number of words to
-generate (so, ``40`` is an argument of the filter, not the value we want to
-transform).
-
-Next, let's use a ``lipsum`` *function*:
-
-.. code-block:: jinja
-
- {{ lipsum(40) }}
-
-Here we go. For this specific example, the creation of a function is the
-extension point to use. And you can use it anywhere an expression is accepted:
-
-.. code-block:: jinja
-
- {{ 'some text' ~ ipsum(40) ~ 'some more text' }}
-
- {% set ipsum = ipsum(40) %}
-
-Last but not the least, you can also use a *global* object with a method able
-to generate lorem ipsum text:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-As a rule of thumb, use functions for frequently used features and global
-objects for everything else.
-
-Keep in mind the following when you want to extend Twig:
-
-========== ========================== ========== =========================
-What? Implementation difficulty? How often? When?
-========== ========================== ========== =========================
-*macro* trivial frequent Content generation
-*global* trivial frequent Helper object
-*function* trivial frequent Content generation
-*filter* trivial frequent Value transformation
-*tag* complex rare DSL language construct
-*test* trivial rare Boolean decision
-*operator* trivial rare Values transformation
-========== ========================== ========== =========================
-
-Globals
--------
-
-A global variable is like any other template variable, except that it's
-available in all templates and macros::
-
- $twig = new Twig_Environment($loader);
- $twig->addGlobal('text', new Text());
-
-You can then use the ``text`` variable anywhere in a template:
-
-.. code-block:: jinja
-
- {{ text.lipsum(40) }}
-
-Filters
--------
-
-A filter is a regular PHP function or an object method that takes the left
-side of the filter (before the pipe ``|``) as first argument and the extra
-arguments passed to the filter (within parentheses ``()``) as extra arguments.
-
-Defining a filter is as easy as associating the filter name with a PHP
-callable. For instance, let's say you have the following code in a template:
-
-.. code-block:: jinja
-
- {{ 'TWIG'|lower }}
-
-When compiling this template to PHP, Twig looks for the PHP callable
-associated with the ``lower`` filter. The ``lower`` filter is a built-in Twig
-filter, and it is simply mapped to the PHP ``strtolower()`` function. After
-compilation, the generated PHP code is roughly equivalent to:
-
-.. code-block:: html+php
-
-
-
-As you can see, the ``'TWIG'`` string is passed as a first argument to the PHP
-function.
-
-A filter can also take extra arguments like in the following example:
-
-.. code-block:: jinja
-
- {{ now|date('d/m/Y') }}
-
-In this case, the extra arguments are passed to the function after the main
-argument, and the compiled code is equivalent to:
-
-.. code-block:: html+php
-
-
-
-Let's see how to create a new filter.
-
-In this section, we will create a ``rot13`` filter, which should return the
-`rot13`_ transformation of a string. Here is an example of its usage and the
-expected output:
-
-.. code-block:: jinja
-
- {{ "Twig"|rot13 }}
-
- {# should displays Gjvt #}
-
-Adding a filter is as simple as calling the ``addFilter()`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addFilter('rot13', new Twig_Filter_Function('str_rot13'));
-
-The second argument of ``addFilter()`` is an instance of ``Twig_Filter``.
-Here, we use ``Twig_Filter_Function`` as the filter is a PHP function. The
-first argument passed to the ``Twig_Filter_Function`` constructor is the name
-of the PHP function to call, here ``str_rot13``, a native PHP function.
-
-Let's say I now want to be able to add a prefix before the converted string:
-
-.. code-block:: jinja
-
- {{ "Twig"|rot13('prefix_') }}
-
- {# should displays prefix_Gjvt #}
-
-As the PHP ``str_rot13()`` function does not support this requirement, let's
-create a new PHP function::
-
- function project_compute_rot13($string, $prefix = '')
- {
- return $prefix.str_rot13($string);
- }
-
-As you can see, the ``prefix`` argument of the filter is passed as an extra
-argument to the ``project_compute_rot13()`` function.
-
-Adding this filter is as easy as before::
-
- $twig->addFilter('rot13', new Twig_Filter_Function('project_compute_rot13'));
-
-For better encapsulation, a filter can also be defined as a static method of a
-class. The ``Twig_Filter_Function`` class can also be used to register such
-static methods as filters::
-
- $twig->addFilter('rot13', new Twig_Filter_Function('SomeClass::rot13Filter'));
-
-.. tip::
-
- In an extension, you can also define a filter as a static method of the
- extension class.
-
-Environment aware Filters
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The ``Twig_Filter`` classes take options as their last argument. For instance,
-if you want access to the current environment instance in your filter, set the
-``needs_environment`` option to ``true``::
-
- $filter = new Twig_Filter_Function('str_rot13', array('needs_environment' => true));
-
-Twig will then pass the current environment as the first argument to the
-filter call::
-
- function twig_compute_rot13(Twig_Environment $env, $string)
- {
- // get the current charset for instance
- $charset = $env->getCharset();
-
- return str_rot13($string);
- }
-
-Automatic Escaping
-~~~~~~~~~~~~~~~~~~
-
-If automatic escaping is enabled, the output of the filter may be escaped
-before printing. If your filter acts as an escaper (or explicitly outputs HTML
-or JavaScript code), you will want the raw output to be printed. In such a
-case, set the ``is_safe`` option::
-
- $filter = new Twig_Filter_Function('nl2br', array('is_safe' => array('html')));
-
-Some filters may need to work on input that is already escaped or safe, for
-example when adding (safe) HTML tags to originally unsafe output. In such a
-case, set the ``pre_escape`` option to escape the input data before it is run
-through your filter::
-
- $filter = new Twig_Filter_Function('somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));
-
-Dynamic Filters
-~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.5
- Dynamic filters support was added in Twig 1.5.
-
-A filter name containing the special ``*`` character is a dynamic filter as
-the ``*`` can be any string::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $arguments)
- {
- // ...
- }
-
-The following filters will be matched by the above defined dynamic filter:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic filter can define more than one dynamic parts::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $suffix, $arguments)
- {
- // ...
- }
-
-The filter will receive all dynamic part values before the normal filters
-arguments. For instance, a call to ``'foo'|a_path_b()`` will result in the
-following PHP call: ``twig_path('a', 'b', 'foo')``.
-
-Functions
----------
-
-A function is a regular PHP function or an object method that can be called from
-templates.
-
-.. code-block:: jinja
-
- {{ constant("DATE_W3C") }}
-
-When compiling this template to PHP, Twig looks for the PHP callable
-associated with the ``constant`` function. The ``constant`` function is a built-in Twig
-function, and it is simply mapped to the PHP ``constant()`` function. After
-compilation, the generated PHP code is roughly equivalent to:
-
-.. code-block:: html+php
-
-
-
-Adding a function is similar to adding a filter. This can be done by calling the
-``addFunction()`` method on the ``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addFunction('functionName', new Twig_Function_Function('someFunction'));
-
-You can also expose extension methods as functions in your templates::
-
- // $this is an object that implements Twig_ExtensionInterface.
- $twig = new Twig_Environment($loader);
- $twig->addFunction('otherFunction', new Twig_Function_Method($this, 'someMethod'));
-
-Functions also support ``needs_environment`` and ``is_safe`` parameters.
-
-Dynamic Functions
-~~~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.5
- Dynamic functions support was added in Twig 1.5.
-
-A function name containing the special ``*`` character is a dynamic function
-as the ``*`` can be any string::
-
- $twig->addFunction('*_path', new Twig_Function_Function('twig_path'));
-
- function twig_path($name, $arguments)
- {
- // ...
- }
-
-The following functions will be matched by the above defined dynamic function:
-
-* ``product_path``
-* ``category_path``
-
-A dynamic function can define more than one dynamic parts::
-
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
-
- function twig_path($name, $suffix, $arguments)
- {
- // ...
- }
-
-The function will receive all dynamic part values before the normal functions
-arguments. For instance, a call to ``a_path_b('foo')`` will result in the
-following PHP call: ``twig_path('a', 'b', 'foo')``.
-
-Tags
-----
-
-One of the most exciting feature of a template engine like Twig is the
-possibility to define new language constructs. This is also the most complex
-feature as you need to understand how Twig's internals work.
-
-Let's create a simple ``set`` tag that allows the definition of simple
-variables from within a template. The tag can be used like follows:
-
-.. code-block:: jinja
-
- {% set name = "value" %}
-
- {{ name }}
-
- {# should output value #}
-
-.. note::
-
- The ``set`` tag is part of the Core extension and as such is always
- available. The built-in version is slightly more powerful and supports
- multiple assignments by default (cf. the template designers chapter for
- more information).
-
-Three steps are needed to define a new tag:
-
-* Defining a Token Parser class (responsible for parsing the template code);
-
-* Defining a Node class (responsible for converting the parsed code to PHP);
-
-* Registering the tag.
-
-Registering a new tag
-~~~~~~~~~~~~~~~~~~~~~
-
-Adding a tag is as simple as calling the ``addTokenParser`` method on the
-``Twig_Environment`` instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addTokenParser(new Project_Set_TokenParser());
-
-Defining a Token Parser
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Now, let's see the actual code of this class::
-
- class Project_Set_TokenParser extends Twig_TokenParser
- {
- public function parse(Twig_Token $token)
- {
- $lineno = $token->getLine();
- $name = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue();
- $this->parser->getStream()->expect(Twig_Token::OPERATOR_TYPE, '=');
- $value = $this->parser->getExpressionParser()->parseExpression();
-
- $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
- return new Project_Set_Node($name, $value, $lineno, $this->getTag());
- }
-
- public function getTag()
- {
- return 'set';
- }
- }
-
-The ``getTag()`` method must return the tag we want to parse, here ``set``.
-
-The ``parse()`` method is invoked whenever the parser encounters a ``set``
-tag. It should return a ``Twig_Node`` instance that represents the node (the
-``Project_Set_Node`` calls creating is explained in the next section).
-
-The parsing process is simplified thanks to a bunch of methods you can call
-from the token stream (``$this->parser->getStream()``):
-
-* ``getCurrent()``: Gets the current token in the stream.
-
-* ``next()``: Moves to the next token in the stream, *but returns the old one*.
-
-* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
- the current token is of a particular type or value (or both). The value may be an
- array of several possible values.
-
-* ``expect($type[, $value[, $message]])``: If the current token isn't of the given
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
- the token is returned and the stream moves to the next token.
-
-* ``look()``: Looks a the next token without consuming it.
-
-Parsing expressions is done by calling the ``parseExpression()`` like we did for
-the ``set`` tag.
-
-.. tip::
-
- Reading the existing ``TokenParser`` classes is the best way to learn all
- the nitty-gritty details of the parsing process.
-
-Defining a Node
-~~~~~~~~~~~~~~~
-
-The ``Project_Set_Node`` class itself is rather simple::
-
- class Project_Set_Node extends Twig_Node
- {
- public function __construct($name, Twig_Node_Expression $value, $lineno, $tag = null)
- {
- parent::__construct(array('value' => $value), array('name' => $name), $lineno, $tag);
- }
-
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->addDebugInfo($this)
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
- ->subcompile($this->getNode('value'))
- ->raw(";\n")
- ;
- }
- }
-
-The compiler implements a fluid interface and provides methods that helps the
-developer generate beautiful and readable PHP code:
-
-* ``subcompile()``: Compiles a node.
-
-* ``raw()``: Writes the given string as is.
-
-* ``write()``: Writes the given string by adding indentation at the beginning
- of each line.
-
-* ``string()``: Writes a quoted string.
-
-* ``repr()``: Writes a PHP representation of a given value (see
- ``Twig_Node_For`` for a usage example).
-
-* ``addDebugInfo()``: Adds the line of the original template file related to
- the current node as a comment.
-
-* ``indent()``: Indents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-* ``outdent()``: Outdents the generated code (see ``Twig_Node_Block`` for a
- usage example).
-
-.. _creating_extensions:
-
-Creating an Extension
----------------------
-
-The main motivation for writing an extension is to move often used code into a
-reusable class like adding support for internationalization. An extension can
-define tags, filters, tests, operators, global variables, functions, and node
-visitors.
-
-Creating an extension also makes for a better separation of code that is
-executed at compilation time and code needed at runtime. As such, it makes
-your code faster.
-
-Most of the time, it is useful to create a single extension for your project,
-to host all the specific tags and filters you want to add to Twig.
-
-.. tip::
-
- When packaging your code into an extension, Twig is smart enough to
- recompile your templates whenever you make a change to it (when the
- ``auto_reload`` is enabled).
-
-.. note::
-
- Before writing your own extensions, have a look at the Twig official
- extension repository: http://github.com/twigphp/Twig-extensions.
-
-An extension is a class that implements the following interface::
-
- interface Twig_ExtensionInterface
- {
- /**
- * Initializes the runtime environment.
- *
- * This is where you can load some file that contains filter functions for instance.
- *
- * @param Twig_Environment $environment The current Twig_Environment instance
- */
- function initRuntime(Twig_Environment $environment);
-
- /**
- * Returns the token parser instances to add to the existing list.
- *
- * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
- */
- function getTokenParsers();
-
- /**
- * Returns the node visitor instances to add to the existing list.
- *
- * @return array An array of Twig_NodeVisitorInterface instances
- */
- function getNodeVisitors();
-
- /**
- * Returns a list of filters to add to the existing list.
- *
- * @return array An array of filters
- */
- function getFilters();
-
- /**
- * Returns a list of tests to add to the existing list.
- *
- * @return array An array of tests
- */
- function getTests();
-
- /**
- * Returns a list of functions to add to the existing list.
- *
- * @return array An array of functions
- */
- function getFunctions();
-
- /**
- * Returns a list of operators to add to the existing list.
- *
- * @return array An array of operators
- */
- function getOperators();
-
- /**
- * Returns a list of global variables to add to the existing list.
- *
- * @return array An array of global variables
- */
- function getGlobals();
-
- /**
- * Returns the name of the extension.
- *
- * @return string The extension name
- */
- function getName();
- }
-
-To keep your extension class clean and lean, it can inherit from the built-in
-``Twig_Extension`` class instead of implementing the whole interface. That
-way, you just need to implement the ``getName()`` method as the
-``Twig_Extension`` provides empty implementations for all other methods.
-
-The ``getName()`` method must return a unique identifier for your extension.
-
-Now, with this information in mind, let's create the most basic extension
-possible::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getName()
- {
- return 'project';
- }
- }
-
-.. note::
-
- Of course, this extension does nothing for now. We will customize it in
- the next sections.
-
-Twig does not care where you save your extension on the filesystem, as all
-extensions must be registered explicitly to be available in your templates.
-
-You can register an extension by using the ``addExtension()`` method on your
-main ``Environment`` object::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new Project_Twig_Extension());
-
-Of course, you need to first load the extension file by either using
-``require_once()`` or by using an autoloader (see `spl_autoload_register()`_).
-
-.. tip::
-
- The bundled extensions are great examples of how extensions work.
-
-Globals
-~~~~~~~
-
-Global variables can be registered in an extension via the ``getGlobals()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getGlobals()
- {
- return array(
- 'text' => new Text(),
- );
- }
-
- // ...
- }
-
-Functions
-~~~~~~~~~
-
-Functions can be registered in an extension via the ``getFunctions()``
-method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFunctions()
- {
- return array(
- 'lipsum' => new Twig_Function_Function('generate_lipsum'),
- );
- }
-
- // ...
- }
-
-Filters
-~~~~~~~
-
-To add a filter to an extension, you need to override the ``getFilters()``
-method. This method must return an array of filters to add to the Twig
-environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'rot13' => new Twig_Filter_Function('str_rot13'),
- );
- }
-
- // ...
- }
-
-As you can see in the above code, the ``getFilters()`` method returns an array
-where keys are the name of the filters (``rot13``) and the values the
-definition of the filter (``new Twig_Filter_Function('str_rot13')``).
-
-As seen in the previous chapter, you can also define filters as static methods
-on the extension class::
-
-$twig->addFilter('rot13', new Twig_Filter_Function('Project_Twig_Extension::rot13Filter'));
-
-You can also use ``Twig_Filter_Method`` instead of ``Twig_Filter_Function``
-when defining a filter to use a method::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'rot13' => new Twig_Filter_Method($this, 'rot13Filter'),
- );
- }
-
- public function rot13Filter($string)
- {
- return str_rot13($string);
- }
-
- // ...
- }
-
-The first argument of the ``Twig_Filter_Method`` constructor is always
-``$this``, the current extension object. The second one is the name of the
-method to call.
-
-Using methods for filters is a great way to package your filter without
-polluting the global namespace. This also gives the developer more flexibility
-at the cost of a small overhead.
-
-Overriding default Filters
-..........................
-
-If some default core filters do not suit your needs, you can easily override
-them by creating your own extension. Just use the same names as the one you
-want to override::
-
- class MyCoreExtension extends Twig_Extension
- {
- public function getFilters()
- {
- return array(
- 'date' => new Twig_Filter_Method($this, 'dateFilter'),
- // ...
- );
- }
-
- public function dateFilter($timestamp, $format = 'F j, Y H:i')
- {
- return '...'.twig_date_format_filter($timestamp, $format);
- }
-
- public function getName()
- {
- return 'project';
- }
- }
-
-Here, we override the ``date`` filter with a custom one. Using this extension
-is as simple as registering the ``MyCoreExtension`` extension by calling the
-``addExtension()`` method on the environment instance::
-
- $twig = new Twig_Environment($loader);
- $twig->addExtension(new MyCoreExtension());
-
-Tags
-~~~~
-
-Adding a tag in an extension can be done by overriding the
-``getTokenParsers()`` method. This method must return an array of tags to add
-to the Twig environment::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTokenParsers()
- {
- return array(new Project_Set_TokenParser());
- }
-
- // ...
- }
-
-In the above code, we have added a single new tag, defined by the
-``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
-responsible for parsing the tag and compiling it to PHP.
-
-Operators
-~~~~~~~~~
-
-The ``getOperators()`` methods allows to add new operators. Here is how to add
-``!``, ``||``, and ``&&`` operators::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getOperators()
- {
- return array(
- array(
- '!' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
- ),
- array(
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- ),
- );
- }
-
- // ...
- }
-
-Tests
-~~~~~
-
-The ``getTests()`` methods allows to add new test functions::
-
- class Project_Twig_Extension extends Twig_Extension
- {
- public function getTests()
- {
- return array(
- 'even' => new Twig_Test_Function('twig_test_even'),
- );
- }
-
- // ...
- }
-
-Testing an Extension
---------------------
-
-.. versionadded:: 1.10
- Support for functional tests was added in Twig 1.10.
-
-Functional Tests
-~~~~~~~~~~~~~~~~
-
-You can create functional tests for extensions simply by creating the
-following file structure in your test directory::
-
- Fixtures/
- filters/
- foo.test
- bar.test
- functions/
- foo.test
- bar.test
- tags/
- foo.test
- bar.test
- IntegrationTest.php
-
-The ``IntegrationTest.php`` file should look like this::
-
- class Project_Tests_IntegrationTest extends Twig_Test_IntegrationTestCase
- {
- public function getExtensions()
- {
- return array(
- new Project_Twig_Extension1(),
- new Project_Twig_Extension2(),
- );
- }
-
- public function getFixturesDir()
- {
- return dirname(__FILE__).'/Fixtures/';
- }
- }
-
-Fixtures examples can be found within the Twig repository
-`tests/Twig/Fixtures`_ directory.
-
-Node Tests
-~~~~~~~~~~
-
-Testing the node visitors can be complex, so extend your test cases from
-``Twig_Test_NodeTestCase``. Examples can be found in the Twig repository
-`tests/Twig/Node`_ directory.
-
-.. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register
-.. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php
-.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures
-.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node
diff --git a/src/composer/vendor/twig/twig/doc/api.rst b/src/composer/vendor/twig/twig/doc/api.rst
deleted file mode 100644
index f367db07..00000000
--- a/src/composer/vendor/twig/twig/doc/api.rst
+++ /dev/null
@@ -1,552 +0,0 @@
-Twig for Developers
-===================
-
-This chapter describes the API to Twig and not the template language. It will
-be most useful as reference to those implementing the template interface to
-the application and not those who are creating Twig templates.
-
-Basics
-------
-
-Twig uses a central object called the **environment** (of class
-``Twig_Environment``). Instances of this class are used to store the
-configuration and extensions, and are used to load templates from the file
-system or other locations.
-
-Most applications will create one ``Twig_Environment`` object on application
-initialization and use that to load templates. In some cases it's however
-useful to have multiple environments side by side, if different configurations
-are in use.
-
-The simplest way to configure Twig to load templates for your application
-looks roughly like this::
-
- require_once '/path/to/lib/Twig/Autoloader.php';
- Twig_Autoloader::register();
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- ));
-
-This will create a template environment with the default settings and a loader
-that looks up the templates in the ``/path/to/templates/`` folder. Different
-loaders are available and you can also write your own if you want to load
-templates from a database or other resources.
-
-.. note::
-
- Notice that the second argument of the environment is an array of options.
- The ``cache`` option is a compilation cache directory, where Twig caches
- the compiled templates to avoid the parsing phase for sub-sequent
- requests. It is very different from the cache you might want to add for
- the evaluated templates. For such a need, you can use any available PHP
- cache library.
-
-To load a template from this environment you just have to call the
-``loadTemplate()`` method which then returns a ``Twig_Template`` instance::
-
- $template = $twig->loadTemplate('index.html');
-
-To render the template with some variables, call the ``render()`` method::
-
- echo $template->render(array('the' => 'variables', 'go' => 'here'));
-
-.. note::
-
- The ``display()`` method is a shortcut to output the template directly.
-
-You can also load and render the template in one fell swoop::
-
- echo $twig->render('index.html', array('the' => 'variables', 'go' => 'here'));
-
-.. _environment_options:
-
-Environment Options
--------------------
-
-When creating a new ``Twig_Environment`` instance, you can pass an array of
-options as the constructor second argument::
-
- $twig = new Twig_Environment($loader, array('debug' => true));
-
-The following options are available:
-
-* ``debug`` *boolean*
-
- When set to ``true``, the generated templates have a
- ``__toString()`` method that you can use to display the generated nodes
- (default to ``false``).
-
-* ``charset`` *string (default to ``utf-8``)*
-
- The charset used by the templates.
-
-* ``base_template_class`` *string (default to ``Twig_Template``)*
-
- The base template class to use for generated
- templates.
-
-* ``cache`` *string|false*
-
- An absolute path where to store the compiled templates, or
- ``false`` to disable caching (which is the default).
-
-* ``auto_reload`` *boolean*
-
- When developing with Twig, it's useful to recompile the
- template whenever the source code changes. If you don't provide a value for
- the ``auto_reload`` option, it will be determined automatically based on the
- ``debug`` value.
-
-* ``strict_variables`` *boolean*
-
- If set to ``false``, Twig will silently ignore invalid
- variables (variables and or attributes/methods that do not exist) and
- replace them with a ``null`` value. When set to ``true``, Twig throws an
- exception instead (default to ``false``).
-
-* ``autoescape`` *string|boolean*
-
- If set to ``true``, HTML auto-escaping will be enabled by
- default for all templates (default to ``true``).
-
- As of Twig 1.8, you can set the escaping strategy to use (``html``, ``js``,
- ``false`` to disable).
-
- As of Twig 1.9, you can set the escaping strategy to use (``css``, ``url``,
- ``html_attr``, or a PHP callback that takes the template "filename" and must
- return the escaping strategy to use -- the callback cannot be a function name
- to avoid collision with built-in escaping strategies).
-
- As of Twig 1.17, the ``filename`` escaping strategy determines the escaping
- strategy to use for a template based on the template filename extension (this
- strategy does not incur any overhead at runtime as auto-escaping is done at
- compilation time.)
-
-* ``optimizations`` *integer*
-
- A flag that indicates which optimizations to apply
- (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to
- disable).
-
-Loaders
--------
-
-Loaders are responsible for loading templates from a resource such as the file
-system.
-
-Compilation Cache
-~~~~~~~~~~~~~~~~~
-
-All template loaders can cache the compiled templates on the filesystem for
-future reuse. It speeds up Twig a lot as templates are only compiled once; and
-the performance boost is even larger if you use a PHP accelerator such as APC.
-See the ``cache`` and ``auto_reload`` options of ``Twig_Environment`` above
-for more information.
-
-Built-in Loaders
-~~~~~~~~~~~~~~~~
-
-Here is a list of the built-in loaders Twig provides:
-
-``Twig_Loader_Filesystem``
-..........................
-
-.. versionadded:: 1.10
- The ``prependPath()`` and support for namespaces were added in Twig 1.10.
-
-``Twig_Loader_Filesystem`` loads templates from the file system. This loader
-can find templates in folders on the file system and is the preferred way to
-load them::
-
- $loader = new Twig_Loader_Filesystem($templateDir);
-
-It can also look for templates in an array of directories::
-
- $loader = new Twig_Loader_Filesystem(array($templateDir1, $templateDir2));
-
-With such a configuration, Twig will first look for templates in
-``$templateDir1`` and if they do not exist, it will fallback to look for them
-in the ``$templateDir2``.
-
-You can add or prepend paths via the ``addPath()`` and ``prependPath()``
-methods::
-
- $loader->addPath($templateDir3);
- $loader->prependPath($templateDir4);
-
-The filesystem loader also supports namespaced templates. This allows to group
-your templates under different namespaces which have their own template paths.
-
-When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods,
-specify the namespace as the second argument (when not specified, these
-methods act on the "main" namespace)::
-
- $loader->addPath($templateDir, 'admin');
-
-Namespaced templates can be accessed via the special
-``@namespace_name/template_path`` notation::
-
- $twig->render('@admin/index.html', array());
-
-``Twig_Loader_Array``
-.....................
-
-``Twig_Loader_Array`` loads a template from a PHP array. It's passed an array
-of strings bound to template names::
-
- $loader = new Twig_Loader_Array(array(
- 'index.html' => 'Hello {{ name }}!',
- ));
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.html', array('name' => 'Fabien'));
-
-This loader is very useful for unit testing. It can also be used for small
-projects where storing all templates in a single PHP file might make sense.
-
-.. tip::
-
- When using the ``Array`` or ``String`` loaders with a cache mechanism, you
- should know that a new cache key is generated each time a template content
- "changes" (the cache key being the source code of the template). If you
- don't want to see your cache grows out of control, you need to take care
- of clearing the old cache file by yourself.
-
-``Twig_Loader_Chain``
-.....................
-
-``Twig_Loader_Chain`` delegates the loading of templates to other loaders::
-
- $loader1 = new Twig_Loader_Array(array(
- 'base.html' => '{% block content %}{% endblock %}',
- ));
- $loader2 = new Twig_Loader_Array(array(
- 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}',
- 'base.html' => 'Will never be loaded',
- ));
-
- $loader = new Twig_Loader_Chain(array($loader1, $loader2));
-
- $twig = new Twig_Environment($loader);
-
-When looking for a template, Twig will try each loader in turn and it will
-return as soon as the template is found. When rendering the ``index.html``
-template from the above example, Twig will load it with ``$loader2`` but the
-``base.html`` template will be loaded from ``$loader1``.
-
-``Twig_Loader_Chain`` accepts any loader that implements
-``Twig_LoaderInterface``.
-
-.. note::
-
- You can also add loaders via the ``addLoader()`` method.
-
-Create your own Loader
-~~~~~~~~~~~~~~~~~~~~~~
-
-All loaders implement the ``Twig_LoaderInterface``::
-
- interface Twig_LoaderInterface
- {
- /**
- * Gets the source code of a template, given its name.
- *
- * @param string $name string The name of the template to load
- *
- * @return string The template source code
- */
- function getSource($name);
-
- /**
- * Gets the cache key to use for the cache for a given template name.
- *
- * @param string $name string The name of the template to load
- *
- * @return string The cache key
- */
- function getCacheKey($name);
-
- /**
- * Returns true if the template is still fresh.
- *
- * @param string $name The template name
- * @param timestamp $time The last modification time of the cached template
- */
- function isFresh($name, $time);
- }
-
-The ``isFresh()`` method must return ``true`` if the current cached template
-is still fresh, given the last modification time, or ``false`` otherwise.
-
-.. tip::
-
- As of Twig 1.11.0, you can also implement ``Twig_ExistsLoaderInterface``
- to make your loader faster when used with the chain loader.
-
-Using Extensions
-----------------
-
-Twig extensions are packages that add new features to Twig. Using an
-extension is as simple as using the ``addExtension()`` method::
-
- $twig->addExtension(new Twig_Extension_Sandbox());
-
-Twig comes bundled with the following extensions:
-
-* *Twig_Extension_Core*: Defines all the core features of Twig.
-
-* *Twig_Extension_Escaper*: Adds automatic output-escaping and the possibility
- to escape/unescape blocks of code.
-
-* *Twig_Extension_Sandbox*: Adds a sandbox mode to the default Twig
- environment, making it safe to evaluate untrusted code.
-
-* *Twig_Extension_Profiler*: Enabled the built-in Twig profiler (as of Twig
- 1.18).
-
-* *Twig_Extension_Optimizer*: Optimizes the node tree before compilation.
-
-The core, escaper, and optimizer extensions do not need to be added to the
-Twig environment, as they are registered by default.
-
-Built-in Extensions
--------------------
-
-This section describes the features added by the built-in extensions.
-
-.. tip::
-
- Read the chapter about extending Twig to learn how to create your own
- extensions.
-
-Core Extension
-~~~~~~~~~~~~~~
-
-The ``core`` extension defines all the core features of Twig:
-
-* :doc:`Tags `;
-* :doc:`Filters `;
-* :doc:`Functions `;
-* :doc:`Tests `.
-
-Escaper Extension
-~~~~~~~~~~~~~~~~~
-
-The ``escaper`` extension adds automatic output escaping to Twig. It defines a
-tag, ``autoescape``, and a filter, ``raw``.
-
-When creating the escaper extension, you can switch on or off the global
-output escaping strategy::
-
- $escaper = new Twig_Extension_Escaper('html');
- $twig->addExtension($escaper);
-
-If set to ``html``, all variables in templates are escaped (using the ``html``
-escaping strategy), except those using the ``raw`` filter:
-
-.. code-block:: jinja
-
- {{ article.to_html|raw }}
-
-You can also change the escaping mode locally by using the ``autoescape`` tag
-(see the :doc:`autoescape` doc for the syntax used before
-Twig 1.8):
-
-.. code-block:: jinja
-
- {% autoescape 'html' %}
- {{ var }}
- {{ var|raw }} {# var won't be escaped #}
- {{ var|escape }} {# var won't be double-escaped #}
- {% endautoescape %}
-
-.. warning::
-
- The ``autoescape`` tag has no effect on included files.
-
-The escaping rules are implemented as follows:
-
-* Literals (integers, booleans, arrays, ...) used in the template directly as
- variables or filter arguments are never automatically escaped:
-
- .. code-block:: jinja
-
- {{ "Twig
" }} {# won't be escaped #}
-
- {% set text = "Twig
" %}
- {{ text }} {# will be escaped #}
-
-* Expressions which the result is always a literal or a variable marked safe
- are never automatically escaped:
-
- .. code-block:: jinja
-
- {{ foo ? "Twig
" : "
Twig" }} {# won't be escaped #}
-
- {% set text = "Twig
" %}
- {{ foo ? text : "
Twig" }} {# will be escaped #}
-
- {% set text = "Twig
" %}
- {{ foo ? text|raw : "
Twig" }} {# won't be escaped #}
-
- {% set text = "Twig
" %}
- {{ foo ? text|escape : "
Twig" }} {# the result of the expression won't be escaped #}
-
-* Escaping is applied before printing, after any other filter is applied:
-
- .. code-block:: jinja
-
- {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #}
-
-* The `raw` filter should only be used at the end of the filter chain:
-
- .. code-block:: jinja
-
- {{ var|raw|upper }} {# will be escaped #}
-
- {{ var|upper|raw }} {# won't be escaped #}
-
-* Automatic escaping is not applied if the last filter in the chain is marked
- safe for the current context (e.g. ``html`` or ``js``). ``escape`` and
- ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked
- safe for JavaScript, ``raw`` is marked safe for everything.
-
- .. code-block:: jinja
-
- {% autoescape 'js' %}
- {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #}
- {{ var }} {# will be escaped for JavaScript #}
- {{ var|escape('js') }} {# won't be double-escaped #}
- {% endautoescape %}
-
-.. note::
-
- Note that autoescaping has some limitations as escaping is applied on
- expressions after evaluation. For instance, when working with
- concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as
- escaping is applied on the result of the concatenation, not on the
- individual variables (so, the ``raw`` filter won't have any effect here).
-
-Sandbox Extension
-~~~~~~~~~~~~~~~~~
-
-The ``sandbox`` extension can be used to evaluate untrusted code. Access to
-unsafe attributes and methods is prohibited. The sandbox security is managed
-by a policy instance. By default, Twig comes with one policy class:
-``Twig_Sandbox_SecurityPolicy``. This class allows you to white-list some
-tags, filters, properties, and methods::
-
- $tags = array('if');
- $filters = array('upper');
- $methods = array(
- 'Article' => array('getTitle', 'getBody'),
- );
- $properties = array(
- 'Article' => array('title', 'body'),
- );
- $functions = array('range');
- $policy = new Twig_Sandbox_SecurityPolicy($tags, $filters, $methods, $properties, $functions);
-
-With the previous configuration, the security policy will only allow usage of
-the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be
-able to call the ``getTitle()`` and ``getBody()`` methods on ``Article``
-objects, and the ``title`` and ``body`` public properties. Everything else
-won't be allowed and will generate a ``Twig_Sandbox_SecurityError`` exception.
-
-The policy object is the first argument of the sandbox constructor::
-
- $sandbox = new Twig_Extension_Sandbox($policy);
- $twig->addExtension($sandbox);
-
-By default, the sandbox mode is disabled and should be enabled when including
-untrusted template code by using the ``sandbox`` tag:
-
-.. code-block:: jinja
-
- {% sandbox %}
- {% include 'user.html' %}
- {% endsandbox %}
-
-You can sandbox all templates by passing ``true`` as the second argument of
-the extension constructor::
-
- $sandbox = new Twig_Extension_Sandbox($policy, true);
-
-Profiler Extension
-~~~~~~~~~~~~~~~~~~
-
-.. versionadded:: 1.18
- The Profile extension was added in Twig 1.18.
-
-The ``profiler`` extension enables a profiler for Twig templates; it should
-only be used on your development machines as it adds some overhead::
-
- $profile = new Twig_Profiler_Profile();
- $twig->addExtension(new Twig_Extension_Profiler($profile));
-
- $dumper = new Twig_Profiler_Dumper_Text();
- echo $dumper->dump($profile);
-
-A profile contains information about time and memory consumption for template,
-block, and macro executions.
-
-You can also dump the data in a `Blackfire.io `_
-compatible format::
-
- $dumper = new Twig_Profiler_Dumper_Blackfire();
- file_put_contents('/path/to/profile.prof', $dumper->dump($profile));
-
-Upload the profile to visualize it (create a `free account
-`_ first):
-
-.. code-block:: sh
-
- blackfire --slot=7 upload /path/to/profile.prof
-
-Optimizer Extension
-~~~~~~~~~~~~~~~~~~~
-
-The ``optimizer`` extension optimizes the node tree before compilation::
-
- $twig->addExtension(new Twig_Extension_Optimizer());
-
-By default, all optimizations are turned on. You can select the ones you want
-to enable by passing them to the constructor::
-
- $optimizer = new Twig_Extension_Optimizer(Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR);
-
- $twig->addExtension($optimizer);
-
-Twig supports the following optimizations:
-
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_ALL``, enables all optimizations
- (this is the default value).
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_NONE``, disables all optimizations.
- This reduces the compilation time, but it can increase the execution time
- and the consumed memory.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_FOR``, optimizes the ``for`` tag by
- removing the ``loop`` variable creation whenever possible.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_RAW_FILTER``, removes the ``raw``
- filter whenever possible.
-* ``Twig_NodeVisitor_Optimizer::OPTIMIZE_VAR_ACCESS``, simplifies the creation
- and access of variables in the compiled templates whenever possible.
-
-Exceptions
-----------
-
-Twig can throw exceptions:
-
-* ``Twig_Error``: The base exception for all errors.
-
-* ``Twig_Error_Syntax``: Thrown to tell the user that there is a problem with
- the template syntax.
-
-* ``Twig_Error_Runtime``: Thrown when an error occurs at runtime (when a filter
- does not exist for instance).
-
-* ``Twig_Error_Loader``: Thrown when an error occurs during template loading.
-
-* ``Twig_Sandbox_SecurityError``: Thrown when an unallowed tag, filter, or
- method is called in a sandboxed template.
diff --git a/src/composer/vendor/twig/twig/doc/coding_standards.rst b/src/composer/vendor/twig/twig/doc/coding_standards.rst
deleted file mode 100644
index f435df49..00000000
--- a/src/composer/vendor/twig/twig/doc/coding_standards.rst
+++ /dev/null
@@ -1,101 +0,0 @@
-Coding Standards
-================
-
-When writing Twig templates, we recommend you to follow these official coding
-standards:
-
-* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``,
- and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
-
- .. code-block:: jinja
-
- {{ foo }}
- {# comment #}
- {% if foo %}{% endif %}
-
- When using the whitespace control character, do not put any spaces between
- it and the delimiter:
-
- .. code-block:: jinja
-
- {{- foo -}}
- {#- comment -#}
- {%- if foo -%}{%- endif -%}
-
-* Put one (and only one) space before and after the following operators:
- comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
- operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
- operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
- operator (``?:``):
-
- .. code-block:: jinja
-
- {{ 1 + 2 }}
- {{ foo ~ bar }}
- {{ true ? true : false }}
-
-* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in
- arrays and hashes:
-
- .. code-block:: jinja
-
- {{ [1, 2, 3] }}
- {{ {'foo': 'bar'} }}
-
-* Do not put any spaces after an opening parenthesis and before a closing
- parenthesis in expressions:
-
- .. code-block:: jinja
-
- {{ 1 + (2 * 3) }}
-
-* Do not put any spaces before and after string delimiters:
-
- .. code-block:: jinja
-
- {{ 'foo' }}
- {{ "foo" }}
-
-* Do not put any spaces before and after the following operators: ``|``,
- ``.``, ``..``, ``[]``:
-
- .. code-block:: jinja
-
- {{ foo|upper|lower }}
- {{ user.name }}
- {{ user[name] }}
- {% for i in 1..12 %}{% endfor %}
-
-* Do not put any spaces before and after the parenthesis used for filter and
- function calls:
-
- .. code-block:: jinja
-
- {{ foo|default('foo') }}
- {{ range(1..10) }}
-
-* Do not put any spaces before and after the opening and the closing of arrays
- and hashes:
-
- .. code-block:: jinja
-
- {{ [1, 2, 3] }}
- {{ {'foo': 'bar'} }}
-
-* Use lower cased and underscored variable names:
-
- .. code-block:: jinja
-
- {% set foo = 'foo' %}
- {% set foo_bar = 'foo' %}
-
-* Indent your code inside tags (use the same indentation as the one used for
- the target language of the rendered template):
-
- .. code-block:: jinja
-
- {% block foo %}
- {% if true %}
- true
- {% endif %}
- {% endblock %}
diff --git a/src/composer/vendor/twig/twig/doc/deprecated.rst b/src/composer/vendor/twig/twig/doc/deprecated.rst
deleted file mode 100644
index 844336b3..00000000
--- a/src/composer/vendor/twig/twig/doc/deprecated.rst
+++ /dev/null
@@ -1,160 +0,0 @@
-Deprecated Features
-===================
-
-This document lists all deprecated features in Twig. Deprecated features are
-kept for backward compatibility and removed in the next major release (a
-feature that was deprecated in Twig 1.x is removed in Twig 2.0).
-
-Deprecation Notices
--------------------
-
-As of Twig 1.21, Twig generates deprecation notices when a template uses
-deprecated features. See :ref:`deprecation-notices` for more information.
-
-Token Parsers
--------------
-
-* As of Twig 1.x, the token parser broker sub-system is deprecated. The
- following class and interface will be removed in 2.0:
-
- * ``Twig_TokenParserBrokerInterface``
- * ``Twig_TokenParserBroker``
-
-Extensions
-----------
-
-* As of Twig 1.x, the ability to remove an extension is deprecated and the
- ``Twig_Environment::removeExtension()`` method will be removed in 2.0.
-
-* As of Twig 1.23, the ``Twig_ExtensionInterface::initRuntime()`` method is
- deprecated. You have two options to avoid the deprecation notice: if you
- implement this method to store the environment for your custom filters,
- functions, or tests, use the ``needs_environment`` option instead; if you
- have more complex needs, explicitly implement
- ``Twig_Extension_InitRuntimeInterface`` (not recommended).
-
-* As of Twig 1.23, the ``Twig_ExtensionInterface::getGlobals()`` method is
- deprecated. Implement ``Twig_Extension_GlobalsInterface`` to avoid
- deprecation notices.
-
-PEAR
-----
-
-PEAR support has been discontinued in Twig 1.15.1, and no PEAR packages are
-provided anymore. Use Composer instead.
-
-Filters
--------
-
-* As of Twig 1.x, use ``Twig_SimpleFilter`` to add a filter. The following
- classes and interfaces will be removed in 2.0:
-
- * ``Twig_FilterInterface``
- * ``Twig_FilterCallableInterface``
- * ``Twig_Filter``
- * ``Twig_Filter_Function``
- * ``Twig_Filter_Method``
- * ``Twig_Filter_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleFilter`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Filter`` instead). In Twig 2.x,
- ``Twig_SimpleFilter`` is just an alias for ``Twig_Filter``.
-
-Functions
----------
-
-* As of Twig 1.x, use ``Twig_SimpleFunction`` to add a function. The following
- classes and interfaces will be removed in 2.0:
-
- * ``Twig_FunctionInterface``
- * ``Twig_FunctionCallableInterface``
- * ``Twig_Function``
- * ``Twig_Function_Function``
- * ``Twig_Function_Method``
- * ``Twig_Function_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleFunction`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Function`` instead). In Twig 2.x,
- ``Twig_SimpleFunction`` is just an alias for ``Twig_Function``.
-
-Tests
------
-
-* As of Twig 1.x, use ``Twig_SimpleTest`` to add a test. The following classes
- and interfaces will be removed in 2.0:
-
- * ``Twig_TestInterface``
- * ``Twig_TestCallableInterface``
- * ``Twig_Test``
- * ``Twig_Test_Function``
- * ``Twig_Test_Method``
- * ``Twig_Test_Node``
-
-* As of Twig 2.x, the ``Twig_SimpleTest`` class is deprecated and will be
- removed in Twig 3.x (use ``Twig_Test`` instead). In Twig 2.x,
- ``Twig_SimpleTest`` is just an alias for ``Twig_Test``.
-
-* The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
- as`` and ``divisible by`` respectively.
-
-Tags
-----
-
-* As of Twig 1.x, the ``raw`` tag is deprecated. You should use ``verbatim``
- instead.
-
-Nodes
------
-
-* As of Twig 1.x, ``Node::toXml()`` is deprecated and will be removed in Twig
- 2.0.
-
-Interfaces
-----------
-
-* As of Twig 2.x, the following interfaces are deprecated and empty (they will
- be removed in Twig 3.0):
-
-* ``Twig_CompilerInterface`` (use ``Twig_Compiler`` instead)
-* ``Twig_LexerInterface`` (use ``Twig_Lexer`` instead)
-* ``Twig_NodeInterface`` (use ``Twig_Node`` instead)
-* ``Twig_ParserInterface`` (use ``Twig_Parser`` instead)
-* ``Twig_ExistsLoaderInterface`` (merged with ``Twig_LoaderInterface``)
-* ``Twig_TemplateInterface`` (use ``Twig_Template`` instead, and use
- those constants Twig_Template::ANY_CALL, Twig_Template::ARRAY_CALL,
- Twig_Template::METHOD_CALL)
-
-Loaders
--------
-
-* As of Twig 1.x, ``Twig_Loader_String`` is deprecated and will be removed in
- 2.0. You can render a string via ``Twig_Environment::createTemplate()``.
-
-Node Visitors
--------------
-
-* Because of the removal of ``Twig_NodeInterface`` in 2.0, you need to extend
- ``Twig_BaseNodeVisitor`` instead of implementing ``Twig_NodeVisitorInterface``
- directly to make your node visitors compatible with both Twig 1.x and 2.x.
-
-Globals
--------
-
-* As of Twig 2.x, the ability to register a global variable after the runtime
- or the extensions have been initialized is not possible anymore (but
- changing the value of an already registered global is possible).
-
-* As of Twig 1.x, the ``_self`` global variable is deprecated except for usage
- in the ``from`` and the ``import`` tags. In Twig 2.0, ``_self`` is not
- exposed anymore but still usable in the ``from`` and the ``import`` tags.
-
-Miscellaneous
--------------
-
-* As of Twig 1.x, ``Twig_Environment::clearTemplateCache()``, ``Twig_Environment::writeCacheFile()``,
- ``Twig_Environment::clearCacheFiles()``, ``Twig_Environment::getCacheFilename()``, and
- ``Twig_Environment::getTemplateClassPrefix()`` are deprecated and will be removed in 2.0.
-
-* As of Twig 1.x, ``Twig_Template::getEnvironment()`` and
- ``Twig_TemplateInterface::getEnvironment()`` are deprecated and will be
- removed in 2.0.
diff --git a/src/composer/vendor/twig/twig/doc/filters/abs.rst b/src/composer/vendor/twig/twig/doc/filters/abs.rst
deleted file mode 100644
index 22fa59d0..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/abs.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``abs``
-=======
-
-The ``abs`` filter returns the absolute value.
-
-.. code-block:: jinja
-
- {# number = -5 #}
-
- {{ number|abs }}
-
- {# outputs 5 #}
-
-.. note::
-
- Internally, Twig uses the PHP `abs`_ function.
-
-.. _`abs`: http://php.net/abs
diff --git a/src/composer/vendor/twig/twig/doc/filters/batch.rst b/src/composer/vendor/twig/twig/doc/filters/batch.rst
deleted file mode 100644
index f8b6fa9d..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/batch.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-``batch``
-=========
-
-.. versionadded:: 1.12.3
- The ``batch`` filter was added in Twig 1.12.3.
-
-The ``batch`` filter "batches" items by returning a list of lists with the
-given number of items. A second parameter can be provided and used to fill in
-missing items:
-
-.. code-block:: jinja
-
- {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %}
-
-
- {% for row in items|batch(3, 'No item') %}
-
- {% for column in row %}
- {{ column }}
- {% endfor %}
-
- {% endfor %}
-
-
-The above example will be rendered as:
-
-.. code-block:: jinja
-
-
-
- a
- b
- c
-
-
- d
- e
- f
-
-
- g
- No item
- No item
-
-
-
-Arguments
----------
-
-* ``size``: The size of the batch; fractional numbers will be rounded up
-* ``fill``: Used to fill in missing items
diff --git a/src/composer/vendor/twig/twig/doc/filters/capitalize.rst b/src/composer/vendor/twig/twig/doc/filters/capitalize.rst
deleted file mode 100644
index 10546a1f..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/capitalize.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``capitalize``
-==============
-
-The ``capitalize`` filter capitalizes a value. The first character will be
-uppercase, all others lowercase:
-
-.. code-block:: jinja
-
- {{ 'my first car'|capitalize }}
-
- {# outputs 'My first car' #}
diff --git a/src/composer/vendor/twig/twig/doc/filters/convert_encoding.rst b/src/composer/vendor/twig/twig/doc/filters/convert_encoding.rst
deleted file mode 100644
index f4ebe580..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/convert_encoding.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-``convert_encoding``
-====================
-
-.. versionadded:: 1.4
- The ``convert_encoding`` filter was added in Twig 1.4.
-
-The ``convert_encoding`` filter converts a string from one encoding to
-another. The first argument is the expected output charset and the second one
-is the input charset:
-
-.. code-block:: jinja
-
- {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }}
-
-.. note::
-
- This filter relies on the `iconv`_ or `mbstring`_ extension, so one of
- them must be installed. In case both are installed, `mbstring`_ is used by
- default (Twig before 1.8.1 uses `iconv`_ by default).
-
-Arguments
----------
-
-* ``to``: The output charset
-* ``from``: The input charset
-
-.. _`iconv`: http://php.net/iconv
-.. _`mbstring`: http://php.net/mbstring
diff --git a/src/composer/vendor/twig/twig/doc/filters/date.rst b/src/composer/vendor/twig/twig/doc/filters/date.rst
deleted file mode 100644
index c86d42ba..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/date.rst
+++ /dev/null
@@ -1,94 +0,0 @@
-``date``
-========
-
-.. versionadded:: 1.1
- The timezone support has been added in Twig 1.1.
-
-.. versionadded:: 1.5
- The default date format support has been added in Twig 1.5.
-
-.. versionadded:: 1.6.1
- The default timezone support has been added in Twig 1.6.1.
-
-.. versionadded:: 1.11.0
- The introduction of the false value for the timezone was introduced in Twig 1.11.0
-
-The ``date`` filter formats a date to a given format:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y") }}
-
-The format specifier is the same as supported by `date`_,
-except when the filtered data is of type `DateInterval`_, when the format must conform to
-`DateInterval::format`_ instead.
-
-The ``date`` filter accepts strings (it must be in a format supported by the
-`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For
-instance, to display the current date, filter the word "now":
-
-.. code-block:: jinja
-
- {{ "now"|date("m/d/Y") }}
-
-To escape words and characters in the date format use ``\\`` in front of each
-character:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("F jS \\a\\t g:ia") }}
-
-If the value passed to the ``date`` filter is ``null``, it will return the
-current date by default. If an empty string is desired instead of the current
-date, use a ternary operator:
-
-.. code-block:: jinja
-
- {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }}
-
-If no format is provided, Twig will use the default one: ``F j, Y H:i``. This
-default can be easily changed by calling the ``setDateFormat()`` method on the
-``core`` extension instance. The first argument is the default format for
-dates and the second one is the default format for date intervals:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setDateFormat('d/m/Y', '%d days');
-
-Timezone
---------
-
-By default, the date is displayed by applying the default timezone (the one
-specified in php.ini or declared in Twig -- see below), but you can override
-it by explicitly specifying a timezone:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y", "Europe/Paris") }}
-
-If the date is already a DateTime object, and if you want to keep its current
-timezone, pass ``false`` as the timezone value:
-
-.. code-block:: jinja
-
- {{ post.published_at|date("m/d/Y", false) }}
-
-The default timezone can also be set globally by calling ``setTimezone()``:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setTimezone('Europe/Paris');
-
-Arguments
----------
-
-* ``format``: The date format
-* ``timezone``: The date timezone
-
-.. _`strtotime`: http://www.php.net/strtotime
-.. _`DateTime`: http://www.php.net/DateTime
-.. _`DateInterval`: http://www.php.net/DateInterval
-.. _`date`: http://www.php.net/date
-.. _`DateInterval::format`: http://www.php.net/DateInterval.format
diff --git a/src/composer/vendor/twig/twig/doc/filters/date_modify.rst b/src/composer/vendor/twig/twig/doc/filters/date_modify.rst
deleted file mode 100644
index add40b56..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/date_modify.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-``date_modify``
-===============
-
-.. versionadded:: 1.9.0
- The date_modify filter has been added in Twig 1.9.0.
-
-The ``date_modify`` filter modifies a date with a given modifier string:
-
-.. code-block:: jinja
-
- {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}
-
-The ``date_modify`` filter accepts strings (it must be in a format supported
-by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine
-it with the :doc:`date` filter for formatting.
-
-Arguments
----------
-
-* ``modifier``: The modifier
-
-.. _`strtotime`: http://www.php.net/strtotime
-.. _`DateTime`: http://www.php.net/DateTime
diff --git a/src/composer/vendor/twig/twig/doc/filters/default.rst b/src/composer/vendor/twig/twig/doc/filters/default.rst
deleted file mode 100644
index 641ac6e7..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/default.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-``default``
-===========
-
-The ``default`` filter returns the passed default value if the value is
-undefined or empty, otherwise the value of the variable:
-
-.. code-block:: jinja
-
- {{ var|default('var is not defined') }}
-
- {{ var.foo|default('foo item on var is not defined') }}
-
- {{ var['foo']|default('foo item on var is not defined') }}
-
- {{ ''|default('passed var is empty') }}
-
-When using the ``default`` filter on an expression that uses variables in some
-method calls, be sure to use the ``default`` filter whenever a variable can be
-undefined:
-
-.. code-block:: jinja
-
- {{ var.method(foo|default('foo'))|default('foo') }}
-
-.. note::
-
- Read the documentation for the :doc:`defined<../tests/defined>` and
- :doc:`empty<../tests/empty>` tests to learn more about their semantics.
-
-Arguments
----------
-
-* ``default``: The default value
diff --git a/src/composer/vendor/twig/twig/doc/filters/escape.rst b/src/composer/vendor/twig/twig/doc/filters/escape.rst
deleted file mode 100644
index fc9771ac..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/escape.rst
+++ /dev/null
@@ -1,116 +0,0 @@
-``escape``
-==========
-
-.. versionadded:: 1.9.0
- The ``css``, ``url``, and ``html_attr`` strategies were added in Twig
- 1.9.0.
-
-.. versionadded:: 1.14.0
- The ability to define custom escapers was added in Twig 1.14.0.
-
-The ``escape`` filter escapes a string for safe insertion into the final
-output. It supports different escaping strategies depending on the template
-context.
-
-By default, it uses the HTML escaping strategy:
-
-.. code-block:: jinja
-
- {{ user.username|escape }}
-
-For convenience, the ``e`` filter is defined as an alias:
-
-.. code-block:: jinja
-
- {{ user.username|e }}
-
-The ``escape`` filter can also be used in other contexts than HTML thanks to
-an optional argument which defines the escaping strategy to use:
-
-.. code-block:: jinja
-
- {{ user.username|e }}
- {# is equivalent to #}
- {{ user.username|e('html') }}
-
-And here is how to escape variables included in JavaScript code:
-
-.. code-block:: jinja
-
- {{ user.username|escape('js') }}
- {{ user.username|e('js') }}
-
-The ``escape`` filter supports the following escaping strategies:
-
-* ``html``: escapes a string for the **HTML body** context.
-
-* ``js``: escapes a string for the **JavaScript context**.
-
-* ``css``: escapes a string for the **CSS context**. CSS escaping can be
- applied to any string being inserted into CSS and escapes everything except
- alphanumerics.
-
-* ``url``: escapes a string for the **URI or parameter contexts**. This should
- not be used to escape an entire URI; only a subcomponent being inserted.
-
-* ``html_attr``: escapes a string for the **HTML attribute** context.
-
-.. note::
-
- Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function
- for the HTML escaping strategy.
-
-.. caution::
-
- When using automatic escaping, Twig tries to not double-escape a variable
- when the automatic escaping strategy is the same as the one applied by the
- escape filter; but that does not work when using a variable as the
- escaping strategy:
-
- .. code-block:: jinja
-
- {% set strategy = 'html' %}
-
- {% autoescape 'html' %}
- {{ var|escape('html') }} {# won't be double-escaped #}
- {{ var|escape(strategy) }} {# will be double-escaped #}
- {% endautoescape %}
-
- When using a variable as the escaping strategy, you should disable
- automatic escaping:
-
- .. code-block:: jinja
-
- {% set strategy = 'html' %}
-
- {% autoescape 'html' %}
- {{ var|escape(strategy)|raw }} {# won't be double-escaped #}
- {% endautoescape %}
-
-Custom Escapers
----------------
-
-You can define custom escapers by calling the ``setEscaper()`` method on the
-``core`` extension instance. The first argument is the escaper name (to be
-used in the ``escape`` call) and the second one must be a valid PHP callable:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setEscaper('csv', 'csv_escaper'));
-
-When called by Twig, the callable receives the Twig environment instance, the
-string to escape, and the charset.
-
-.. note::
-
- Built-in escapers cannot be overridden mainly they should be considered as
- the final implementation and also for better performance.
-
-Arguments
----------
-
-* ``strategy``: The escaping strategy
-* ``charset``: The string charset
-
-.. _`htmlspecialchars`: http://php.net/htmlspecialchars
diff --git a/src/composer/vendor/twig/twig/doc/filters/first.rst b/src/composer/vendor/twig/twig/doc/filters/first.rst
deleted file mode 100644
index 674c1f9e..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/first.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-``first``
-=========
-
-.. versionadded:: 1.12.2
- The ``first`` filter was added in Twig 1.12.2.
-
-The ``first`` filter returns the first "element" of a sequence, a mapping, or
-a string:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3, 4]|first }}
- {# outputs 1 #}
-
- {{ { a: 1, b: 2, c: 3, d: 4 }|first }}
- {# outputs 1 #}
-
- {{ '1234'|first }}
- {# outputs 1 #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
diff --git a/src/composer/vendor/twig/twig/doc/filters/format.rst b/src/composer/vendor/twig/twig/doc/filters/format.rst
deleted file mode 100644
index f8effd9a..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/format.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-``format``
-==========
-
-The ``format`` filter formats a given string by replacing the placeholders
-(placeholders follows the `sprintf`_ notation):
-
-.. code-block:: jinja
-
- {{ "I like %s and %s."|format(foo, "bar") }}
-
- {# outputs I like foo and bar
- if the foo parameter equals to the foo string. #}
-
-.. _`sprintf`: http://www.php.net/sprintf
-
-.. seealso:: :doc:`replace`
diff --git a/src/composer/vendor/twig/twig/doc/filters/index.rst b/src/composer/vendor/twig/twig/doc/filters/index.rst
deleted file mode 100644
index 8daa9611..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/index.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-Filters
-=======
-
-.. toctree::
- :maxdepth: 1
-
- abs
- batch
- capitalize
- convert_encoding
- date
- date_modify
- default
- escape
- first
- format
- join
- json_encode
- keys
- last
- length
- lower
- merge
- nl2br
- number_format
- raw
- replace
- reverse
- round
- slice
- sort
- split
- striptags
- title
- trim
- upper
- url_encode
diff --git a/src/composer/vendor/twig/twig/doc/filters/join.rst b/src/composer/vendor/twig/twig/doc/filters/join.rst
deleted file mode 100644
index 2fab9452..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/join.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-``join``
-========
-
-The ``join`` filter returns a string which is the concatenation of the items
-of a sequence:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3]|join }}
- {# returns 123 #}
-
-The separator between elements is an empty string per default, but you can
-define it with the optional first parameter:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3]|join('|') }}
- {# outputs 1|2|3 #}
-
-Arguments
----------
-
-* ``glue``: The separator
diff --git a/src/composer/vendor/twig/twig/doc/filters/json_encode.rst b/src/composer/vendor/twig/twig/doc/filters/json_encode.rst
deleted file mode 100644
index a39bb476..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/json_encode.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-``json_encode``
-===============
-
-The ``json_encode`` filter returns the JSON representation of a value:
-
-.. code-block:: jinja
-
- {{ data|json_encode() }}
-
-.. note::
-
- Internally, Twig uses the PHP `json_encode`_ function.
-
-Arguments
----------
-
-* ``options``: A bitmask of `json_encode options`_ (``{{
- data|json_encode(constant('JSON_PRETTY_PRINT')) }}``)
-
-.. _`json_encode`: http://php.net/json_encode
-.. _`json_encode options`: http://www.php.net/manual/en/json.constants.php
diff --git a/src/composer/vendor/twig/twig/doc/filters/keys.rst b/src/composer/vendor/twig/twig/doc/filters/keys.rst
deleted file mode 100644
index e4f090c6..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/keys.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``keys``
-========
-
-The ``keys`` filter returns the keys of an array. It is useful when you want to
-iterate over the keys of an array:
-
-.. code-block:: jinja
-
- {% for key in array|keys %}
- ...
- {% endfor %}
diff --git a/src/composer/vendor/twig/twig/doc/filters/last.rst b/src/composer/vendor/twig/twig/doc/filters/last.rst
deleted file mode 100644
index 345b6573..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/last.rst
+++ /dev/null
@@ -1,25 +0,0 @@
-``last``
-========
-
-.. versionadded:: 1.12.2
- The ``last`` filter was added in Twig 1.12.2.
-
-The ``last`` filter returns the last "element" of a sequence, a mapping, or
-a string:
-
-.. code-block:: jinja
-
- {{ [1, 2, 3, 4]|last }}
- {# outputs 4 #}
-
- {{ { a: 1, b: 2, c: 3, d: 4 }|last }}
- {# outputs 4 #}
-
- {{ '1234'|last }}
- {# outputs 4 #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
diff --git a/src/composer/vendor/twig/twig/doc/filters/length.rst b/src/composer/vendor/twig/twig/doc/filters/length.rst
deleted file mode 100644
index 1f783b3d..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/length.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``length``
-==========
-
-The ``length`` filter returns the number of items of a sequence or mapping, or
-the length of a string:
-
-.. code-block:: jinja
-
- {% if users|length > 10 %}
- ...
- {% endif %}
diff --git a/src/composer/vendor/twig/twig/doc/filters/lower.rst b/src/composer/vendor/twig/twig/doc/filters/lower.rst
deleted file mode 100644
index ef9faa90..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/lower.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-``lower``
-=========
-
-The ``lower`` filter converts a value to lowercase:
-
-.. code-block:: jinja
-
- {{ 'WELCOME'|lower }}
-
- {# outputs 'welcome' #}
diff --git a/src/composer/vendor/twig/twig/doc/filters/merge.rst b/src/composer/vendor/twig/twig/doc/filters/merge.rst
deleted file mode 100644
index 88780dd6..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/merge.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-``merge``
-=========
-
-The ``merge`` filter merges an array with another array:
-
-.. code-block:: jinja
-
- {% set values = [1, 2] %}
-
- {% set values = values|merge(['apple', 'orange']) %}
-
- {# values now contains [1, 2, 'apple', 'orange'] #}
-
-New values are added at the end of the existing ones.
-
-The ``merge`` filter also works on hashes:
-
-.. code-block:: jinja
-
- {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %}
-
- {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %}
-
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #}
-
-For hashes, the merging process occurs on the keys: if the key does not
-already exist, it is added but if the key already exists, its value is
-overridden.
-
-.. tip::
-
- If you want to ensure that some values are defined in an array (by given
- default values), reverse the two elements in the call:
-
- .. code-block:: jinja
-
- {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
-
- {% set items = { 'apple': 'unknown' }|merge(items) %}
-
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #}
-
-.. note::
-
- Internally, Twig uses the PHP `array_merge`_ function. It supports
- Traversable objects by transforming those to arrays.
-
-.. _`array_merge`: http://php.net/array_merge
diff --git a/src/composer/vendor/twig/twig/doc/filters/nl2br.rst b/src/composer/vendor/twig/twig/doc/filters/nl2br.rst
deleted file mode 100644
index 5c923e14..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/nl2br.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-``nl2br``
-=========
-
-.. versionadded:: 1.5
- The ``nl2br`` filter was added in Twig 1.5.
-
-The ``nl2br`` filter inserts HTML line breaks before all newlines in a string:
-
-.. code-block:: jinja
-
- {{ "I like Twig.\nYou will like it too."|nl2br }}
- {# outputs
-
- I like Twig.
- You will like it too.
-
- #}
-
-.. note::
-
- The ``nl2br`` filter pre-escapes the input before applying the
- transformation.
diff --git a/src/composer/vendor/twig/twig/doc/filters/number_format.rst b/src/composer/vendor/twig/twig/doc/filters/number_format.rst
deleted file mode 100644
index 3114e845..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/number_format.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-``number_format``
-=================
-
-.. versionadded:: 1.5
- The ``number_format`` filter was added in Twig 1.5
-
-The ``number_format`` filter formats numbers. It is a wrapper around PHP's
-`number_format`_ function:
-
-.. code-block:: jinja
-
- {{ 200.35|number_format }}
-
-You can control the number of decimal places, decimal point, and thousands
-separator using the additional arguments:
-
-.. code-block:: jinja
-
- {{ 9800.333|number_format(2, '.', ',') }}
-
-If no formatting options are provided then Twig will use the default formatting
-options of:
-
-* 0 decimal places.
-* ``.`` as the decimal point.
-* ``,`` as the thousands separator.
-
-These defaults can be easily changed through the core extension:
-
-.. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setNumberFormat(3, '.', ',');
-
-The defaults set for ``number_format`` can be over-ridden upon each call using the
-additional parameters.
-
-Arguments
----------
-
-* ``decimal``: The number of decimal points to display
-* ``decimal_point``: The character(s) to use for the decimal point
-* ``thousand_sep``: The character(s) to use for the thousands separator
-
-.. _`number_format`: http://php.net/number_format
diff --git a/src/composer/vendor/twig/twig/doc/filters/raw.rst b/src/composer/vendor/twig/twig/doc/filters/raw.rst
deleted file mode 100644
index e5e5b12e..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/raw.rst
+++ /dev/null
@@ -1,36 +0,0 @@
-``raw``
-=======
-
-The ``raw`` filter marks the value as being "safe", which means that in an
-environment with automatic escaping enabled this variable will not be escaped
-if ``raw`` is the last filter applied to it:
-
-.. code-block:: jinja
-
- {% autoescape %}
- {{ var|raw }} {# var won't be escaped #}
- {% endautoescape %}
-
-.. note::
-
- Be careful when using the ``raw`` filter inside expressions:
-
- .. code-block:: jinja
-
- {% autoescape %}
- {% set hello = 'Hello' %}
- {% set hola = 'Hola' %}
-
- {{ false ? 'Hola' : hello|raw }}
- does not render the same as
- {{ false ? hola : hello|raw }}
- but renders the same as
- {{ (false ? hola : hello)|raw }}
- {% endautoescape %}
-
- The first ternary statement is not escaped: ``hello`` is marked as being
- safe and Twig does not escape static values (see
- :doc:`escape<../tags/autoescape>`). In the second ternary statement, even
- if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole
- expression. The third ternary statement is marked as safe and the result is
- not escaped.
diff --git a/src/composer/vendor/twig/twig/doc/filters/replace.rst b/src/composer/vendor/twig/twig/doc/filters/replace.rst
deleted file mode 100644
index 1227957b..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/replace.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-``replace``
-===========
-
-The ``replace`` filter formats a given string by replacing the placeholders
-(placeholders are free-form):
-
-.. code-block:: jinja
-
- {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
-
- {# outputs I like foo and bar
- if the foo parameter equals to the foo string. #}
-
-Arguments
----------
-
-* ``replace_pairs``: The placeholder values
-
-.. seealso:: :doc:`format`
diff --git a/src/composer/vendor/twig/twig/doc/filters/reverse.rst b/src/composer/vendor/twig/twig/doc/filters/reverse.rst
deleted file mode 100644
index 76fd2c1a..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/reverse.rst
+++ /dev/null
@@ -1,47 +0,0 @@
-``reverse``
-===========
-
-.. versionadded:: 1.6
- Support for strings has been added in Twig 1.6.
-
-The ``reverse`` filter reverses a sequence, a mapping, or a string:
-
-.. code-block:: jinja
-
- {% for user in users|reverse %}
- ...
- {% endfor %}
-
- {{ '1234'|reverse }}
-
- {# outputs 4321 #}
-
-.. tip::
-
- For sequences and mappings, numeric keys are not preserved. To reverse
- them as well, pass ``true`` as an argument to the ``reverse`` filter:
-
- .. code-block:: jinja
-
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %}
- {{ key }}: {{ value }}
- {%- endfor %}
-
- {# output: 0: c 1: b 2: a #}
-
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %}
- {{ key }}: {{ value }}
- {%- endfor %}
-
- {# output: 3: c 2: b 1: a #}
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-Arguments
----------
-
-* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.
-
-.. _`Traversable`: http://php.net/Traversable
diff --git a/src/composer/vendor/twig/twig/doc/filters/round.rst b/src/composer/vendor/twig/twig/doc/filters/round.rst
deleted file mode 100644
index 2521cf16..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/round.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-``round``
-=========
-
-.. versionadded:: 1.15.0
- The ``round`` filter was added in Twig 1.15.0.
-
-The ``round`` filter rounds a number to a given precision:
-
-.. code-block:: jinja
-
- {{ 42.55|round }}
- {# outputs 43 #}
-
- {{ 42.55|round(1, 'floor') }}
- {# outputs 42.5 #}
-
-The ``round`` filter takes two optional arguments; the first one specifies the
-precision (default is ``0``) and the second the rounding method (default is
-``common``):
-
-* ``common`` rounds either up or down (rounds the value up to precision decimal
- places away from zero, when it is half way there -- making 1.5 into 2 and
- -1.5 into -2);
-
-* ``ceil`` always rounds up;
-
-* ``floor`` always rounds down.
-
-.. note::
-
- The ``//`` operator is equivalent to ``|round(0, 'floor')``.
-
-Arguments
----------
-
-* ``precision``: The rounding precision
-* ``method``: The rounding method
diff --git a/src/composer/vendor/twig/twig/doc/filters/slice.rst b/src/composer/vendor/twig/twig/doc/filters/slice.rst
deleted file mode 100644
index 70bf139e..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/slice.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-``slice``
-===========
-
-.. versionadded:: 1.6
- The ``slice`` filter was added in Twig 1.6.
-
-The ``slice`` filter extracts a slice of a sequence, a mapping, or a string:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %}
- {# will iterate over 2 and 3 #}
- {% endfor %}
-
- {{ '12345'|slice(1, 2) }}
-
- {# outputs 23 #}
-
-You can use any valid expression for both the start and the length:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5]|slice(start, length) %}
- {# ... #}
- {% endfor %}
-
-As syntactic sugar, you can also use the ``[]`` notation:
-
-.. code-block:: jinja
-
- {% for i in [1, 2, 3, 4, 5][start:length] %}
- {# ... #}
- {% endfor %}
-
- {{ '12345'[1:2] }} {# will display "23" #}
-
- {# you can omit the first argument -- which is the same as 0 #}
- {{ '12345'[:2] }} {# will display "12" #}
-
- {# you can omit the last argument -- which will select everything till the end #}
- {{ '12345'[2:] }} {# will display "345" #}
-
-The ``slice`` filter works as the `array_slice`_ PHP function for arrays and
-`mb_substr`_ for strings with a fallback to `substr`_.
-
-If the start is non-negative, the sequence will start at that start in the
-variable. If start is negative, the sequence will start that far from the end
-of the variable.
-
-If length is given and is positive, then the sequence will have up to that
-many elements in it. If the variable is shorter than the length, then only the
-available variable elements will be present. If length is given and is
-negative then the sequence will stop that many elements from the end of the
-variable. If it is omitted, then the sequence will have everything from offset
-up until the end of the variable.
-
-.. note::
-
- It also works with objects implementing the `Traversable`_ interface.
-
-Arguments
----------
-
-* ``start``: The start of the slice
-* ``length``: The size of the slice
-* ``preserve_keys``: Whether to preserve key or not (when the input is an array)
-
-.. _`Traversable`: http://php.net/manual/en/class.traversable.php
-.. _`array_slice`: http://php.net/array_slice
-.. _`mb_substr` : http://php.net/mb-substr
-.. _`substr`: http://php.net/substr
diff --git a/src/composer/vendor/twig/twig/doc/filters/sort.rst b/src/composer/vendor/twig/twig/doc/filters/sort.rst
deleted file mode 100644
index 350207f8..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/sort.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``sort``
-========
-
-The ``sort`` filter sorts an array:
-
-.. code-block:: jinja
-
- {% for user in users|sort %}
- ...
- {% endfor %}
-
-.. note::
-
- Internally, Twig uses the PHP `asort`_ function to maintain index
- association. It supports Traversable objects by transforming
- those to arrays.
-
-.. _`asort`: http://php.net/asort
diff --git a/src/composer/vendor/twig/twig/doc/filters/split.rst b/src/composer/vendor/twig/twig/doc/filters/split.rst
deleted file mode 100644
index bbc6d798..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/split.rst
+++ /dev/null
@@ -1,53 +0,0 @@
-``split``
-=========
-
-.. versionadded:: 1.10.3
- The ``split`` filter was added in Twig 1.10.3.
-
-The ``split`` filter splits a string by the given delimiter and returns a list
-of strings:
-
-.. code-block:: jinja
-
- {% set foo = "one,two,three"|split(',') %}
- {# foo contains ['one', 'two', 'three'] #}
-
-You can also pass a ``limit`` argument:
-
- * If ``limit`` is positive, the returned array will contain a maximum of
- limit elements with the last element containing the rest of string;
-
- * If ``limit`` is negative, all components except the last -limit are
- returned;
-
- * If ``limit`` is zero, then this is treated as 1.
-
-.. code-block:: jinja
-
- {% set foo = "one,two,three,four,five"|split(',', 3) %}
- {# foo contains ['one', 'two', 'three,four,five'] #}
-
-If the ``delimiter`` is an empty string, then value will be split by equal
-chunks. Length is set by the ``limit`` argument (one character by default).
-
-.. code-block:: jinja
-
- {% set foo = "123"|split('') %}
- {# foo contains ['1', '2', '3'] #}
-
- {% set bar = "aabbcc"|split('', 2) %}
- {# bar contains ['aa', 'bb', 'cc'] #}
-
-.. note::
-
- Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is
- empty) functions for string splitting.
-
-Arguments
----------
-
-* ``delimiter``: The delimiter
-* ``limit``: The limit argument
-
-.. _`explode`: http://php.net/explode
-.. _`str_split`: http://php.net/str_split
diff --git a/src/composer/vendor/twig/twig/doc/filters/striptags.rst b/src/composer/vendor/twig/twig/doc/filters/striptags.rst
deleted file mode 100644
index 72c6f252..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/striptags.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-``striptags``
-=============
-
-The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace
-by one space:
-
-.. code-block:: jinja
-
- {{ some_html|striptags }}
-
-.. note::
-
- Internally, Twig uses the PHP `strip_tags`_ function.
-
-.. _`strip_tags`: http://php.net/strip_tags
diff --git a/src/composer/vendor/twig/twig/doc/filters/title.rst b/src/composer/vendor/twig/twig/doc/filters/title.rst
deleted file mode 100644
index c5a318e8..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/title.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``title``
-=========
-
-The ``title`` filter returns a titlecased version of the value. Words will
-start with uppercase letters, all remaining characters are lowercase:
-
-.. code-block:: jinja
-
- {{ 'my first car'|title }}
-
- {# outputs 'My First Car' #}
diff --git a/src/composer/vendor/twig/twig/doc/filters/trim.rst b/src/composer/vendor/twig/twig/doc/filters/trim.rst
deleted file mode 100644
index 4ddb2083..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/trim.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-``trim``
-========
-
-.. versionadded:: 1.6.2
- The ``trim`` filter was added in Twig 1.6.2.
-
-The ``trim`` filter strips whitespace (or other characters) from the beginning
-and end of a string:
-
-.. code-block:: jinja
-
- {{ ' I like Twig. '|trim }}
-
- {# outputs 'I like Twig.' #}
-
- {{ ' I like Twig.'|trim('.') }}
-
- {# outputs ' I like Twig' #}
-
-.. note::
-
- Internally, Twig uses the PHP `trim`_ function.
-
-Arguments
----------
-
-* ``character_mask``: The characters to strip
-
-.. _`trim`: http://php.net/trim
diff --git a/src/composer/vendor/twig/twig/doc/filters/upper.rst b/src/composer/vendor/twig/twig/doc/filters/upper.rst
deleted file mode 100644
index 561cebe3..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/upper.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-``upper``
-=========
-
-The ``upper`` filter converts a value to uppercase:
-
-.. code-block:: jinja
-
- {{ 'welcome'|upper }}
-
- {# outputs 'WELCOME' #}
diff --git a/src/composer/vendor/twig/twig/doc/filters/url_encode.rst b/src/composer/vendor/twig/twig/doc/filters/url_encode.rst
deleted file mode 100644
index 5944e59c..00000000
--- a/src/composer/vendor/twig/twig/doc/filters/url_encode.rst
+++ /dev/null
@@ -1,34 +0,0 @@
-``url_encode``
-==============
-
-.. versionadded:: 1.12.3
- Support for encoding an array as query string was added in Twig 1.12.3.
-
-.. versionadded:: 1.16.0
- The ``raw`` argument was removed in Twig 1.16.0. Twig now always encodes
- according to RFC 3986.
-
-The ``url_encode`` filter percent encodes a given string as URL segment
-or an array as query string:
-
-.. code-block:: jinja
-
- {{ "path-seg*ment"|url_encode }}
- {# outputs "path-seg%2Ament" #}
-
- {{ "string with spaces"|url_encode }}
- {# outputs "string%20with%20spaces" #}
-
- {{ {'param': 'value', 'foo': 'bar'}|url_encode }}
- {# outputs "param=value&foo=bar" #}
-
-.. note::
-
- Internally, Twig uses the PHP `urlencode`_ (or `rawurlencode`_ if you pass
- ``true`` as the first parameter) or the `http_build_query`_ function. Note
- that as of Twig 1.16.0, ``urlencode`` **always** uses ``rawurlencode`` (the
- ``raw`` argument was removed.)
-
-.. _`urlencode`: http://php.net/urlencode
-.. _`rawurlencode`: http://php.net/rawurlencode
-.. _`http_build_query`: http://php.net/http_build_query
diff --git a/src/composer/vendor/twig/twig/doc/functions/attribute.rst b/src/composer/vendor/twig/twig/doc/functions/attribute.rst
deleted file mode 100644
index ceba96b0..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/attribute.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-``attribute``
-=============
-
-.. versionadded:: 1.2
- The ``attribute`` function was added in Twig 1.2.
-
-The ``attribute`` function can be used to access a "dynamic" attribute of a
-variable:
-
-.. code-block:: jinja
-
- {{ attribute(object, method) }}
- {{ attribute(object, method, arguments) }}
- {{ attribute(array, item) }}
-
-In addition, the ``defined`` test can check for the existence of a dynamic
-attribute:
-
-.. code-block:: jinja
-
- {{ attribute(object, method) is defined ? 'Method exists' : 'Method does not exist' }}
-
-.. note::
-
- The resolution algorithm is the same as the one used for the ``.``
- notation, except that the item can be any valid expression.
diff --git a/src/composer/vendor/twig/twig/doc/functions/block.rst b/src/composer/vendor/twig/twig/doc/functions/block.rst
deleted file mode 100644
index fd571efb..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/block.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-``block``
-=========
-
-When a template uses inheritance and if you want to print a block multiple
-times, use the ``block`` function:
-
-.. code-block:: jinja
-
- {% block title %}{% endblock %}
-
- {{ block('title') }}
-
- {% block body %}{% endblock %}
-
-.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>`
diff --git a/src/composer/vendor/twig/twig/doc/functions/constant.rst b/src/composer/vendor/twig/twig/doc/functions/constant.rst
deleted file mode 100644
index bea0e9fc..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/constant.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-``constant``
-============
-
-.. versionadded: 1.12.1
- constant now accepts object instances as the second argument.
-
-``constant`` returns the constant value for a given string:
-
-.. code-block:: jinja
-
- {{ some_date|date(constant('DATE_W3C')) }}
- {{ constant('Namespace\\Classname::CONSTANT_NAME') }}
-
-As of 1.12.1 you can read constants from object instances as well:
-
-.. code-block:: jinja
-
- {{ constant('RSS', date) }}
diff --git a/src/composer/vendor/twig/twig/doc/functions/cycle.rst b/src/composer/vendor/twig/twig/doc/functions/cycle.rst
deleted file mode 100644
index e3434932..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/cycle.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-``cycle``
-=========
-
-The ``cycle`` function cycles on an array of values:
-
-.. code-block:: jinja
-
- {% set start_year = date() | date('Y') %}
- {% set end_year = start_year + 5 %}
-
- {% for year in start_year..end_year %}
- {{ cycle(['odd', 'even'], loop.index0) }}
- {% endfor %}
-
-The array can contain any number of values:
-
-.. code-block:: jinja
-
- {% set fruits = ['apple', 'orange', 'citrus'] %}
-
- {% for i in 0..10 %}
- {{ cycle(fruits, i) }}
- {% endfor %}
-
-Arguments
----------
-
-* ``position``: The cycle position
diff --git a/src/composer/vendor/twig/twig/doc/functions/date.rst b/src/composer/vendor/twig/twig/doc/functions/date.rst
deleted file mode 100644
index 714e08c4..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/date.rst
+++ /dev/null
@@ -1,52 +0,0 @@
-``date``
-========
-
-.. versionadded:: 1.6
- The date function has been added in Twig 1.6.
-
-.. versionadded:: 1.6.1
- The default timezone support has been added in Twig 1.6.1.
-
-Converts an argument to a date to allow date comparison:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date('-2days') %}
- {# do something #}
- {% endif %}
-
-The argument must be in one of PHP’s supported `date and time formats`_.
-
-You can pass a timezone as the second argument:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date('-2days', 'Europe/Paris') %}
- {# do something #}
- {% endif %}
-
-If no argument is passed, the function returns the current date:
-
-.. code-block:: jinja
-
- {% if date(user.created_at) < date() %}
- {# always! #}
- {% endif %}
-
-.. note::
-
- You can set the default timezone globally by calling ``setTimezone()`` on
- the ``core`` extension instance:
-
- .. code-block:: php
-
- $twig = new Twig_Environment($loader);
- $twig->getExtension('core')->setTimezone('Europe/Paris');
-
-Arguments
----------
-
-* ``date``: The date
-* ``timezone``: The timezone
-
-.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php
diff --git a/src/composer/vendor/twig/twig/doc/functions/dump.rst b/src/composer/vendor/twig/twig/doc/functions/dump.rst
deleted file mode 100644
index a231f089..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/dump.rst
+++ /dev/null
@@ -1,69 +0,0 @@
-``dump``
-========
-
-.. versionadded:: 1.5
- The ``dump`` function was added in Twig 1.5.
-
-The ``dump`` function dumps information about a template variable. This is
-mostly useful to debug a template that does not behave as expected by
-introspecting its variables:
-
-.. code-block:: jinja
-
- {{ dump(user) }}
-
-.. note::
-
- The ``dump`` function is not available by default. You must add the
- ``Twig_Extension_Debug`` extension explicitly when creating your Twig
- environment::
-
- $twig = new Twig_Environment($loader, array(
- 'debug' => true,
- // ...
- ));
- $twig->addExtension(new Twig_Extension_Debug());
-
- Even when enabled, the ``dump`` function won't display anything if the
- ``debug`` option on the environment is not enabled (to avoid leaking debug
- information on a production server).
-
-In an HTML context, wrap the output with a ``pre`` tag to make it easier to
-read:
-
-.. code-block:: jinja
-
-
- {{ dump(user) }}
-
-
-.. tip::
-
- Using a ``pre`` tag is not needed when `XDebug`_ is enabled and
- ``html_errors`` is ``on``; as a bonus, the output is also nicer with
- XDebug enabled.
-
-You can debug several variables by passing them as additional arguments:
-
-.. code-block:: jinja
-
- {{ dump(user, categories) }}
-
-If you don't pass any value, all variables from the current context are
-dumped:
-
-.. code-block:: jinja
-
- {{ dump() }}
-
-.. note::
-
- Internally, Twig uses the PHP `var_dump`_ function.
-
-Arguments
----------
-
-* ``context``: The context to dump
-
-.. _`XDebug`: http://xdebug.org/docs/display
-.. _`var_dump`: http://php.net/var_dump
diff --git a/src/composer/vendor/twig/twig/doc/functions/include.rst b/src/composer/vendor/twig/twig/doc/functions/include.rst
deleted file mode 100644
index 33bd56d1..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/include.rst
+++ /dev/null
@@ -1,80 +0,0 @@
-``include``
-===========
-
-.. versionadded:: 1.12
- The ``include`` function was added in Twig 1.12.
-
-The ``include`` function returns the rendered content of a template:
-
-.. code-block:: jinja
-
- {{ include('template.html') }}
- {{ include(some_var) }}
-
-Included templates have access to the variables of the active context.
-
-If you are using the filesystem loader, the templates are looked for in the
-paths defined by it.
-
-The context is passed by default to the template but you can also pass
-additional variables:
-
-.. code-block:: jinja
-
- {# template.html will have access to the variables from the current context and the additional ones provided #}
- {{ include('template.html', {foo: 'bar'}) }}
-
-You can disable access to the context by setting ``with_context`` to
-``false``:
-
-.. code-block:: jinja
-
- {# only the foo variable will be accessible #}
- {{ include('template.html', {foo: 'bar'}, with_context = false) }}
-
-.. code-block:: jinja
-
- {# no variables will be accessible #}
- {{ include('template.html', with_context = false) }}
-
-And if the expression evaluates to a ``Twig_Template`` object, Twig will use it
-directly::
-
- // {{ include(template) }}
-
- $template = $twig->loadTemplate('some_template.twig');
-
- $twig->loadTemplate('template.twig')->display(array('template' => $template));
-
-When you set the ``ignore_missing`` flag, Twig will return an empty string if
-the template does not exist:
-
-.. code-block:: jinja
-
- {{ include('sidebar.html', ignore_missing = true) }}
-
-You can also provide a list of templates that are checked for existence before
-inclusion. The first template that exists will be rendered:
-
-.. code-block:: jinja
-
- {{ include(['page_detailed.html', 'page.html']) }}
-
-If ``ignore_missing`` is set, it will fall back to rendering nothing if none
-of the templates exist, otherwise it will throw an exception.
-
-When including a template created by an end user, you should consider
-sandboxing it:
-
-.. code-block:: jinja
-
- {{ include('page.html', sandboxed = true) }}
-
-Arguments
----------
-
-* ``template``: The template to render
-* ``variables``: The variables to pass to the template
-* ``with_context``: Whether to pass the current context variables or not
-* ``ignore_missing``: Whether to ignore missing templates or not
-* ``sandboxed``: Whether to sandbox the template or not
diff --git a/src/composer/vendor/twig/twig/doc/functions/index.rst b/src/composer/vendor/twig/twig/doc/functions/index.rst
deleted file mode 100644
index 07214a76..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/index.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-Functions
-=========
-
-.. toctree::
- :maxdepth: 1
-
- attribute
- block
- constant
- cycle
- date
- dump
- include
- max
- min
- parent
- random
- range
- source
- template_from_string
diff --git a/src/composer/vendor/twig/twig/doc/functions/max.rst b/src/composer/vendor/twig/twig/doc/functions/max.rst
deleted file mode 100644
index 6f3cfc53..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/max.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-``max``
-=======
-
-.. versionadded:: 1.15
- The ``max`` function was added in Twig 1.15.
-
-``max`` returns the biggest value of a sequence or a set of values:
-
-.. code-block:: jinja
-
- {{ max(1, 3, 2) }}
- {{ max([1, 3, 2]) }}
-
-When called with a mapping, max ignores keys and only compares values:
-
-.. code-block:: jinja
-
- {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }}
- {# returns "e" #}
-
diff --git a/src/composer/vendor/twig/twig/doc/functions/min.rst b/src/composer/vendor/twig/twig/doc/functions/min.rst
deleted file mode 100644
index 7b6a65e1..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/min.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-``min``
-=======
-
-.. versionadded:: 1.15
- The ``min`` function was added in Twig 1.15.
-
-``min`` returns the lowest value of a sequence or a set of values:
-
-.. code-block:: jinja
-
- {{ min(1, 3, 2) }}
- {{ min([1, 3, 2]) }}
-
-When called with a mapping, min ignores keys and only compares values:
-
-.. code-block:: jinja
-
- {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }}
- {# returns "a" #}
-
diff --git a/src/composer/vendor/twig/twig/doc/functions/parent.rst b/src/composer/vendor/twig/twig/doc/functions/parent.rst
deleted file mode 100644
index f5bd2001..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/parent.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-``parent``
-==========
-
-When a template uses inheritance, it's possible to render the contents of the
-parent block when overriding a block by using the ``parent`` function:
-
-.. code-block:: jinja
-
- {% extends "base.html" %}
-
- {% block sidebar %}
- Table Of Contents
- ...
- {{ parent() }}
- {% endblock %}
-
-The ``parent()`` call will return the content of the ``sidebar`` block as
-defined in the ``base.html`` template.
-
-.. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>`
diff --git a/src/composer/vendor/twig/twig/doc/functions/random.rst b/src/composer/vendor/twig/twig/doc/functions/random.rst
deleted file mode 100644
index 168e74f8..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/random.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-``random``
-==========
-
-.. versionadded:: 1.5
- The ``random`` function was added in Twig 1.5.
-
-.. versionadded:: 1.6
- String and integer handling was added in Twig 1.6.
-
-The ``random`` function returns a random value depending on the supplied
-parameter type:
-
-* a random item from a sequence;
-* a random character from a string;
-* a random integer between 0 and the integer parameter (inclusive).
-
-.. code-block:: jinja
-
- {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}
- {{ random('ABC') }} {# example output: C #}
- {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #}
- {{ random(5) }} {# example output: 3 #}
-
-Arguments
----------
-
-* ``values``: The values
-
-.. _`mt_rand`: http://php.net/mt_rand
diff --git a/src/composer/vendor/twig/twig/doc/functions/range.rst b/src/composer/vendor/twig/twig/doc/functions/range.rst
deleted file mode 100644
index b7cd0111..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/range.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-``range``
-=========
-
-Returns a list containing an arithmetic progression of integers:
-
-.. code-block:: jinja
-
- {% for i in range(0, 3) %}
- {{ i }},
- {% endfor %}
-
- {# outputs 0, 1, 2, 3, #}
-
-When step is given (as the third parameter), it specifies the increment (or
-decrement):
-
-.. code-block:: jinja
-
- {% for i in range(0, 6, 2) %}
- {{ i }},
- {% endfor %}
-
- {# outputs 0, 2, 4, 6, #}
-
-The Twig built-in ``..`` operator is just syntactic sugar for the ``range``
-function (with a step of 1):
-
-.. code-block:: jinja
-
- {% for i in 0..3 %}
- {{ i }},
- {% endfor %}
-
-.. tip::
-
- The ``range`` function works as the native PHP `range`_ function.
-
-Arguments
----------
-
-* ``low``: The first value of the sequence.
-* ``high``: The highest possible value of the sequence.
-* ``step``: The increment between elements of the sequence.
-
-.. _`range`: http://php.net/range
diff --git a/src/composer/vendor/twig/twig/doc/functions/source.rst b/src/composer/vendor/twig/twig/doc/functions/source.rst
deleted file mode 100644
index 3c921b1c..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/source.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-``source``
-==========
-
-.. versionadded:: 1.15
- The ``source`` function was added in Twig 1.15.
-
-.. versionadded:: 1.18.3
- The ``ignore_missing`` flag was added in Twig 1.18.3.
-
-The ``source`` function returns the content of a template without rendering it:
-
-.. code-block:: jinja
-
- {{ source('template.html') }}
- {{ source(some_var) }}
-
-When you set the ``ignore_missing`` flag, Twig will return an empty string if
-the template does not exist:
-
-.. code-block:: jinja
-
- {{ source('template.html', ignore_missing = true) }}
-
-The function uses the same template loaders as the ones used to include
-templates. So, if you are using the filesystem loader, the templates are looked
-for in the paths defined by it.
-
-Arguments
----------
-
-* ``name``: The name of the template to read
-* ``ignore_missing``: Whether to ignore missing templates or not
diff --git a/src/composer/vendor/twig/twig/doc/functions/template_from_string.rst b/src/composer/vendor/twig/twig/doc/functions/template_from_string.rst
deleted file mode 100644
index ce6a60dc..00000000
--- a/src/composer/vendor/twig/twig/doc/functions/template_from_string.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-``template_from_string``
-========================
-
-.. versionadded:: 1.11
- The ``template_from_string`` function was added in Twig 1.11.
-
-The ``template_from_string`` function loads a template from a string:
-
-.. code-block:: jinja
-
- {{ include(template_from_string("Hello {{ name }}")) }}
- {{ include(template_from_string(page.template)) }}
-
-.. note::
-
- The ``template_from_string`` function is not available by default. You
- must add the ``Twig_Extension_StringLoader`` extension explicitly when
- creating your Twig environment::
-
- $twig = new Twig_Environment(...);
- $twig->addExtension(new Twig_Extension_StringLoader());
-
-.. note::
-
- Even if you will probably always use the ``template_from_string`` function
- with the ``include`` function, you can use it with any tag or function that
- takes a template as an argument (like the ``embed`` or ``extends`` tags).
-
-Arguments
----------
-
-* ``template``: The template
diff --git a/src/composer/vendor/twig/twig/doc/index.rst b/src/composer/vendor/twig/twig/doc/index.rst
deleted file mode 100644
index 358bd738..00000000
--- a/src/composer/vendor/twig/twig/doc/index.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-Twig
-====
-
-.. toctree::
- :maxdepth: 2
-
- intro
- installation
- templates
- api
- advanced
- internals
- deprecated
- recipes
- coding_standards
- tags/index
- filters/index
- functions/index
- tests/index
diff --git a/src/composer/vendor/twig/twig/doc/installation.rst b/src/composer/vendor/twig/twig/doc/installation.rst
deleted file mode 100644
index afdcf165..00000000
--- a/src/composer/vendor/twig/twig/doc/installation.rst
+++ /dev/null
@@ -1,116 +0,0 @@
-Installation
-============
-
-You have multiple ways to install Twig.
-
-Installing the Twig PHP package
--------------------------------
-
-Installing via Composer (recommended)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Install `Composer`_ and run the following command to get the latest version:
-
-.. code-block:: bash
-
- composer require twig/twig:~1.0
-
-Installing from the tarball release
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1. Download the most recent tarball from the `download page`_
-2. Verify the integrity of the tarball http://fabien.potencier.org/article/73/signing-project-releases
-3. Unpack the tarball
-4. Move the files somewhere in your project
-
-Installing the development version
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: bash
-
- git clone git://github.com/twigphp/Twig.git
-
-Installing the PEAR package
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. note::
-
- Using PEAR for installing Twig is deprecated and Twig 1.15.1 was the last
- version published on the PEAR channel; use Composer instead.
-
-.. code-block:: bash
-
- pear channel-discover pear.twig-project.org
- pear install twig/Twig
-
-Installing the C extension
---------------------------
-
-.. versionadded:: 1.4
- The C extension was added in Twig 1.4.
-
-.. note::
-
- The C extension is **optional** but it brings some nice performance
- improvements. Note that the extension is not a replacement for the PHP
- code; it only implements a small part of the PHP code to improve the
- performance at runtime; you must still install the regular PHP code.
-
-Twig comes with a C extension that enhances the performance of the Twig
-runtime engine; install it like any other PHP extensions:
-
-.. code-block:: bash
-
- cd ext/twig
- phpize
- ./configure
- make
- make install
-
-.. note::
-
- You can also install the C extension via PEAR (note that this method is
- deprecated and newer versions of Twig are not available on the PEAR
- channel):
-
- .. code-block:: bash
-
- pear channel-discover pear.twig-project.org
- pear install twig/CTwig
-
-For Windows:
-
-1. Setup the build environment following the `PHP documentation`_
-2. Put Twig's C extension source code into ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\ext\twig``
-3. Use the ``configure --disable-all --enable-cli --enable-twig=shared`` command instead of step 14
-4. ``nmake``
-5. Copy the ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\Release_TS\php_twig.dll`` file to your PHP setup.
-
-.. tip::
-
- For Windows ZendServer, ZTS is not enabled as mentioned in `Zend Server
- FAQ`_.
-
- You have to use ``configure --disable-all --disable-zts --enable-cli
- --enable-twig=shared`` to be able to build the twig C extension for
- ZendServer.
-
- The built DLL will be available in
- ``C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release``
-
-Finally, enable the extension in your ``php.ini`` configuration file:
-
-.. code-block:: ini
-
- extension=twig.so #For Unix systems
- extension=php_twig.dll #For Windows systems
-
-And from now on, Twig will automatically compile your templates to take
-advantage of the C extension. Note that this extension does not replace the
-PHP code but only provides an optimized version of the
-``Twig_Template::getAttribute()`` method.
-
-.. _`download page`: https://github.com/twigphp/Twig/tags
-.. _`Composer`: https://getcomposer.org/download/
-.. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild
-.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6
diff --git a/src/composer/vendor/twig/twig/doc/internals.rst b/src/composer/vendor/twig/twig/doc/internals.rst
deleted file mode 100644
index ef1174dd..00000000
--- a/src/composer/vendor/twig/twig/doc/internals.rst
+++ /dev/null
@@ -1,138 +0,0 @@
-Twig Internals
-==============
-
-Twig is very extensible and you can easily hack it. Keep in mind that you
-should probably try to create an extension before hacking the core, as most
-features and enhancements can be handled with extensions. This chapter is also
-useful for people who want to understand how Twig works under the hood.
-
-How does Twig work?
--------------------
-
-The rendering of a Twig template can be summarized into four key steps:
-
-* **Load** the template: If the template is already compiled, load it and go
- to the *evaluation* step, otherwise:
-
- * First, the **lexer** tokenizes the template source code into small pieces
- for easier processing;
- * Then, the **parser** converts the token stream into a meaningful tree
- of nodes (the Abstract Syntax Tree);
- * Eventually, the *compiler* transforms the AST into PHP code.
-
-* **Evaluate** the template: It basically means calling the ``display()``
- method of the compiled template and passing it the context.
-
-The Lexer
----------
-
-The lexer tokenizes a template source code into a token stream (each token is
-an instance of ``Twig_Token``, and the stream is an instance of
-``Twig_TokenStream``). The default lexer recognizes 13 different token types:
-
-* ``Twig_Token::BLOCK_START_TYPE``, ``Twig_Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``)
-* ``Twig_Token::VAR_START_TYPE``, ``Twig_Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``)
-* ``Twig_Token::TEXT_TYPE``: A text outside an expression;
-* ``Twig_Token::NAME_TYPE``: A name in an expression;
-* ``Twig_Token::NUMBER_TYPE``: A number in an expression;
-* ``Twig_Token::STRING_TYPE``: A string in an expression;
-* ``Twig_Token::OPERATOR_TYPE``: An operator;
-* ``Twig_Token::PUNCTUATION_TYPE``: A punctuation sign;
-* ``Twig_Token::INTERPOLATION_START_TYPE``, ``Twig_Token::INTERPOLATION_END_TYPE`` (as of Twig 1.5): Delimiters for string interpolation;
-* ``Twig_Token::EOF_TYPE``: Ends of template.
-
-You can manually convert a source code into a token stream by calling the
-``tokenize()`` method of an environment::
-
- $stream = $twig->tokenize($source, $identifier);
-
-As the stream has a ``__toString()`` method, you can have a textual
-representation of it by echoing the object::
-
- echo $stream."\n";
-
-Here is the output for the ``Hello {{ name }}`` template:
-
-.. code-block:: text
-
- TEXT_TYPE(Hello )
- VAR_START_TYPE()
- NAME_TYPE(name)
- VAR_END_TYPE()
- EOF_TYPE()
-
-.. note::
-
- The default lexer (``Twig_Lexer``) can be changed by calling
- the ``setLexer()`` method::
-
- $twig->setLexer($lexer);
-
-The Parser
-----------
-
-The parser converts the token stream into an AST (Abstract Syntax Tree), or a
-node tree (an instance of ``Twig_Node_Module``). The core extension defines
-the basic nodes like: ``for``, ``if``, ... and the expression nodes.
-
-You can manually convert a token stream into a node tree by calling the
-``parse()`` method of an environment::
-
- $nodes = $twig->parse($stream);
-
-Echoing the node object gives you a nice representation of the tree::
-
- echo $nodes."\n";
-
-Here is the output for the ``Hello {{ name }}`` template:
-
-.. code-block:: text
-
- Twig_Node_Module(
- Twig_Node_Text(Hello )
- Twig_Node_Print(
- Twig_Node_Expression_Name(name)
- )
- )
-
-.. note::
-
- The default parser (``Twig_TokenParser``) can be changed by calling the
- ``setParser()`` method::
-
- $twig->setParser($parser);
-
-The Compiler
-------------
-
-The last step is done by the compiler. It takes a node tree as an input and
-generates PHP code usable for runtime execution of the template.
-
-You can manually compile a node tree to PHP code with the ``compile()`` method
-of an environment::
-
- $php = $twig->compile($nodes);
-
-The generated template for a ``Hello {{ name }}`` template reads as follows
-(the actual output can differ depending on the version of Twig you are
-using)::
-
- /* Hello {{ name }} */
- class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends Twig_Template
- {
- protected function doDisplay(array $context, array $blocks = array())
- {
- // line 1
- echo "Hello ";
- echo twig_escape_filter($this->env, isset($context["name"]) ? $context["name"] : null), "html", null, true);
- }
-
- // some more code
- }
-
-.. note::
-
- The default compiler (``Twig_Compiler``) can be changed by calling the
- ``setCompiler()`` method::
-
- $twig->setCompiler($compiler);
diff --git a/src/composer/vendor/twig/twig/doc/intro.rst b/src/composer/vendor/twig/twig/doc/intro.rst
deleted file mode 100644
index 9b38c97d..00000000
--- a/src/composer/vendor/twig/twig/doc/intro.rst
+++ /dev/null
@@ -1,85 +0,0 @@
-Introduction
-============
-
-This is the documentation for Twig, the flexible, fast, and secure template
-engine for PHP.
-
-If you have any exposure to other text-based template languages, such as
-Smarty, Django, or Jinja, you should feel right at home with Twig. It's both
-designer and developer friendly by sticking to PHP's principles and adding
-functionality useful for templating environments.
-
-The key-features are...
-
-* *Fast*: Twig compiles templates down to plain optimized PHP code. The
- overhead compared to regular PHP code was reduced to the very minimum.
-
-* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This
- allows Twig to be used as a template language for applications where users
- may modify the template design.
-
-* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
- developer to define its own custom tags and filters, and create its own DSL.
-
-Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish,
-phpBB, Piwik, OroCRM, and many frameworks have support for it as well like
-Slim, Yii, Laravel, Codeigniter, and Kohana, just to name a few.
-
-Prerequisites
--------------
-
-Twig needs at least **PHP 5.2.7** to run.
-
-Installation
-------------
-
-The recommended way to install Twig is via Composer:
-
-.. code-block:: bash
-
- composer require "twig/twig:~1.0"
-
-.. note::
-
- To learn more about the other installation methods, read the
- :doc:`installation` chapter; it also explains how to install
- the Twig C extension.
-
-Basic API Usage
----------------
-
-This section gives you a brief introduction to the PHP API for Twig.
-
-.. code-block:: php
-
- require_once '/path/to/vendor/autoload.php';
-
- $loader = new Twig_Loader_Array(array(
- 'index' => 'Hello {{ name }}!',
- ));
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index', array('name' => 'Fabien'));
-
-Twig uses a loader (``Twig_Loader_Array``) to locate templates, and an
-environment (``Twig_Environment``) to store the configuration.
-
-The ``render()`` method loads the template passed as a first argument and
-renders it with the variables passed as a second argument.
-
-As templates are generally stored on the filesystem, Twig also comes with a
-filesystem loader::
-
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- ));
-
- echo $twig->render('index.html', array('name' => 'Fabien'));
-
-.. tip::
-
- If you are not using Composer, use the Twig built-in autoloader::
-
- require_once '/path/to/lib/Twig/Autoloader.php';
- Twig_Autoloader::register();
diff --git a/src/composer/vendor/twig/twig/doc/recipes.rst b/src/composer/vendor/twig/twig/doc/recipes.rst
deleted file mode 100644
index 6ad53276..00000000
--- a/src/composer/vendor/twig/twig/doc/recipes.rst
+++ /dev/null
@@ -1,518 +0,0 @@
-Recipes
-=======
-
-.. _deprecation-notices:
-
-Displaying Deprecation Notices
-------------------------------
-
-.. versionadded:: 1.21
- This works as of Twig 1.21.
-
-Deprecated features generate deprecation notices (via a call to the
-``trigger_error()`` PHP function). By default, they are silenced and never
-displayed nor logged.
-
-To easily remove all deprecated feature usages from your templates, write and
-run a script along the lines of the following::
-
- require_once __DIR__.'/vendor/autoload.php';
-
- $twig = create_your_twig_env();
-
- $deprecations = new Twig_Util_DeprecationCollector($twig);
-
- print_r($deprecations->collectDir(__DIR__.'/templates'));
-
-The ``collectDir()`` method compiles all templates found in a directory,
-catches deprecation notices, and return them.
-
-.. tip::
-
- If your templates are not stored on the filesystem, use the ``collect()``
- method instead which takes an ``Iterator``; the iterator must return
- template names as keys and template contents as values (as done by
- ``Twig_Util_TemplateDirIterator``).
-
-However, this code won't find all deprecations (like using deprecated some Twig
-classes). To catch all notices, register a custom error handler like the one
-below::
-
- $deprecations = array();
- set_error_handler(function ($type, $msg) use (&$deprecations) {
- if (E_USER_DEPRECATED === $type) {
- $deprecations[] = $msg;
- }
- });
-
- // run your application
-
- print_r($deprecations);
-
-Note that most deprecation notices are triggered during **compilation**, so
-they won't be generated when templates are already cached.
-
-.. tip::
-
- If you want to manage the deprecation notices from your PHPUnit tests, have
- a look at the `symfony/phpunit-bridge
- `_ package, which eases the
- process a lot.
-
-Making a Layout conditional
----------------------------
-
-Working with Ajax means that the same content is sometimes displayed as is,
-and sometimes decorated with a layout. As Twig layout template names can be
-any valid expression, you can pass a variable that evaluates to ``true`` when
-the request is made via Ajax and choose the layout accordingly:
-
-.. code-block:: jinja
-
- {% extends request.ajax ? "base_ajax.html" : "base.html" %}
-
- {% block content %}
- This is the content to be displayed.
- {% endblock %}
-
-Making an Include dynamic
--------------------------
-
-When including a template, its name does not need to be a string. For
-instance, the name can depend on the value of a variable:
-
-.. code-block:: jinja
-
- {% include var ~ '_foo.html' %}
-
-If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be
-rendered.
-
-As a matter of fact, the template name can be any valid expression, such as
-the following:
-
-.. code-block:: jinja
-
- {% include var|default('index') ~ '_foo.html' %}
-
-Overriding a Template that also extends itself
-----------------------------------------------
-
-A template can be customized in two different ways:
-
-* *Inheritance*: A template *extends* a parent template and overrides some
- blocks;
-
-* *Replacement*: If you use the filesystem loader, Twig loads the first
- template it finds in a list of configured directories; a template found in a
- directory *replaces* another one from a directory further in the list.
-
-But how do you combine both: *replace* a template that also extends itself
-(aka a template in a directory further in the list)?
-
-Let's say that your templates are loaded from both ``.../templates/mysite``
-and ``.../templates/default`` in this order. The ``page.twig`` template,
-stored in ``.../templates/default`` reads as follows:
-
-.. code-block:: jinja
-
- {# page.twig #}
- {% extends "layout.twig" %}
-
- {% block content %}
- {% endblock %}
-
-You can replace this template by putting a file with the same name in
-``.../templates/mysite``. And if you want to extend the original template, you
-might be tempted to write the following:
-
-.. code-block:: jinja
-
- {# page.twig in .../templates/mysite #}
- {% extends "page.twig" %} {# from .../templates/default #}
-
-Of course, this will not work as Twig will always load the template from
-``.../templates/mysite``.
-
-It turns out it is possible to get this to work, by adding a directory right
-at the end of your template directories, which is the parent of all of the
-other directories: ``.../templates`` in our case. This has the effect of
-making every template file within our system uniquely addressable. Most of the
-time you will use the "normal" paths, but in the special case of wanting to
-extend a template with an overriding version of itself we can reference its
-parent's full, unambiguous template path in the extends tag:
-
-.. code-block:: jinja
-
- {# page.twig in .../templates/mysite #}
- {% extends "default/page.twig" %} {# from .../templates #}
-
-.. note::
-
- This recipe was inspired by the following Django wiki page:
- http://code.djangoproject.com/wiki/ExtendingTemplates
-
-Customizing the Syntax
-----------------------
-
-Twig allows some syntax customization for the block delimiters. It's not
-recommended to use this feature as templates will be tied with your custom
-syntax. But for specific projects, it can make sense to change the defaults.
-
-To change the block delimiters, you need to create your own lexer object::
-
- $twig = new Twig_Environment();
-
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('{#', '#}'),
- 'tag_block' => array('{%', '%}'),
- 'tag_variable' => array('{{', '}}'),
- 'interpolation' => array('#{', '}'),
- ));
- $twig->setLexer($lexer);
-
-Here are some configuration example that simulates some other template engines
-syntax::
-
- // Ruby erb syntax
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('<%#', '%>'),
- 'tag_block' => array('<%', '%>'),
- 'tag_variable' => array('<%=', '%>'),
- ));
-
- // SGML Comment Syntax
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array(''),
- 'tag_block' => array(''),
- 'tag_variable' => array('${', '}'),
- ));
-
- // Smarty like
- $lexer = new Twig_Lexer($twig, array(
- 'tag_comment' => array('{*', '*}'),
- 'tag_block' => array('{', '}'),
- 'tag_variable' => array('{$', '}'),
- ));
-
-Using dynamic Object Properties
--------------------------------
-
-When Twig encounters a variable like ``article.title``, it tries to find a
-``title`` public property in the ``article`` object.
-
-It also works if the property does not exist but is rather defined dynamically
-thanks to the magic ``__get()`` method; you just need to also implement the
-``__isset()`` magic method like shown in the following snippet of code::
-
- class Article
- {
- public function __get($name)
- {
- if ('title' == $name) {
- return 'The title';
- }
-
- // throw some kind of error
- }
-
- public function __isset($name)
- {
- if ('title' == $name) {
- return true;
- }
-
- return false;
- }
- }
-
-Accessing the parent Context in Nested Loops
---------------------------------------------
-
-Sometimes, when using nested loops, you need to access the parent context. The
-parent context is always accessible via the ``loop.parent`` variable. For
-instance, if you have the following template data::
-
- $data = array(
- 'topics' => array(
- 'topic1' => array('Message 1 of topic 1', 'Message 2 of topic 1'),
- 'topic2' => array('Message 1 of topic 2', 'Message 2 of topic 2'),
- ),
- );
-
-And the following template to display all messages in all topics:
-
-.. code-block:: jinja
-
- {% for topic, messages in topics %}
- * {{ loop.index }}: {{ topic }}
- {% for message in messages %}
- - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }}
- {% endfor %}
- {% endfor %}
-
-The output will be similar to:
-
-.. code-block:: text
-
- * 1: topic1
- - 1.1: The message 1 of topic 1
- - 1.2: The message 2 of topic 1
- * 2: topic2
- - 2.1: The message 1 of topic 2
- - 2.2: The message 2 of topic 2
-
-In the inner loop, the ``loop.parent`` variable is used to access the outer
-context. So, the index of the current ``topic`` defined in the outer for loop
-is accessible via the ``loop.parent.loop.index`` variable.
-
-Defining undefined Functions and Filters on the Fly
----------------------------------------------------
-
-When a function (or a filter) is not defined, Twig defaults to throw a
-``Twig_Error_Syntax`` exception. However, it can also call a `callback`_ (any
-valid PHP callable) which should return a function (or a filter).
-
-For filters, register callbacks with ``registerUndefinedFilterCallback()``.
-For functions, use ``registerUndefinedFunctionCallback()``::
-
- // auto-register all native PHP functions as Twig functions
- // don't try this at home as it's not secure at all!
- $twig->registerUndefinedFunctionCallback(function ($name) {
- if (function_exists($name)) {
- return new Twig_Function_Function($name);
- }
-
- return false;
- });
-
-If the callable is not able to return a valid function (or filter), it must
-return ``false``.
-
-If you register more than one callback, Twig will call them in turn until one
-does not return ``false``.
-
-.. tip::
-
- As the resolution of functions and filters is done during compilation,
- there is no overhead when registering these callbacks.
-
-Validating the Template Syntax
-------------------------------
-
-When template code is provided by a third-party (through a web interface for
-instance), it might be interesting to validate the template syntax before
-saving it. If the template code is stored in a `$template` variable, here is
-how you can do it::
-
- try {
- $twig->parse($twig->tokenize($template));
-
- // the $template is valid
- } catch (Twig_Error_Syntax $e) {
- // $template contains one or more syntax errors
- }
-
-If you iterate over a set of files, you can pass the filename to the
-``tokenize()`` method to get the filename in the exception message::
-
- foreach ($files as $file) {
- try {
- $twig->parse($twig->tokenize($template, $file));
-
- // the $template is valid
- } catch (Twig_Error_Syntax $e) {
- // $template contains one or more syntax errors
- }
- }
-
-.. note::
-
- This method won't catch any sandbox policy violations because the policy
- is enforced during template rendering (as Twig needs the context for some
- checks like allowed methods on objects).
-
-Refreshing modified Templates when OPcache or APC is enabled
-------------------------------------------------------------
-
-When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC
-with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template
-cache won't update the cache.
-
-To get around this, force Twig to invalidate the bytecode cache::
-
- $twig = new Twig_Environment($loader, array(
- 'cache' => new Twig_Cache_Filesystem('/some/cache/path', Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION),
- // ...
- ));
-
-.. note::
-
- Before Twig 1.22, you should extend ``Twig_Environment`` instead::
-
- class OpCacheAwareTwigEnvironment extends Twig_Environment
- {
- protected function writeCacheFile($file, $content)
- {
- parent::writeCacheFile($file, $content);
-
- // Compile cached file into bytecode cache
- if (function_exists('opcache_invalidate')) {
- opcache_invalidate($file, true);
- } elseif (function_exists('apc_compile_file')) {
- apc_compile_file($file);
- }
- }
- }
-
-Reusing a stateful Node Visitor
--------------------------------
-
-When attaching a visitor to a ``Twig_Environment`` instance, Twig uses it to
-visit *all* templates it compiles. If you need to keep some state information
-around, you probably want to reset it when visiting a new template.
-
-This can be easily achieved with the following code::
-
- protected $someTemplateState = array();
-
- public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
- {
- if ($node instanceof Twig_Node_Module) {
- // reset the state as we are entering a new template
- $this->someTemplateState = array();
- }
-
- // ...
-
- return $node;
- }
-
-Using a Database to store Templates
------------------------------------
-
-If you are developing a CMS, templates are usually stored in a database. This
-recipe gives you a simple PDO template loader you can use as a starting point
-for your own.
-
-First, let's create a temporary in-memory SQLite3 database to work with::
-
- $dbh = new PDO('sqlite::memory:');
- $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)');
- $base = '{% block content %}{% endblock %}';
- $index = '
- {% extends "base.twig" %}
- {% block content %}Hello {{ name }}{% endblock %}
- ';
- $now = time();
- $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('base.twig', '$base', $now)");
- $dbh->exec("INSERT INTO templates (name, source, last_modified) VALUES ('index.twig', '$index', $now)");
-
-We have created a simple ``templates`` table that hosts two templates:
-``base.twig`` and ``index.twig``.
-
-Now, let's define a loader able to use this database::
-
- class DatabaseTwigLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
- {
- protected $dbh;
-
- public function __construct(PDO $dbh)
- {
- $this->dbh = $dbh;
- }
-
- public function getSource($name)
- {
- if (false === $source = $this->getValue('source', $name)) {
- throw new Twig_Error_Loader(sprintf('Template "%s" does not exist.', $name));
- }
-
- return $source;
- }
-
- // Twig_ExistsLoaderInterface as of Twig 1.11
- public function exists($name)
- {
- return $name === $this->getValue('name', $name);
- }
-
- public function getCacheKey($name)
- {
- return $name;
- }
-
- public function isFresh($name, $time)
- {
- if (false === $lastModified = $this->getValue('last_modified', $name)) {
- return false;
- }
-
- return $lastModified <= $time;
- }
-
- protected function getValue($column, $name)
- {
- $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name');
- $sth->execute(array(':name' => (string) $name));
-
- return $sth->fetchColumn();
- }
- }
-
-Finally, here is an example on how you can use it::
-
- $loader = new DatabaseTwigLoader($dbh);
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.twig', array('name' => 'Fabien'));
-
-Using different Template Sources
---------------------------------
-
-This recipe is the continuation of the previous one. Even if you store the
-contributed templates in a database, you might want to keep the original/base
-templates on the filesystem. When templates can be loaded from different
-sources, you need to use the ``Twig_Loader_Chain`` loader.
-
-As you can see in the previous recipe, we reference the template in the exact
-same way as we would have done it with a regular filesystem loader. This is
-the key to be able to mix and match templates coming from the database, the
-filesystem, or any other loader for that matter: the template name should be a
-logical name, and not the path from the filesystem::
-
- $loader1 = new DatabaseTwigLoader($dbh);
- $loader2 = new Twig_Loader_Array(array(
- 'base.twig' => '{% block content %}{% endblock %}',
- ));
- $loader = new Twig_Loader_Chain(array($loader1, $loader2));
-
- $twig = new Twig_Environment($loader);
-
- echo $twig->render('index.twig', array('name' => 'Fabien'));
-
-Now that the ``base.twig`` templates is defined in an array loader, you can
-remove it from the database, and everything else will still work as before.
-
-Loading a Template from a String
---------------------------------
-
-From a template, you can easily load a template stored in a string via the
-``template_from_string`` function (available as of Twig 1.11 via the
-``Twig_Extension_StringLoader`` extension)::
-
-.. code-block:: jinja
-
- {{ include(template_from_string("Hello {{ name }}")) }}
-
-From PHP, it's also possible to load a template stored in a string via
-``Twig_Environment::createTemplate()`` (available as of Twig 1.18)::
-
- $template = $twig->createTemplate('hello {{ name }}');
- echo $template->render(array('name' => 'Fabien'));
-
-.. note::
-
- Never use the ``Twig_Loader_String`` loader, which has severe limitations.
-
-.. _callback: http://www.php.net/manual/en/function.is-callable.php
diff --git a/src/composer/vendor/twig/twig/doc/tags/autoescape.rst b/src/composer/vendor/twig/twig/doc/tags/autoescape.rst
deleted file mode 100644
index 4208d1a3..00000000
--- a/src/composer/vendor/twig/twig/doc/tags/autoescape.rst
+++ /dev/null
@@ -1,83 +0,0 @@
-``autoescape``
-==============
-
-Whether automatic escaping is enabled or not, you can mark a section of a
-template to be escaped or not by using the ``autoescape`` tag:
-
-.. code-block:: jinja
-
- {# The following syntax works as of Twig 1.8 -- see the note below for previous versions #}
-
- {% autoescape %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape 'html' %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape 'js' %}
- Everything will be automatically escaped in this block
- using the js escaping strategy
- {% endautoescape %}
-
- {% autoescape false %}
- Everything will be outputted as is in this block
- {% endautoescape %}
-
-.. note::
-
- Before Twig 1.8, the syntax was different:
-
- .. code-block:: jinja
-
- {% autoescape true %}
- Everything will be automatically escaped in this block
- using the HTML strategy
- {% endautoescape %}
-
- {% autoescape false %}
- Everything will be outputted as is in this block
- {% endautoescape %}
-
- {% autoescape true js %}
- Everything will be automatically escaped in this block
- using the js escaping strategy
- {% endautoescape %}
-
-When automatic escaping is enabled everything is escaped by default except for
-values explicitly marked as safe. Those can be marked in the template by using
-the :doc:`raw<../filters/raw>` filter:
-
-.. code-block:: jinja
-
- {% autoescape %}
- {{ safe_value|raw }}
- {% endautoescape %}
-
-Functions returning template data (like :doc:`macros` and
-:doc:`parent<../functions/parent>`) always return safe markup.
-
-.. note::
-
- Twig is smart enough to not escape an already escaped value by the
- :doc:`escape<../filters/escape>` filter.
-
-.. note::
-
- Twig does not escape static expressions:
-
- .. code-block:: jinja
-
- {% set hello = "Hello" %}
- {{ hello }}
- {{ "world" }}
-
- Will be rendered "Hello **world**".
-
-.. note::
-
- The chapter :doc:`Twig for Developers<../api>` gives more information
- about when and how automatic escaping is applied.
diff --git a/src/composer/vendor/twig/twig/doc/tags/block.rst b/src/composer/vendor/twig/twig/doc/tags/block.rst
deleted file mode 100644
index e3804823..00000000
--- a/src/composer/vendor/twig/twig/doc/tags/block.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-``block``
-=========
-
-Blocks are used for inheritance and act as placeholders and replacements at
-the same time. They are documented in detail in the documentation for the
-:doc:`extends<../tags/extends>` tag.
-
-Block names should consist of alphanumeric characters, and underscores. Dashes
-are not permitted.
-
-.. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>`
diff --git a/src/composer/vendor/twig/twig/doc/tags/do.rst b/src/composer/vendor/twig/twig/doc/tags/do.rst
deleted file mode 100644
index 1c344e30..00000000
--- a/src/composer/vendor/twig/twig/doc/tags/do.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-``do``
-======
-
-.. versionadded:: 1.5
- The ``do`` tag was added in Twig 1.5.
-
-The ``do`` tag works exactly like the regular variable expression (``{{ ...
-}}``) just that it doesn't print anything:
-
-.. code-block:: jinja
-
- {% do 1 + 2 %}
diff --git a/src/composer/vendor/twig/twig/doc/tags/embed.rst b/src/composer/vendor/twig/twig/doc/tags/embed.rst
deleted file mode 100644
index 5a6a0299..00000000
--- a/src/composer/vendor/twig/twig/doc/tags/embed.rst
+++ /dev/null
@@ -1,178 +0,0 @@
-``embed``
-=========
-
-.. versionadded:: 1.8
- The ``embed`` tag was added in Twig 1.8.
-
-The ``embed`` tag combines the behaviour of :doc:`include` and
-:doc:`extends`.
-It allows you to include another template's contents, just like ``include``
-does. But it also allows you to override any block defined inside the
-included template, like when extending a template.
-
-Think of an embedded template as a "micro layout skeleton".
-
-.. code-block:: jinja
-
- {% embed "teasers_skeleton.twig" %}
- {# These blocks are defined in "teasers_skeleton.twig" #}
- {# and we override them right here: #}
- {% block left_teaser %}
- Some content for the left teaser box
- {% endblock %}
- {% block right_teaser %}
- Some content for the right teaser box
- {% endblock %}
- {% endembed %}
-
-The ``embed`` tag takes the idea of template inheritance to the level of
-content fragments. While template inheritance allows for "document skeletons",
-which are filled with life by child templates, the ``embed`` tag allows you to
-create "skeletons" for smaller units of content and re-use and fill them
-anywhere you like.
-
-Since the use case may not be obvious, let's look at a simplified example.
-Imagine a base template shared by multiple HTML pages, defining a single block
-named "content":
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ │ │
- │ │ │ │
- │ │ (child template to │ │
- │ │ put content here) │ │
- │ │ │ │
- │ │ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-Some pages ("foo" and "bar") share the same content structure -
-two vertically stacked boxes:
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ ┌─ block "top" ───┐ │ │
- │ │ │ │ │ │
- │ │ └─────────────────┘ │ │
- │ │ ┌─ block "bottom" ┐ │ │
- │ │ │ │ │ │
- │ │ └─────────────────┘ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-While other pages ("boom" and "baz") share a different content structure -
-two boxes side by side:
-
-.. code-block:: text
-
- ┌─── page layout ─────────────────────┐
- │ │
- │ ┌── block "content" ──┐ │
- │ │ │ │
- │ │ ┌ block ┐ ┌ block ┐ │ │
- │ │ │"left" │ │"right"│ │ │
- │ │ │ │ │ │ │ │
- │ │ │ │ │ │ │ │
- │ │ └───────┘ └───────┘ │ │
- │ └─────────────────────┘ │
- │ │
- └─────────────────────────────────────┘
-
-Without the ``embed`` tag, you have two ways to design your templates:
-
- * Create two "intermediate" base templates that extend the master layout
- template: one with vertically stacked boxes to be used by the "foo" and
- "bar" pages and another one with side-by-side boxes for the "boom" and
- "baz" pages.
-
- * Embed the markup for the top/bottom and left/right boxes into each page
- template directly.
-
-These two solutions do not scale well because they each have a major drawback:
-
- * The first solution may indeed work for this simplified example. But imagine
- we add a sidebar, which may again contain different, recurring structures
- of content. Now we would need to create intermediate base templates for
- all occurring combinations of content structure and sidebar structure...
- and so on.
-
- * The second solution involves duplication of common code with all its negative
- consequences: any change involves finding and editing all affected copies
- of the structure, correctness has to be verified for each copy, copies may
- go out of sync by careless modifications etc.
-
-In such a situation, the ``embed`` tag comes in handy. The common layout
-code can live in a single base template, and the two different content structures,
-let's call them "micro layouts" go into separate templates which are embedded
-as necessary:
-
-Page template ``foo.twig``:
-
-.. code-block:: jinja
-
- {% extends "layout_skeleton.twig" %}
-
- {% block content %}
- {% embed "vertical_boxes_skeleton.twig" %}
- {% block top %}
- Some content for the top box
- {% endblock %}
-
- {% block bottom %}
- Some content for the bottom box
- {% endblock %}
- {% endembed %}
- {% endblock %}
-
-And here is the code for ``vertical_boxes_skeleton.twig``:
-
-.. code-block:: html+jinja
-
-
- {% block top %}
- Top box default content
- {% endblock %}
-
-
-
- {% block bottom %}
- Bottom box default content
- {% endblock %}
-
-
-The goal of the ``vertical_boxes_skeleton.twig`` template being to factor
-out the HTML markup for the boxes.
-
-The ``embed`` tag takes the exact same arguments as the ``include`` tag:
-
-.. code-block:: jinja
-
- {% embed "base" with {'foo': 'bar'} %}
- ...
- {% endembed %}
-
- {% embed "base" with {'foo': 'bar'} only %}
- ...
- {% endembed %}
-
- {% embed "base" ignore missing %}
- ...
- {% endembed %}
-
-.. warning::
-
- As embedded templates do not have "names", auto-escaping strategies based
- on the template "filename" won't work as expected if you change the
- context (for instance, if you embed a CSS/JavaScript template into an HTML
- one). In that case, explicitly set the default auto-escaping strategy with
- the ``autoescape`` tag.
-
-.. seealso:: :doc:`include<../tags/include>`
diff --git a/src/composer/vendor/twig/twig/doc/tags/extends.rst b/src/composer/vendor/twig/twig/doc/tags/extends.rst
deleted file mode 100644
index 1ad2b12b..00000000
--- a/src/composer/vendor/twig/twig/doc/tags/extends.rst
+++ /dev/null
@@ -1,268 +0,0 @@
-``extends``
-===========
-
-The ``extends`` tag can be used to extend a template from another one.
-
-.. note::
-
- Like PHP, Twig does not support multiple inheritance. So you can only have
- one extends tag called per rendering. However, Twig supports horizontal
- :doc:`reuse ', 1)));
- $node = new Twig_Node_Spaceless($body, 1);
-
- $this->assertEquals($body, $node->getNode('body'));
- }
-
- public function getTests()
- {
- $body = new Twig_Node(array(new Twig_Node_Text(' foo ', 1)));
- $node = new Twig_Node_Spaceless($body, 1);
-
- return array(
- array($node, << foo ";
-echo trim(preg_replace('/>\s+', '><', ob_get_clean()));
-EOF
- ),
- );
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php
deleted file mode 100644
index ceaf67f4..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-assertEquals('foo', $node->getAttribute('data'));
- }
-
- public function getTests()
- {
- $tests = array();
- $tests[] = array(new Twig_Node_Text('foo', 1), "// line 1\necho \"foo\";");
-
- return $tests;
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php
deleted file mode 100644
index b5ea7aac..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php
+++ /dev/null
@@ -1,124 +0,0 @@
-getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false));
-
- $stream = $env->parse($env->tokenize('{{ block("foo") }}', 'index'));
-
- $node = $stream->getNode('body')->getNode(0);
-
- $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node));
- $this->assertTrue($node->getAttribute('output'));
- }
-
- public function testRenderParentBlockOptimizer()
- {
- $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false));
-
- $stream = $env->parse($env->tokenize('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index'));
-
- $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body');
-
- $this->assertEquals('Twig_Node_Expression_Parent', get_class($node));
- $this->assertTrue($node->getAttribute('output'));
- }
-
- public function testRenderVariableBlockOptimizer()
- {
- if (PHP_VERSION_ID >= 50400) {
- return;
- }
-
- $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false));
- $stream = $env->parse($env->tokenize('{{ block(name|lower) }}', 'index'));
-
- $node = $stream->getNode('body')->getNode(0)->getNode(1);
-
- $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node));
- $this->assertTrue($node->getAttribute('output'));
- }
-
- /**
- * @dataProvider getTestsForForOptimizer
- */
- public function testForOptimizer($template, $expected)
- {
- $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false));
-
- $stream = $env->parse($env->tokenize($template, 'index'));
-
- foreach ($expected as $target => $withLoop) {
- $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : ''));
- }
- }
-
- public function getTestsForForOptimizer()
- {
- return array(
- array('{% for i in foo %}{% endfor %}', array('i' => false)),
-
- array('{% for i in foo %}{{ loop.index }}{% endfor %}', array('i' => true)),
-
- array('{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)),
-
- array('{% for i in foo %}{% include "foo" %}{% endfor %}', array('i' => true)),
-
- array('{% for i in foo %}{% include "foo" only %}{% endfor %}', array('i' => false)),
-
- array('{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', array('i' => false)),
-
- array('{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', array('i' => true)),
-
- array('{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => true)),
-
- array('{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)),
-
- array('{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => false)),
-
- array('{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)),
-
- array('{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)),
-
- array('{% for i in foo %}{{ include("foo") }}{% endfor %}', array('i' => true)),
-
- array('{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', array('i' => false)),
-
- array('{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', array('i' => true)),
-
- array('{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', array('i' => false)),
-
- array('{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', array('i' => true)),
- );
- }
-
- public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop)
- {
- if (null === $node) {
- return;
- }
-
- foreach ($node as $n) {
- if ($n instanceof Twig_Node_For) {
- if ($target === $n->getNode('value_target')->getAttribute('name')) {
- return $withLoop == $n->getAttribute('with_loop');
- }
- }
-
- $ret = $this->checkForConfiguration($n, $target, $withLoop);
- if (null !== $ret) {
- return $ret;
- }
- }
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/ParserTest.php
deleted file mode 100644
index 01daf309..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/ParserTest.php
+++ /dev/null
@@ -1,196 +0,0 @@
-getParser();
- $parser->setMacro('parent', $this->getMock('Twig_Node_Macro', array(), array(), '', null));
- }
-
- /**
- * @expectedException Twig_Error_Syntax
- * @expectedExceptionMessage Unknown "foo" tag. Did you mean "for" at line 1?
- */
- public function testUnknownTag()
- {
- $stream = new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1),
- new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1),
- new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
- new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
- ));
- $parser = new Twig_Parser(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
- $parser->parse($stream);
- }
-
- /**
- * @expectedException Twig_Error_Syntax
- * @expectedExceptionMessage Unknown "foobar" tag at line 1.
- */
- public function testUnknownTagWithoutSuggestions()
- {
- $stream = new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1),
- new Twig_Token(Twig_Token::NAME_TYPE, 'foobar', 1),
- new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
- new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
- ));
- $parser = new Twig_Parser(new Twig_Environment($this->getMock('Twig_LoaderInterface')));
- $parser->parse($stream);
- }
-
- /**
- * @dataProvider getFilterBodyNodesData
- */
- public function testFilterBodyNodes($input, $expected)
- {
- $parser = $this->getParser();
-
- $this->assertEquals($expected, $parser->filterBodyNodes($input));
- }
-
- public function getFilterBodyNodesData()
- {
- return array(
- array(
- new Twig_Node(array(new Twig_Node_Text(' ', 1))),
- new Twig_Node(array()),
- ),
- array(
- $input = new Twig_Node(array(new Twig_Node_Set(false, new Twig_Node(), new Twig_Node(), 1))),
- $input,
- ),
- array(
- $input = new Twig_Node(array(new Twig_Node_Set(true, new Twig_Node(), new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1))))), 1))),
- $input,
- ),
- );
- }
-
- /**
- * @dataProvider getFilterBodyNodesDataThrowsException
- * @expectedException Twig_Error_Syntax
- */
- public function testFilterBodyNodesThrowsException($input)
- {
- $parser = $this->getParser();
-
- $parser->filterBodyNodes($input);
- }
-
- public function getFilterBodyNodesDataThrowsException()
- {
- return array(
- array(new Twig_Node_Text('foo', 1)),
- array(new Twig_Node(array(new Twig_Node(array(new Twig_Node_Text('foo', 1)))))),
- );
- }
-
- /**
- * @expectedException Twig_Error_Syntax
- * @expectedExceptionMessage A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed at line 1.
- */
- public function testFilterBodyNodesWithBOM()
- {
- $parser = $this->getParser();
- $parser->filterBodyNodes(new Twig_Node_Text(chr(0xEF).chr(0xBB).chr(0xBF), 1));
- }
-
- public function testParseIsReentrant()
- {
- $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array(
- 'autoescape' => false,
- 'optimizations' => 0,
- ));
- $twig->addTokenParser(new TestTokenParser());
-
- $parser = new Twig_Parser($twig);
-
- $parser->parse(new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1),
- new Twig_Token(Twig_Token::NAME_TYPE, 'test', 1),
- new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
- new Twig_Token(Twig_Token::VAR_START_TYPE, '', 1),
- new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1),
- new Twig_Token(Twig_Token::VAR_END_TYPE, '', 1),
- new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
- )));
-
- $this->assertNull($parser->getParent());
- }
-
- // The getVarName() must not depend on the template loaders,
- // If this test does not throw any exception, that's good.
- // see https://github.com/symfony/symfony/issues/4218
- public function testGetVarName()
- {
- $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array(
- 'autoescape' => false,
- 'optimizations' => 0,
- ));
-
- $twig->parse($twig->tokenize(<<getMock('Twig_LoaderInterface')));
- $parser->setParent(new Twig_Node());
- $parser->stream = $this->getMockBuilder('Twig_TokenStream')->disableOriginalConstructor()->getMock();
-
- return $parser;
- }
-}
-
-class TestParser extends Twig_Parser
-{
- public $stream;
-
- public function filterBodyNodes(Twig_NodeInterface $node)
- {
- return parent::filterBodyNodes($node);
- }
-}
-
-class TestTokenParser extends Twig_TokenParser
-{
- public function parse(Twig_Token $token)
- {
- // simulate the parsing of another template right in the middle of the parsing of the current template
- $this->parser->parse(new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1),
- new Twig_Token(Twig_Token::NAME_TYPE, 'extends', 1),
- new Twig_Token(Twig_Token::STRING_TYPE, 'base', 1),
- new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
- new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
- )));
-
- $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
- return new Twig_Node(array());
- }
-
- public function getTag()
- {
- return 'test';
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
deleted file mode 100644
index da97f478..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock();
-
- $profile->expects($this->any())->method('isRoot')->will($this->returnValue(true));
- $profile->expects($this->any())->method('getName')->will($this->returnValue('main'));
- $profile->expects($this->any())->method('getDuration')->will($this->returnValue(1));
- $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0));
- $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0));
-
- $subProfiles = array(
- $this->getIndexProfile(
- array(
- $this->getEmbeddedBlockProfile(),
- $this->getEmbeddedTemplateProfile(
- array(
- $this->getIncludedTemplateProfile(),
- )
- ),
- $this->getMacroProfile(),
- $this->getEmbeddedTemplateProfile(
- array(
- $this->getIncludedTemplateProfile(),
- )
- ),
- )
- ),
- );
-
- $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles));
- $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles)));
-
- return $profile;
- }
-
- private function getIndexProfile(array $subProfiles = array())
- {
- return $this->generateProfile('main', 1, true, 'template', 'index.twig', $subProfiles);
- }
-
- private function getEmbeddedBlockProfile(array $subProfiles = array())
- {
- return $this->generateProfile('body', 0.0001, false, 'block', 'embedded.twig', $subProfiles);
- }
-
- private function getEmbeddedTemplateProfile(array $subProfiles = array())
- {
- return $this->generateProfile('main', 0.0001, true, 'template', 'embedded.twig', $subProfiles);
- }
-
- private function getIncludedTemplateProfile(array $subProfiles = array())
- {
- return $this->generateProfile('main', 0.0001, true, 'template', 'included.twig', $subProfiles);
- }
-
- private function getMacroProfile(array $subProfiles = array())
- {
- return $this->generateProfile('foo', 0.0001, false, 'macro', 'index.twig', $subProfiles);
- }
-
- /**
- * @param string $name
- * @param float $duration
- * @param bool $isTemplate
- * @param string $type
- * @param string $templateName
- * @param array $subProfiles
- *
- * @return Twig_Profiler_Profile
- */
- private function generateProfile($name, $duration, $isTemplate, $type, $templateName, array $subProfiles = array())
- {
- $profile = $this->getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock();
-
- $profile->expects($this->any())->method('isRoot')->will($this->returnValue(false));
- $profile->expects($this->any())->method('getName')->will($this->returnValue($name));
- $profile->expects($this->any())->method('getDuration')->will($this->returnValue($duration));
- $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0));
- $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0));
- $profile->expects($this->any())->method('isTemplate')->will($this->returnValue($isTemplate));
- $profile->expects($this->any())->method('getType')->will($this->returnValue($type));
- $profile->expects($this->any())->method('getTemplate')->will($this->returnValue($templateName));
- $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles));
- $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles)));
-
- return $profile;
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php
deleted file mode 100644
index 1a1b9d29..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-assertStringMatchesFormat(<<index.twig//1 %d %d %d
-index.twig==>embedded.twig::block(body)//1 %d %d 0
-index.twig==>embedded.twig//2 %d %d %d
-embedded.twig==>included.twig//2 %d %d %d
-index.twig==>index.twig::macro(foo)//1 %d %d %d
-EOF
- , $dumper->dump($this->getProfile()));
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php
deleted file mode 100644
index 66a68c4b..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-assertStringMatchesFormat(<<main %d.%dms/%d%
-└ index.twig %d.%dms/%d%
- └ embedded.twig::block(body)
- └ embedded.twig
- │ └ included.twig
- └ index.twig::macro(foo)
- └ embedded.twig
- └ included.twig
-
-EOF
- , $dumper->dump($this->getProfile()));
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php
deleted file mode 100644
index e2ea165a..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-assertStringMatchesFormat(<<dump($this->getProfile()));
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php
deleted file mode 100644
index f786f06c..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-assertEquals('template', $profile->getTemplate());
- $this->assertEquals('type', $profile->getType());
- $this->assertEquals('name', $profile->getName());
- }
-
- public function testIsRoot()
- {
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
- $this->assertTrue($profile->isRoot());
-
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE);
- $this->assertFalse($profile->isRoot());
- }
-
- public function testIsTemplate()
- {
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE);
- $this->assertTrue($profile->isTemplate());
-
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
- $this->assertFalse($profile->isTemplate());
- }
-
- public function testIsBlock()
- {
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::BLOCK);
- $this->assertTrue($profile->isBlock());
-
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
- $this->assertFalse($profile->isBlock());
- }
-
- public function testIsMacro()
- {
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::MACRO);
- $this->assertTrue($profile->isMacro());
-
- $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
- $this->assertFalse($profile->isMacro());
- }
-
- public function testGetAddProfile()
- {
- $profile = new Twig_Profiler_Profile();
- $profile->addProfile($a = new Twig_Profiler_Profile());
- $profile->addProfile($b = new Twig_Profiler_Profile());
-
- $this->assertSame(array($a, $b), $profile->getProfiles());
- $this->assertSame(array($a, $b), iterator_to_array($profile));
- }
-
- public function testGetDuration()
- {
- $profile = new Twig_Profiler_Profile();
- usleep(1);
- $profile->leave();
-
- $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration()));
- }
-
- public function testSerialize()
- {
- $profile = new Twig_Profiler_Profile('template', 'type', 'name');
- $profile1 = new Twig_Profiler_Profile('template1', 'type1', 'name1');
- $profile->addProfile($profile1);
- $profile->leave();
- $profile1->leave();
-
- $profile2 = unserialize(serialize($profile));
- $profiles = $profile->getProfiles();
- $this->assertCount(1, $profiles);
- $profile3 = $profiles[0];
-
- $this->assertEquals($profile->getTemplate(), $profile2->getTemplate());
- $this->assertEquals($profile->getType(), $profile2->getType());
- $this->assertEquals($profile->getName(), $profile2->getName());
- $this->assertEquals($profile->getDuration(), $profile2->getDuration());
-
- $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate());
- $this->assertEquals($profile1->getType(), $profile3->getType());
- $this->assertEquals($profile1->getName(), $profile3->getName());
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
deleted file mode 100644
index f0146649..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
+++ /dev/null
@@ -1,693 +0,0 @@
-getMockForAbstractClass('Twig_Template', array(), '', false);
- $template->displayBlock('foo', array(), array('foo' => array(new stdClass(), 'foo')));
- }
-
- /**
- * @dataProvider getAttributeExceptions
- */
- public function testGetAttributeExceptions($template, $message, $useExt)
- {
- $name = 'index_'.($useExt ? 1 : 0);
- $templates = array(
- $name => $template.$useExt, // appending $useExt makes the template content unique
- );
-
- $env = new Twig_Environment(new Twig_Loader_Array($templates), array('strict_variables' => true));
- if (!$useExt) {
- $env->addNodeVisitor(new CExtDisablingNodeVisitor());
- }
- $template = $env->loadTemplate($name);
-
- $context = array(
- 'string' => 'foo',
- 'null' => null,
- 'empty_array' => array(),
- 'array' => array('foo' => 'foo'),
- 'array_access' => new Twig_TemplateArrayAccessObject(),
- 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(),
- 'object' => new stdClass(),
- );
-
- try {
- $template->render($context);
- $this->fail('Accessing an invalid attribute should throw an exception.');
- } catch (Twig_Error_Runtime $e) {
- $this->assertSame(sprintf($message, $name), $e->getMessage());
- }
- }
-
- public function getAttributeExceptions()
- {
- $tests = array(
- array('{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1', false),
- array('{{ null["a"] }}', 'Impossible to access a key ("a") on a null variable in "%s" at line 1', false),
- array('{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false),
- array('{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false),
- array('{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false),
- array('{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1', false),
- array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1', false),
- array('{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1', false),
- array('{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1', false),
- array('{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false),
- array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false),
- array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1', false),
- array('{{ array_access.a }}', 'Method "a" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false),
- array('{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Method "missing_method" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false),
- array('{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.', false),
- array('{{ object["a"] }}', 'Impossible to access a key "a" on an object of class "stdClass" that does not implement ArrayAccess interface in "%s" at line 1', false),
- );
-
- if (function_exists('twig_template_get_attributes')) {
- foreach (array_slice($tests, 0) as $test) {
- $test[2] = true;
- $tests[] = $test;
- }
- }
-
- return $tests;
- }
-
- public function testGetSource()
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), false);
-
- $this->assertSame(" */*bar*/ ?>\n", $template->getSource());
- }
-
- /**
- * @dataProvider getGetAttributeWithSandbox
- */
- public function testGetAttributeWithSandbox($object, $item, $allowed, $useExt)
- {
- $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
- $policy = new Twig_Sandbox_SecurityPolicy(array(), array(), array(/*method*/), array(/*prop*/), array());
- $twig->addExtension(new Twig_Extension_Sandbox($policy, !$allowed));
- $template = new Twig_TemplateTest($twig, $useExt);
-
- try {
- $template->getAttribute($object, $item, array(), 'any');
-
- if (!$allowed) {
- $this->fail();
- }
- } catch (Twig_Sandbox_SecurityError $e) {
- if ($allowed) {
- $this->fail();
- }
-
- $this->assertContains('is not allowed', $e->getMessage());
- }
- }
-
- public function getGetAttributeWithSandbox()
- {
- $tests = array(
- array(new Twig_TemplatePropertyObject(), 'defined', false, false),
- array(new Twig_TemplatePropertyObject(), 'defined', true, false),
- array(new Twig_TemplateMethodObject(), 'defined', false, false),
- array(new Twig_TemplateMethodObject(), 'defined', true, false),
- );
-
- if (function_exists('twig_template_get_attributes')) {
- foreach (array_slice($tests, 0) as $test) {
- $test[3] = true;
- $tests[] = $test;
- }
- }
-
- return $tests;
- }
-
- /**
- * @dataProvider getGetAttributeWithTemplateAsObject
- */
- public function testGetAttributeWithTemplateAsObject($useExt)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
- $template1 = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), false);
-
- $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'string'));
- $this->assertEquals('some_string', $template->getAttribute($template1, 'string'));
-
- $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'true'));
- $this->assertEquals('1', $template->getAttribute($template1, 'true'));
-
- $this->assertInstanceof('Twig_Markup', $template->getAttribute($template1, 'zero'));
- $this->assertEquals('0', $template->getAttribute($template1, 'zero'));
-
- $this->assertNotInstanceof('Twig_Markup', $template->getAttribute($template1, 'empty'));
- $this->assertSame('', $template->getAttribute($template1, 'empty'));
-
- $this->assertFalse($template->getAttribute($template1, 'env', array(), Twig_Template::ANY_CALL, true));
- $this->assertFalse($template->getAttribute($template1, 'environment', array(), Twig_Template::ANY_CALL, true));
- $this->assertFalse($template->getAttribute($template1, 'getEnvironment', array(), Twig_Template::METHOD_CALL, true));
- $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', array(), Twig_Template::METHOD_CALL, true));
- }
-
- public function getGetAttributeWithTemplateAsObject()
- {
- $bools = array(
- array(false),
- );
-
- if (function_exists('twig_template_get_attributes')) {
- $bools[] = array(true);
- }
-
- return $bools;
- }
-
- /**
- * @dataProvider getTestsDependingOnExtensionAvailability
- */
- public function testGetAttributeOnArrayWithConfusableKey($useExt = false)
- {
- $template = new Twig_TemplateTest(
- new Twig_Environment($this->getMock('Twig_LoaderInterface')),
- $useExt
- );
-
- $array = array('Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros');
-
- $this->assertSame('Zero', $array[false]);
- $this->assertSame('One', $array[true]);
- $this->assertSame('One', $array[1.5]);
- $this->assertSame('One', $array['1']);
- $this->assertSame('MinusOne', $array[-1.5]);
- $this->assertSame('FloatButString', $array['1.5']);
- $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']);
- $this->assertSame('EmptyString', $array[null]);
-
- $this->assertSame('Zero', $template->getAttribute($array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)');
- $this->assertSame('One', $template->getAttribute($array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)');
- $this->assertSame('One', $template->getAttribute($array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)');
- $this->assertSame('One', $template->getAttribute($array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)');
- $this->assertSame('MinusOne', $template->getAttribute($array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)');
- $this->assertSame('FloatButString', $template->getAttribute($array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)');
- $this->assertSame('IntegerButStringWithLeadingZeros', $template->getAttribute($array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)');
- $this->assertSame('EmptyString', $template->getAttribute($array, null), 'null is treated as "" when accessing an array (equals PHP behavior)');
- }
-
- public function getTestsDependingOnExtensionAvailability()
- {
- if (function_exists('twig_template_get_attributes')) {
- return array(array(false), array(true));
- }
-
- return array(array(false));
- }
-
- /**
- * @dataProvider getGetAttributeTests
- */
- public function testGetAttribute($defined, $value, $object, $item, $arguments, $type, $useExt = false)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
-
- $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type));
- }
-
- /**
- * @dataProvider getGetAttributeTests
- */
- public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false, $exceptionMessage = null)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt);
-
- if ($defined) {
- $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type));
- } else {
- try {
- $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type));
-
- throw new Exception('Expected Twig_Error_Runtime exception.');
- } catch (Twig_Error_Runtime $e) {
- if (null !== $exceptionMessage) {
- $this->assertSame($exceptionMessage, $e->getMessage());
- }
- }
- }
- }
-
- /**
- * @dataProvider getGetAttributeTests
- */
- public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type, $useExt = false)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
-
- $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true));
- }
-
- /**
- * @dataProvider getGetAttributeTests
- */
- public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type, $useExt = false)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true)), $useExt);
-
- $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true));
- }
-
- /**
- * @dataProvider getTestsDependingOnExtensionAvailability
- */
- public function testGetAttributeCallExceptions($useExt = false)
- {
- $template = new Twig_TemplateTest(new Twig_Environment($this->getMock('Twig_LoaderInterface')), $useExt);
-
- $object = new Twig_TemplateMagicMethodExceptionObject();
-
- $this->assertNull($template->getAttribute($object, 'foo'));
- }
-
- public function getGetAttributeTests()
- {
- $array = array(
- 'defined' => 'defined',
- 'zero' => 0,
- 'null' => null,
- '1' => 1,
- 'bar' => true,
- '09' => '09',
- '+4' => '+4',
- );
-
- $objectArray = new Twig_TemplateArrayAccessObject();
- $stdObject = (object) $array;
- $magicPropertyObject = new Twig_TemplateMagicPropertyObject();
- $propertyObject = new Twig_TemplatePropertyObject();
- $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator();
- $propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess();
- $propertyObject3 = new Twig_TemplatePropertyObjectDefinedWithUndefinedValue();
- $methodObject = new Twig_TemplateMethodObject();
- $magicMethodObject = new Twig_TemplateMagicMethodObject();
-
- $anyType = Twig_Template::ANY_CALL;
- $methodType = Twig_Template::METHOD_CALL;
- $arrayType = Twig_Template::ARRAY_CALL;
-
- $basicTests = array(
- // array(defined, value, property to fetch)
- array(true, 'defined', 'defined'),
- array(false, null, 'undefined'),
- array(false, null, 'protected'),
- array(true, 0, 'zero'),
- array(true, 1, 1),
- array(true, 1, 1.0),
- array(true, null, 'null'),
- array(true, true, 'bar'),
- array(true, '09', '09'),
- array(true, '+4', '+4'),
- );
- $testObjects = array(
- // array(object, type of fetch)
- array($array, $arrayType),
- array($objectArray, $arrayType),
- array($stdObject, $anyType),
- array($magicPropertyObject, $anyType),
- array($methodObject, $methodType),
- array($methodObject, $anyType),
- array($propertyObject, $anyType),
- array($propertyObject1, $anyType),
- array($propertyObject2, $anyType),
- );
-
- $tests = array();
- foreach ($testObjects as $testObject) {
- foreach ($basicTests as $test) {
- // properties cannot be numbers
- if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) {
- continue;
- }
-
- if ('+4' === $test[2] && $methodObject === $testObject[0]) {
- continue;
- }
-
- $tests[] = array($test[0], $test[1], $testObject[0], $test[2], array(), $testObject[1]);
- }
- }
-
- // additional properties tests
- $tests = array_merge($tests, array(
- array(true, null, $propertyObject3, 'foo', array(), $anyType),
- ));
-
- // additional method tests
- $tests = array_merge($tests, array(
- array(true, 'defined', $methodObject, 'defined', array(), $methodType),
- array(true, 'defined', $methodObject, 'DEFINED', array(), $methodType),
- array(true, 'defined', $methodObject, 'getDefined', array(), $methodType),
- array(true, 'defined', $methodObject, 'GETDEFINED', array(), $methodType),
- array(true, 'static', $methodObject, 'static', array(), $methodType),
- array(true, 'static', $methodObject, 'getStatic', array(), $methodType),
-
- array(true, '__call_undefined', $magicMethodObject, 'undefined', array(), $methodType),
- array(true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', array(), $methodType),
- ));
-
- // add the same tests for the any type
- foreach ($tests as $test) {
- if ($anyType !== $test[5]) {
- $test[5] = $anyType;
- $tests[] = $test;
- }
- }
-
- $methodAndPropObject = new Twig_TemplateMethodAndPropObject();
-
- // additional method tests
- $tests = array_merge($tests, array(
- array(true, 'a', $methodAndPropObject, 'a', array(), $anyType),
- array(true, 'a', $methodAndPropObject, 'a', array(), $methodType),
- array(false, null, $methodAndPropObject, 'a', array(), $arrayType),
-
- array(true, 'b_prop', $methodAndPropObject, 'b', array(), $anyType),
- array(true, 'b', $methodAndPropObject, 'B', array(), $anyType),
- array(true, 'b', $methodAndPropObject, 'b', array(), $methodType),
- array(true, 'b', $methodAndPropObject, 'B', array(), $methodType),
- array(false, null, $methodAndPropObject, 'b', array(), $arrayType),
-
- array(false, null, $methodAndPropObject, 'c', array(), $anyType),
- array(false, null, $methodAndPropObject, 'c', array(), $methodType),
- array(false, null, $methodAndPropObject, 'c', array(), $arrayType),
-
- ));
-
- // tests when input is not an array or object
- $tests = array_merge($tests, array(
- array(false, null, 42, 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a integer variable ("42")'),
- array(false, null, 'string', 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a string variable ("string")'),
- array(false, null, array(), 'a', array(), $anyType, false, 'Key "a" does not exist as the array is empty'),
- ));
-
- // add twig_template_get_attributes tests
-
- if (function_exists('twig_template_get_attributes')) {
- foreach (array_slice($tests, 0) as $test) {
- $test = array_pad($test, 7, null);
- $test[6] = true;
- $tests[] = $test;
- }
- }
-
- return $tests;
- }
-}
-
-class Twig_TemplateTest extends Twig_Template
-{
- protected $useExtGetAttribute = false;
-
- public function __construct(Twig_Environment $env, $useExtGetAttribute = false)
- {
- parent::__construct($env);
- $this->useExtGetAttribute = $useExtGetAttribute;
- self::$cache = array();
- }
-
- public function getZero()
- {
- return 0;
- }
-
- public function getEmpty()
- {
- return '';
- }
-
- public function getString()
- {
- return 'some_string';
- }
-
- public function getTrue()
- {
- return true;
- }
-
- public function getTemplateName()
- {
- }
-
- public function getDebugInfo()
- {
- return array();
- }
-
- protected function doGetParent(array $context)
- {
- }
-
- protected function doDisplay(array $context, array $blocks = array())
- {
- }
-
- public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
- {
- if ($this->useExtGetAttribute) {
- return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
- } else {
- return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck);
- }
- }
-}
-/* *//* *bar*//* ?>*/
-/* */
-
-class Twig_TemplateArrayAccessObject implements ArrayAccess
-{
- protected $protected = 'protected';
-
- public $attributes = array(
- 'defined' => 'defined',
- 'zero' => 0,
- 'null' => null,
- '1' => 1,
- 'bar' => true,
- '09' => '09',
- '+4' => '+4',
- );
-
- public function offsetExists($name)
- {
- return array_key_exists($name, $this->attributes);
- }
-
- public function offsetGet($name)
- {
- return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null;
- }
-
- public function offsetSet($name, $value)
- {
- }
-
- public function offsetUnset($name)
- {
- }
-}
-
-class Twig_TemplateMagicPropertyObject
-{
- public $defined = 'defined';
-
- public $attributes = array(
- 'zero' => 0,
- 'null' => null,
- '1' => 1,
- 'bar' => true,
- '09' => '09',
- '+4' => '+4',
- );
-
- protected $protected = 'protected';
-
- public function __isset($name)
- {
- return array_key_exists($name, $this->attributes);
- }
-
- public function __get($name)
- {
- return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null;
- }
-}
-
-class Twig_TemplateMagicPropertyObjectWithException
-{
- public function __isset($key)
- {
- throw new Exception('Hey! Don\'t try to isset me!');
- }
-}
-
-class Twig_TemplatePropertyObject
-{
- public $defined = 'defined';
- public $zero = 0;
- public $null = null;
- public $bar = true;
-
- protected $protected = 'protected';
-}
-
-class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements IteratorAggregate
-{
- public function getIterator()
- {
- return new ArrayIterator(array('foo', 'bar'));
- }
-}
-
-class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements ArrayAccess
-{
- private $data = array();
-
- public function offsetExists($offset)
- {
- return array_key_exists($offset, $this->data);
- }
-
- public function offsetGet($offset)
- {
- return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a';
- }
-
- public function offsetSet($offset, $value)
- {
- }
-
- public function offsetUnset($offset)
- {
- }
-}
-
-class Twig_TemplatePropertyObjectDefinedWithUndefinedValue
-{
- public $foo;
-
- public function __construct()
- {
- $this->foo = @$notExist;
- }
-}
-
-class Twig_TemplateMethodObject
-{
- public function getDefined()
- {
- return 'defined';
- }
-
- public function get1()
- {
- return 1;
- }
-
- public function get09()
- {
- return '09';
- }
-
- public function getZero()
- {
- return 0;
- }
-
- public function getNull()
- {
- }
-
- public function isBar()
- {
- return true;
- }
-
- protected function getProtected()
- {
- return 'protected';
- }
-
- public static function getStatic()
- {
- return 'static';
- }
-}
-
-class Twig_TemplateMethodAndPropObject
-{
- private $a = 'a_prop';
- public function getA()
- {
- return 'a';
- }
-
- public $b = 'b_prop';
- public function getB()
- {
- return 'b';
- }
-
- private $c = 'c_prop';
- private function getC()
- {
- return 'c';
- }
-}
-
-class Twig_TemplateMagicMethodObject
-{
- public function __call($method, $arguments)
- {
- return '__call_'.$method;
- }
-}
-
-class Twig_TemplateMagicMethodExceptionObject
-{
- public function __call($method, $arguments)
- {
- throw new BadMethodCallException(sprintf('Unknown method "%s".', $method));
- }
-}
-
-class CExtDisablingNodeVisitor implements Twig_NodeVisitorInterface
-{
- public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
- {
- if ($node instanceof Twig_Node_Expression_GetAttr) {
- $node->setAttribute('disable_c_ext', true);
- }
-
- return $node;
- }
-
- public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
- {
- return $node;
- }
-
- public function getPriority()
- {
- return 0;
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php
deleted file mode 100644
index 5ac3a286..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-isEOF()) {
- $token = $stream->next();
-
- $repr[] = $token->getValue();
- }
- $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token');
- }
-
- /**
- * @expectedException Twig_Error_Syntax
- * @expectedMessage Unexpected end of template
- */
- public function testEndOfTemplateNext()
- {
- $stream = new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1),
- ));
- while (!$stream->isEOF()) {
- $stream->next();
- }
- }
-
- /**
- * @expectedException Twig_Error_Syntax
- * @expectedMessage Unexpected end of template
- */
- public function testEndOfTemplateLook()
- {
- $stream = new Twig_TokenStream(array(
- new Twig_Token(Twig_Token::BLOCK_START_TYPE, 1, 1),
- ));
- while (!$stream->isEOF()) {
- $stream->look();
- $stream->next();
- }
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/src/composer/vendor/twig/twig/test/Twig/Tests/escapingTest.php
deleted file mode 100644
index abf62364..00000000
--- a/src/composer/vendor/twig/twig/test/Twig/Tests/escapingTest.php
+++ /dev/null
@@ -1,320 +0,0 @@
- ''',
- '"' => '"',
- '<' => '<',
- '>' => '>',
- '&' => '&',
- );
-
- protected $htmlAttrSpecialChars = array(
- '\'' => ''',
- /* Characters beyond ASCII value 255 to unicode escape */
- 'Ā' => 'Ā',
- /* Immune chars excluded */
- ',' => ',',
- '.' => '.',
- '-' => '-',
- '_' => '_',
- /* Basic alnums excluded */
- 'a' => 'a',
- 'A' => 'A',
- 'z' => 'z',
- 'Z' => 'Z',
- '0' => '0',
- '9' => '9',
- /* Basic control characters and null */
- "\r" => '
',
- "\n" => '
',
- "\t" => ' ',
- "\0" => '�', // should use Unicode replacement char
- /* Encode chars as named entities where possible */
- '<' => '<',
- '>' => '>',
- '&' => '&',
- '"' => '"',
- /* Encode spaces for quoteless attribute protection */
- ' ' => ' ',
- );
-
- protected $jsSpecialChars = array(
- /* HTML special chars - escape without exception to hex */
- '<' => '\\x3C',
- '>' => '\\x3E',
- '\'' => '\\x27',
- '"' => '\\x22',
- '&' => '\\x26',
- /* Characters beyond ASCII value 255 to unicode escape */
- 'Ā' => '\\u0100',
- /* Immune chars excluded */
- ',' => ',',
- '.' => '.',
- '_' => '_',
- /* Basic alnums excluded */
- 'a' => 'a',
- 'A' => 'A',
- 'z' => 'z',
- 'Z' => 'Z',
- '0' => '0',
- '9' => '9',
- /* Basic control characters and null */
- "\r" => '\\x0D',
- "\n" => '\\x0A',
- "\t" => '\\x09',
- "\0" => '\\x00',
- /* Encode spaces for quoteless attribute protection */
- ' ' => '\\x20',
- );
-
- protected $urlSpecialChars = array(
- /* HTML special chars - escape without exception to percent encoding */
- '<' => '%3C',
- '>' => '%3E',
- '\'' => '%27',
- '"' => '%22',
- '&' => '%26',
- /* Characters beyond ASCII value 255 to hex sequence */
- 'Ā' => '%C4%80',
- /* Punctuation and unreserved check */
- ',' => '%2C',
- '.' => '.',
- '_' => '_',
- '-' => '-',
- ':' => '%3A',
- ';' => '%3B',
- '!' => '%21',
- /* Basic alnums excluded */
- 'a' => 'a',
- 'A' => 'A',
- 'z' => 'z',
- 'Z' => 'Z',
- '0' => '0',
- '9' => '9',
- /* Basic control characters and null */
- "\r" => '%0D',
- "\n" => '%0A',
- "\t" => '%09',
- "\0" => '%00',
- /* PHP quirks from the past */
- ' ' => '%20',
- '~' => '~',
- '+' => '%2B',
- );
-
- protected $cssSpecialChars = array(
- /* HTML special chars - escape without exception to hex */
- '<' => '\\3C ',
- '>' => '\\3E ',
- '\'' => '\\27 ',
- '"' => '\\22 ',
- '&' => '\\26 ',
- /* Characters beyond ASCII value 255 to unicode escape */
- 'Ā' => '\\100 ',
- /* Immune chars excluded */
- ',' => '\\2C ',
- '.' => '\\2E ',
- '_' => '\\5F ',
- /* Basic alnums excluded */
- 'a' => 'a',
- 'A' => 'A',
- 'z' => 'z',
- 'Z' => 'Z',
- '0' => '0',
- '9' => '9',
- /* Basic control characters and null */
- "\r" => '\\D ',
- "\n" => '\\A ',
- "\t" => '\\9 ',
- "\0" => '\\0 ',
- /* Encode spaces for quoteless attribute protection */
- ' ' => '\\20 ',
- );
-
- protected $env;
-
- protected function setUp()
- {
- $this->env = new Twig_Environment($this->getMock('Twig_LoaderInterface'));
- }
-
- public function testHtmlEscapingConvertsSpecialChars()
- {
- foreach ($this->htmlSpecialChars as $key => $value) {
- $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html'), 'Failed to escape: '.$key);
- }
- }
-
- public function testHtmlAttributeEscapingConvertsSpecialChars()
- {
- foreach ($this->htmlAttrSpecialChars as $key => $value) {
- $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html_attr'), 'Failed to escape: '.$key);
- }
- }
-
- public function testJavascriptEscapingConvertsSpecialChars()
- {
- foreach ($this->jsSpecialChars as $key => $value) {
- $this->assertEquals($value, twig_escape_filter($this->env, $key, 'js'), 'Failed to escape: '.$key);
- }
- }
-
- public function testJavascriptEscapingReturnsStringIfZeroLength()
- {
- $this->assertEquals('', twig_escape_filter($this->env, '', 'js'));
- }
-
- public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits()
- {
- $this->assertEquals('123', twig_escape_filter($this->env, '123', 'js'));
- }
-
- public function testCssEscapingConvertsSpecialChars()
- {
- foreach ($this->cssSpecialChars as $key => $value) {
- $this->assertEquals($value, twig_escape_filter($this->env, $key, 'css'), 'Failed to escape: '.$key);
- }
- }
-
- public function testCssEscapingReturnsStringIfZeroLength()
- {
- $this->assertEquals('', twig_escape_filter($this->env, '', 'css'));
- }
-
- public function testCssEscapingReturnsStringIfContainsOnlyDigits()
- {
- $this->assertEquals('123', twig_escape_filter($this->env, '123', 'css'));
- }
-
- public function testUrlEscapingConvertsSpecialChars()
- {
- foreach ($this->urlSpecialChars as $key => $value) {
- $this->assertEquals($value, twig_escape_filter($this->env, $key, 'url'), 'Failed to escape: '.$key);
- }
- }
-
- /**
- * Range tests to confirm escaped range of characters is within OWASP recommendation.
- */
-
- /**
- * Only testing the first few 2 ranges on this prot. function as that's all these
- * other range tests require.
- */
- public function testUnicodeCodepointConversionToUtf8()
- {
- $expected = ' ~ޙ';
- $codepoints = array(0x20, 0x7e, 0x799);
- $result = '';
- foreach ($codepoints as $value) {
- $result .= $this->codepointToUtf8($value);
- }
- $this->assertEquals($expected, $result);
- }
-
- /**
- * Convert a Unicode Codepoint to a literal UTF-8 character.
- *
- * @param int $codepoint Unicode codepoint in hex notation
- *
- * @return string UTF-8 literal string
- */
- protected function codepointToUtf8($codepoint)
- {
- if ($codepoint < 0x80) {
- return chr($codepoint);
- }
- if ($codepoint < 0x800) {
- return chr($codepoint >> 6 & 0x3f | 0xc0)
- .chr($codepoint & 0x3f | 0x80);
- }
- if ($codepoint < 0x10000) {
- return chr($codepoint >> 12 & 0x0f | 0xe0)
- .chr($codepoint >> 6 & 0x3f | 0x80)
- .chr($codepoint & 0x3f | 0x80);
- }
- if ($codepoint < 0x110000) {
- return chr($codepoint >> 18 & 0x07 | 0xf0)
- .chr($codepoint >> 12 & 0x3f | 0x80)
- .chr($codepoint >> 6 & 0x3f | 0x80)
- .chr($codepoint & 0x3f | 0x80);
- }
- throw new Exception('Codepoint requested outside of Unicode range');
- }
-
- public function testJavascriptEscapingEscapesOwaspRecommendedRanges()
- {
- $immune = array(',', '.', '_'); // Exceptions to escaping ranges
- for ($chr = 0; $chr < 0xFF; ++$chr) {
- if ($chr >= 0x30 && $chr <= 0x39
- || $chr >= 0x41 && $chr <= 0x5A
- || $chr >= 0x61 && $chr <= 0x7A) {
- $literal = $this->codepointToUtf8($chr);
- $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js'));
- } else {
- $literal = $this->codepointToUtf8($chr);
- if (in_array($literal, $immune)) {
- $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js'));
- } else {
- $this->assertNotEquals(
- $literal,
- twig_escape_filter($this->env, $literal, 'js'),
- "$literal should be escaped!");
- }
- }
- }
- }
-
- public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges()
- {
- $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges
- for ($chr = 0; $chr < 0xFF; ++$chr) {
- if ($chr >= 0x30 && $chr <= 0x39
- || $chr >= 0x41 && $chr <= 0x5A
- || $chr >= 0x61 && $chr <= 0x7A) {
- $literal = $this->codepointToUtf8($chr);
- $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr'));
- } else {
- $literal = $this->codepointToUtf8($chr);
- if (in_array($literal, $immune)) {
- $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr'));
- } else {
- $this->assertNotEquals(
- $literal,
- twig_escape_filter($this->env, $literal, 'html_attr'),
- "$literal should be escaped!");
- }
- }
- }
- }
-
- public function testCssEscapingEscapesOwaspRecommendedRanges()
- {
- // CSS has no exceptions to escaping ranges
- for ($chr = 0; $chr < 0xFF; ++$chr) {
- if ($chr >= 0x30 && $chr <= 0x39
- || $chr >= 0x41 && $chr <= 0x5A
- || $chr >= 0x61 && $chr <= 0x7A) {
- $literal = $this->codepointToUtf8($chr);
- $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'css'));
- } else {
- $literal = $this->codepointToUtf8($chr);
- $this->assertNotEquals(
- $literal,
- twig_escape_filter($this->env, $literal, 'css'),
- "$literal should be escaped!");
- }
- }
- }
-}
diff --git a/src/composer/vendor/twig/twig/test/bootstrap.php b/src/composer/vendor/twig/twig/test/bootstrap.php
deleted file mode 100644
index aecb976f..00000000
--- a/src/composer/vendor/twig/twig/test/bootstrap.php
+++ /dev/null
@@ -1,13 +0,0 @@
-setCurrentUser($user);
-UIManager::getInstance()->setProfiles($profileCurrent, $profileSwitched);
-UIManager::getInstance()->setHomeLink($homeLink);
-
-$moduleManagers = BaseService::getInstance()->getModuleManagers();
-foreach($moduleManagers as $moduleManagerObj){
- $allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
-
- if($allowed){
- $moduleManagerObj->initQuickAccessMenu();
- }
-}
diff --git a/src/crons/cron.php b/src/crons/cron.php
deleted file mode 100644
index 748560a6..00000000
--- a/src/crons/cron.php
+++ /dev/null
@@ -1,22 +0,0 @@
-Find("status = ?",array('Enabled'));
-
-if(!$crons){
- LogManager::getInstance()->info(CLIENT_NAME." error :".$cron->ErrorMsg());
-}
-
-LogManager::getInstance()->info(CLIENT_NAME." cron count :".count($crons));
-foreach($crons as $cron){
- $count++;
- $iceCron = new IceCron($cron);
- LogManager::getInstance()->info(CLIENT_NAME." check cron :".$cron->name);
- if($iceCron->isRunNow()){
- LogManager::getInstance()->info(CLIENT_NAME." execute cron :".$cron->name);
- $iceCron->execute();
- sleep(1);
- }
-}
-
diff --git a/src/crons/cronRunner.php b/src/crons/cronRunner.php
deleted file mode 100644
index 3537a02b..00000000
--- a/src/crons/cronRunner.php
+++ /dev/null
@@ -1,18 +0,0 @@
-run();
-
diff --git a/src/crons/echo.php b/src/crons/echo.php
deleted file mode 100644
index cbd2d20b..00000000
--- a/src/crons/echo.php
+++ /dev/null
@@ -1,3 +0,0 @@
-ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:100%;font-weight:bold;font-size:1.2em}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.old,.bootstrap-datetimepicker-widget td.new{color:#999}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{color:#fff;background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget td.active:hover,.bootstrap-datetimepicker-widget td.active:hover:hover,.bootstrap-datetimepicker-widget td.active:active,.bootstrap-datetimepicker-widget td.active:hover:active,.bootstrap-datetimepicker-widget td.active.active,.bootstrap-datetimepicker-widget td.active:hover.active,.bootstrap-datetimepicker-widget td.active.disabled,.bootstrap-datetimepicker-widget td.active:hover.disabled,.bootstrap-datetimepicker-widget td.active[disabled],.bootstrap-datetimepicker-widget td.active:hover[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.bootstrap-datetimepicker-widget td.active:active,.bootstrap-datetimepicker-widget td.active:hover:active,.bootstrap-datetimepicker-widget td.active.active,.bootstrap-datetimepicker-widget td.active:hover.active{background-color:#039 \9}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{color:#fff;background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget td span.active:hover,.bootstrap-datetimepicker-widget td span.active:active,.bootstrap-datetimepicker-widget td span.active.active,.bootstrap-datetimepicker-widget td span.active.disabled,.bootstrap-datetimepicker-widget td span.active[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.bootstrap-datetimepicker-widget td span.active:active,.bootstrap-datetimepicker-widget td span.active.active{background-color:#039 \9}.bootstrap-datetimepicker-widget td span.old{color:#999}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget th.switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{background:0;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i{display:block;cursor:pointer;width:16px;height:16px}.bootstrap-datetimepicker-widget.left-oriented:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.left-oriented:after{left:auto;right:7px}
\ No newline at end of file
diff --git a/src/css/datepicker.css b/src/css/datepicker.css
deleted file mode 100644
index bd9b6b90..00000000
--- a/src/css/datepicker.css
+++ /dev/null
@@ -1,7 +0,0 @@
- /*
- Datepicker for Bootstrap
- Copyright 2012 Stefan Petre
- Licensed under the Apache License v2.0
- http://www.apache.org/licenses/LICENSE-2.0
-*/
- .datepicker { top: 0; left: 0; padding: 4px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; /*.dow { border-top: 1px solid #ddd !important; }*/ } .datepicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .datepicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .datepicker > div { display: none; } .datepicker table { width: 100%; margin: 0; } .datepicker td, .datepicker th { text-align: center; width: 20px; height: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td.day:hover { background: #eeeeee; cursor: pointer; } .datepicker td.old, .datepicker td.new { color: #999999; } .datepicker td.active, .datepicker td.active:hover { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { background-color: #0044cc; } .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { background-color: #003399 \9; } .datepicker td span { display: block; width: 47px; height: 54px; line-height: 54px; float: left; margin: 2px; cursor: pointer; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td span:hover { background: #eeeeee; } .datepicker td span.active { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { background-color: #0044cc; } .datepicker td span.active:active, .datepicker td span.active.active { background-color: #003399 \9; } .datepicker td span.old { color: #999999; } .datepicker th.switch { width: 145px; } .datepicker th.next, .datepicker th.prev { font-size: 19.5px; } .datepicker thead tr:first-child th { cursor: pointer; } .datepicker thead tr:first-child th:hover { background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; }
\ No newline at end of file
diff --git a/src/css/fullcalendar.css b/src/css/fullcalendar.css
deleted file mode 100644
index 92fe47f2..00000000
--- a/src/css/fullcalendar.css
+++ /dev/null
@@ -1,589 +0,0 @@
-/*!
- * FullCalendar v1.6.4 Stylesheet
- * Docs & License: http://arshaw.com/fullcalendar/
- * (c) 2013 Adam Shaw
- */
-
-
-.fc {
- direction: ltr;
- text-align: left;
- }
-
-.fc table {
- border-collapse: collapse;
- border-spacing: 0;
- }
-
-html .fc,
-.fc table {
- font-size: 1em;
- }
-
-.fc td,
-.fc th {
- padding: 0;
- vertical-align: top;
- }
-
-
-
-/* Header
-------------------------------------------------------------------------*/
-
-.fc-header td {
- white-space: nowrap;
- }
-
-.fc-header-left {
- width: 25%;
- text-align: left;
- }
-
-.fc-header-center {
- text-align: center;
- }
-
-.fc-header-right {
- width: 25%;
- text-align: right;
- }
-
-.fc-header-title {
- display: inline-block;
- vertical-align: top;
- }
-
-.fc-header-title h2 {
- margin-top: 0;
- white-space: nowrap;
- }
-
-.fc .fc-header-space {
- padding-left: 10px;
- }
-
-.fc-header .fc-button {
- margin-bottom: 1em;
- vertical-align: top;
- }
-
-/* buttons edges butting together */
-
-.fc-header .fc-button {
- margin-right: -1px;
- }
-
-.fc-header .fc-corner-right, /* non-theme */
-.fc-header .ui-corner-right { /* theme */
- margin-right: 0; /* back to normal */
- }
-
-/* button layering (for border precedence) */
-
-.fc-header .fc-state-hover,
-.fc-header .ui-state-hover {
- z-index: 2;
- }
-
-.fc-header .fc-state-down {
- z-index: 3;
- }
-
-.fc-header .fc-state-active,
-.fc-header .ui-state-active {
- z-index: 4;
- }
-
-
-
-/* Content
-------------------------------------------------------------------------*/
-
-.fc-content {
- clear: both;
- zoom: 1; /* for IE7, gives accurate coordinates for [un]freezeContentHeight */
- }
-
-.fc-view {
- width: 100%;
- overflow: hidden;
- }
-
-
-
-/* Cell Styles
-------------------------------------------------------------------------*/
-
-.fc-widget-header, /* , usually */
-.fc-widget-content { /* , usually */
- border: 1px solid #ddd;
- }
-
-.fc-state-highlight { /* today cell */ /* TODO: add .fc-today to */
- background: #fcf8e3;
- }
-
-.fc-cell-overlay { /* semi-transparent rectangle while dragging */
- background: #bce8f1;
- opacity: .3;
- filter: alpha(opacity=30); /* for IE */
- }
-
-
-
-/* Buttons
-------------------------------------------------------------------------*/
-
-.fc-button {
- position: relative;
- display: inline-block;
- padding: 0 .6em;
- overflow: hidden;
- height: 1.9em;
- line-height: 1.9em;
- white-space: nowrap;
- cursor: pointer;
- }
-
-.fc-state-default { /* non-theme */
- border: 1px solid;
- }
-
-.fc-state-default.fc-corner-left { /* non-theme */
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- }
-
-.fc-state-default.fc-corner-right { /* non-theme */
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- }
-
-/*
- Our default prev/next buttons use HTML entities like ‹ › « »
- and we'll try to make them look good cross-browser.
-*/
-
-.fc-text-arrow {
- margin: 0 .1em;
- font-size: 2em;
- font-family: "Courier New", Courier, monospace;
- vertical-align: baseline; /* for IE7 */
- }
-
-.fc-button-prev .fc-text-arrow,
-.fc-button-next .fc-text-arrow { /* for ‹ › */
- font-weight: bold;
- }
-
-/* icon (for jquery ui) */
-
-.fc-button .fc-icon-wrap {
- position: relative;
- float: left;
- top: 50%;
- }
-
-.fc-button .ui-icon {
- position: relative;
- float: left;
- margin-top: -50%;
- *margin-top: 0;
- *top: -50%;
- }
-
-/*
- button states
- borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
-*/
-
-.fc-state-default {
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- color: #333;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
- }
-
-.fc-state-hover,
-.fc-state-down,
-.fc-state-active,
-.fc-state-disabled {
- color: #333333;
- background-color: #e6e6e6;
- }
-
-.fc-state-hover {
- color: #333333;
- text-decoration: none;
- background-position: 0 -15px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
- }
-
-.fc-state-down,
-.fc-state-active {
- background-color: #cccccc;
- background-image: none;
- outline: 0;
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
- }
-
-.fc-state-disabled {
- cursor: default;
- background-image: none;
- opacity: 0.65;
- filter: alpha(opacity=65);
- box-shadow: none;
- }
-
-
-
-/* Global Event Styles
-------------------------------------------------------------------------*/
-
-.fc-event-container > * {
- z-index: 8;
- }
-
-.fc-event-container > .ui-draggable-dragging,
-.fc-event-container > .ui-resizable-resizing {
- z-index: 9;
- }
-
-.fc-event {
- border: 1px solid #3a87ad; /* default BORDER color */
- background-color: #3a87ad; /* default BACKGROUND color */
- color: #fff; /* default TEXT color */
- font-size: .85em;
- cursor: default;
- }
-
-a.fc-event {
- text-decoration: none;
- }
-
-a.fc-event,
-.fc-event-draggable {
- cursor: pointer;
- }
-
-.fc-rtl .fc-event {
- text-align: right;
- }
-
-.fc-event-inner {
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
-
-.fc-event-time,
-.fc-event-title {
- padding: 0 1px;
- }
-
-.fc .ui-resizable-handle {
- display: block;
- position: absolute;
- z-index: 99999;
- overflow: hidden; /* hacky spaces (IE6/7) */
- font-size: 300%; /* */
- line-height: 50%; /* */
- }
-
-
-
-/* Horizontal Events
-------------------------------------------------------------------------*/
-
-.fc-event-hori {
- border-width: 1px 0;
- margin-bottom: 1px;
- }
-
-.fc-ltr .fc-event-hori.fc-event-start,
-.fc-rtl .fc-event-hori.fc-event-end {
- border-left-width: 1px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
- }
-
-.fc-ltr .fc-event-hori.fc-event-end,
-.fc-rtl .fc-event-hori.fc-event-start {
- border-right-width: 1px;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- }
-
-/* resizable */
-
-.fc-event-hori .ui-resizable-e {
- top: 0 !important; /* importants override pre jquery ui 1.7 styles */
- right: -3px !important;
- width: 7px !important;
- height: 100% !important;
- cursor: e-resize;
- }
-
-.fc-event-hori .ui-resizable-w {
- top: 0 !important;
- left: -3px !important;
- width: 7px !important;
- height: 100% !important;
- cursor: w-resize;
- }
-
-.fc-event-hori .ui-resizable-handle {
- _padding-bottom: 14px; /* IE6 had 0 height */
- }
-
-
-
-/* Reusable Separate-border Table
-------------------------------------------------------------*/
-
-table.fc-border-separate {
- border-collapse: separate;
- }
-
-.fc-border-separate th,
-.fc-border-separate td {
- border-width: 1px 0 0 1px;
- }
-
-.fc-border-separate th.fc-last,
-.fc-border-separate td.fc-last {
- border-right-width: 1px;
- }
-
-.fc-border-separate tr.fc-last th,
-.fc-border-separate tr.fc-last td {
- border-bottom-width: 1px;
- }
-
-.fc-border-separate tbody tr.fc-first td,
-.fc-border-separate tbody tr.fc-first th {
- border-top-width: 0;
- }
-
-
-
-/* Month View, Basic Week View, Basic Day View
-------------------------------------------------------------------------*/
-
-.fc-grid th {
- text-align: center;
- }
-
-.fc .fc-week-number {
- width: 22px;
- text-align: center;
- }
-
-.fc .fc-week-number div {
- padding: 0 2px;
- }
-
-.fc-grid .fc-day-number {
- float: right;
- padding: 0 2px;
- }
-
-.fc-grid .fc-other-month .fc-day-number {
- opacity: 0.3;
- filter: alpha(opacity=30); /* for IE */
- /* opacity with small font can sometimes look too faded
- might want to set the 'color' property instead
- making day-numbers bold also fixes the problem */
- }
-
-.fc-grid .fc-day-content {
- clear: both;
- padding: 2px 2px 1px; /* distance between events and day edges */
- }
-
-/* event styles */
-
-.fc-grid .fc-event-time {
- font-weight: bold;
- }
-
-/* right-to-left */
-
-.fc-rtl .fc-grid .fc-day-number {
- float: left;
- }
-
-.fc-rtl .fc-grid .fc-event-time {
- float: right;
- }
-
-
-
-/* Agenda Week View, Agenda Day View
-------------------------------------------------------------------------*/
-
-.fc-agenda table {
- border-collapse: separate;
- }
-
-.fc-agenda-days th {
- text-align: center;
- }
-
-.fc-agenda .fc-agenda-axis {
- width: 50px;
- padding: 0 4px;
- vertical-align: middle;
- text-align: right;
- white-space: nowrap;
- font-weight: normal;
- }
-
-.fc-agenda .fc-week-number {
- font-weight: bold;
- }
-
-.fc-agenda .fc-day-content {
- padding: 2px 2px 1px;
- }
-
-/* make axis border take precedence */
-
-.fc-agenda-days .fc-agenda-axis {
- border-right-width: 1px;
- }
-
-.fc-agenda-days .fc-col0 {
- border-left-width: 0;
- }
-
-/* all-day area */
-
-.fc-agenda-allday th {
- border-width: 0 1px;
- }
-
-.fc-agenda-allday .fc-day-content {
- min-height: 34px; /* TODO: doesnt work well in quirksmode */
- _height: 34px;
- }
-
-/* divider (between all-day and slots) */
-
-.fc-agenda-divider-inner {
- height: 2px;
- overflow: hidden;
- }
-
-.fc-widget-header .fc-agenda-divider-inner {
- background: #eee;
- }
-
-/* slot rows */
-
-.fc-agenda-slots th {
- border-width: 1px 1px 0;
- }
-
-.fc-agenda-slots td {
- border-width: 1px 0 0;
- background: none;
- }
-
-.fc-agenda-slots td div {
- height: 20px;
- }
-
-.fc-agenda-slots tr.fc-slot0 th,
-.fc-agenda-slots tr.fc-slot0 td {
- border-top-width: 0;
- }
-
-.fc-agenda-slots tr.fc-minor th,
-.fc-agenda-slots tr.fc-minor td {
- border-top-style: dotted;
- }
-
-.fc-agenda-slots tr.fc-minor th.ui-widget-header {
- *border-top-style: solid; /* doesn't work with background in IE6/7 */
- }
-
-
-
-/* Vertical Events
-------------------------------------------------------------------------*/
-
-.fc-event-vert {
- border-width: 0 1px;
- }
-
-.fc-event-vert.fc-event-start {
- border-top-width: 1px;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- }
-
-.fc-event-vert.fc-event-end {
- border-bottom-width: 1px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
- }
-
-.fc-event-vert .fc-event-time {
- white-space: nowrap;
- font-size: 10px;
- }
-
-.fc-event-vert .fc-event-inner {
- position: relative;
- z-index: 2;
- }
-
-.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
- position: absolute;
- z-index: 1;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: #fff;
- opacity: .25;
- filter: alpha(opacity=25);
- }
-
-.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
-.fc-select-helper .fc-event-bg {
- display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
- }
-
-/* resizable */
-
-.fc-event-vert .ui-resizable-s {
- bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
- width: 100% !important;
- height: 8px !important;
- overflow: hidden !important;
- line-height: 8px !important;
- font-size: 11px !important;
- font-family: monospace;
- text-align: center;
- cursor: s-resize;
- }
-
-.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
- _overflow: hidden;
- }
-
-
diff --git a/src/css/fullcalendar.print.css b/src/css/fullcalendar.print.css
deleted file mode 100644
index 43607199..00000000
--- a/src/css/fullcalendar.print.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/*!
- * FullCalendar v1.6.4 Print Stylesheet
- * Docs & License: http://arshaw.com/fullcalendar/
- * (c) 2013 Adam Shaw
- */
-
-/*
- * Include this stylesheet on your page to get a more printer-friendly calendar.
- * When including this stylesheet, use the media='print' attribute of the tag.
- * Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
- */
-
-
- /* Events
------------------------------------------------------*/
-
-.fc-event {
- background: #fff !important;
- color: #000 !important;
- }
-
-/* for vertical events */
-
-.fc-event-bg {
- display: none !important;
- }
-
-.fc-event .ui-resizable-handle {
- display: none !important;
- }
-
-
diff --git a/src/css/jquery.timepicker.css b/src/css/jquery.timepicker.css
deleted file mode 100644
index dc45f68d..00000000
--- a/src/css/jquery.timepicker.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.ui-timepicker-list {
- overflow-y: auto;
- height: 150px;
- width: 6.5em;
- background: #fff;
- border: 1px solid #ddd;
- margin: 0;
- padding: 0;
- list-style: none;
- -webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
- -moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
- box-shadow:0 5px 10px rgba(0,0,0,0.2);
- outline: none;
- z-index: 10001;
-}
-
-.ui-timepicker-list.ui-timepicker-with-duration {
- width: 11em;
-}
-
-.ui-timepicker-duration {
- margin-left: 5px; color: #888;
-}
-
-.ui-timepicker-list:hover .ui-timepicker-duration {
- color: #888;
-}
-
-.ui-timepicker-list li {
- padding: 3px 0 3px 5px;
- cursor: pointer;
- white-space: nowrap;
- color: #000;
- list-style: none;
- margin: 0;
-}
-
-.ui-timepicker-list:hover .ui-timepicker-selected {
- background: #fff; color: #000;
-}
-
-li.ui-timepicker-selected,
-.ui-timepicker-list li:hover,
-.ui-timepicker-list:hover .ui-timepicker-selected:hover {
- background: #1980EC; color: #fff;
-}
-
-li.ui-timepicker-selected .ui-timepicker-duration,
-.ui-timepicker-list li:hover .ui-timepicker-duration {
- color: #ccc;
-}
diff --git a/src/css/style.css b/src/css/style.css
deleted file mode 100644
index b900384d..00000000
--- a/src/css/style.css
+++ /dev/null
@@ -1,667 +0,0 @@
-.redFont{
- color: red;
-}
-.box_ws{
- background: white;
- border-left: 1px solid #DDD;
- border-right: 1px solid #DDD;
- border-bottom: 1px solid #DDD;
- color: #555;
-}
-
-.cal_box_ws{
- background: white;
- border: 1px solid #DDD;
- color: #555;
- height: 100px;
-}
-
-.cal_box_ws .wd_date_full{
- font-weight:bold;
- font-size:10px;
- float: right;
- margin-right: 5px;
-}
-
-.cal_box_ws .wd_date{
- font-size:10px;
- float: right;
- margin-right: 5px;
-}
-
-.nav-pills li a:hover{
- background: #1D64AD;
- color:white;
-}
-
-.navbar-inverse .brand, .navbar-inverse .nav > li > a {
- font-weight: bold;
- font-size: 12px;
-}
-
-.categoryWrap p{
- font-size:16px;
- font-weight:bold;
- padding: 3px;
-}
-
-.categoryWrap p:hover{
- font-size:16px;
- font-weight:bold;
- color:white;
- background: gray;
- padding: 3px;
- cursor:pointer;
- border-radius: 4px;
-
-}
-
-.resultLogo{
- text-align: center;
-}
-
-.pbar{
- font-weight:bold;
- font-size:11px;
-}
-
-.pbar .progress{
- height: 10px;
-}
-
-.bs-docs-sidenav {
- width: 228px;
- margin: 30px 0 0;
- padding: 0;
- background-color: #fff;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
- -moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
- box-shadow: 0 1px 4px rgba(0,0,0,.065);
-}
-.bs-docs-sidenav > li > a {
- display: block;
- *width: 190px;
- margin: 0 0 -1px;
- padding: 8px 14px;
- border: 1px solid #e5e5e5;
-}
-.bs-docs-sidenav > li:first-child > a {
- -webkit-border-radius: 6px 6px 0 0;
- -moz-border-radius: 6px 6px 0 0;
- border-radius: 6px 6px 0 0;
-}
-.bs-docs-sidenav > li:last-child > a {
- -webkit-border-radius: 0 0 6px 6px;
- -moz-border-radius: 0 0 6px 6px;
- border-radius: 0 0 6px 6px;
-}
-.bs-docs-sidenav > .active > a {
- position: relative;
- z-index: 2;
- padding: 9px 15px;
- border: 0;
- text-shadow: 0 1px 0 rgba(0,0,0,.15);
- -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
- -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
- box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
-}
-/* Chevrons */
-.bs-docs-sidenav .icon-chevron-right {
- float: right;
- margin-top: 2px;
- margin-right: -6px;
- opacity: .25;
-}
-.bs-docs-sidenav > li > a:hover {
- background-color: #f5f5f5;
-}
-.bs-docs-sidenav a:hover .icon-chevron-right {
- opacity: .5;
-}
-.bs-docs-sidenav .active .icon-chevron-right,
-.bs-docs-sidenav .active a:hover .icon-chevron-right {
- background-image: url(../img/glyphicons-halflings-white.png);
- opacity: 1;
-}
-.bs-docs-sidenav.affix {
- top: 40px;
-}
-.bs-docs-sidenav.affix-bottom {
- position: absolute;
- top: auto;
- bottom: 270px;
-}
-
-
-
-
-/* Responsive
--------------------------------------------------- */
-
-/* Desktop large
-------------------------- */
-@media (min-width: 1200px) {
- .bs-docs-container {
- max-width: 970px;
- }
- .bs-docs-sidenav {
- width: 258px;
- }
-}
-
-.reviewPoints{
- margin-top:10px;
-}
-
-.reviewPoints .star{
- margin-left: 10px;
-}
-
-.reviewBlock {
- position: relative;
- margin: 0px 0;
- padding: 39px 19px 14px;
- background-color: white;
- border: 1px solid #DDD;
- /*
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- */
- font-size:12px;
-}
-
-/*.reviewBlock::after {
-content: attr(data-content);
-position: absolute;
-top: -1px;
-left: -1px;
-padding: 3px 7px;
-font-size: 12px;
-font-weight: bold;
-background-color: whiteSmoke;
-border: 1px solid #DDD;
-color: #9DA0A4;
--webkit-border-radius: 4px 0 4px 0;
--moz-border-radius: 4px 0 4px 0;
-border-radius: 4px 0 4px 0;
-}*/
-
-.box_ws{
- background: white;
- border-left: 1px solid #DDD;
- border-right: 1px solid #DDD;
- border-bottom: 1px solid #DDD;
- color: #555;
-}
-
-.cal_box_ws{
- background: white;
- border: 1px solid #DDD;
- color: #555;
- height: 100px;
-}
-
-.cal_box_ws .wd_date_full{
- font-weight:bold;
- font-size:10px;
- float: right;
- margin-right: 5px;
-}
-
-.cal_box_ws .wd_date{
- font-size:10px;
- float: right;
- margin-right: 5px;
-}
-
-.nav-pills li a:hover{
- background: #1D64AD;
- color:white;
-}
-
-
-.nav-tabs > li > a:hover{
- color:#555;
-}
-
-
-.topheader {
- background: -moz-linear-gradient(#829AA8, #405A6A);
- background: -webkit-linear-gradient(#829AA8, #405A6A);
- background: linear-gradient(#829AA8, #405A6A);
- border: 1px solid #677C89;
- border-bottom-color: #6B808D;
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
-}
-
-
-.bgbody{
- background: #FAFAFA;
- background: -moz-linear-gradient(#FAFAFA, #EAEAEA);
- background: -webkit-linear-gradient(#FAFAFA, #EAEAEA);
- background: linear-gradient(#FAFAFA, #EAEAEA);
- border-bottom: 1px solid #CACACA;
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
-}
-
-.leftMenu{
- background-color: #E9F1F4;
- border-style: solid;
- border-width: 1px 1px 2px;
- border-color: #E9F1F4 #D8DEE2 #D8DEE2;
- border-radius: 0 0 5px 5px;
-}
-
-.nav > li > a:hover {
- text-decoration: none;
- background-color: whitesmoke;
- border-radius: 5px;
-}
-
-/*
-.nav-list > .active > a, .nav-list > .active > a:hover{
-color: white;
-text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-background-color: #405A6A;
-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
-border-radius: 5px;
-}
-*/
-
-a {
- color: #405A6A;
- text-decoration: none;
-}
-
-.nav-header {
- display: block;
- padding: 3px 15px;
- font-size: 15px;
- font-weight: bold;
- line-height: 20px;
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
- text-transform: none;
- background: -moz-linear-gradient(#829AA8, #405A6A);
- background: -webkit-linear-gradient(#829AA8, #405A6A);
- background: linear-gradient(#829AA8, #405A6A);
- color: white;
- border-radius: 2px;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in {
- opacity: 0.4;
- filter: alpha(opacity=40);
-}
-
-.error{
- color:red;
-}
-
-.columnMain{
- font-weight: bold;
-}
-
-.borderBox{
- padding-bottom: 10px;
- padding-left: 10px;
- padding-top: 10px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- margin-bottom: 20px;
- -moz-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
- -webkit-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
- box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
- border: 1px solid #EEE;
-}
-
-
-.iceicon_edit{
- background-image: url("../images/edit.png");
-}
-
-.iceicon_delete{
- background-image: url("../images/delete.png");
-}
-
-.iceicon_user{
- background-image: url("../images/user.png");
-}
-
-.dropdown-menu{
- z-index: 10000;
-}
-
-.lightface .lightfaceContent .lightfaceTitle {
- font-size: 14px;
- color: #fff;
- background-color: #405A6A;
- border: 1px solid #405A6A;
- font-weight: bold;
- margin: -1px;
- margin-bottom: 0;
- padding: 5px 10px;
- line-height: 30px;
-}
-
-.label-ice, .badge-ice{
- background-color: #405A6A;
-}
-
-.dataTables_processing{
- position: absolute;
- margin-left: 40px;
- font-weight: bold;
- font-size: 13px;
- color: gray;
-}
-
-
-
-/*changes to full caledar*/
-.fc-header-title h2 {
- margin-top: 0;
- white-space: nowrap;
- font-size: 20px;
- margin-left: 10px;
- color:#405A6A;
-}
-
-table.dataTable{
- font-size: 1.1em;
-}
-
-.form-horizontal{
- font-size: 1.2em;
-}
-
-.form-horizontal .row{
- margin-bottom: 10px;
-}
-
-.table.dataTable {width:100% !important;}
-
-.iceLabel{
- font-size: 12px !important;
- font-weight: bold;
- color: #3c8dbc;
-}
-
-.nav-tabs>li>a{
- border-radius:0px;
-}
-
-.nav > li > a:hover {
- border-radius:0px;
-}
-
-.btn {
- -webkit-border-radius: 0px;
- -moz-border-radius: 0px;
- border-radius: 0px;
- box-shadow: 0 1px 1px rgba(0,0,0,.12),0 1px 1px rgba(0,0,0,.24);
-}
-
-
-/* select2 style overide */
-.select2-choice{
- border: none !important;
- width: 100% !important;
- border-radius: 0px !important;
- background-color: #FFF !important;
- background-image: none !important;
-}
-
-
-.select2-container{
- padding:3px !important;
-}
-
-.select2-container-multi{
- padding:0px !important;
- border:none;
-}
-
-.select2-arrow{
- background-image: none !important;
- background: #FFF !important;
- border: none !important;
-}
-
-.select2-drop-active {
- /*border: 1px solid black !important;*/
- border-top: none !important;
- background: #f0f0f0 !important;
-}
-
-.logTime{
- font-weight: bold;
- font-size: 13px;
- font-style: italic;
-}
-
-.popupForm{
- border: none !important;
- padding: 0px 19px 14px !important;
-}
-
-.content {
- background: #FFF;
-}
-
-/*
-@media (min-width:1025px) {
- .content {
- min-height: 1100px;
- }
-}*/
-
-.wrapper {
- background: #FFF;
-}
-
-.user-panel > .info > p {
- margin-bottom: 9px;
- max-width: 135px;
- line-height: 17px;
-}
-
-.list-group-item-text{
- margin-bottom:5px;
-}
-
-.list-group-item{
- padding-bottom:30px;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*custom for v11.0 */
-
-
-.table-bordered>thead>tr>th{
- border:none !important;
-}
-
-.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
- border-bottom-width: 2px;
- border: none;
-}
-
-.table{
- -webkit-transition: margin-left .15s linear;
- transition: margin-left .15s linear;
- -webkit-user-select: none;
- background-color: #fff;
- -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
- box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
-}
-
-.reviewBlock{/*
- -webkit-box-sizing: border-box;
- box-sizing: border-box*/
- box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
- border: none;
-}
-
-.treeview-menu li:hover{
- font-weight:bold;
-}
-
-.online-button-yellow {
- width: 12px;
- height:12px;
- border-radius: 50%;
- border:2px solid #FFFF99;
- overflow:hidden;
-
- background: #FFCC00;
- box-shadow: 0 0 3px gray;
-}
-
-
-.online-button-green {
- width: 12px;
- height:12px;
- border-radius: 50%;
- border:2px solid #80E680;
- overflow:hidden;
-
- background: #00CC00;
- box-shadow: 0 0 3px gray;
-}
-
-.online-button-red {
- width: 12px;
- height:12px;
- border-radius: 50%;
- border:2px solid #FFB2B2;
- overflow:hidden;
-
- background: #FF0000;
- box-shadow: 0 0 3px gray;
-}
-
-.online-button-gray {
- width: 12px;
- height:12px;
- border-radius: 50%;
- border:2px solid #F6F6F6;
- overflow:hidden;
-
- background: #AAAAAA;
- box-shadow: 0 0 3px gray;
-}
-
-.header {
- background: url('../images/sort_both.png') no-repeat center right;
-}
-
-.sorting_disabled {
- background: none;
-}
-
-.headerSortUp {
- background: url('../images/sort_asc.png') no-repeat center right;
-}
-
-.headerSortDown {
- background: url('../images/sort_desc.png') no-repeat center right;
-}
-
-.hc-details{
- z-index:9999;
-}
-
-.header{
- cursor: pointer;
-}
-
-
-/* Full Cal */
-.fc-head{
- height: 40px;
- background-color: #3c8dbc;
- font-size: 14px;
- color: #FFF;
-}
-
-.fc-toolbar h2{
- font-size: 15px;
-}
-
-.navbar, .right-side{
- box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
- border: none;
-}
-
-.right-side{
- margin-bottom: 20px;
-}
-
-.sidebar .sidebar-menu {
- box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
- border: none;
- background: #FFF;
-}
-
-.treeview.active{
- box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
- border: none;
- background: #FFF;
-}
-
-.sidebar .sidebar-menu .treeview-menu > li {
- background: #FFF;
-}
-
-.skin-blue .sidebar > .sidebar-menu > li > a:hover, .skin-blue .sidebar > .sidebar-menu > li.active > a {
- color: #222;
- background: #fff !important;
-}
-
-.right-side > .content-header > h1 > small {
- color: #FFF;
-}
-
-.modal-content {
- border-radius: 0px;
-}
-
-.panel {
- border-radius: 0px;
- -moz-border-radius: 0px;
- -webkit-border-radius: 0px;
-}
-
-.logoResponsive{
- background: #3c8dbc !important;
- text-align: left !important;
- width:50% !important;
-}
-
-@media screen and (min-width: 0px) and (max-width: 600px) {
- .logoResponsive { display: none !important;}
-}
-
-.select2Multi{
- height:auto !important;
-}
-
-.callout h4{color: #FFF !important;}
\ No newline at end of file
diff --git a/src/data.php b/src/data.php
deleted file mode 100644
index 180655b7..00000000
--- a/src/data.php
+++ /dev/null
@@ -1,188 +0,0 @@
-fixJSON($_REQUEST['sm']);
-$_REQUEST['cl'] = BaseService::getInstance()->fixJSON($_REQUEST['cl']);
-$_REQUEST['ft'] = BaseService::getInstance()->fixJSON($_REQUEST['ft']);
-
-
-$columns = json_decode($_REQUEST['cl'],true);
-$columns[]="id";
-$table = $_REQUEST['t'];
-$obj = new $table();
-
-
-$sLimit = "";
-if ( isset( $_REQUEST['iDisplayStart'] ) && $_REQUEST['iDisplayLength'] != '-1' ){
- $sLimit = " LIMIT ".intval( $_REQUEST['iDisplayStart'] ).", ".intval( $_REQUEST['iDisplayLength'] );
-}
-
-$isSubOrdinates = false;
-if(isset($_REQUEST['type']) && $_REQUEST['type']="sub"){
- $isSubOrdinates = true;
-}
-
-$skipProfileRestriction = false;
-if(isset($_REQUEST['skip']) && $_REQUEST['type']="1"){
- $skipProfileRestriction = true;
-}
-
-$sortData = BaseService::getInstance()->getSortingData($_REQUEST);
-$data = BaseService::getInstance()->getData($_REQUEST['t'],$_REQUEST['sm'],$_REQUEST['ft'],$_REQUEST['ob'],$sLimit, $_REQUEST['cl'], $_REQUEST['sSearch'],$isSubOrdinates,$skipProfileRestriction,$sortData);
-
-//Get Total row count
-$totalRows = 0;
-
-$countFilterQuery = "";
-$countFilterQueryData = array();
-if(!empty($_REQUEST['ft'])){
- $filter = json_decode($_REQUEST['ft']);
- if(!empty($filter)){
- LogManager::getInstance()->debug("Filter:".print_r($filter,true));
- if(method_exists($obj,'getCustomFilterQuery')){
- $response = $obj->getCustomFilterQuery($filter);
- $countFilterQuery = $response[0];
- $countFilterQueryData = $response[1];
- }else{
-
- $defaultFilterResp = BaseService::getInstance()->buildDefaultFilterQuery($filter);
- $countFilterQuery = $defaultFilterResp[0];
- $countFilterQueryData = $defaultFilterResp[1];
- }
- }
-}
-
-LogManager::getInstance()->debug("Row Count Filter Query:".$countFilterQuery);
-LogManager::getInstance()->debug("Row Count Filter Query Data:".json_encode($countFilterQueryData));
-
-
-if(in_array($table, BaseService::getInstance()->userTables) && !$skipProfileRestriction && !$isSubOrdinates){
- $cemp = BaseService::getInstance()->getCurrentProfileId();
- $sql = "Select count(id) as count from ".$obj->_table." where ".SIGN_IN_ELEMENT_MAPPING_FIELD_NAME." = ? ".$countFilterQuery;
- array_unshift($countFilterQueryData,$cemp);
- LogManager::getInstance()->debug("Count Filter Query 1:".$sql);
- LogManager::getInstance()->debug("Count Filter Query Data 1:".json_encode($countFilterQueryData));
-
- $rowCount = $obj->DB()->Execute($sql, $countFilterQueryData);
-
-}else{
- if($isSubOrdinates){
- $cemp = BaseService::getInstance()->getCurrentProfileId();
- $profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
- $subordinate = new $profileClass();
- $subordinates = $subordinate->Find("supervisor = ?",array($cemp));
-
- $cempObj = new Employee();
- $cempObj->Load("id = ?",array($cemp));
-
- if($obj->getUserOnlyMeAccessField() == 'id' &&
- SettingsManager::getInstance()->getSetting('System: Company Structure Managers Enabled') == 1 &&
- CompanyStructure::isHeadOfCompanyStructure($cempObj->department, $cemp)){
- if(empty($subordinates)){
- $subordinates = array();
- }
-
- $childCompaniesIds = array();
- if(SettingsManager::getInstance()->getSetting('System: Child Company Structure Managers Enabled') == '1'){
- $childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
- $childCompanies = $childCompaniesResp->getObject();
-
- foreach($childCompanies as $cc){
- $childCompaniesIds[] = $cc->id;
- }
- }else{
- $childCompaniesIds[] = $cempObj->department;
- }
-
-
- if(!empty($childCompaniesIds)) {
- $childStructureSubordinates = $subordinate->Find("department in (" . implode(',', $childCompaniesIds) . ") and id != ?", array($cemp));
- $subordinates = array_merge($subordinates, $childStructureSubordinates);
- }
- }
-
-
- $subordinatesIds = "";
- foreach($subordinates as $sub){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$sub->id;
- }
- if($obj->allowIndirectMapping()){
- $indeirectEmployees = $subordinate->Find("indirect_supervisors IS NOT NULL and indirect_supervisors <> '' and status = 'Active'", array());
- foreach($indeirectEmployees as $ie){
- $indirectSupervisors = json_decode($ie->indirect_supervisors, true);
- if(in_array($cemp, $indirectSupervisors)){
- if($subordinatesIds != ""){
- $subordinatesIds.=",";
- }
- $subordinatesIds.=$ie->id;
- }
- }
- }
- $sql = "Select count(id) as count from ".$obj->_table." where ".$obj->getUserOnlyMeAccessField()." in (".$subordinatesIds.") ".$countFilterQuery;
- LogManager::getInstance()->debug("Count Filter Query 2:".$sql);
- LogManager::getInstance()->debug("Count Filter Query Data 2:".json_encode($countFilterQueryData));
- $rowCount = $obj->DB()->Execute($sql,$countFilterQueryData);
- }else{
- $sql = "Select count(id) as count from ".$obj->_table;
- if(!empty($countFilterQuery)){
- $sql.=" where 1=1 ".$countFilterQuery;
- }
- LogManager::getInstance()->debug("Count Filter Query 3:".$sql);
- LogManager::getInstance()->debug("Count Filter Query Data 3:".json_encode($countFilterQueryData));
- $rowCount = $obj->DB()->Execute($sql,$countFilterQueryData);
- }
-
-}
-
-if(!empty($rowCount)){
- foreach ($rowCount as $cnt) {
- $totalRows = $cnt['count'];
- }
-}else{
- $totalRows = 0;
-}
-
-
-/*
- * Output
- */
-
-$output = array(
- "sEcho" => intval($_REQUEST['sEcho']),
- "iTotalRecords" => $totalRows,
- "iTotalDisplayRecords" => $totalRows,
- "aaData" => array()
-);
-
-/*
-$output['debug_data'] = print_r($data,true);
-$output['debug_col'] = print_r($columns,true);
-$output['debug_col_plain'] = $_REQUEST['cl'];
-$output['get_magic_quotes_gpc'] = get_magic_quotes_gpc();
-*/
-
-foreach($data as $item){
- $row = array();
- $colCount = count($columns);
- for ($i=0 ; $i<$colCount;$i++){
- $row[] = $item->$columns[$i];
- }
- $row["_org"] = BaseService::getInstance()->cleanUpAdoDB($item);
- $output['aaData'][] = $row;
-}
-echo json_encode($output);
diff --git a/src/entry_footer.php b/src/entry_footer.php
deleted file mode 100644
index 1d7a6bf4..00000000
--- a/src/entry_footer.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/entry_header.php b/src/entry_header.php
deleted file mode 100644
index f593c536..00000000
--- a/src/entry_header.php
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- =$meta->title?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/fileupload.php b/src/fileupload.php
deleted file mode 100644
index 55231c64..00000000
--- a/src/fileupload.php
+++ /dev/null
@@ -1,194 +0,0 @@
-allowedExtensions = $allowedExtensions;
- $this->sizeLimit = $sizeLimit;
- $this->checkServerSettings();
- $this->file = new qqUploadedFileForm();
- }
-
- private function checkServerSettings(){
- $postSize = $this->toBytes(ini_get('post_max_size'));
- $uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
-
- /*if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit){
- $size = max(1, $this->sizeLimit / 1024 / 1024) . 'M';
- die("{'error':'increase post_max_size and upload_max_filesize to $size'}");
- }*/
- }
-
- private function toBytes($str){
- $val = trim($str);
- $last = strtolower($str[strlen($str)-1]);
- switch($last) {
- case 'g': $val *= 1024;
- case 'm': $val *= 1024;
- case 'k': $val *= 1024;
- }
- return $val;
- }
-
- /**
- * Returns array('success'=>1) or array('error'=>'error message')
- */
- function handleUpload($uploadDirectory,$saveFileName, $replaceOldFile = FALSE){
- if (!is_writable($uploadDirectory)){
- return array('success'=>0,'error' => "Server error. Upload directory ($uploadDirectory) is not writable");
- }
-
- if (!$this->file){
- return array('success'=>0,'error' => 'No files were uploaded.');
- }
-
- $size = $this->file->getSize();
- LogManager::getInstance()->info('file size ='.$size);
- LogManager::getInstance()->info('file size limit ='.$this->sizeLimit);
- if ($size == 0) {
- return array('success'=>0,'error' => 'File is empty');
- }
-
- if ($size > $this->sizeLimit) {
- return array('success'=>0,'error' => 'File is too large');
- }
-
- $pathinfo = pathinfo($this->file->getName());
- $filename = $pathinfo['filename'];
- //$filename = md5(uniqid());
- $ext = $pathinfo['extension'];
-
- if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){
- $these = implode(', ', $this->allowedExtensions);
- return array('success'=>0,'error' => 'File has an invalid extension, it should be one of '. $these . '.');
- }
- //$filename .= microtime(true);
- $filename = $saveFileName; // file with only name
- $saveFileName = $saveFileName.'.'.strtolower($ext); // file with extention
-
- $final_img_location = $uploadDirectory . $saveFileName;
-
- if ($this->file->save($final_img_location)){
- $arr = explode("/", $final_img_location);
- return array('success'=>1,'filename'=>$arr[count($arr)-1],'error'=>'');
- } else {
- return array('success'=>0,'error'=> 'Could not save uploaded file.' .
- 'The upload was cancelled, or server error encountered');
- }
-
- }
-}
-//Generate File Name
-$saveFileName = $_POST['file_name'];
-$saveFileName = str_replace("..","",$saveFileName);
-$saveFileName = str_replace("/","",$saveFileName);
-
-if(stristr($saveFileName,".php")){
- $saveFileName = str_replace(".php","",$saveFileName);
-}
-
-if(empty($saveFileName) || $saveFileName == "_NEW_"){
- $saveFileName = microtime();
- $saveFileName = str_replace(".", "-", $saveFileName);
-}
-
-$file = new File();
-$file->Load("name = ?",array($saveFileName));
-
-// list of valid extensions, ex. array("jpeg", "xml", "bmp")
-
-$allowedExtensions = explode(',', "csv,doc,xls,docx,xlsx,txt,ppt,pptx,rtf,pdf,xml,jpg,bmp,gif,png,jpeg");
-// max file size in bytes
-$sizeLimit =MAX_FILE_SIZE_KB * 1024;
-$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
-$result = $uploader->handleUpload(CLIENT_BASE_PATH.'data/',$saveFileName);
-// to pass data through iframe you will need to encode all html tags
-
-$uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
-$uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
-$uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
-$s3Bucket = SettingsManager::getInstance()->getSetting("Files: S3 Bucket");
-$s3WebUrl = SettingsManager::getInstance()->getSetting("Files: S3 Web Url");
-
-$uploadedToS3 = false;
-
-LogManager::getInstance()->info($uploadFilesToS3."|".$uploadFilesToS3Key."|".$uploadFilesToS3Secret."|".$s3Bucket."|".$s3WebUrl."|".CLIENT_NAME);
-
-if($uploadFilesToS3.'' == '1' && !empty($uploadFilesToS3Key) && !empty($uploadFilesToS3Secret) &&
- !empty($s3Bucket) && !empty($s3WebUrl)){
-
- $localFile = CLIENT_BASE_PATH.'data/'.$result['filename'];
-
- $f_size = filesize($localFile);
- $uploadname = CLIENT_NAME."/".$result['filename'];
- LogManager::getInstance()->info("Upload file to s3:".$uploadname);
- LogManager::getInstance()->info("Local file:".$localFile);
- LogManager::getInstance()->info("Local file size:".$f_size);
-
-
- $s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
- $res = $s3FileSys->putObject($s3Bucket, $uploadname, $localFile, 'authenticated-read');
-
- $file_url = $s3WebUrl.$uploadname;
- $file_url = $s3FileSys->generateExpiringURL($file_url);
- LogManager::getInstance()->info("Response from s3 file sys:".print_r($res,true));
- unlink($localFile);
-
- $uploadedToS3 = true;
-}
-
-if($result['success'] == 1){
- $file->name = $saveFileName;
- $file->filename = $result['filename'];
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $file->$signInMappingField = $_POST['user']=="_NONE_"?null:$_POST['user'];
- $file->file_group = $_POST['file_group'];
- $file->Save();
- if($uploadedToS3){
- $result['data'] = $file_url;
- }else{
- $result['data'] = CLIENT_BASE_URL.'data/'.$result['filename'];
- }
- $result['data'] .= "|".$saveFileName;
- $result['data'] .= "|".$file->id;
-}
-
-
-echo "";
-
-
diff --git a/src/fileupload_page.php b/src/fileupload_page.php
deleted file mode 100644
index 546c7c7c..00000000
--- a/src/fileupload_page.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/font/roboto/Roboto-Black-webfont.woff b/src/font/roboto/Roboto-Black-webfont.woff
deleted file mode 100644
index b9731ba7..00000000
Binary files a/src/font/roboto/Roboto-Black-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-BlackItalic-webfont.woff b/src/font/roboto/Roboto-BlackItalic-webfont.woff
deleted file mode 100644
index 54a2a259..00000000
Binary files a/src/font/roboto/Roboto-BlackItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Bold-webfont.woff b/src/font/roboto/Roboto-Bold-webfont.woff
deleted file mode 100644
index 03357ce4..00000000
Binary files a/src/font/roboto/Roboto-Bold-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-BoldCondensed-webfont.woff b/src/font/roboto/Roboto-BoldCondensed-webfont.woff
deleted file mode 100644
index be472c3e..00000000
Binary files a/src/font/roboto/Roboto-BoldCondensed-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-BoldCondensedItalic-webfont.woff b/src/font/roboto/Roboto-BoldCondensedItalic-webfont.woff
deleted file mode 100644
index ef522c8b..00000000
Binary files a/src/font/roboto/Roboto-BoldCondensedItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-BoldItalic-webfont.woff b/src/font/roboto/Roboto-BoldItalic-webfont.woff
deleted file mode 100644
index 78879251..00000000
Binary files a/src/font/roboto/Roboto-BoldItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Condensed-webfont.woff b/src/font/roboto/Roboto-Condensed-webfont.woff
deleted file mode 100644
index 7bee5623..00000000
Binary files a/src/font/roboto/Roboto-Condensed-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-CondensedItalic-webfont.woff b/src/font/roboto/Roboto-CondensedItalic-webfont.woff
deleted file mode 100644
index 0a456352..00000000
Binary files a/src/font/roboto/Roboto-CondensedItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Italic-webfont.woff b/src/font/roboto/Roboto-Italic-webfont.woff
deleted file mode 100644
index 2586e11d..00000000
Binary files a/src/font/roboto/Roboto-Italic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Light-webfont.woff b/src/font/roboto/Roboto-Light-webfont.woff
deleted file mode 100644
index f6abd871..00000000
Binary files a/src/font/roboto/Roboto-Light-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-LightItalic-webfont.woff b/src/font/roboto/Roboto-LightItalic-webfont.woff
deleted file mode 100644
index c9ec37db..00000000
Binary files a/src/font/roboto/Roboto-LightItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Medium-webfont.woff b/src/font/roboto/Roboto-Medium-webfont.woff
deleted file mode 100644
index 15166091..00000000
Binary files a/src/font/roboto/Roboto-Medium-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-MediumItalic-webfont.eot b/src/font/roboto/Roboto-MediumItalic-webfont.eot
deleted file mode 100644
index 9e6f7090..00000000
Binary files a/src/font/roboto/Roboto-MediumItalic-webfont.eot and /dev/null differ
diff --git a/src/font/roboto/Roboto-MediumItalic-webfont.woff b/src/font/roboto/Roboto-MediumItalic-webfont.woff
deleted file mode 100644
index 5ea094a7..00000000
Binary files a/src/font/roboto/Roboto-MediumItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Regular-webfont.woff b/src/font/roboto/Roboto-Regular-webfont.woff
deleted file mode 100644
index 6ff6afd8..00000000
Binary files a/src/font/roboto/Roboto-Regular-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-Thin-webfont.woff b/src/font/roboto/Roboto-Thin-webfont.woff
deleted file mode 100644
index 0b65ccf8..00000000
Binary files a/src/font/roboto/Roboto-Thin-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto-ThinItalic-webfont.woff b/src/font/roboto/Roboto-ThinItalic-webfont.woff
deleted file mode 100644
index 035a8187..00000000
Binary files a/src/font/roboto/Roboto-ThinItalic-webfont.woff and /dev/null differ
diff --git a/src/font/roboto/Roboto.css b/src/font/roboto/Roboto.css
deleted file mode 100644
index cdd4f63d..00000000
--- a/src/font/roboto/Roboto.css
+++ /dev/null
@@ -1,106 +0,0 @@
-@font-face {
- font-family: 'Roboto';
- src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Regular-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto';
- src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Italic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-}
-@font-face {
- font-family: 'Roboto';
- src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Bold-webfont.woff') format('woff');
- font-weight: 700;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto';
- src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldItalic-webfont.woff') format('woff');
- font-weight: 700;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Roboto Condensed';
- src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-Condensed-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto Condensed';
- src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-CondensedItalic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-}
-@font-face {
- font-family: 'Roboto Condensed';
- src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldCondensed-webfont.woff') format('woff');
- font-weight: 700;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto Condensed';
- src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldCondensedItalic-webfont.woff') format('woff');
- font-weight: 700;
- font-style: italic;
-}
-
-@font-face {
- font-family: 'Roboto Thin';
- src: local('Roboto Thin'), url('https://roboto-webfont.googlecode.com/files/Roboto-Thin-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto Thin';
- src: local('Roboto Thin'), url('https://roboto-webfont.googlecode.com/files/Roboto-ThinItalic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-
-}
-
-@font-face {
- font-family: 'Roboto Light';
- src: local('Roboto Light'), url('https://roboto-webfont.googlecode.com/files/Roboto-Light-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-
-}
-@font-face {
- font-family: 'Roboto Light';
- src: local('Roboto Light'), url('https://roboto-webfont.googlecode.com/files/Roboto-LightItalic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-
-}
-
-@font-face {
- font-family: 'Roboto Medium';
- src: local('Roboto Medium'), url('https://roboto-webfont.googlecode.com/files/Roboto-Medium-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-
-}
-@font-face {
- font-family: 'Roboto Medium';
- src: local('Roboto Medium'), url('https://roboto-webfont.googlecode.com/files/Roboto-MediumItalic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-
-}
-
-@font-face {
- font-family: 'Roboto Black';
- src: local('Roboto Black'), url('https://roboto-webfont.googlecode.com/files/Roboto-Black-webfont.woff') format('woff');
- font-weight: 400;
- font-style: normal;
-}
-@font-face {
- font-family: 'Roboto Black';
- src: local('Roboto Black'), url('https://roboto-webfont.googlecode.com/files/Roboto-BlackItalic-webfont.woff') format('woff');
- font-weight: 400;
- font-style: italic;
-}
\ No newline at end of file
diff --git a/src/fonts/FontAwesome.otf b/src/fonts/FontAwesome.otf
deleted file mode 100644
index 81c9ad94..00000000
Binary files a/src/fonts/FontAwesome.otf and /dev/null differ
diff --git a/src/fonts/fontawesome-webfont.eot b/src/fonts/fontawesome-webfont.eot
deleted file mode 100644
index 84677bc0..00000000
Binary files a/src/fonts/fontawesome-webfont.eot and /dev/null differ
diff --git a/src/fonts/fontawesome-webfont.svg b/src/fonts/fontawesome-webfont.svg
deleted file mode 100644
index d907b25a..00000000
--- a/src/fonts/fontawesome-webfont.svg
+++ /dev/null
@@ -1,520 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/fonts/fontawesome-webfont.ttf b/src/fonts/fontawesome-webfont.ttf
deleted file mode 100644
index 96a3639c..00000000
Binary files a/src/fonts/fontawesome-webfont.ttf and /dev/null differ
diff --git a/src/fonts/fontawesome-webfont.woff b/src/fonts/fontawesome-webfont.woff
deleted file mode 100644
index 628b6a52..00000000
Binary files a/src/fonts/fontawesome-webfont.woff and /dev/null differ
diff --git a/src/fonts/glyphicons-halflings-regular.eot b/src/fonts/glyphicons-halflings-regular.eot
deleted file mode 100644
index 423bd5d3..00000000
Binary files a/src/fonts/glyphicons-halflings-regular.eot and /dev/null differ
diff --git a/src/fonts/glyphicons-halflings-regular.svg b/src/fonts/glyphicons-halflings-regular.svg
deleted file mode 100644
index 44694887..00000000
--- a/src/fonts/glyphicons-halflings-regular.svg
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/fonts/glyphicons-halflings-regular.ttf b/src/fonts/glyphicons-halflings-regular.ttf
deleted file mode 100644
index a498ef4e..00000000
Binary files a/src/fonts/glyphicons-halflings-regular.ttf and /dev/null differ
diff --git a/src/fonts/glyphicons-halflings-regular.woff b/src/fonts/glyphicons-halflings-regular.woff
deleted file mode 100644
index d83c539b..00000000
Binary files a/src/fonts/glyphicons-halflings-regular.woff and /dev/null differ
diff --git a/src/fonts/ionicons.eot b/src/fonts/ionicons.eot
deleted file mode 100644
index 20d07a23..00000000
Binary files a/src/fonts/ionicons.eot and /dev/null differ
diff --git a/src/fonts/ionicons.svg b/src/fonts/ionicons.svg
deleted file mode 100644
index e916713e..00000000
--- a/src/fonts/ionicons.svg
+++ /dev/null
@@ -1,1623 +0,0 @@
-
-
-
-
diff --git a/src/fonts/ionicons.ttf b/src/fonts/ionicons.ttf
deleted file mode 100644
index e40d8e0b..00000000
Binary files a/src/fonts/ionicons.ttf and /dev/null differ
diff --git a/src/fonts/ionicons.woff b/src/fonts/ionicons.woff
deleted file mode 100644
index a4f70ef6..00000000
Binary files a/src/fonts/ionicons.woff and /dev/null differ
diff --git a/src/footer.php b/src/footer.php
deleted file mode 100644
index 00d9cf57..00000000
--- a/src/footer.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/header.php b/src/header.php
deleted file mode 100644
index 850f259b..00000000
--- a/src/header.php
+++ /dev/null
@@ -1,330 +0,0 @@
-.
-
-------------------------------------------------------------------
-
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
- */
-
-include 'includes.inc.php';
-if(empty($user)){
- $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
- SessionUtils::saveSessionObject('loginRedirect',$actual_link);
- header("Location:".CLIENT_BASE_URL."login.php");
-}
-
-if(empty($user->default_module)){
- if($user->user_level == "Admin"){
- $homeLink = HOME_LINK_ADMIN;
- }else{
- $homeLink = HOME_LINK_OTHERS;
- }
-}else{
- $defaultModule = new Module();
- $defaultModule->Load("id = ?",array($user->default_module));
- if($defaultModule->mod_group == "user"){
- $defaultModule->mod_group = "modules";
- }
- $homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&n=".$defaultModule->name.
- "&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
-}
-
-
-//Check Module Permissions
-$modulePermissions = BaseService::getInstance()->loadModulePermissions($_REQUEST['g'], $_REQUEST['n'],$user->user_level);
-
-
-if(!in_array($user->user_level, $modulePermissions['user'])){
-
- if(!empty($user->user_roles)){
- $userRoles = json_decode($user->user_roles,true);
- }else{
- $userRoles = array();
- }
- $commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles);
- if(empty($commonRoles)){
- session_start();
- $_SESSION['user'] = null;
- session_destroy();
- session_write_close();
- $user = null;
- header("Location:".CLIENT_BASE_URL."login.php?f=1&fm=You are not allowed to access this module");
- exit();
- }
-
-}
-
-$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
-
-$companyName = SettingsManager::getInstance()->getSetting('Company: Name');
-
-if(empty($companyName) || $companyName == "Sample Company Pvt Ltd"){
- $companyName = APP_NAME;
-}
-
-//Load meta info
-$meta = json_decode(file_get_contents(MODULE_PATH."/meta.json"),true);
-
-include('configureUIManager.php');
-
-?>
-
-
-
- =$companyName?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- =LanguageManager::tran('Home')?>
-
-
-
-
-
-
-
-
-
-
- ';
- var html = html.replace(/_id_/g,id);
- var html = html.replace(/_msg_/g,msg);
- var html = html.replace(/_file_group_/g,group);
- var html = html.replace(/_user_/g,user);
- var html = html.replace(/_file_type_/g,fileType);
-
- modJs.renderModel('upload',"Upload File",html);
- $('#uploadModel').modal('show');
-
-}
-
-function closeUploadDialog(success,error,data){
- var arr = data.split("|");
- var file = arr[0];
- var fileBaseName = arr[1];
- var fileId = arr[2];
-
- if(success == 1){
- //popupUpload.close();
- $('#uploadModel').modal('hide');
- if(uploadResultAttr == "url"){
- if(uploadAttr == "val"){
- $('#'+uploadId).val(file);
- }else if(uploadAttr == "html"){
- $('#'+uploadId).html(file);
- }else{
- $('#'+uploadId).attr(uploadAttr,file);
- }
-
- }else if(uploadResultAttr == "name"){
- if(uploadAttr == "val"){
- $('#'+uploadId).val(fileBaseName);
- }else if(uploadAttr == "html"){
- $('#'+uploadId).html(fileBaseName);
- $('#'+uploadId).attr("val",fileBaseName);
- }else{
- $('#'+uploadId).attr(uploadAttr,fileBaseName);
- }
- $('#'+uploadId).show();
- $('#'+uploadId+"_download").show();
- }else if(uploadResultAttr == "id"){
- if(uploadAttr == "val"){
- $('#'+uploadId).attr(uploadAttr,fileId);
- }else if(uploadAttr == "html"){
- $('#'+uploadId).html(fileBaseName);
- $('#'+uploadId).attr("val",fileId);
- }else{
- $('#'+uploadId).attr(uploadAttr,fileId);
- }
- $('#'+uploadId).show();
- $('#'+uploadId+"_download").show();
- }
-
-
- }else{
- //popupUpload.close();
- $('#uploadModel').modal('hide');
- }
-
-}
-
-function download(name, closeCallback, closeCallbackData){
-
- var successCallback = function(data){
-
- var link;
- var fileParts;
- var viewableImages = ["png","jpg","gif","bmp","jpge"];
-
- if(data['filename'].indexOf("https:") == 0 || data['filename'].indexOf("http:") == 0){
-
- fileParts = data['filename'].split("?");
- fileParts = fileParts[0].split(".");
-
- link = 'Download File ';
- if(jQuery.inArray(fileParts[fileParts.length - 1], viewableImages ) >= 0) {
- link += '
';
- }
- }else{
- fileParts = data['filename'].split(".");
- link = 'Download File ';
- if(jQuery.inArray(fileParts[fileParts.length - 1], viewableImages ) >= 0) {
- link += '
';
- }
- }
-
- modJs.showMessage("Download File Attachment",link,closeCallback,closeCallbackData);
- };
-
- var failCallback = function(data){
- modJs.showMessage("Error Downloading File","File not found");
- };
-
- modJs.sendCustomRequest("file",{'name':name},successCallback,failCallback);
-}
-
-function randomString(length){
- var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
-
- if (! length) {
- length = Math.floor(Math.random() * chars.length);
- }
-
- var str = '';
- for (var i = 0; i < length; i++) {
- str += chars[Math.floor(Math.random() * chars.length)];
- }
- return str;
-}
-
-function verifyInstance(key){
- var object = {};
- object['a'] = "verifyInstance";
- object['key'] = key;
- $.post(this.baseUrl, object, function(data) {
- if(data.status == "SUCCESS"){
- $("#verifyModel").hide();
- $('body').removeClass('modal-open');
- $('.modal-backdrop').remove();
- alert("Success: Instance Verified");
- }else{
- alert("Error: "+data.message);
- }
- },"json");
-}
-
-function nl2br(str, is_xhtml) {
- // discuss at: http://phpjs.org/functions/nl2br/
- // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
- // improved by: Philip Peterson
- // improved by: Onno Marsman
- // improved by: Atli r
- // improved by: Brett Zamir (http://brett-zamir.me)
- // improved by: Maximusya
- // bugfixed by: Onno Marsman
- // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
- // input by: Brett Zamir (http://brett-zamir.me)
- // example 1: nl2br('Kevin\nvan\nZonneveld');
- // returns 1: 'Kevin
\nvan
\nZonneveld'
- // example 2: nl2br("\nOne\nTwo\n\nThree\n", false);
- // returns 2: '
\nOne
\nTwo
\n
\nThree
\n'
- // example 3: nl2br("\nOne\nTwo\n\nThree\n", true);
- // returns 3: '
\nOne
\nTwo
\n
\nThree
\n'
-
- var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '
' : '
'; // Adjust comment to avoid issue on phpjs.org display
-
- return (str + '')
- .replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
-}
diff --git a/src/js/base64.js b/src/js/base64.js
deleted file mode 100644
index 3be84364..00000000
--- a/src/js/base64.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
- *
- * Licensed under the MIT license.
- * http://opensource.org/licenses/mit-license
- *
- * References:
- * http://en.wikipedia.org/wiki/Base64
- */
-
-(function(global) {
- 'use strict';
- // existing version for noConflict()
- var _Base64 = global.Base64;
- var version = "2.1.8";
- // if node.js, we use Buffer
- var buffer;
- if (typeof module !== 'undefined' && module.exports) {
- buffer = require('buffer').Buffer;
- }
- // constants
- var b64chars
- = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- var b64tab = function(bin) {
- var t = {};
- for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
- return t;
- }(b64chars);
- var fromCharCode = String.fromCharCode;
- // encoder stuff
- var cb_utob = function(c) {
- if (c.length < 2) {
- var cc = c.charCodeAt(0);
- return cc < 0x80 ? c
- : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
- + fromCharCode(0x80 | (cc & 0x3f)))
- : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
- + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
- + fromCharCode(0x80 | ( cc & 0x3f)));
- } else {
- var cc = 0x10000
- + (c.charCodeAt(0) - 0xD800) * 0x400
- + (c.charCodeAt(1) - 0xDC00);
- return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
- + fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
- + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
- + fromCharCode(0x80 | ( cc & 0x3f)));
- }
- };
- var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
- var utob = function(u) {
- return u.replace(re_utob, cb_utob);
- };
- var cb_encode = function(ccc) {
- var padlen = [0, 2, 1][ccc.length % 3],
- ord = ccc.charCodeAt(0) << 16
- | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
- | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
- chars = [
- b64chars.charAt( ord >>> 18),
- b64chars.charAt((ord >>> 12) & 63),
- padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
- padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
- ];
- return chars.join('');
- };
- var btoa = global.btoa ? function(b) {
- return global.btoa(b);
- } : function(b) {
- return b.replace(/[\s\S]{1,3}/g, cb_encode);
- };
- var _encode = buffer ? function (u) {
- return (u.constructor === buffer.constructor ? u : new buffer(u))
- .toString('base64')
- }
- : function (u) { return btoa(utob(u)) }
- ;
- var encode = function(u, urisafe) {
- return !urisafe
- ? _encode(String(u))
- : _encode(String(u)).replace(/[+\/]/g, function(m0) {
- return m0 == '+' ? '-' : '_';
- }).replace(/=/g, '');
- };
- var encodeURI = function(u) { return encode(u, true) };
- // decoder stuff
- var re_btou = new RegExp([
- '[\xC0-\xDF][\x80-\xBF]',
- '[\xE0-\xEF][\x80-\xBF]{2}',
- '[\xF0-\xF7][\x80-\xBF]{3}'
- ].join('|'), 'g');
- var cb_btou = function(cccc) {
- switch(cccc.length) {
- case 4:
- var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
- | ((0x3f & cccc.charCodeAt(1)) << 12)
- | ((0x3f & cccc.charCodeAt(2)) << 6)
- | (0x3f & cccc.charCodeAt(3)),
- offset = cp - 0x10000;
- return (fromCharCode((offset >>> 10) + 0xD800)
- + fromCharCode((offset & 0x3FF) + 0xDC00));
- case 3:
- return fromCharCode(
- ((0x0f & cccc.charCodeAt(0)) << 12)
- | ((0x3f & cccc.charCodeAt(1)) << 6)
- | (0x3f & cccc.charCodeAt(2))
- );
- default:
- return fromCharCode(
- ((0x1f & cccc.charCodeAt(0)) << 6)
- | (0x3f & cccc.charCodeAt(1))
- );
- }
- };
- var btou = function(b) {
- return b.replace(re_btou, cb_btou);
- };
- var cb_decode = function(cccc) {
- var len = cccc.length,
- padlen = len % 4,
- n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
- | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
- | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
- | (len > 3 ? b64tab[cccc.charAt(3)] : 0),
- chars = [
- fromCharCode( n >>> 16),
- fromCharCode((n >>> 8) & 0xff),
- fromCharCode( n & 0xff)
- ];
- chars.length -= [0, 0, 2, 1][padlen];
- return chars.join('');
- };
- var atob = global.atob ? function(a) {
- return global.atob(a);
- } : function(a){
- return a.replace(/[\s\S]{1,4}/g, cb_decode);
- };
- var _decode = buffer ? function(a) {
- return (a.constructor === buffer.constructor
- ? a : new buffer(a, 'base64')).toString();
- }
- : function(a) { return btou(atob(a)) };
- var decode = function(a){
- return _decode(
- String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
- .replace(/[^A-Za-z0-9\+\/]/g, '')
- );
- };
- var noConflict = function() {
- var Base64 = global.Base64;
- global.Base64 = _Base64;
- return Base64;
- };
- // export Base64
- global.Base64 = {
- VERSION: version,
- atob: atob,
- btoa: btoa,
- fromBase64: decode,
- toBase64: encode,
- utob: utob,
- encode: encode,
- encodeURI: encodeURI,
- btou: btou,
- decode: decode,
- noConflict: noConflict
- };
- // if ES5 is available, make Base64.extendString() available
- if (typeof Object.defineProperty === 'function') {
- var noEnum = function(v){
- return {value:v,enumerable:false,writable:true,configurable:true};
- };
- global.Base64.extendString = function () {
- Object.defineProperty(
- String.prototype, 'fromBase64', noEnum(function () {
- return decode(this)
- }));
- Object.defineProperty(
- String.prototype, 'toBase64', noEnum(function (urisafe) {
- return encode(this, urisafe)
- }));
- Object.defineProperty(
- String.prototype, 'toBase64URI', noEnum(function () {
- return encode(this, true)
- }));
- };
- }
-})(this);
diff --git a/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.css b/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.css
deleted file mode 100644
index 80175eaf..00000000
--- a/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.css
+++ /dev/null
@@ -1,227 +0,0 @@
-/*!
- * Bootstrap Colorpicker
- * http://mjolnic.github.io/bootstrap-colorpicker/
- *
- * Originally written by (c) 2012 Stefan Petre
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0.txt
- *
- */
-
-.colorpicker-saturation {
- float: left;
- width: 100px;
- height: 100px;
- cursor: crosshair;
- background-image: url("../img/bootstrap-colorpicker/saturation.png");
-}
-
-.colorpicker-saturation i {
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 5px;
- height: 5px;
- margin: -4px 0 0 -4px;
- border: 1px solid #000;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.colorpicker-saturation i b {
- display: block;
- width: 5px;
- height: 5px;
- border: 1px solid #fff;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.colorpicker-hue,
-.colorpicker-alpha {
- float: left;
- width: 15px;
- height: 100px;
- margin-bottom: 4px;
- margin-left: 4px;
- cursor: row-resize;
-}
-
-.colorpicker-hue i,
-.colorpicker-alpha i {
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 100%;
- height: 1px;
- margin-top: -1px;
- background: #000;
- border-top: 1px solid #fff;
-}
-
-.colorpicker-hue {
- background-image: url("../img/bootstrap-colorpicker/hue.png");
-}
-
-.colorpicker-alpha {
- display: none;
- background-image: url("../img/bootstrap-colorpicker/alpha.png");
-}
-
-.colorpicker {
- top: 0;
- left: 0;
- z-index: 2500;
- min-width: 130px;
- padding: 4px;
- margin-top: 1px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- *zoom: 1;
-}
-
-.colorpicker:before,
-.colorpicker:after {
- display: table;
- line-height: 0;
- content: "";
-}
-
-.colorpicker:after {
- clear: both;
-}
-
-.colorpicker:before {
- position: absolute;
- top: -7px;
- left: 6px;
- display: inline-block;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-left: 7px solid transparent;
- border-bottom-color: rgba(0, 0, 0, 0.2);
- content: '';
-}
-
-.colorpicker:after {
- position: absolute;
- top: -6px;
- left: 7px;
- display: inline-block;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #ffffff;
- border-left: 6px solid transparent;
- content: '';
-}
-
-.colorpicker div {
- position: relative;
-}
-
-.colorpicker.colorpicker-with-alpha {
- min-width: 140px;
-}
-
-.colorpicker.colorpicker-with-alpha .colorpicker-alpha {
- display: block;
-}
-
-.colorpicker-color {
- height: 10px;
- margin-top: 5px;
- clear: both;
- background-image: url("../img/bootstrap-colorpicker/alpha.png");
- background-position: 0 100%;
-}
-
-.colorpicker-color div {
- height: 10px;
-}
-
-.colorpicker-element .input-group-addon i,
-.colorpicker-element .add-on i {
- display: inline-block;
- width: 16px;
- height: 16px;
- vertical-align: text-top;
- cursor: pointer;
-}
-
-.colorpicker.colorpicker-inline {
- position: relative;
- z-index: auto;
- display: inline-block;
- float: none;
-}
-
-.colorpicker.colorpicker-horizontal {
- width: 110px;
- height: auto;
- min-width: 110px;
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-saturation {
- margin-bottom: 4px;
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-color {
- width: 100px;
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-hue,
-.colorpicker.colorpicker-horizontal .colorpicker-alpha {
- float: left;
- width: 100px;
- height: 15px;
- margin-bottom: 4px;
- margin-left: 0;
- cursor: col-resize;
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-hue i,
-.colorpicker.colorpicker-horizontal .colorpicker-alpha i {
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 1px;
- height: 15px;
- margin-top: 0;
- background: #ffffff;
- border: none;
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-hue {
- background-image: url("../img/bootstrap-colorpicker/hue-horizontal.png");
-}
-
-.colorpicker.colorpicker-horizontal .colorpicker-alpha {
- background-image: url("../img/bootstrap-colorpicker/alpha-horizontal.png");
-}
-
-.colorpicker.colorpicker-hidden {
- display: none;
-}
-
-.colorpicker.colorpicker-visible {
- display: block;
-}
-
-.colorpicker-inline.colorpicker-visible {
- display: inline-block;
-}
-
-.colorpicker-right:before {
- right: 6px;
- left: auto;
-}
-
-.colorpicker-right:after {
- right: 7px;
- left: auto;
-}
\ No newline at end of file
diff --git a/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.min.css b/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.min.css
deleted file mode 100644
index 75a01669..00000000
--- a/src/js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.min.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Bootstrap Colorpicker
- * http://mjolnic.github.io/bootstrap-colorpicker/
- *
- * Originally written by (c) 2012 Stefan Petre
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0.txt
- *
- */.colorpicker-saturation{float:left;width:100px;height:100px;cursor:crosshair;background-image:url("../img/bootstrap-colorpicker/saturation.png")}.colorpicker-saturation i{position:absolute;top:0;left:0;display:block;width:5px;height:5px;margin:-4px 0 0 -4px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-saturation i b{display:block;width:5px;height:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-hue,.colorpicker-alpha{float:left;width:15px;height:100px;margin-bottom:4px;margin-left:4px;cursor:row-resize}.colorpicker-hue i,.colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:100%;height:1px;margin-top:-1px;background:#000;border-top:1px solid #fff}.colorpicker-hue{background-image:url("../img/bootstrap-colorpicker/hue.png")}.colorpicker-alpha{display:none;background-image:url("../img/bootstrap-colorpicker/alpha.png")}.colorpicker{top:0;left:0;z-index:2500;min-width:130px;padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1}.colorpicker:before,.colorpicker:after{display:table;line-height:0;content:""}.colorpicker:after{clear:both}.colorpicker:before{position:absolute;top:-7px;left:6px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.colorpicker:after{position:absolute;top:-6px;left:7px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:url("../img/bootstrap-colorpicker/alpha.png");background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-element .input-group-addon i,.colorpicker-element .add-on i{display:inline-block;width:16px;height:16px;vertical-align:text-top;cursor:pointer}.colorpicker.colorpicker-inline{position:relative;z-index:auto;display:inline-block;float:none}.colorpicker.colorpicker-horizontal{width:110px;height:auto;min-width:110px}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-hue,.colorpicker.colorpicker-horizontal .colorpicker-alpha{float:left;width:100px;height:15px;margin-bottom:4px;margin-left:0;cursor:col-resize}.colorpicker.colorpicker-horizontal .colorpicker-hue i,.colorpicker.colorpicker-horizontal .colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:1px;height:15px;margin-top:0;background:#fff;border:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url("../img/bootstrap-colorpicker/hue-horizontal.png")}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url("../img/bootstrap-colorpicker/alpha-horizontal.png")}.colorpicker.colorpicker-hidden{display:none}.colorpicker.colorpicker-visible{display:block}.colorpicker-inline.colorpicker-visible{display:inline-block}.colorpicker-right:before{right:6px;left:auto}.colorpicker-right:after{right:7px;left:auto}
\ No newline at end of file
diff --git a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha-horizontal.png b/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha-horizontal.png
deleted file mode 100644
index d0a65c08..00000000
Binary files a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha-horizontal.png and /dev/null differ
diff --git a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha.png b/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha.png
deleted file mode 100644
index 38043f1c..00000000
Binary files a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/alpha.png and /dev/null differ
diff --git a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue-horizontal.png b/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue-horizontal.png
deleted file mode 100644
index a0d9add8..00000000
Binary files a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue-horizontal.png and /dev/null differ
diff --git a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue.png b/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue.png
deleted file mode 100644
index d89560e9..00000000
Binary files a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/hue.png and /dev/null differ
diff --git a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/saturation.png b/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/saturation.png
deleted file mode 100644
index 594ae50e..00000000
Binary files a/src/js/bootstrap-colorpicker-2.1.1/img/bootstrap-colorpicker/saturation.png and /dev/null differ
diff --git a/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.js b/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.js
deleted file mode 100644
index 1f231c31..00000000
--- a/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.js
+++ /dev/null
@@ -1,1025 +0,0 @@
-/*!
- * Bootstrap Colorpicker
- * http://mjolnic.github.io/bootstrap-colorpicker/
- *
- * Originally written by (c) 2012 Stefan Petre
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0.txt
- *
- * @todo Update DOCS
- */
-
-(function(factory) {
- "use strict";
- if (typeof define === 'function' && define.amd) {
- define(['jquery'], factory);
- } else if (window.jQuery && !window.jQuery.fn.colorpicker) {
- factory(window.jQuery);
- }
- }
- (function($) {
- 'use strict';
-
- // Color object
- var Color = function(val) {
- this.value = {
- h: 0,
- s: 0,
- b: 0,
- a: 1
- };
- this.origFormat = null; // original string format
- if (val) {
- if (val.toLowerCase !== undefined) {
- // cast to string
- val = val + '';
- this.setColor(val);
- } else if (val.h !== undefined) {
- this.value = val;
- }
- }
- };
-
- Color.prototype = {
- constructor: Color,
- // 140 predefined colors from the HTML Colors spec
- colors: {
- "aliceblue": "#f0f8ff",
- "antiquewhite": "#faebd7",
- "aqua": "#00ffff",
- "aquamarine": "#7fffd4",
- "azure": "#f0ffff",
- "beige": "#f5f5dc",
- "bisque": "#ffe4c4",
- "black": "#000000",
- "blanchedalmond": "#ffebcd",
- "blue": "#0000ff",
- "blueviolet": "#8a2be2",
- "brown": "#a52a2a",
- "burlywood": "#deb887",
- "cadetblue": "#5f9ea0",
- "chartreuse": "#7fff00",
- "chocolate": "#d2691e",
- "coral": "#ff7f50",
- "cornflowerblue": "#6495ed",
- "cornsilk": "#fff8dc",
- "crimson": "#dc143c",
- "cyan": "#00ffff",
- "darkblue": "#00008b",
- "darkcyan": "#008b8b",
- "darkgoldenrod": "#b8860b",
- "darkgray": "#a9a9a9",
- "darkgreen": "#006400",
- "darkkhaki": "#bdb76b",
- "darkmagenta": "#8b008b",
- "darkolivegreen": "#556b2f",
- "darkorange": "#ff8c00",
- "darkorchid": "#9932cc",
- "darkred": "#8b0000",
- "darksalmon": "#e9967a",
- "darkseagreen": "#8fbc8f",
- "darkslateblue": "#483d8b",
- "darkslategray": "#2f4f4f",
- "darkturquoise": "#00ced1",
- "darkviolet": "#9400d3",
- "deeppink": "#ff1493",
- "deepskyblue": "#00bfff",
- "dimgray": "#696969",
- "dodgerblue": "#1e90ff",
- "firebrick": "#b22222",
- "floralwhite": "#fffaf0",
- "forestgreen": "#228b22",
- "fuchsia": "#ff00ff",
- "gainsboro": "#dcdcdc",
- "ghostwhite": "#f8f8ff",
- "gold": "#ffd700",
- "goldenrod": "#daa520",
- "gray": "#808080",
- "green": "#008000",
- "greenyellow": "#adff2f",
- "honeydew": "#f0fff0",
- "hotpink": "#ff69b4",
- "indianred ": "#cd5c5c",
- "indigo ": "#4b0082",
- "ivory": "#fffff0",
- "khaki": "#f0e68c",
- "lavender": "#e6e6fa",
- "lavenderblush": "#fff0f5",
- "lawngreen": "#7cfc00",
- "lemonchiffon": "#fffacd",
- "lightblue": "#add8e6",
- "lightcoral": "#f08080",
- "lightcyan": "#e0ffff",
- "lightgoldenrodyellow": "#fafad2",
- "lightgrey": "#d3d3d3",
- "lightgreen": "#90ee90",
- "lightpink": "#ffb6c1",
- "lightsalmon": "#ffa07a",
- "lightseagreen": "#20b2aa",
- "lightskyblue": "#87cefa",
- "lightslategray": "#778899",
- "lightsteelblue": "#b0c4de",
- "lightyellow": "#ffffe0",
- "lime": "#00ff00",
- "limegreen": "#32cd32",
- "linen": "#faf0e6",
- "magenta": "#ff00ff",
- "maroon": "#800000",
- "mediumaquamarine": "#66cdaa",
- "mediumblue": "#0000cd",
- "mediumorchid": "#ba55d3",
- "mediumpurple": "#9370d8",
- "mediumseagreen": "#3cb371",
- "mediumslateblue": "#7b68ee",
- "mediumspringgreen": "#00fa9a",
- "mediumturquoise": "#48d1cc",
- "mediumvioletred": "#c71585",
- "midnightblue": "#191970",
- "mintcream": "#f5fffa",
- "mistyrose": "#ffe4e1",
- "moccasin": "#ffe4b5",
- "navajowhite": "#ffdead",
- "navy": "#000080",
- "oldlace": "#fdf5e6",
- "olive": "#808000",
- "olivedrab": "#6b8e23",
- "orange": "#ffa500",
- "orangered": "#ff4500",
- "orchid": "#da70d6",
- "palegoldenrod": "#eee8aa",
- "palegreen": "#98fb98",
- "paleturquoise": "#afeeee",
- "palevioletred": "#d87093",
- "papayawhip": "#ffefd5",
- "peachpuff": "#ffdab9",
- "peru": "#cd853f",
- "pink": "#ffc0cb",
- "plum": "#dda0dd",
- "powderblue": "#b0e0e6",
- "purple": "#800080",
- "red": "#ff0000",
- "rosybrown": "#bc8f8f",
- "royalblue": "#4169e1",
- "saddlebrown": "#8b4513",
- "salmon": "#fa8072",
- "sandybrown": "#f4a460",
- "seagreen": "#2e8b57",
- "seashell": "#fff5ee",
- "sienna": "#a0522d",
- "silver": "#c0c0c0",
- "skyblue": "#87ceeb",
- "slateblue": "#6a5acd",
- "slategray": "#708090",
- "snow": "#fffafa",
- "springgreen": "#00ff7f",
- "steelblue": "#4682b4",
- "tan": "#d2b48c",
- "teal": "#008080",
- "thistle": "#d8bfd8",
- "tomato": "#ff6347",
- "turquoise": "#40e0d0",
- "violet": "#ee82ee",
- "wheat": "#f5deb3",
- "white": "#ffffff",
- "whitesmoke": "#f5f5f5",
- "yellow": "#ffff00",
- "yellowgreen": "#9acd32",
- "transparent": "transparent"
- },
- _sanitizeNumber: function(val) {
- if (typeof val === 'number') {
- return val;
- }
- if (isNaN(val) || (val === null) || (val === '') || (val === undefined)) {
- return 1;
- }
- if (val.toLowerCase !== undefined) {
- return parseFloat(val);
- }
- return 1;
- },
- isTransparent: function(strVal) {
- if (!strVal) {
- return false;
- }
- strVal = strVal.toLowerCase().trim();
- return (strVal == 'transparent') || (strVal.match(/#?00000000/)) || (strVal.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/));
- },
- rgbaIsTransparent: function(rgba) {
- return ((rgba.r == 0) && (rgba.g == 0) && (rgba.b == 0) && (rgba.a == 0));
- },
- //parse a string to HSB
- setColor: function(strVal) {
- strVal = strVal.toLowerCase().trim();
- if (strVal) {
- if (this.isTransparent(strVal)) {
- this.value = {
- h: 0,
- s: 0,
- b: 0,
- a: 0
- }
- } else {
- this.value = this.stringToHSB(strVal) || {
- h: 0,
- s: 0,
- b: 0,
- a: 1
- }; // if parser fails, defaults to black
- }
- }
- },
- stringToHSB: function(strVal) {
- strVal = strVal.toLowerCase();
- var that = this,
- result = false;
- $.each(this.stringParsers, function(i, parser) {
- var match = parser.re.exec(strVal),
- values = match && parser.parse.apply(that, [match]),
- format = parser.format || 'rgba';
- if (values) {
- if (format.match(/hsla?/)) {
- result = that.RGBtoHSB.apply(that, that.HSLtoRGB.apply(that, values));
- } else {
- result = that.RGBtoHSB.apply(that, values);
- }
- that.origFormat = format;
- return false;
- }
- return true;
- });
- return result;
- },
- setHue: function(h) {
- this.value.h = 1 - h;
- },
- setSaturation: function(s) {
- this.value.s = s;
- },
- setBrightness: function(b) {
- this.value.b = 1 - b;
- },
- setAlpha: function(a) {
- this.value.a = parseInt((1 - a) * 100, 10) / 100;
- },
- toRGB: function(h, s, b, a) {
- if (!h) {
- h = this.value.h;
- s = this.value.s;
- b = this.value.b;
- }
- h *= 360;
- var R, G, B, X, C;
- h = (h % 360) / 60;
- C = b * s;
- X = C * (1 - Math.abs(h % 2 - 1));
- R = G = B = b - C;
-
- h = ~~h;
- R += [C, X, 0, 0, X, C][h];
- G += [X, C, C, X, 0, 0][h];
- B += [0, 0, X, C, C, X][h];
- return {
- r: Math.round(R * 255),
- g: Math.round(G * 255),
- b: Math.round(B * 255),
- a: a || this.value.a
- };
- },
- toHex: function(h, s, b, a) {
- var rgb = this.toRGB(h, s, b, a);
- if (this.rgbaIsTransparent(rgb)) {
- return 'transparent';
- }
- return '#' + ((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1);
- },
- toHSL: function(h, s, b, a) {
- h = h || this.value.h;
- s = s || this.value.s;
- b = b || this.value.b;
- a = a || this.value.a;
-
- var H = h,
- L = (2 - s) * b,
- S = s * b;
- if (L > 0 && L <= 1) {
- S /= L;
- } else {
- S /= 2 - L;
- }
- L /= 2;
- if (S > 1) {
- S = 1;
- }
- return {
- h: isNaN(H) ? 0 : H,
- s: isNaN(S) ? 0 : S,
- l: isNaN(L) ? 0 : L,
- a: isNaN(a) ? 0 : a
- };
- },
- toAlias: function(r, g, b, a) {
- var rgb = this.toHex(r, g, b, a);
- for (var alias in this.colors) {
- if (this.colors[alias] == rgb) {
- return alias;
- }
- }
- return false;
- },
- RGBtoHSB: function(r, g, b, a) {
- r /= 255;
- g /= 255;
- b /= 255;
-
- var H, S, V, C;
- V = Math.max(r, g, b);
- C = V - Math.min(r, g, b);
- H = (C === 0 ? null :
- V === r ? (g - b) / C :
- V === g ? (b - r) / C + 2 :
- (r - g) / C + 4
- );
- H = ((H + 360) % 6) * 60 / 360;
- S = C === 0 ? 0 : C / V;
- return {
- h: this._sanitizeNumber(H),
- s: S,
- b: V,
- a: this._sanitizeNumber(a)
- };
- },
- HueToRGB: function(p, q, h) {
- if (h < 0) {
- h += 1;
- } else if (h > 1) {
- h -= 1;
- }
- if ((h * 6) < 1) {
- return p + (q - p) * h * 6;
- } else if ((h * 2) < 1) {
- return q;
- } else if ((h * 3) < 2) {
- return p + (q - p) * ((2 / 3) - h) * 6;
- } else {
- return p;
- }
- },
- HSLtoRGB: function(h, s, l, a) {
- if (s < 0) {
- s = 0;
- }
- var q;
- if (l <= 0.5) {
- q = l * (1 + s);
- } else {
- q = l + s - (l * s);
- }
-
- var p = 2 * l - q;
-
- var tr = h + (1 / 3);
- var tg = h;
- var tb = h - (1 / 3);
-
- var r = Math.round(this.HueToRGB(p, q, tr) * 255);
- var g = Math.round(this.HueToRGB(p, q, tg) * 255);
- var b = Math.round(this.HueToRGB(p, q, tb) * 255);
- return [r, g, b, this._sanitizeNumber(a)];
- },
- toString: function(format) {
- format = format || 'rgba';
- switch (format) {
- case 'rgb':
- {
- var rgb = this.toRGB();
- if (this.rgbaIsTransparent(rgb)) {
- return 'transparent';
- }
- return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
- }
- break;
- case 'rgba':
- {
- var rgb = this.toRGB();
- return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')';
- }
- break;
- case 'hsl':
- {
- var hsl = this.toHSL();
- return 'hsl(' + Math.round(hsl.h * 360) + ',' + Math.round(hsl.s * 100) + '%,' + Math.round(hsl.l * 100) + '%)';
- }
- break;
- case 'hsla':
- {
- var hsl = this.toHSL();
- return 'hsla(' + Math.round(hsl.h * 360) + ',' + Math.round(hsl.s * 100) + '%,' + Math.round(hsl.l * 100) + '%,' + hsl.a + ')';
- }
- break;
- case 'hex':
- {
- return this.toHex();
- }
- break;
- case 'alias':
- return this.toAlias() || this.toHex();
- default:
- {
- return false;
- }
- break;
- }
- },
- // a set of RE's that can match strings and generate color tuples.
- // from John Resig color plugin
- // https://github.com/jquery/jquery-color/
- stringParsers: [{
- re: /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,
- format: 'rgb',
- parse: function(execResult) {
- return [
- execResult[1],
- execResult[2],
- execResult[3],
- 1
- ];
- }
- }, {
- re: /rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,
- format: 'rgb',
- parse: function(execResult) {
- return [
- 2.55 * execResult[1],
- 2.55 * execResult[2],
- 2.55 * execResult[3],
- 1
- ];
- }
- }, {
- re: /rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
- format: 'rgba',
- parse: function(execResult) {
- return [
- execResult[1],
- execResult[2],
- execResult[3],
- execResult[4]
- ];
- }
- }, {
- re: /rgba\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
- format: 'rgba',
- parse: function(execResult) {
- return [
- 2.55 * execResult[1],
- 2.55 * execResult[2],
- 2.55 * execResult[3],
- execResult[4]
- ];
- }
- }, {
- re: /hsl\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,
- format: 'hsl',
- parse: function(execResult) {
- return [
- execResult[1] / 360,
- execResult[2] / 100,
- execResult[3] / 100,
- execResult[4]
- ];
- }
- }, {
- re: /hsla\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
- format: 'hsla',
- parse: function(execResult) {
- return [
- execResult[1] / 360,
- execResult[2] / 100,
- execResult[3] / 100,
- execResult[4]
- ];
- }
- }, {
- re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
- format: 'hex',
- parse: function(execResult) {
- return [
- parseInt(execResult[1], 16),
- parseInt(execResult[2], 16),
- parseInt(execResult[3], 16),
- 1
- ];
- }
- }, {
- re: /#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
- format: 'hex',
- parse: function(execResult) {
- return [
- parseInt(execResult[1] + execResult[1], 16),
- parseInt(execResult[2] + execResult[2], 16),
- parseInt(execResult[3] + execResult[3], 16),
- 1
- ];
- }
- }, {
- //predefined color name
- re: /^([a-z]{3,})$/,
- format: 'alias',
- parse: function(execResult) {
- var hexval = this.colorNameToHex(execResult[0]) || '#000000';
- var match = this.stringParsers[6].re.exec(hexval),
- values = match && this.stringParsers[6].parse.apply(this, [match]);
- return values;
- }
- }],
- colorNameToHex: function(name) {
- if (typeof this.colors[name.toLowerCase()] !== 'undefined') {
- return this.colors[name.toLowerCase()];
- }
- return false;
- }
- };
-
-
- var defaults = {
- horizontal: false, // horizontal mode layout ?
- inline: false, //forces to show the colorpicker as an inline element
- color: false, //forces a color
- format: false, //forces a format
- input: 'input', // children input selector
- container: false, // container selector
- component: '.add-on, .input-group-addon', // children component selector
- sliders: {
- saturation: {
- maxLeft: 100,
- maxTop: 100,
- callLeft: 'setSaturation',
- callTop: 'setBrightness'
- },
- hue: {
- maxLeft: 0,
- maxTop: 100,
- callLeft: false,
- callTop: 'setHue'
- },
- alpha: {
- maxLeft: 0,
- maxTop: 100,
- callLeft: false,
- callTop: 'setAlpha'
- }
- },
- slidersHorz: {
- saturation: {
- maxLeft: 100,
- maxTop: 100,
- callLeft: 'setSaturation',
- callTop: 'setBrightness'
- },
- hue: {
- maxLeft: 100,
- maxTop: 0,
- callLeft: 'setHue',
- callTop: false
- },
- alpha: {
- maxLeft: 100,
- maxTop: 0,
- callLeft: 'setAlpha',
- callTop: false
- }
- },
- template: ''
- };
-
- var Colorpicker = function(element, options) {
- this.element = $(element).addClass('colorpicker-element');
- this.options = $.extend({}, defaults, this.element.data(), options);
- this.component = this.options.component;
- this.component = (this.component !== false) ? this.element.find(this.component) : false;
- if (this.component && (this.component.length === 0)) {
- this.component = false;
- }
- this.container = (this.options.container === true) ? this.element : this.options.container;
- this.container = (this.container !== false) ? $(this.container) : false;
-
- // Is the element an input? Should we search inside for any input?
- this.input = this.element.is('input') ? this.element : (this.options.input ?
- this.element.find(this.options.input) : false);
- if (this.input && (this.input.length === 0)) {
- this.input = false;
- }
- // Set HSB color
- this.color = new Color(this.options.color !== false ? this.options.color : this.getValue());
- this.format = this.options.format !== false ? this.options.format : this.color.origFormat;
-
- // Setup picker
- this.picker = $(this.options.template);
- if (this.options.inline) {
- this.picker.addClass('colorpicker-inline colorpicker-visible');
- } else {
- this.picker.addClass('colorpicker-hidden');
- }
- if (this.options.horizontal) {
- this.picker.addClass('colorpicker-horizontal');
- }
- if (this.format === 'rgba' || this.format === 'hsla') {
- this.picker.addClass('colorpicker-with-alpha');
- }
- if (this.options.align === 'right') {
- this.picker.addClass('colorpicker-right');
- }
- this.picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));
- this.picker.appendTo(this.container ? this.container : $('body'));
-
- // Bind events
- if (this.input !== false) {
- this.input.on({
- 'keyup.colorpicker': $.proxy(this.keyup, this)
- });
- if (this.component === false) {
- this.element.on({
- 'focus.colorpicker': $.proxy(this.show, this)
- });
- }
- if (this.options.inline === false) {
- this.element.on({
- 'focusout.colorpicker': $.proxy(this.hide, this)
- });
- }
- }
-
- if (this.component !== false) {
- this.component.on({
- 'click.colorpicker': $.proxy(this.show, this)
- });
- }
-
- if ((this.input === false) && (this.component === false)) {
- this.element.on({
- 'click.colorpicker': $.proxy(this.show, this)
- });
- }
-
- // for HTML5 input[type='color']
- if ((this.input !== false) && (this.component !== false) && (this.input.attr('type') === 'color')) {
-
- this.input.on({
- 'click.colorpicker': $.proxy(this.show, this),
- 'focus.colorpicker': $.proxy(this.show, this)
- });
- }
- this.update();
-
- $($.proxy(function() {
- this.element.trigger('create');
- }, this));
- };
-
- Colorpicker.Color = Color;
-
- Colorpicker.prototype = {
- constructor: Colorpicker,
- destroy: function() {
- this.picker.remove();
- this.element.removeData('colorpicker').off('.colorpicker');
- if (this.input !== false) {
- this.input.off('.colorpicker');
- }
- if (this.component !== false) {
- this.component.off('.colorpicker');
- }
- this.element.removeClass('colorpicker-element');
- this.element.trigger({
- type: 'destroy'
- });
- },
- reposition: function() {
- if (this.options.inline !== false || this.options.container) {
- return false;
- }
- var type = this.container && this.container[0] !== document.body ? 'position' : 'offset';
- var element = this.component || this.element;
- var offset = element[type]();
- if (this.options.align === 'right') {
- offset.left -= this.picker.outerWidth() - element.outerWidth()
- }
- this.picker.css({
- top: offset.top + element.outerHeight(),
- left: offset.left
- });
- },
- show: function(e) {
- if (this.isDisabled()) {
- return false;
- }
- this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');
- this.reposition();
- $(window).on('resize.colorpicker', $.proxy(this.reposition, this));
- if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {
- if (e.stopPropagation && e.preventDefault) {
- e.stopPropagation();
- e.preventDefault();
- }
- }
- if (this.options.inline === false) {
- $(window.document).on({
- 'mousedown.colorpicker': $.proxy(this.hide, this)
- });
- }
- this.element.trigger({
- type: 'showPicker',
- color: this.color
- });
- },
- hide: function() {
- this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');
- $(window).off('resize.colorpicker', this.reposition);
- $(document).off({
- 'mousedown.colorpicker': this.hide
- });
- this.update();
- this.element.trigger({
- type: 'hidePicker',
- color: this.color
- });
- },
- updateData: function(val) {
- val = val || this.color.toString(this.format);
- this.element.data('color', val);
- return val;
- },
- updateInput: function(val) {
- val = val || this.color.toString(this.format);
- if (this.input !== false) {
- this.input.prop('value', val);
- }
- return val;
- },
- updatePicker: function(val) {
- if (val !== undefined) {
- this.color = new Color(val);
- }
- var sl = (this.options.horizontal === false) ? this.options.sliders : this.options.slidersHorz;
- var icns = this.picker.find('i');
- if (icns.length === 0) {
- return;
- }
- if (this.options.horizontal === false) {
- sl = this.options.sliders;
- icns.eq(1).css('top', sl.hue.maxTop * (1 - this.color.value.h)).end()
- .eq(2).css('top', sl.alpha.maxTop * (1 - this.color.value.a));
- } else {
- sl = this.options.slidersHorz;
- icns.eq(1).css('left', sl.hue.maxLeft * (1 - this.color.value.h)).end()
- .eq(2).css('left', sl.alpha.maxLeft * (1 - this.color.value.a));
- }
- icns.eq(0).css({
- 'top': sl.saturation.maxTop - this.color.value.b * sl.saturation.maxTop,
- 'left': this.color.value.s * sl.saturation.maxLeft
- });
- this.picker.find('.colorpicker-saturation').css('backgroundColor', this.color.toHex(this.color.value.h, 1, 1, 1));
- this.picker.find('.colorpicker-alpha').css('backgroundColor', this.color.toHex());
- this.picker.find('.colorpicker-color, .colorpicker-color div').css('backgroundColor', this.color.toString(this.format));
- return val;
- },
- updateComponent: function(val) {
- val = val || this.color.toString(this.format);
- if (this.component !== false) {
- var icn = this.component.find('i').eq(0);
- if (icn.length > 0) {
- icn.css({
- 'backgroundColor': val
- });
- } else {
- this.component.css({
- 'backgroundColor': val
- });
- }
- }
- return val;
- },
- update: function(force) {
- var val;
- if ((this.getValue(false) !== false) || (force === true)) {
- // Update input/data only if the current value is not empty
- val = this.updateComponent();
- this.updateInput(val);
- this.updateData(val);
- this.updatePicker(); // only update picker if value is not empty
- }
- return val;
-
- },
- setValue: function(val) { // set color manually
- this.color = new Color(val);
- this.update();
- this.element.trigger({
- type: 'changeColor',
- color: this.color,
- value: val
- });
- },
- getValue: function(defaultValue) {
- defaultValue = (defaultValue === undefined) ? '#000000' : defaultValue;
- var val;
- if (this.hasInput()) {
- val = this.input.val();
- } else {
- val = this.element.data('color');
- }
- if ((val === undefined) || (val === '') || (val === null)) {
- // if not defined or empty, return default
- val = defaultValue;
- }
- return val;
- },
- hasInput: function() {
- return (this.input !== false);
- },
- isDisabled: function() {
- if (this.hasInput()) {
- return (this.input.prop('disabled') === true);
- }
- return false;
- },
- disable: function() {
- if (this.hasInput()) {
- this.input.prop('disabled', true);
- this.element.trigger({
- type: 'disable',
- color: this.color,
- value: this.getValue()
- });
- return true;
- }
- return false;
- },
- enable: function() {
- if (this.hasInput()) {
- this.input.prop('disabled', false);
- this.element.trigger({
- type: 'enable',
- color: this.color,
- value: this.getValue()
- });
- return true;
- }
- return false;
- },
- currentSlider: null,
- mousePointer: {
- left: 0,
- top: 0
- },
- mousedown: function(e) {
- if (!e.pageX && !e.pageY && e.originalEvent) {
- e.pageX = e.originalEvent.touches[0].pageX;
- e.pageY = e.originalEvent.touches[0].pageY;
- }
- e.stopPropagation();
- e.preventDefault();
-
- var target = $(e.target);
-
- //detect the slider and set the limits and callbacks
- var zone = target.closest('div');
- var sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;
- if (!zone.is('.colorpicker')) {
- if (zone.is('.colorpicker-saturation')) {
- this.currentSlider = $.extend({}, sl.saturation);
- } else if (zone.is('.colorpicker-hue')) {
- this.currentSlider = $.extend({}, sl.hue);
- } else if (zone.is('.colorpicker-alpha')) {
- this.currentSlider = $.extend({}, sl.alpha);
- } else {
- return false;
- }
- var offset = zone.offset();
- //reference to guide's style
- this.currentSlider.guide = zone.find('i')[0].style;
- this.currentSlider.left = e.pageX - offset.left;
- this.currentSlider.top = e.pageY - offset.top;
- this.mousePointer = {
- left: e.pageX,
- top: e.pageY
- };
- //trigger mousemove to move the guide to the current position
- $(document).on({
- 'mousemove.colorpicker': $.proxy(this.mousemove, this),
- 'touchmove.colorpicker': $.proxy(this.mousemove, this),
- 'mouseup.colorpicker': $.proxy(this.mouseup, this),
- 'touchend.colorpicker': $.proxy(this.mouseup, this)
- }).trigger('mousemove');
- }
- return false;
- },
- mousemove: function(e) {
- if (!e.pageX && !e.pageY && e.originalEvent) {
- e.pageX = e.originalEvent.touches[0].pageX;
- e.pageY = e.originalEvent.touches[0].pageY;
- }
- e.stopPropagation();
- e.preventDefault();
- var left = Math.max(
- 0,
- Math.min(
- this.currentSlider.maxLeft,
- this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)
- )
- );
- var top = Math.max(
- 0,
- Math.min(
- this.currentSlider.maxTop,
- this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)
- )
- );
- this.currentSlider.guide.left = left + 'px';
- this.currentSlider.guide.top = top + 'px';
- if (this.currentSlider.callLeft) {
- this.color[this.currentSlider.callLeft].call(this.color, left / this.currentSlider.maxLeft);
- }
- if (this.currentSlider.callTop) {
- this.color[this.currentSlider.callTop].call(this.color, top / this.currentSlider.maxTop);
- }
- this.update(true);
-
- this.element.trigger({
- type: 'changeColor',
- color: this.color
- });
- return false;
- },
- mouseup: function(e) {
- e.stopPropagation();
- e.preventDefault();
- $(document).off({
- 'mousemove.colorpicker': this.mousemove,
- 'touchmove.colorpicker': this.mousemove,
- 'mouseup.colorpicker': this.mouseup,
- 'touchend.colorpicker': this.mouseup
- });
- return false;
- },
- keyup: function(e) {
- if ((e.keyCode === 38)) {
- if (this.color.value.a < 1) {
- this.color.value.a = Math.round((this.color.value.a + 0.01) * 100) / 100;
- }
- this.update(true);
- } else if ((e.keyCode === 40)) {
- if (this.color.value.a > 0) {
- this.color.value.a = Math.round((this.color.value.a - 0.01) * 100) / 100;
- }
- this.update(true);
- } else {
- var val = this.input.val();
- this.color = new Color(val);
- if (this.getValue(false) !== false) {
- this.updateData();
- this.updateComponent();
- this.updatePicker();
- }
- }
- this.element.trigger({
- type: 'changeColor',
- color: this.color,
- value: val
- });
- }
- };
-
- $.colorpicker = Colorpicker;
-
- $.fn.colorpicker = function(option) {
- var pickerArgs = arguments,
- rv;
-
- var $returnValue = this.each(function() {
- var $this = $(this),
- inst = $this.data('colorpicker'),
- options = ((typeof option === 'object') ? option : {});
- if ((!inst) && (typeof option !== 'string')) {
- $this.data('colorpicker', new Colorpicker(this, options));
- } else {
- if (typeof option === 'string') {
- rv = inst[option].apply(inst, Array.prototype.slice.call(pickerArgs, 1));
- }
- }
- });
- if (option === 'getValue') {
- return rv;
- }
- return $returnValue;
- };
-
- $.fn.colorpicker.constructor = Colorpicker;
-
- }));
diff --git a/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.min.js b/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.min.js
deleted file mode 100644
index 458696d4..00000000
--- a/src/js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):window.jQuery&&!window.jQuery.fn.colorpicker&&a(window.jQuery)}(function(a){"use strict";var b=function(a){this.value={h:0,s:0,b:0,a:1},this.origFormat=null,a&&(void 0!==a.toLowerCase?(a+="",this.setColor(a)):void 0!==a.h&&(this.value=a))};b.prototype={constructor:b,colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",transparent:"transparent"},_sanitizeNumber:function(a){return"number"==typeof a?a:isNaN(a)||null===a||""===a||void 0===a?1:void 0!==a.toLowerCase?parseFloat(a):1},isTransparent:function(a){return a?(a=a.toLowerCase().trim(),"transparent"==a||a.match(/#?00000000/)||a.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/)):!1},rgbaIsTransparent:function(a){return 0==a.r&&0==a.g&&0==a.b&&0==a.a},setColor:function(a){a=a.toLowerCase().trim(),a&&(this.value=this.isTransparent(a)?{h:0,s:0,b:0,a:0}:this.stringToHSB(a)||{h:0,s:0,b:0,a:1})},stringToHSB:function(b){b=b.toLowerCase();var c=this,d=!1;return a.each(this.stringParsers,function(a,e){var f=e.re.exec(b),g=f&&e.parse.apply(c,[f]),h=e.format||"rgba";return g?(d=h.match(/hsla?/)?c.RGBtoHSB.apply(c,c.HSLtoRGB.apply(c,g)):c.RGBtoHSB.apply(c,g),c.origFormat=h,!1):!0}),d},setHue:function(a){this.value.h=1-a},setSaturation:function(a){this.value.s=a},setBrightness:function(a){this.value.b=1-a},setAlpha:function(a){this.value.a=parseInt(100*(1-a),10)/100},toRGB:function(a,b,c,d){a||(a=this.value.h,b=this.value.s,c=this.value.b),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Math.abs(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],{r:Math.round(255*e),g:Math.round(255*f),b:Math.round(255*g),a:d||this.value.a}},toHex:function(a,b,c,d){var e=this.toRGB(a,b,c,d);return this.rgbaIsTransparent(e)?"transparent":"#"+(1<<24|parseInt(e.r)<<16|parseInt(e.g)<<8|parseInt(e.b)).toString(16).substr(1)},toHSL:function(a,b,c,d){a=a||this.value.h,b=b||this.value.s,c=c||this.value.b,d=d||this.value.a;var e=a,f=(2-b)*c,g=b*c;return g/=f>0&&1>=f?f:2-f,f/=2,g>1&&(g=1),{h:isNaN(e)?0:e,s:isNaN(g)?0:g,l:isNaN(f)?0:f,a:isNaN(d)?0:d}},toAlias:function(a,b,c,d){var e=this.toHex(a,b,c,d);for(var f in this.colors)if(this.colors[f]==e)return f;return!1},RGBtoHSB:function(a,b,c,d){a/=255,b/=255,c/=255;var e,f,g,h;return g=Math.max(a,b,c),h=g-Math.min(a,b,c),e=0===h?null:g===a?(b-c)/h:g===b?(c-a)/h+2:(a-b)/h+4,e=(e+360)%6*60/360,f=0===h?0:h/g,{h:this._sanitizeNumber(e),s:f,b:g,a:this._sanitizeNumber(d)}},HueToRGB:function(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+(b-a)*c*6:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a},HSLtoRGB:function(a,b,c,d){0>b&&(b=0);var e;e=.5>=c?c*(1+b):c+b-c*b;var f=2*c-e,g=a+1/3,h=a,i=a-1/3,j=Math.round(255*this.HueToRGB(f,e,g)),k=Math.round(255*this.HueToRGB(f,e,h)),l=Math.round(255*this.HueToRGB(f,e,i));return[j,k,l,this._sanitizeNumber(d)]},toString:function(a){switch(a=a||"rgba"){case"rgb":var b=this.toRGB();return this.rgbaIsTransparent(b)?"transparent":"rgb("+b.r+","+b.g+","+b.b+")";case"rgba":var b=this.toRGB();return"rgba("+b.r+","+b.g+","+b.b+","+b.a+")";case"hsl":var c=this.toHSL();return"hsl("+Math.round(360*c.h)+","+Math.round(100*c.s)+"%,"+Math.round(100*c.l)+"%)";case"hsla":var c=this.toHSL();return"hsla("+Math.round(360*c.h)+","+Math.round(100*c.s)+"%,"+Math.round(100*c.l)+"%,"+c.a+")";case"hex":return this.toHex();case"alias":return this.toAlias()||this.toHex();default:return!1}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(a){return[a[1],a[2],a[3],1]}},{re:/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/hsl\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/hsla\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16),1]}},{re:/^([a-z]{3,})$/,format:"alias",parse:function(a){var b=this.colorNameToHex(a[0])||"#000000",c=this.stringParsers[6].re.exec(b),d=c&&this.stringParsers[6].parse.apply(this,[c]);return d}}],colorNameToHex:function(a){return"undefined"!=typeof this.colors[a.toLowerCase()]?this.colors[a.toLowerCase()]:!1}};var c={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:''},d=function(d,e){this.element=a(d).addClass("colorpicker-element"),this.options=a.extend({},c,this.element.data(),e),this.component=this.options.component,this.component=this.component!==!1?this.element.find(this.component):!1,this.component&&0===this.component.length&&(this.component=!1),this.container=this.options.container===!0?this.element:this.options.container,this.container=this.container!==!1?a(this.container):!1,this.input=this.element.is("input")?this.element:this.options.input?this.element.find(this.options.input):!1,this.input&&0===this.input.length&&(this.input=!1),this.color=new b(this.options.color!==!1?this.options.color:this.getValue()),this.format=this.options.format!==!1?this.options.format:this.color.origFormat,this.picker=a(this.options.template),this.picker.addClass(this.options.inline?"colorpicker-inline colorpicker-visible":"colorpicker-hidden"),this.options.horizontal&&this.picker.addClass("colorpicker-horizontal"),("rgba"===this.format||"hsla"===this.format)&&this.picker.addClass("colorpicker-with-alpha"),"right"===this.options.align&&this.picker.addClass("colorpicker-right"),this.picker.on("mousedown.colorpicker touchstart.colorpicker",a.proxy(this.mousedown,this)),this.picker.appendTo(this.container?this.container:a("body")),this.input!==!1&&(this.input.on({"keyup.colorpicker":a.proxy(this.keyup,this)}),this.component===!1&&this.element.on({"focus.colorpicker":a.proxy(this.show,this)}),this.options.inline===!1&&this.element.on({"focusout.colorpicker":a.proxy(this.hide,this)})),this.component!==!1&&this.component.on({"click.colorpicker":a.proxy(this.show,this)}),this.input===!1&&this.component===!1&&this.element.on({"click.colorpicker":a.proxy(this.show,this)}),this.input!==!1&&this.component!==!1&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":a.proxy(this.show,this),"focus.colorpicker":a.proxy(this.show,this)}),this.update(),a(a.proxy(function(){this.element.trigger("create")},this))};d.Color=b,d.prototype={constructor:d,destroy:function(){this.picker.remove(),this.element.removeData("colorpicker").off(".colorpicker"),this.input!==!1&&this.input.off(".colorpicker"),this.component!==!1&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==!1||this.options.container)return!1;var a=this.container&&this.container[0]!==document.body?"position":"offset",b=this.component||this.element,c=b[a]();"right"===this.options.align&&(c.left-=this.picker.outerWidth()-b.outerWidth()),this.picker.css({top:c.top+b.outerHeight(),left:c.left})},show:function(b){return this.isDisabled()?!1:(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),a(window).on("resize.colorpicker",a.proxy(this.reposition,this)),!b||this.hasInput()&&"color"!==this.input.attr("type")||b.stopPropagation&&b.preventDefault&&(b.stopPropagation(),b.preventDefault()),this.options.inline===!1&&a(window.document).on({"mousedown.colorpicker":a.proxy(this.hide,this)}),void this.element.trigger({type:"showPicker",color:this.color}))},hide:function(){this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),a(window).off("resize.colorpicker",this.reposition),a(document).off({"mousedown.colorpicker":this.hide}),this.update(),this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(a){return a=a||this.color.toString(this.format),this.element.data("color",a),a},updateInput:function(a){return a=a||this.color.toString(this.format),this.input!==!1&&this.input.prop("value",a),a},updatePicker:function(a){void 0!==a&&(this.color=new b(a));var c=this.options.horizontal===!1?this.options.sliders:this.options.slidersHorz,d=this.picker.find("i");return 0!==d.length?(this.options.horizontal===!1?(c=this.options.sliders,d.eq(1).css("top",c.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",c.alpha.maxTop*(1-this.color.value.a))):(c=this.options.slidersHorz,d.eq(1).css("left",c.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",c.alpha.maxLeft*(1-this.color.value.a))),d.eq(0).css({top:c.saturation.maxTop-this.color.value.b*c.saturation.maxTop,left:this.color.value.s*c.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex()),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(this.format)),a):void 0},updateComponent:function(a){if(a=a||this.color.toString(this.format),this.component!==!1){var b=this.component.find("i").eq(0);b.length>0?b.css({backgroundColor:a}):this.component.css({backgroundColor:a})}return a},update:function(a){var b;return(this.getValue(!1)!==!1||a===!0)&&(b=this.updateComponent(),this.updateInput(b),this.updateData(b),this.updatePicker()),b},setValue:function(a){this.color=new b(a),this.update(),this.element.trigger({type:"changeColor",color:this.color,value:a})},getValue:function(a){a=void 0===a?"#000000":a;var b;return b=this.hasInput()?this.input.val():this.element.data("color"),(void 0===b||""===b||null===b)&&(b=a),b},hasInput:function(){return this.input!==!1},isDisabled:function(){return this.hasInput()?this.input.prop("disabled")===!0:!1},disable:function(){return this.hasInput()?(this.input.prop("disabled",!0),this.element.trigger({type:"disable",color:this.color,value:this.getValue()}),!0):!1},enable:function(){return this.hasInput()?(this.input.prop("disabled",!1),this.element.trigger({type:"enable",color:this.color,value:this.getValue()}),!0):!1},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(b){b.pageX||b.pageY||!b.originalEvent||(b.pageX=b.originalEvent.touches[0].pageX,b.pageY=b.originalEvent.touches[0].pageY),b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("div"),e=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!d.is(".colorpicker")){if(d.is(".colorpicker-saturation"))this.currentSlider=a.extend({},e.saturation);else if(d.is(".colorpicker-hue"))this.currentSlider=a.extend({},e.hue);else{if(!d.is(".colorpicker-alpha"))return!1;this.currentSlider=a.extend({},e.alpha)}var f=d.offset();this.currentSlider.guide=d.find("i")[0].style,this.currentSlider.left=b.pageX-f.left,this.currentSlider.top=b.pageY-f.top,this.mousePointer={left:b.pageX,top:b.pageY},a(document).on({"mousemove.colorpicker":a.proxy(this.mousemove,this),"touchmove.colorpicker":a.proxy(this.mousemove,this),"mouseup.colorpicker":a.proxy(this.mouseup,this),"touchend.colorpicker":a.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(a){a.pageX||a.pageY||!a.originalEvent||(a.pageX=a.originalEvent.touches[0].pageX,a.pageY=a.originalEvent.touches[0].pageY),a.stopPropagation(),a.preventDefault();var b=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((a.pageX||this.mousePointer.left)-this.mousePointer.left))),c=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((a.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=b+"px",this.currentSlider.guide.top=c+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,b/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,c/this.currentSlider.maxTop),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(b){return b.stopPropagation(),b.preventDefault(),a(document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},keyup:function(a){if(38===a.keyCode)this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0);else if(40===a.keyCode)this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0);else{var c=this.input.val();this.color=new b(c),this.getValue(!1)!==!1&&(this.updateData(),this.updateComponent(),this.updatePicker())}this.element.trigger({type:"changeColor",color:this.color,value:c})}},a.colorpicker=d,a.fn.colorpicker=function(b){var c,e=arguments,f=this.each(function(){var f=a(this),g=f.data("colorpicker"),h="object"==typeof b?b:{};g||"string"==typeof b?"string"==typeof b&&(c=g[b].apply(g,Array.prototype.slice.call(e,1))):f.data("colorpicker",new d(this,h))});return"getValue"===b?c:f},a.fn.colorpicker.constructor=d});
\ No newline at end of file
diff --git a/src/js/bootstrap-datepicker.js b/src/js/bootstrap-datepicker.js
deleted file mode 100644
index 787f3525..00000000
--- a/src/js/bootstrap-datepicker.js
+++ /dev/null
@@ -1,458 +0,0 @@
-/* =========================================================
- * bootstrap-datepicker.js
- * http://www.eyecon.ro/bootstrap-datepicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
-
-!function( $ ) {
-
- // Picker object
-
- var Datepicker = function(element, options){
- this.element = $(element);
- this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
- this.picker = $(DPGlobal.template)
- .appendTo('body')
- .on({
- click: $.proxy(this.click, this),
- mousedown: $.proxy(this.mousedown, this)
- });
- this.isInput = this.element.is('input');
- this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
-
- if (this.isInput) {
- this.element.on({
- focus: $.proxy(this.show, this),
- blur: $.proxy(this.hide, this),
- keyup: $.proxy(this.update, this)
- });
- } else {
- if (this.component){
- this.component.on('click', $.proxy(this.show, this));
- } else {
- this.element.on('click', $.proxy(this.show, this));
- }
- }
- this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
- if (typeof this.minViewMode === 'string') {
- switch (this.minViewMode) {
- case 'months':
- this.minViewMode = 1;
- break;
- case 'years':
- this.minViewMode = 2;
- break;
- default:
- this.minViewMode = 0;
- break;
- }
- }
- this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
- if (typeof this.viewMode === 'string') {
- switch (this.viewMode) {
- case 'months':
- this.viewMode = 1;
- break;
- case 'years':
- this.viewMode = 2;
- break;
- default:
- this.viewMode = 0;
- break;
- }
- }
- this.startViewMode = this.viewMode;
- this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
- this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
- this.fillDow();
- this.fillMonths();
- this.update();
- this.showMode();
- };
-
- Datepicker.prototype = {
- constructor: Datepicker,
-
- show: function(e) {
- this.picker.show();
- this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
- this.place();
- $(window).on('resize', $.proxy(this.place, this));
- if (e ) {
- e.stopPropagation();
- e.preventDefault();
- }
- if (!this.isInput) {
- $(document).on('mousedown', $.proxy(this.hide, this));
- }
-
- this.element.trigger({
- type: 'show',
- date: this.date
- });
-
- },
-
- hide: function(){
- this.picker.hide();
- $(window).off('resize', this.place);
- this.viewMode = this.startViewMode;
- this.showMode();
- if (!this.isInput) {
- $(document).off('mousedown', this.hide);
- }
- this.set();
- this.element.trigger({
- type: 'hide',
- date: this.date
- });
- },
-
- set: function() {
- var formated = DPGlobal.formatDate(this.date, this.format);
- if (!this.isInput) {
- if (this.component){
- this.element.find('input').prop('value', formated);
- }
- this.element.data('date', formated);
- } else {
- this.element.prop('value', formated);
- }
- },
-
- setValue: function(newDate) {
- if (typeof newDate === 'string') {
- this.date = DPGlobal.parseDate(newDate, this.format);
- } else {
- this.date = new Date(newDate);
- }
- this.set();
- this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
- this.fill();
- },
-
- place: function(){
- var offset = this.component ? this.component.offset() : this.element.offset();
- this.picker.css({
- top: offset.top + this.height,
- left: offset.left
- });
- },
-
- update: function(newDate){
- this.date = DPGlobal.parseDate(
- typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
- this.format
- );
- this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
- this.fill();
- },
-
- fillDow: function(){
- var dowCnt = this.weekStart;
- var html = ' ';
- while (dowCnt < this.weekStart + 7) {
- html += ''+DPGlobal.dates.daysMin[(dowCnt++)%7]+' ';
- }
- html += ' ';
- this.picker.find('.datepicker-days thead').append(html);
- },
-
- fillMonths: function(){
- var html = '';
- var i = 0
- while (i < 12) {
- html += ''+DPGlobal.dates.monthsShort[i++]+'';
- }
- this.picker.find('.datepicker-months td').append(html);
- },
-
- fill: function() {
- var d = new Date(this.viewDate),
- year = d.getFullYear(),
- month = d.getMonth(),
- currentDate = this.date.valueOf();
- this.picker.find('.datepicker-days th:eq(1)')
- .text(DPGlobal.dates.months[month]+' '+year);
- var prevMonth = new Date(year, month-1, 28,0,0,0,0),
- day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
- prevMonth.setDate(day);
- prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
- var nextMonth = new Date(prevMonth);
- nextMonth.setDate(nextMonth.getDate() + 42);
- nextMonth = nextMonth.valueOf();
- html = [];
- var clsName;
- while(prevMonth.valueOf() < nextMonth) {
- if (prevMonth.getDay() === this.weekStart) {
- html.push('');
- }
- clsName = '';
- if (prevMonth.getMonth() < month) {
- clsName += ' old';
- } else if (prevMonth.getMonth() > month) {
- clsName += ' new';
- }
- if (prevMonth.valueOf() === currentDate) {
- clsName += ' active';
- }
- html.push(''+prevMonth.getDate() + ' ');
- if (prevMonth.getDay() === this.weekEnd) {
- html.push(' ');
- }
- prevMonth.setDate(prevMonth.getDate()+1);
- }
- this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
- var currentYear = this.date.getFullYear();
-
- var months = this.picker.find('.datepicker-months')
- .find('th:eq(1)')
- .text(year)
- .end()
- .find('span').removeClass('active');
- if (currentYear === year) {
- months.eq(this.date.getMonth()).addClass('active');
- }
-
- html = '';
- year = parseInt(year/10, 10) * 10;
- var yearCont = this.picker.find('.datepicker-years')
- .find('th:eq(1)')
- .text(year + '-' + (year + 9))
- .end()
- .find('td');
- year -= 1;
- for (var i = -1; i < 11; i++) {
- html += ''+year+'';
- year += 1;
- }
- yearCont.html(html);
- },
-
- click: function(e) {
- e.stopPropagation();
- e.preventDefault();
- var target = $(e.target).closest('span, td, th');
- if (target.length === 1) {
- switch(target[0].nodeName.toLowerCase()) {
- case 'th':
- switch(target[0].className) {
- case 'switch':
- this.showMode(1);
- break;
- case 'prev':
- case 'next':
- this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
- this.viewDate,
- this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
- DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
- );
- this.fill();
- this.set();
- break;
- }
- break;
- case 'span':
- if (target.is('.month')) {
- var month = target.parent().find('span').index(target);
- this.viewDate.setMonth(month);
- } else {
- var year = parseInt(target.text(), 10)||0;
- this.viewDate.setFullYear(year);
- }
- if (this.viewMode !== 0) {
- this.date = new Date(this.viewDate);
- this.element.trigger({
- type: 'changeDate',
- date: this.date,
- viewMode: DPGlobal.modes[this.viewMode].clsName
- });
- }
- this.showMode(-1);
- this.fill();
- this.set();
- break;
- case 'td':
- if (target.is('.day')){
- var day = parseInt(target.text(), 10)||1;
- var month = this.viewDate.getMonth();
- if (target.is('.old')) {
- month -= 1;
- } else if (target.is('.new')) {
- month += 1;
- }
- var year = this.viewDate.getFullYear();
- this.date = new Date(year, month, day,0,0,0,0);
- this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
- this.fill();
- this.set();
- this.element.trigger({
- type: 'changeDate',
- date: this.date,
- viewMode: DPGlobal.modes[this.viewMode].clsName
- });
-
- this.hide();
- }
- break;
- }
- }
- },
-
- mousedown: function(e){
- e.stopPropagation();
- e.preventDefault();
- },
-
- showMode: function(dir) {
- if (dir) {
- this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
- }
- this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
- }
- };
-
- $.fn.datepicker = function ( option, val ) {
- return this.each(function () {
- var $this = $(this),
- data = $this.data('datepicker'),
- options = typeof option === 'object' && option;
- if (!data) {
- $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
- }
- if (typeof option === 'string') data[option](val);
- });
- };
-
- $.fn.datepicker.defaults = {
- };
- $.fn.datepicker.Constructor = Datepicker;
-
- var DPGlobal = {
- modes: [
- {
- clsName: 'days',
- navFnc: 'Month',
- navStep: 1
- },
- {
- clsName: 'months',
- navFnc: 'FullYear',
- navStep: 1
- },
- {
- clsName: 'years',
- navFnc: 'FullYear',
- navStep: 10
- }],
- dates:{
- days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
- daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
- daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
- months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
- monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
- },
- isLeapYear: function (year) {
- return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
- },
- getDaysInMonth: function (year, month) {
- return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
- },
- parseFormat: function(format){
- var separator = format.match(/[.\/\-\s].*?/),
- parts = format.split(/\W+/);
- if (!separator || !parts || parts.length === 0){
- throw new Error("Invalid date format.");
- }
- return {separator: separator, parts: parts};
- },
- parseDate: function(date, format) {
- var parts = date.split(format.separator),
- date = new Date(),
- val;
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- if (parts.length === format.parts.length) {
- for (var i=0, cnt = format.parts.length; i < cnt; i++) {
- val = parseInt(parts[i], 10)||1;
- switch(format.parts[i]) {
- case 'dd':
- case 'd':
- date.setDate(val);
- break;
- case 'mm':
- case 'm':
- date.setMonth(val - 1);
- break;
- case 'yy':
- date.setFullYear(2000 + val);
- break;
- case 'yyyy':
- date.setFullYear(val);
- break;
- }
- }
- }
- return date;
- },
- formatDate: function(date, format){
- var val = {
- d: date.getDate(),
- m: date.getMonth() + 1,
- yy: date.getFullYear().toString().substring(2),
- yyyy: date.getFullYear()
- };
- val.dd = (val.d < 10 ? '0' : '') + val.d;
- val.mm = (val.m < 10 ? '0' : '') + val.m;
- var date = [];
- for (var i=0, cnt = format.parts.length; i < cnt; i++) {
- date.push(val[format.parts[i]]);
- }
- return date.join(format.separator);
- },
- headTemplate: ''+
- ''+
- '‹ '+
- ' '+
- '› '+
- ' '+
- '',
- contTemplate: ' '
- };
- DPGlobal.template = '';
-
-}( window.jQuery )
\ No newline at end of file
diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js
deleted file mode 100644
index 071840e4..00000000
--- a/src/js/bootstrap-datetimepicker.js
+++ /dev/null
@@ -1,1309 +0,0 @@
-/**
- * @license
- * =========================================================
- * bootstrap-datetimepicker.js
- * http://www.eyecon.ro/bootstrap-datepicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- *
- * Contributions:
- * - Andrew Rowls
- * - Thiago de Arruda
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =========================================================
- */
-
-(function($) {
-
- // Picker object
- var smartPhone = (window.orientation != undefined);
- var DateTimePicker = function(element, options) {
- this.id = dpgId++;
- this.init(element, options);
- };
-
- var dateToDate = function(dt) {
- if (typeof dt === 'string') {
- return new Date(dt);
- }
- return dt;
- };
-
- DateTimePicker.prototype = {
- constructor: DateTimePicker,
-
- init: function(element, options) {
- var icon;
- if (!(options.pickTime || options.pickDate))
- throw new Error('Must choose at least one picker');
- this.options = options;
- this.$element = $(element);
- this.language = options.language in dates ? options.language : 'en'
- this.pickDate = options.pickDate;
- this.pickTime = options.pickTime;
- this.isInput = this.$element.is('input');
- this.component = false;
- if (this.$element.find('.input-append') || this.$element.find('.input-prepend'))
- this.component = this.$element.find('.add-on');
- this.format = options.format;
- if (!this.format) {
- if (this.isInput) this.format = this.$element.data('format');
- else this.format = this.$element.find('input').data('format');
- if (!this.format) this.format = 'MM/dd/yyyy';
- }
- this._compileFormat();
- if (this.component) {
- icon = this.component.find('i');
- }
- if (this.pickTime) {
- if (icon && icon.length) this.timeIcon = icon.data('time-icon');
- if (!this.timeIcon) this.timeIcon = 'fa fa-clock-o';
- icon.addClass(this.timeIcon);
- }
- if (this.pickDate) {
- if (icon && icon.length) this.dateIcon = icon.data('date-icon');
- if (!this.dateIcon) this.dateIcon = 'fa fa-calendar';
- icon.removeClass(this.timeIcon);
- icon.addClass(this.dateIcon);
- }
- this.widget = $(getTemplate(this.timeIcon, options.pickDate, options.pickTime, options.pick12HourFormat, options.pickSeconds, options.collapse)).appendTo('body');
- this.minViewMode = options.minViewMode||this.$element.data('date-minviewmode')||0;
- if (typeof this.minViewMode === 'string') {
- switch (this.minViewMode) {
- case 'months':
- this.minViewMode = 1;
- break;
- case 'years':
- this.minViewMode = 2;
- break;
- default:
- this.minViewMode = 0;
- break;
- }
- }
- this.viewMode = options.viewMode||this.$element.data('date-viewmode')||0;
- if (typeof this.viewMode === 'string') {
- switch (this.viewMode) {
- case 'months':
- this.viewMode = 1;
- break;
- case 'years':
- this.viewMode = 2;
- break;
- default:
- this.viewMode = 0;
- break;
- }
- }
- this.startViewMode = this.viewMode;
- this.weekStart = options.weekStart||this.$element.data('date-weekstart')||0;
- this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
- this.setStartDate(options.startDate || this.$element.data('date-startdate'));
- this.setEndDate(options.endDate || this.$element.data('date-enddate'));
- this.fillDow();
- this.fillMonths();
- this.fillHours();
- this.fillMinutes();
- this.fillSeconds();
- this.update();
- this.showMode();
- this._attachDatePickerEvents();
- },
-
- show: function(e) {
- this.widget.show();
- this.height = this.component ? this.component.outerHeight() : this.$element.outerHeight();
- this.place();
- this.$element.trigger({
- type: 'show',
- date: this._date
- });
- this._attachDatePickerGlobalEvents();
- if (e) {
- e.stopPropagation();
- e.preventDefault();
- }
- },
-
- disable: function(){
- this.$element.find('input').prop('disabled',true);
- this._detachDatePickerEvents();
- },
- enable: function(){
- this.$element.find('input').prop('disabled',false);
- this._attachDatePickerEvents();
- },
-
- hide: function() {
- // Ignore event if in the middle of a picker transition
- var collapse = this.widget.find('.collapse')
- for (var i = 0; i < collapse.length; i++) {
- var collapseData = collapse.eq(i).data('collapse');
- if (collapseData && collapseData.transitioning)
- return;
- }
- this.widget.hide();
- this.viewMode = this.startViewMode;
- this.showMode();
- this.set();
- this.$element.trigger({
- type: 'hide',
- date: this._date
- });
- this._detachDatePickerGlobalEvents();
- },
-
- set: function() {
- var formatted = '';
- if (!this._unset) formatted = this.formatDate(this._date);
- if (!this.isInput) {
- if (this.component){
- var input = this.$element.find('input');
- input.val(formatted);
- this._resetMaskPos(input);
- }
- this.$element.data('date', formatted);
- } else {
- this.$element.val(formatted);
- this._resetMaskPos(this.$element);
- }
- },
-
- setValue: function(newDate) {
- if (!newDate) {
- this._unset = true;
- } else {
- this._unset = false;
- }
- if (typeof newDate === 'string') {
- this._date = this.parseDate(newDate);
- } else if(newDate) {
- this._date = new Date(newDate);
- }
- this.set();
- this.viewDate = UTCDate(this._date.getUTCFullYear(), this._date.getUTCMonth(), 1, 0, 0, 0, 0);
- this.fillDate();
- this.fillTime();
- },
-
- getDate: function() {
- if (this._unset) return null;
- return new Date(this._date.valueOf());
- },
-
- setDate: function(date) {
- if (!date) this.setValue(null);
- else this.setValue(date.valueOf());
- },
-
- setStartDate: function(date) {
- if (date instanceof Date) {
- this.startDate = date;
- } else if (typeof date === 'string') {
- this.startDate = new UTCDate(date);
- if (! this.startDate.getUTCFullYear()) {
- this.startDate = -Infinity;
- }
- } else {
- this.startDate = -Infinity;
- }
- if (this.viewDate) {
- this.update();
- }
- },
-
- setEndDate: function(date) {
- if (date instanceof Date) {
- this.endDate = date;
- } else if (typeof date === 'string') {
- this.endDate = new UTCDate(date);
- if (! this.endDate.getUTCFullYear()) {
- this.endDate = Infinity;
- }
- } else {
- this.endDate = Infinity;
- }
- if (this.viewDate) {
- this.update();
- }
- },
-
- getLocalDate: function() {
- if (this._unset) return null;
- var d = this._date;
- return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(),
- d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
- },
-
- setLocalDate: function(localDate) {
- if (!localDate) this.setValue(null);
- else
- this.setValue(Date.UTC(
- localDate.getFullYear(),
- localDate.getMonth(),
- localDate.getDate(),
- localDate.getHours(),
- localDate.getMinutes(),
- localDate.getSeconds(),
- localDate.getMilliseconds()));
- },
-
- place: function(){
- var position = 'absolute';
- var offset = this.component ? this.component.offset() : this.$element.offset();
- this.width = this.component ? this.component.outerWidth() : this.$element.outerWidth();
- offset.top = offset.top + this.height;
-
- var $window = $(window);
-
- if ( this.options.width != undefined ) {
- this.widget.width( this.options.width );
- }
-
- if ( this.options.orientation == 'left' ) {
- this.widget.addClass( 'left-oriented' );
- offset.left = offset.left - this.widget.width() + 20;
- }
-
- if (this._isInFixed()) {
- position = 'fixed';
- offset.top -= $window.scrollTop();
- offset.left -= $window.scrollLeft();
- }
-
- if ($window.width() < offset.left + this.widget.outerWidth()) {
- offset.right = $window.width() - offset.left - this.width;
- offset.left = 'auto';
- this.widget.addClass('pull-right');
- } else {
- offset.right = 'auto';
- this.widget.removeClass('pull-right');
- }
-
- this.widget.css({
- position: position,
- top: offset.top,
- left: offset.left,
- right: offset.right
- });
- },
-
- notifyChange: function(){
- this.$element.trigger({
- type: 'changeDate',
- date: this.getDate(),
- localDate: this.getLocalDate()
- });
- },
-
- update: function(newDate){
- var dateStr = newDate;
- if (!dateStr) {
- if (this.isInput) {
- dateStr = this.$element.val();
- } else {
- dateStr = this.$element.find('input').val();
- }
- if (dateStr) {
- this._date = this.parseDate(dateStr);
- }
- if (!this._date) {
- var tmp = new Date()
- this._date = UTCDate(tmp.getFullYear(),
- tmp.getMonth(),
- tmp.getDate(),
- tmp.getHours(),
- tmp.getMinutes(),
- tmp.getSeconds(),
- tmp.getMilliseconds())
- }
- }
- this.viewDate = UTCDate(this._date.getUTCFullYear(), this._date.getUTCMonth(), 1, 0, 0, 0, 0);
- this.fillDate();
- this.fillTime();
- },
-
- fillDow: function() {
- var dowCnt = this.weekStart;
- var html = $('');
- while (dowCnt < this.weekStart + 7) {
- html.append('' + dates[this.language].daysMin[(dowCnt++) % 7] + ' ');
- }
- this.widget.find('.datepicker-days thead').append(html);
- },
-
- fillMonths: function() {
- var html = '';
- var i = 0
- while (i < 12) {
- html += '' + dates[this.language].monthsShort[i++] + '';
- }
- this.widget.find('.datepicker-months td').append(html);
- },
-
- fillDate: function() {
- var year = this.viewDate.getUTCFullYear();
- var month = this.viewDate.getUTCMonth();
- var currentDate = UTCDate(
- this._date.getUTCFullYear(),
- this._date.getUTCMonth(),
- this._date.getUTCDate(),
- 0, 0, 0, 0
- );
- var startYear = typeof this.startDate === 'object' ? this.startDate.getUTCFullYear() : -Infinity;
- var startMonth = typeof this.startDate === 'object' ? this.startDate.getUTCMonth() : -1;
- var endYear = typeof this.endDate === 'object' ? this.endDate.getUTCFullYear() : Infinity;
- var endMonth = typeof this.endDate === 'object' ? this.endDate.getUTCMonth() : 12;
-
- this.widget.find('.datepicker-days').find('.disabled').removeClass('disabled');
- this.widget.find('.datepicker-months').find('.disabled').removeClass('disabled');
- this.widget.find('.datepicker-years').find('.disabled').removeClass('disabled');
-
- this.widget.find('.datepicker-days th:eq(1)').text(
- dates[this.language].months[month] + ' ' + year);
-
- var prevMonth = UTCDate(year, month-1, 28, 0, 0, 0, 0);
- var day = DPGlobal.getDaysInMonth(
- prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
- prevMonth.setUTCDate(day);
- prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.weekStart + 7) % 7);
- if ((year == startYear && month <= startMonth) || year < startYear) {
- this.widget.find('.datepicker-days th:eq(0)').addClass('disabled');
- }
- if ((year == endYear && month >= endMonth) || year > endYear) {
- this.widget.find('.datepicker-days th:eq(2)').addClass('disabled');
- }
-
- var nextMonth = new Date(prevMonth.valueOf());
- nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
- nextMonth = nextMonth.valueOf();
- var html = [];
- var row;
- var clsName;
- while (prevMonth.valueOf() < nextMonth) {
- if (prevMonth.getUTCDay() === this.weekStart) {
- row = $(' ');
- html.push(row);
- }
- clsName = '';
- if (prevMonth.getUTCFullYear() < year ||
- (prevMonth.getUTCFullYear() == year &&
- prevMonth.getUTCMonth() < month)) {
- clsName += ' old';
- } else if (prevMonth.getUTCFullYear() > year ||
- (prevMonth.getUTCFullYear() == year &&
- prevMonth.getUTCMonth() > month)) {
- clsName += ' new';
- }
- if (prevMonth.valueOf() === currentDate.valueOf()) {
- clsName += ' active';
- }
- if ((prevMonth.valueOf() + 86400000) <= this.startDate) {
- clsName += ' disabled';
- }
- if (prevMonth.valueOf() > this.endDate) {
- clsName += ' disabled';
- }
- row.append('' + prevMonth.getUTCDate() + ' ');
- prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
- }
- this.widget.find('.datepicker-days tbody').empty().append(html);
- var currentYear = this._date.getUTCFullYear();
-
- var months = this.widget.find('.datepicker-months').find(
- 'th:eq(1)').text(year).end().find('span').removeClass('active');
- if (currentYear === year) {
- months.eq(this._date.getUTCMonth()).addClass('active');
- }
- if (currentYear - 1 < startYear) {
- this.widget.find('.datepicker-months th:eq(0)').addClass('disabled');
- }
- if (currentYear + 1 > endYear) {
- this.widget.find('.datepicker-months th:eq(2)').addClass('disabled');
- }
- for (var i = 0; i < 12; i++) {
- if ((year == startYear && startMonth > i) || (year < startYear)) {
- $(months[i]).addClass('disabled');
- } else if ((year == endYear && endMonth < i) || (year > endYear)) {
- $(months[i]).addClass('disabled');
- }
- }
-
- html = '';
- year = parseInt(year/10, 10) * 10;
- var yearCont = this.widget.find('.datepicker-years').find(
- 'th:eq(1)').text(year + '-' + (year + 9)).end().find('td');
- this.widget.find('.datepicker-years').find('th').removeClass('disabled');
- if (startYear > year) {
- this.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled');
- }
- if (endYear < year+9) {
- this.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled');
- }
- year -= 1;
- for (var i = -1; i < 11; i++) {
- html += '' + year + '';
- year += 1;
- }
- yearCont.html(html);
- },
-
- fillHours: function() {
- var table = this.widget.find(
- '.timepicker .timepicker-hours table');
- table.parent().hide();
- var html = '';
- if (this.options.pick12HourFormat) {
- var current = 1;
- for (var i = 0; i < 3; i += 1) {
- html += ' ';
- for (var j = 0; j < 4; j += 1) {
- var c = current.toString();
- html += '' + padLeft(c, 2, '0') + ' ';
- current++;
- }
- html += ' '
- }
- } else {
- var current = 0;
- for (var i = 0; i < 6; i += 1) {
- html += '';
- for (var j = 0; j < 4; j += 1) {
- var c = current.toString();
- html += '' + padLeft(c, 2, '0') + ' ';
- current++;
- }
- html += ' '
- }
- }
- table.html(html);
- },
-
- fillMinutes: function() {
- var table = this.widget.find(
- '.timepicker .timepicker-minutes table');
- table.parent().hide();
- var html = '';
- var current = 0;
- for (var i = 0; i < 5; i++) {
- html += '';
- for (var j = 0; j < 4; j += 1) {
- var c = current.toString();
- html += '' + padLeft(c, 2, '0') + ' ';
- current += 3;
- }
- html += ' ';
- }
- table.html(html);
- },
-
- fillSeconds: function() {
- var table = this.widget.find(
- '.timepicker .timepicker-seconds table');
- table.parent().hide();
- var html = '';
- var current = 0;
- for (var i = 0; i < 5; i++) {
- html += '';
- for (var j = 0; j < 4; j += 1) {
- var c = current.toString();
- html += '' + padLeft(c, 2, '0') + ' ';
- current += 3;
- }
- html += ' ';
- }
- table.html(html);
- },
-
- fillTime: function() {
- if (!this._date)
- return;
- var timeComponents = this.widget.find('.timepicker span[data-time-component]');
- var table = timeComponents.closest('table');
- var is12HourFormat = this.options.pick12HourFormat;
- var hour = this._date.getUTCHours();
- var period = 'AM';
- if (is12HourFormat) {
- if (hour >= 12) period = 'PM';
- if (hour === 0) hour = 12;
- else if (hour != 12) hour = hour % 12;
- this.widget.find(
- '.timepicker [data-action=togglePeriod]').text(period);
- }
- hour = padLeft(hour.toString(), 2, '0');
- var minute = padLeft(this._date.getUTCMinutes().toString(), 2, '0');
- var second = padLeft(this._date.getUTCSeconds().toString(), 2, '0');
- timeComponents.filter('[data-time-component=hours]').text(hour);
- timeComponents.filter('[data-time-component=minutes]').text(minute);
- timeComponents.filter('[data-time-component=seconds]').text(second);
- },
-
- click: function(e) {
- e.stopPropagation();
- e.preventDefault();
- this._unset = false;
- var target = $(e.target).closest('span, td, th');
- if (target.length === 1) {
- if (! target.is('.disabled')) {
- switch(target[0].nodeName.toLowerCase()) {
- case 'th':
- switch(target[0].className) {
- case 'switch':
- this.showMode(1);
- break;
- case 'prev':
- case 'next':
- var vd = this.viewDate;
- var navFnc = DPGlobal.modes[this.viewMode].navFnc;
- var step = DPGlobal.modes[this.viewMode].navStep;
- if (target[0].className === 'prev') step = step * -1;
- vd['set' + navFnc](vd['get' + navFnc]() + step);
- this.fillDate();
- this.set();
- break;
- }
- break;
- case 'span':
- if (target.is('.month')) {
- var month = target.parent().find('span').index(target);
- this.viewDate.setUTCMonth(month);
- } else {
- var year = parseInt(target.text(), 10) || 0;
- this.viewDate.setUTCFullYear(year);
- }
- if (this.viewMode !== 0) {
- this._date = UTCDate(
- this.viewDate.getUTCFullYear(),
- this.viewDate.getUTCMonth(),
- this.viewDate.getUTCDate(),
- this._date.getUTCHours(),
- this._date.getUTCMinutes(),
- this._date.getUTCSeconds(),
- this._date.getUTCMilliseconds()
- );
- this.notifyChange();
- }
- this.showMode(-1);
- this.fillDate();
- this.set();
- break;
- case 'td':
- if (target.is('.day')) {
- var day = parseInt(target.text(), 10) || 1;
- var month = this.viewDate.getUTCMonth();
- var year = this.viewDate.getUTCFullYear();
- if (target.is('.old')) {
- if (month === 0) {
- month = 11;
- year -= 1;
- } else {
- month -= 1;
- }
- } else if (target.is('.new')) {
- if (month == 11) {
- month = 0;
- year += 1;
- } else {
- month += 1;
- }
- }
- this._date = UTCDate(
- year, month, day,
- this._date.getUTCHours(),
- this._date.getUTCMinutes(),
- this._date.getUTCSeconds(),
- this._date.getUTCMilliseconds()
- );
- this.viewDate = UTCDate(
- year, month, Math.min(28, day) , 0, 0, 0, 0);
- this.fillDate();
- this.set();
- this.notifyChange();
- }
- break;
- }
- }
- }
- },
-
- actions: {
- incrementHours: function(e) {
- this._date.setUTCHours(this._date.getUTCHours() + 1);
- },
-
- incrementMinutes: function(e) {
- this._date.setUTCMinutes(this._date.getUTCMinutes() + 1);
- },
-
- incrementSeconds: function(e) {
- this._date.setUTCSeconds(this._date.getUTCSeconds() + 1);
- },
-
- decrementHours: function(e) {
- this._date.setUTCHours(this._date.getUTCHours() - 1);
- },
-
- decrementMinutes: function(e) {
- this._date.setUTCMinutes(this._date.getUTCMinutes() - 1);
- },
-
- decrementSeconds: function(e) {
- this._date.setUTCSeconds(this._date.getUTCSeconds() - 1);
- },
-
- togglePeriod: function(e) {
- var hour = this._date.getUTCHours();
- if (hour >= 12) hour -= 12;
- else hour += 12;
- this._date.setUTCHours(hour);
- },
-
- showPicker: function() {
- this.widget.find('.timepicker > div:not(.timepicker-picker)').hide();
- this.widget.find('.timepicker .timepicker-picker').show();
- },
-
- showHours: function() {
- this.widget.find('.timepicker .timepicker-picker').hide();
- this.widget.find('.timepicker .timepicker-hours').show();
- },
-
- showMinutes: function() {
- this.widget.find('.timepicker .timepicker-picker').hide();
- this.widget.find('.timepicker .timepicker-minutes').show();
- },
-
- showSeconds: function() {
- this.widget.find('.timepicker .timepicker-picker').hide();
- this.widget.find('.timepicker .timepicker-seconds').show();
- },
-
- selectHour: function(e) {
- var tgt = $(e.target);
- var value = parseInt(tgt.text(), 10);
- if (this.options.pick12HourFormat) {
- var current = this._date.getUTCHours();
- if (current >= 12) {
- if (value != 12) value = (value + 12) % 24;
- } else {
- if (value === 12) value = 0;
- else value = value % 12;
- }
- }
- this._date.setUTCHours(value);
- this.actions.showPicker.call(this);
- },
-
- selectMinute: function(e) {
- var tgt = $(e.target);
- var value = parseInt(tgt.text(), 10);
- this._date.setUTCMinutes(value);
- this.actions.showPicker.call(this);
- },
-
- selectSecond: function(e) {
- var tgt = $(e.target);
- var value = parseInt(tgt.text(), 10);
- this._date.setUTCSeconds(value);
- this.actions.showPicker.call(this);
- }
- },
-
- doAction: function(e) {
- e.stopPropagation();
- e.preventDefault();
- if (!this._date) this._date = UTCDate(1970, 0, 0, 0, 0, 0, 0);
- var action = $(e.currentTarget).data('action');
- var rv = this.actions[action].apply(this, arguments);
- this.set();
- this.fillTime();
- this.notifyChange();
- return rv;
- },
-
- stopEvent: function(e) {
- e.stopPropagation();
- e.preventDefault();
- },
-
- // part of the following code was taken from
- // http://cloud.github.com/downloads/digitalBush/jquery.maskedinput/jquery.maskedinput-1.3.js
- keydown: function(e) {
- var self = this, k = e.which, input = $(e.target);
- if (k == 8 || k == 46) {
- // backspace and delete cause the maskPosition
- // to be recalculated
- setTimeout(function() {
- self._resetMaskPos(input);
- });
- }
- },
-
- keypress: function(e) {
- var k = e.which;
- if (k == 8 || k == 46) {
- // For those browsers which will trigger
- // keypress on backspace/delete
- return;
- }
- var input = $(e.target);
- var c = String.fromCharCode(k);
- var val = input.val() || '';
- val += c;
- var mask = this._mask[this._maskPos];
- if (!mask) {
- return false;
- }
- if (mask.end != val.length) {
- return;
- }
- if (!mask.pattern.test(val.slice(mask.start))) {
- val = val.slice(0, val.length - 1);
- while ((mask = this._mask[this._maskPos]) && mask.character) {
- val += mask.character;
- // advance mask position past static
- // part
- this._maskPos++;
- }
- val += c;
- if (mask.end != val.length) {
- input.val(val);
- return false;
- } else {
- if (!mask.pattern.test(val.slice(mask.start))) {
- input.val(val.slice(0, mask.start));
- return false;
- } else {
- input.val(val);
- this._maskPos++;
- return false;
- }
- }
- } else {
- this._maskPos++;
- }
- },
-
- change: function(e) {
- var input = $(e.target);
- var val = input.val();
- if (this._formatPattern.test(val)) {
- this.update();
- this.setValue(this._date.getTime());
- this.notifyChange();
- this.set();
- } else if (val && val.trim()) {
- this.setValue(this._date.getTime());
- if (this._date) this.set();
- else input.val('');
- } else {
- if (this._date) {
- this.setValue(null);
- // unset the date when the input is
- // erased
- this.notifyChange();
- this._unset = true;
- }
- }
- this._resetMaskPos(input);
- },
-
- showMode: function(dir) {
- if (dir) {
- this.viewMode = Math.max(this.minViewMode, Math.min(
- 2, this.viewMode + dir));
- }
- this.widget.find('.datepicker > div').hide().filter(
- '.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
- },
-
- destroy: function() {
- this._detachDatePickerEvents();
- this._detachDatePickerGlobalEvents();
- this.widget.remove();
- this.$element.removeData('datetimepicker');
- this.component.removeData('datetimepicker');
- },
-
- formatDate: function(d) {
- return this.format.replace(formatReplacer, function(match) {
- var methodName, property, rv, len = match.length;
- if (match === 'ms')
- len = 1;
- property = dateFormatComponents[match].property
- if (property === 'Hours12') {
- rv = d.getUTCHours();
- if (rv === 0) rv = 12;
- else if (rv !== 12) rv = rv % 12;
- } else if (property === 'Period12') {
- if (d.getUTCHours() >= 12) return 'PM';
- else return 'AM';
- } else if (property === 'UTCYear') {
- rv = d.getUTCFullYear();
- rv = rv.toString().substr(2);
- } else {
- methodName = 'get' + property;
- rv = d[methodName]();
- }
- if (methodName === 'getUTCMonth') rv = rv + 1;
- return padLeft(rv.toString(), len, '0');
- });
- },
-
- parseDate: function(str) {
- var match, i, property, methodName, value, parsed = {};
- if (!(match = this._formatPattern.exec(str)))
- return null;
- for (i = 1; i < match.length; i++) {
- property = this._propertiesByIndex[i];
- if (!property)
- continue;
- value = match[i];
- if (/^\d+$/.test(value))
- value = parseInt(value, 10);
- parsed[property] = value;
- }
- return this._finishParsingDate(parsed);
- },
-
- _resetMaskPos: function(input) {
- var val = input.val();
- for (var i = 0; i < this._mask.length; i++) {
- if (this._mask[i].end > val.length) {
- // If the mask has ended then jump to
- // the next
- this._maskPos = i;
- break;
- } else if (this._mask[i].end === val.length) {
- this._maskPos = i + 1;
- break;
- }
- }
- },
-
- _finishParsingDate: function(parsed) {
- var year, month, date, hours, minutes, seconds, milliseconds;
- year = parsed.UTCFullYear;
- if (parsed.UTCYear) year = 2000 + parsed.UTCYear;
- if (!year) year = 1970;
- if (parsed.UTCMonth) month = parsed.UTCMonth - 1;
- else month = 0;
- date = parsed.UTCDate || 1;
- hours = parsed.UTCHours || 0;
- minutes = parsed.UTCMinutes || 0;
- seconds = parsed.UTCSeconds || 0;
- milliseconds = parsed.UTCMilliseconds || 0;
- if (parsed.Hours12) {
- hours = parsed.Hours12;
- }
- if (parsed.Period12) {
- if (/pm/i.test(parsed.Period12)) {
- if (hours != 12) hours = (hours + 12) % 24;
- } else {
- hours = hours % 12;
- }
- }
- return UTCDate(year, month, date, hours, minutes, seconds, milliseconds);
- },
-
- _compileFormat: function () {
- var match, component, components = [], mask = [],
- str = this.format, propertiesByIndex = {}, i = 0, pos = 0;
- while (match = formatComponent.exec(str)) {
- component = match[0];
- if (component in dateFormatComponents) {
- i++;
- propertiesByIndex[i] = dateFormatComponents[component].property;
- components.push('\\s*' + dateFormatComponents[component].getPattern(
- this) + '\\s*');
- mask.push({
- pattern: new RegExp(dateFormatComponents[component].getPattern(
- this)),
- property: dateFormatComponents[component].property,
- start: pos,
- end: pos += component.length
- });
- }
- else {
- components.push(escapeRegExp(component));
- mask.push({
- pattern: new RegExp(escapeRegExp(component)),
- character: component,
- start: pos,
- end: ++pos
- });
- }
- str = str.slice(component.length);
- }
- this._mask = mask;
- this._maskPos = 0;
- this._formatPattern = new RegExp(
- '^\\s*' + components.join('') + '\\s*$');
- this._propertiesByIndex = propertiesByIndex;
- },
-
- _attachDatePickerEvents: function() {
- var self = this;
- // this handles date picker clicks
- this.widget.on('click', '.datepicker *', $.proxy(this.click, this));
- // this handles time picker clicks
- this.widget.on('click', '[data-action]', $.proxy(this.doAction, this));
- this.widget.on('mousedown', $.proxy(this.stopEvent, this));
- if (this.pickDate && this.pickTime) {
- this.widget.on('click.togglePicker', '.accordion-toggle', function(e) {
- e.stopPropagation();
- var $this = $(this);
- var $parent = $this.closest('ul');
- var expanded = $parent.find('.collapse.in');
- var closed = $parent.find('.collapse:not(.in)');
-
- if (expanded && expanded.length) {
- var collapseData = expanded.data('collapse');
- if (collapseData && collapseData.transitioning) return;
- expanded.collapse('hide');
- closed.collapse('show');
- closed.addClass('collapse');
- expanded.addClass('collapse');
- $this.find('i').toggleClass(self.timeIcon + ' ' + self.dateIcon);
- self.$element.find('.add-on i').toggleClass(self.timeIcon + ' ' + self.dateIcon);
- }
- });
- }
- if (this.isInput) {
- this.$element.on({
- 'focus': $.proxy(this.show, this),
- 'change': $.proxy(this.change, this)
- });
- if (this.options.maskInput) {
- this.$element.on({
- 'keydown': $.proxy(this.keydown, this),
- 'keypress': $.proxy(this.keypress, this)
- });
- }
- } else {
- this.$element.on({
- 'change': $.proxy(this.change, this)
- }, 'input');
- if (this.options.maskInput) {
- this.$element.on({
- 'keydown': $.proxy(this.keydown, this),
- 'keypress': $.proxy(this.keypress, this)
- }, 'input');
- }
- if (this.component){
- this.component.on('click', $.proxy(this.show, this));
- } else {
- this.$element.on('click', $.proxy(this.show, this));
- }
- }
- },
-
- _attachDatePickerGlobalEvents: function() {
- $(window).on(
- 'resize.datetimepicker' + this.id, $.proxy(this.place, this));
- if (!this.isInput) {
- $(document).on(
- 'mousedown.datetimepicker' + this.id, $.proxy(this.hide, this));
-
- $('.bootstrap-datetime-close-btn').on('click',$.proxy(this.hide, this));
- }
- },
-
- _detachDatePickerEvents: function() {
- this.widget.off('click', '.datepicker *', this.click);
- this.widget.off('click', '[data-action]');
- this.widget.off('mousedown', this.stopEvent);
- if (this.pickDate && this.pickTime) {
- this.widget.off('click.togglePicker');
- }
- if (this.isInput) {
- this.$element.off({
- 'focus': this.show,
- 'change': this.change
- });
- if (this.options.maskInput) {
- this.$element.off({
- 'keydown': this.keydown,
- 'keypress': this.keypress
- });
- }
- } else {
- this.$element.off({
- 'change': this.change
- }, 'input');
- if (this.options.maskInput) {
- this.$element.off({
- 'keydown': this.keydown,
- 'keypress': this.keypress
- }, 'input');
- }
- if (this.component){
- this.component.off('click', this.show);
- } else {
- this.$element.off('click', this.show);
- }
- }
- },
-
- _detachDatePickerGlobalEvents: function () {
- $(window).off('resize.datetimepicker' + this.id);
- if (!this.isInput) {
- $(document).off('mousedown.datetimepicker' + this.id);
- }
- },
-
- _isInFixed: function() {
- if (this.$element) {
- var parents = this.$element.parents();
- var inFixed = false;
- for (var i=0; i' +
- '' +
- '- ' +
- '' +
- DPGlobal.template +
- '' +
- '
' +
- ' ' +
- '- ' +
- '' +
- TPGlobal.getTemplate(is12Hours, showSeconds) +
- '' +
- '
' +
- '' +
- '
' +
- ''
- );
- } else if (pickTime) {
- return (
- ''
- );
- } else {
- return (
- ''
- );
- }
- }
-
- function UTCDate() {
- return new Date(Date.UTC.apply(Date, arguments));
- }
-
- var DPGlobal = {
- modes: [
- {
- clsName: 'days',
- navFnc: 'UTCMonth',
- navStep: 1
- },
- {
- clsName: 'months',
- navFnc: 'UTCFullYear',
- navStep: 1
- },
- {
- clsName: 'years',
- navFnc: 'UTCFullYear',
- navStep: 10
- }],
- isLeapYear: function (year) {
- return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
- },
- getDaysInMonth: function (year, month) {
- return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
- },
- headTemplate:
- '' +
- '' +
- '‹ ' +
- ' ' +
- '› ' +
- ' ' +
- '',
- contTemplate: ' '
- };
- DPGlobal.template =
- '' +
- '' +
- DPGlobal.headTemplate +
- '' +
- '
' +
- '' +
- '' +
- '' +
- DPGlobal.headTemplate +
- DPGlobal.contTemplate+
- '
'+
- ''+
- ''+
- ''+
- DPGlobal.headTemplate+
- DPGlobal.contTemplate+
- '
'+
- '';
- var TPGlobal = {
- hourTemplate: '',
- minuteTemplate: '',
- secondTemplate: ''
- };
- TPGlobal.getTemplate = function(is12Hours, showSeconds) {
- return (
- '' +
- '' +
- '' +
- '' +
- '
'+
- ''+
- '' +
- '' +
- '
'+
- ''+
- (showSeconds ?
- '' +
- '' +
- '
'+
- '': '')
- );
- }
-
-
-})(window.jQuery)
diff --git a/src/js/bootstrap-datetimepicker.min.js b/src/js/bootstrap-datetimepicker.min.js
deleted file mode 100644
index a30f7764..00000000
--- a/src/js/bootstrap-datetimepicker.min.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * @license
- * =========================================================
- * bootstrap-datetimepicker.js
- * http://www.eyecon.ro/bootstrap-datepicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- *
- * Contributions:
- * - Andrew Rowls
- * - Thiago de Arruda
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * =========================================================
- */
-(function($){var smartPhone=window.orientation!=undefined;var DateTimePicker=function(element,options){this.id=dpgId++;this.init(element,options)};var dateToDate=function(dt){if(typeof dt==="string"){return new Date(dt)}return dt};DateTimePicker.prototype={constructor:DateTimePicker,init:function(element,options){var icon;if(!(options.pickTime||options.pickDate))throw new Error("Must choose at least one picker");this.options=options;this.$element=$(element);this.language=options.language in dates?options.language:"en";this.pickDate=options.pickDate;this.pickTime=options.pickTime;this.isInput=this.$element.is("input");this.component=false;if(this.$element.find(".input-append")||this.$element.find(".input-prepend"))this.component=this.$element.find(".add-on");this.format=options.format;if(!this.format){if(this.isInput)this.format=this.$element.data("format");else this.format=this.$element.find("input").data("format");if(!this.format)this.format="MM/dd/yyyy"}this._compileFormat();if(this.component){icon=this.component.find("i")}if(this.pickTime){if(icon&&icon.length)this.timeIcon=icon.data("time-icon");if(!this.timeIcon)this.timeIcon="icon-time";icon.addClass(this.timeIcon)}if(this.pickDate){if(icon&&icon.length)this.dateIcon=icon.data("date-icon");if(!this.dateIcon)this.dateIcon="icon-calendar";icon.removeClass(this.timeIcon);icon.addClass(this.dateIcon)}this.widget=$(getTemplate(this.timeIcon,options.pickDate,options.pickTime,options.pick12HourFormat,options.pickSeconds,options.collapse)).appendTo("body");this.minViewMode=options.minViewMode||this.$element.data("date-minviewmode")||0;if(typeof this.minViewMode==="string"){switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0;break}}this.viewMode=options.viewMode||this.$element.data("date-viewmode")||0;if(typeof this.viewMode==="string"){switch(this.viewMode){case"months":this.viewMode=1;break;case"years":this.viewMode=2;break;default:this.viewMode=0;break}}this.startViewMode=this.viewMode;this.weekStart=options.weekStart||this.$element.data("date-weekstart")||0;this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.setStartDate(options.startDate||this.$element.data("date-startdate"));this.setEndDate(options.endDate||this.$element.data("date-enddate"));this.fillDow();this.fillMonths();this.fillHours();this.fillMinutes();this.fillSeconds();this.update();this.showMode();this._attachDatePickerEvents()},show:function(e){this.widget.show();this.height=this.component?this.component.outerHeight():this.$element.outerHeight();this.place();this.$element.trigger({type:"show",date:this._date});this._attachDatePickerGlobalEvents();if(e){e.stopPropagation();e.preventDefault()}},disable:function(){this.$element.find("input").prop("disabled",true);this._detachDatePickerEvents()},enable:function(){this.$element.find("input").prop("disabled",false);this._attachDatePickerEvents()},hide:function(){var collapse=this.widget.find(".collapse");for(var i=0;i");while(dowCnt'+dates[this.language].daysMin[dowCnt++%7]+"")}this.widget.find(".datepicker-days thead").append(html)},fillMonths:function(){var html="";var i=0;while(i<12){html+=''+dates[this.language].monthsShort[i++]+""}this.widget.find(".datepicker-months td").append(html)},fillDate:function(){var year=this.viewDate.getUTCFullYear();var month=this.viewDate.getUTCMonth();var currentDate=UTCDate(this._date.getUTCFullYear(),this._date.getUTCMonth(),this._date.getUTCDate(),0,0,0,0);var startYear=typeof this.startDate==="object"?this.startDate.getUTCFullYear():-Infinity;var startMonth=typeof this.startDate==="object"?this.startDate.getUTCMonth():-1;var endYear=typeof this.endDate==="object"?this.endDate.getUTCFullYear():Infinity;var endMonth=typeof this.endDate==="object"?this.endDate.getUTCMonth():12;this.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");this.widget.find(".datepicker-days th:eq(1)").text(dates[this.language].months[month]+" "+year);var prevMonth=UTCDate(year,month-1,28,0,0,0,0);var day=DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(),prevMonth.getUTCMonth());prevMonth.setUTCDate(day);prevMonth.setUTCDate(day-(prevMonth.getUTCDay()-this.weekStart+7)%7);if(year==startYear&&month<=startMonth||year=endMonth||year>endYear){this.widget.find(".datepicker-days th:eq(2)").addClass("disabled")}var nextMonth=new Date(prevMonth.valueOf());nextMonth.setUTCDate(nextMonth.getUTCDate()+42);nextMonth=nextMonth.valueOf();var html=[];var row;var clsName;while(prevMonth.valueOf()");html.push(row)}clsName="";if(prevMonth.getUTCFullYear()year||prevMonth.getUTCFullYear()==year&&prevMonth.getUTCMonth()>month){clsName+=" new"}if(prevMonth.valueOf()===currentDate.valueOf()){clsName+=" active"}if(prevMonth.valueOf()+864e5<=this.startDate){clsName+=" disabled"}if(prevMonth.valueOf()>this.endDate){clsName+=" disabled"}row.append(''+prevMonth.getUTCDate()+" ");prevMonth.setUTCDate(prevMonth.getUTCDate()+1)}this.widget.find(".datepicker-days tbody").empty().append(html);var currentYear=this._date.getUTCFullYear();var months=this.widget.find(".datepicker-months").find("th:eq(1)").text(year).end().find("span").removeClass("active");if(currentYear===year){months.eq(this._date.getUTCMonth()).addClass("active")}if(currentYear-1endYear){this.widget.find(".datepicker-months th:eq(2)").addClass("disabled")}for(var i=0;i<12;i++){if(year==startYear&&startMonth>i||yearendYear){$(months[i]).addClass("disabled")}}html="";year=parseInt(year/10,10)*10;var yearCont=this.widget.find(".datepicker-years").find("th:eq(1)").text(year+"-"+(year+9)).end().find("td");this.widget.find(".datepicker-years").find("th").removeClass("disabled");if(startYear>year){this.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")}if(endYearendYear?" disabled":"")+'">'+year+"";year+=1}yearCont.html(html)},fillHours:function(){var table=this.widget.find(".timepicker .timepicker-hours table");table.parent().hide();var html="";if(this.options.pick12HourFormat){var current=1;for(var i=0;i<3;i+=1){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+" ";current++}html+=" "}}else{var current=0;for(var i=0;i<6;i+=1){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+" ";current++}html+=" "}}table.html(html)},fillMinutes:function(){var table=this.widget.find(".timepicker .timepicker-minutes table");table.parent().hide();var html="";var current=0;for(var i=0;i<5;i++){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+" ";current+=3}html+=" "}table.html(html)},fillSeconds:function(){var table=this.widget.find(".timepicker .timepicker-seconds table");table.parent().hide();var html="";var current=0;for(var i=0;i<5;i++){html+="";for(var j=0;j<4;j+=1){var c=current.toString();html+=''+padLeft(c,2,"0")+" ";current+=3}html+=" "}table.html(html)},fillTime:function(){if(!this._date)return;var timeComponents=this.widget.find(".timepicker span[data-time-component]");var table=timeComponents.closest("table");var is12HourFormat=this.options.pick12HourFormat;var hour=this._date.getUTCHours();var period="AM";if(is12HourFormat){if(hour>=12)period="PM";if(hour===0)hour=12;else if(hour!=12)hour=hour%12;this.widget.find(".timepicker [data-action=togglePeriod]").text(period)}hour=padLeft(hour.toString(),2,"0");var minute=padLeft(this._date.getUTCMinutes().toString(),2,"0");var second=padLeft(this._date.getUTCSeconds().toString(),2,"0");timeComponents.filter("[data-time-component=hours]").text(hour);timeComponents.filter("[data-time-component=minutes]").text(minute);timeComponents.filter("[data-time-component=seconds]").text(second)},click:function(e){e.stopPropagation();e.preventDefault();this._unset=false;var target=$(e.target).closest("span, td, th");if(target.length===1){if(!target.is(".disabled")){switch(target[0].nodeName.toLowerCase()){case"th":switch(target[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var vd=this.viewDate;var navFnc=DPGlobal.modes[this.viewMode].navFnc;var step=DPGlobal.modes[this.viewMode].navStep;if(target[0].className==="prev")step=step*-1;vd["set"+navFnc](vd["get"+navFnc]()+step);this.fillDate();this.set();break}break;case"span":if(target.is(".month")){var month=target.parent().find("span").index(target);this.viewDate.setUTCMonth(month)}else{var year=parseInt(target.text(),10)||0;this.viewDate.setUTCFullYear(year)}if(this.viewMode!==0){this._date=UTCDate(this.viewDate.getUTCFullYear(),this.viewDate.getUTCMonth(),this.viewDate.getUTCDate(),this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds());this.notifyChange()}this.showMode(-1);this.fillDate();this.set();break;case"td":if(target.is(".day")){var day=parseInt(target.text(),10)||1;var month=this.viewDate.getUTCMonth();var year=this.viewDate.getUTCFullYear();if(target.is(".old")){if(month===0){month=11;year-=1}else{month-=1}}else if(target.is(".new")){if(month==11){month=0;year+=1}else{month+=1}}this._date=UTCDate(year,month,day,this._date.getUTCHours(),this._date.getUTCMinutes(),this._date.getUTCSeconds(),this._date.getUTCMilliseconds());this.viewDate=UTCDate(year,month,Math.min(28,day),0,0,0,0);this.fillDate();this.set();this.notifyChange()}break}}}},actions:{incrementHours:function(e){this._date.setUTCHours(this._date.getUTCHours()+1)},incrementMinutes:function(e){this._date.setUTCMinutes(this._date.getUTCMinutes()+1)},incrementSeconds:function(e){this._date.setUTCSeconds(this._date.getUTCSeconds()+1)},decrementHours:function(e){this._date.setUTCHours(this._date.getUTCHours()-1)},decrementMinutes:function(e){this._date.setUTCMinutes(this._date.getUTCMinutes()-1)},decrementSeconds:function(e){this._date.setUTCSeconds(this._date.getUTCSeconds()-1)},togglePeriod:function(e){var hour=this._date.getUTCHours();if(hour>=12)hour-=12;else hour+=12;this._date.setUTCHours(hour)},showPicker:function(){this.widget.find(".timepicker > div:not(.timepicker-picker)").hide();this.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){this.widget.find(".timepicker .timepicker-picker").hide();this.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);if(this.options.pick12HourFormat){var current=this._date.getUTCHours();if(current>=12){if(value!=12)value=(value+12)%24}else{if(value===12)value=0;else value=value%12}}this._date.setUTCHours(value);this.actions.showPicker.call(this)},selectMinute:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);this._date.setUTCMinutes(value);this.actions.showPicker.call(this)},selectSecond:function(e){var tgt=$(e.target);var value=parseInt(tgt.text(),10);this._date.setUTCSeconds(value);this.actions.showPicker.call(this)}},doAction:function(e){e.stopPropagation();e.preventDefault();if(!this._date)this._date=UTCDate(1970,0,0,0,0,0,0);var action=$(e.currentTarget).data("action");var rv=this.actions[action].apply(this,arguments);this.set();this.fillTime();this.notifyChange();return rv},stopEvent:function(e){e.stopPropagation();e.preventDefault()},keydown:function(e){var self=this,k=e.which,input=$(e.target);if(k==8||k==46){setTimeout(function(){self._resetMaskPos(input)})}},keypress:function(e){var k=e.which;if(k==8||k==46){return}var input=$(e.target);var c=String.fromCharCode(k);var val=input.val()||"";val+=c;var mask=this._mask[this._maskPos];if(!mask){return false}if(mask.end!=val.length){return}if(!mask.pattern.test(val.slice(mask.start))){val=val.slice(0,val.length-1);while((mask=this._mask[this._maskPos])&&mask.character){val+=mask.character;this._maskPos++}val+=c;if(mask.end!=val.length){input.val(val);return false}else{if(!mask.pattern.test(val.slice(mask.start))){input.val(val.slice(0,mask.start));return false}else{input.val(val);this._maskPos++;return false}}}else{this._maskPos++}},change:function(e){var input=$(e.target);var val=input.val();if(this._formatPattern.test(val)){this.update();this.setValue(this._date.getTime());this.notifyChange();this.set()}else if(val&&val.trim()){this.setValue(this._date.getTime());if(this._date)this.set();else input.val("")}else{if(this._date){this.setValue(null);this.notifyChange();this._unset=true}}this._resetMaskPos(input)},showMode:function(dir){if(dir){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+dir))}this.widget.find(".datepicker > div").hide().filter(".datepicker-"+DPGlobal.modes[this.viewMode].clsName).show()},destroy:function(){this._detachDatePickerEvents();this._detachDatePickerGlobalEvents();this.widget.remove();this.$element.removeData("datetimepicker");this.component.removeData("datetimepicker")},formatDate:function(d){return this.format.replace(formatReplacer,function(match){var methodName,property,rv,len=match.length;if(match==="ms")len=1;property=dateFormatComponents[match].property;if(property==="Hours12"){rv=d.getUTCHours();if(rv===0)rv=12;else if(rv!==12)rv=rv%12}else if(property==="Period12"){if(d.getUTCHours()>=12)return"PM";else return"AM"}else{methodName="get"+property;rv=d[methodName]()}if(methodName==="getUTCMonth")rv=rv+1;if(methodName==="getUTCYear")rv=rv+1900-2e3;return padLeft(rv.toString(),len,"0")})},parseDate:function(str){var match,i,property,methodName,value,parsed={};if(!(match=this._formatPattern.exec(str)))return null;for(i=1;ival.length){this._maskPos=i;break}else if(this._mask[i].end===val.length){this._maskPos=i+1;break}}},_finishParsingDate:function(parsed){var year,month,date,hours,minutes,seconds,milliseconds;year=parsed.UTCFullYear;if(parsed.UTCYear)year=2e3+parsed.UTCYear;if(!year)year=1970;if(parsed.UTCMonth)month=parsed.UTCMonth-1;else month=0;date=parsed.UTCDate||1;hours=parsed.UTCHours||0;minutes=parsed.UTCMinutes||0;seconds=parsed.UTCSeconds||0;milliseconds=parsed.UTCMilliseconds||0;if(parsed.Hours12){hours=parsed.Hours12}if(parsed.Period12){if(/pm/i.test(parsed.Period12)){if(hours!=12)hours=(hours+12)%24}else{hours=hours%12}}return UTCDate(year,month,date,hours,minutes,seconds,milliseconds)},_compileFormat:function(){var match,component,components=[],mask=[],str=this.format,propertiesByIndex={},i=0,pos=0;while(match=formatComponent.exec(str)){component=match[0];if(component in dateFormatComponents){i++;propertiesByIndex[i]=dateFormatComponents[component].property;components.push("\\s*"+dateFormatComponents[component].getPattern(this)+"\\s*");mask.push({pattern:new RegExp(dateFormatComponents[component].getPattern(this)),property:dateFormatComponents[component].property,start:pos,end:pos+=component.length})}else{components.push(escapeRegExp(component));mask.push({pattern:new RegExp(escapeRegExp(component)),character:component,start:pos,end:++pos})}str=str.slice(component.length)}this._mask=mask;this._maskPos=0;this._formatPattern=new RegExp("^\\s*"+components.join("")+"\\s*$");this._propertiesByIndex=propertiesByIndex},_attachDatePickerEvents:function(){var self=this;this.widget.on("click",".datepicker *",$.proxy(this.click,this));this.widget.on("click","[data-action]",$.proxy(this.doAction,this));this.widget.on("mousedown",$.proxy(this.stopEvent,this));if(this.pickDate&&this.pickTime){this.widget.on("click.togglePicker",".accordion-toggle",function(e){e.stopPropagation();var $this=$(this);var $parent=$this.closest("ul");var expanded=$parent.find(".collapse.in");var closed=$parent.find(".collapse:not(.in)");if(expanded&&expanded.length){var collapseData=expanded.data("collapse");if(collapseData&&collapseData.transitioning)return;expanded.collapse("hide");closed.collapse("show");$this.find("i").toggleClass(self.timeIcon+" "+self.dateIcon);self.$element.find(".add-on i").toggleClass(self.timeIcon+" "+self.dateIcon)}})}if(this.isInput){this.$element.on({focus:$.proxy(this.show,this),change:$.proxy(this.change,this)});if(this.options.maskInput){this.$element.on({keydown:$.proxy(this.keydown,this),keypress:$.proxy(this.keypress,this)})}}else{this.$element.on({change:$.proxy(this.change,this)},"input");if(this.options.maskInput){this.$element.on({keydown:$.proxy(this.keydown,this),keypress:$.proxy(this.keypress,this)},"input")}if(this.component){this.component.on("click",$.proxy(this.show,this))}else{this.$element.on("click",$.proxy(this.show,this))}}},_attachDatePickerGlobalEvents:function(){$(window).on("resize.datetimepicker"+this.id,$.proxy(this.place,this));if(!this.isInput){$(document).on("mousedown.datetimepicker"+this.id,$.proxy(this.hide,this))}},_detachDatePickerEvents:function(){this.widget.off("click",".datepicker *",this.click);this.widget.off("click","[data-action]");this.widget.off("mousedown",this.stopEvent);if(this.pickDate&&this.pickTime){this.widget.off("click.togglePicker")}if(this.isInput){this.$element.off({focus:this.show,change:this.change});if(this.options.maskInput){this.$element.off({keydown:this.keydown,keypress:this.keypress})}}else{this.$element.off({change:this.change},"input");if(this.options.maskInput){this.$element.off({keydown:this.keydown,keypress:this.keypress},"input")}if(this.component){this.component.off("click",this.show)}else{this.$element.off("click",this.show)}}},_detachDatePickerGlobalEvents:function(){$(window).off("resize.datetimepicker"+this.id);if(!this.isInput){$(document).off("mousedown.datetimepicker"+this.id)}},_isInFixed:function(){if(this.$element){var parents=this.$element.parents();var inFixed=false;for(var i=0;i'+""+""}else if(pickTime){return'"}else{return'"}}function UTCDate(){return new Date(Date.UTC.apply(Date,arguments))}var DPGlobal={modes:[{clsName:"days",navFnc:"UTCMonth",navStep:1},{clsName:"months",navFnc:"UTCFullYear",navStep:1},{clsName:"years",navFnc:"UTCFullYear",navStep:10}],isLeapYear:function(year){return year%4===0&&year%100!==0||year%400===0},getDaysInMonth:function(year,month){return[31,DPGlobal.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month]},headTemplate:""+""+'‹ '+' '+'› '+" "+"",contTemplate:' '};DPGlobal.template=''+''+DPGlobal.headTemplate+""+"
"+""+''+''+DPGlobal.headTemplate+DPGlobal.contTemplate+"
"+""+''+''+DPGlobal.headTemplate+DPGlobal.contTemplate+"
"+"";var TPGlobal={hourTemplate:'',minuteTemplate:'',secondTemplate:''};TPGlobal.getTemplate=function(is12Hours,showSeconds){return''+'"+''+''+"
"+""+''+''+"
"+""+(showSeconds?''+''+"
"+"":"")}})(window.jQuery);
\ No newline at end of file
diff --git a/src/js/bootstrapDataTable.php b/src/js/bootstrapDataTable.php
deleted file mode 100644
index 0e3457cf..00000000
--- a/src/js/bootstrapDataTable.php
+++ /dev/null
@@ -1,101 +0,0 @@
-
\ No newline at end of file
diff --git a/src/js/d3js/d3.js b/src/js/d3js/d3.js
deleted file mode 100644
index fc556ed4..00000000
--- a/src/js/d3js/d3.js
+++ /dev/null
@@ -1,4149 +0,0 @@
-(function(){if (!Date.now) Date.now = function() {
- return +new Date;
-};
-try {
- document.createElement("div").style.setProperty("opacity", 0, "");
-} catch (error) {
- var d3_style_prototype = CSSStyleDeclaration.prototype,
- d3_style_setProperty = d3_style_prototype.setProperty;
- d3_style_prototype.setProperty = function(name, value, priority) {
- d3_style_setProperty.call(this, name, value + "", priority);
- };
-}
-d3 = {version: "2.4.4"}; // semver
-var d3_array = d3_arraySlice; // conversion for NodeLists
-
-function d3_arrayCopy(pseudoarray) {
- var i = -1, n = pseudoarray.length, array = [];
- while (++i < n) array.push(pseudoarray[i]);
- return array;
-}
-
-function d3_arraySlice(pseudoarray) {
- return Array.prototype.slice.call(pseudoarray);
-}
-
-try {
- d3_array(document.documentElement.childNodes)[0].nodeType;
-} catch(e) {
- d3_array = d3_arrayCopy;
-}
-
-var d3_arraySubclass = [].__proto__?
-
-// Until ECMAScript supports array subclassing, prototype injection works well.
-function(array, prototype) {
- array.__proto__ = prototype;
-}:
-
-// And if your browser doesn't support __proto__, we'll use direct extension.
-function(array, prototype) {
- for (var property in prototype) array[property] = prototype[property];
-};
-function d3_this() {
- return this;
-}
-d3.functor = function(v) {
- return typeof v === "function" ? v : function() { return v; };
-};
-// A getter-setter method that preserves the appropriate `this` context.
-d3.rebind = function(object, method) {
- return function() {
- var x = method.apply(object, arguments);
- return arguments.length ? object : x;
- };
-};
-d3.ascending = function(a, b) {
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
-};
-d3.descending = function(a, b) {
- return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
-};
-d3.mean = function(array, f) {
- var n = array.length,
- a,
- m = 0,
- i = -1,
- j = 0;
- if (arguments.length === 1) {
- while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
- } else {
- while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
- }
- return j ? m : undefined;
-};
-d3.median = function(array, f) {
- if (arguments.length > 1) array = array.map(f);
- array = array.filter(d3_number);
- return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
-};
-d3.min = function(array, f) {
- var i = -1,
- n = array.length,
- a,
- b;
- if (arguments.length === 1) {
- while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && a > b) a = b;
- } else {
- while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
- }
- return a;
-};
-d3.max = function(array, f) {
- var i = -1,
- n = array.length,
- a,
- b;
- if (arguments.length === 1) {
- while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && b > a) a = b;
- } else {
- while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
- }
- return a;
-};
-function d3_number(x) {
- return x != null && !isNaN(x);
-}
-d3.sum = function(array, f) {
- var s = 0,
- n = array.length,
- a,
- i = -1;
-
- if (arguments.length === 1) {
- while (++i < n) if (!isNaN(a = +array[i])) s += a;
- } else {
- while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
- }
-
- return s;
-};
-// R-7 per
-d3.quantile = function(values, p) {
- var H = (values.length - 1) * p + 1,
- h = Math.floor(H),
- v = values[h - 1],
- e = H - h;
- return e ? v + e * (values[h] - v) : v;
-};
-d3.zip = function() {
- if (!(n = arguments.length)) return [];
- for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) {
- for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) {
- zip[j] = arguments[j][i];
- }
- }
- return zips;
-};
-
-function d3_zipLength(d) {
- return d.length;
-}
-// Locate the insertion point for x in a to maintain sorted order. The
-// arguments lo and hi may be used to specify a subset of the array which should
-// be considered; by default the entire array is used. If x is already present
-// in a, the insertion point will be before (to the left of) any existing
-// entries. The return value is suitable for use as the first argument to
-// `array.splice` assuming that a is already sorted.
-//
-// The returned insertion point i partitions the array a into two halves so that
-// all v < x for v in a[lo:i] for the left side and all v >= x for v in a[i:hi]
-// for the right side.
-d3.bisectLeft = function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = (lo + hi) >> 1;
- if (a[mid] < x) lo = mid + 1;
- else hi = mid;
- }
- return lo;
-};
-
-// Similar to bisectLeft, but returns an insertion point which comes after (to
-// the right of) any existing entries of x in a.
-//
-// The returned insertion point i partitions the array into two halves so that
-// all v <= x for v in a[lo:i] for the left side and all v > x for v in a[i:hi]
-// for the right side.
-d3.bisect =
-d3.bisectRight = function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = (lo + hi) >> 1;
- if (x < a[mid]) hi = mid;
- else lo = mid + 1;
- }
- return lo;
-};
-d3.first = function(array, f) {
- var i = 0,
- n = array.length,
- a = array[0],
- b;
- if (arguments.length === 1) f = d3.ascending;
- while (++i < n) {
- if (f.call(array, a, b = array[i]) > 0) {
- a = b;
- }
- }
- return a;
-};
-d3.last = function(array, f) {
- var i = 0,
- n = array.length,
- a = array[0],
- b;
- if (arguments.length === 1) f = d3.ascending;
- while (++i < n) {
- if (f.call(array, a, b = array[i]) <= 0) {
- a = b;
- }
- }
- return a;
-};
-d3.nest = function() {
- var nest = {},
- keys = [],
- sortKeys = [],
- sortValues,
- rollup;
-
- function map(array, depth) {
- if (depth >= keys.length) return rollup
- ? rollup.call(nest, array) : (sortValues
- ? array.sort(sortValues)
- : array);
-
- var i = -1,
- n = array.length,
- key = keys[depth++],
- keyValue,
- object,
- o = {};
-
- while (++i < n) {
- if ((keyValue = key(object = array[i])) in o) {
- o[keyValue].push(object);
- } else {
- o[keyValue] = [object];
- }
- }
-
- for (keyValue in o) {
- o[keyValue] = map(o[keyValue], depth);
- }
-
- return o;
- }
-
- function entries(map, depth) {
- if (depth >= keys.length) return map;
-
- var a = [],
- sortKey = sortKeys[depth++],
- key;
-
- for (key in map) {
- a.push({key: key, values: entries(map[key], depth)});
- }
-
- if (sortKey) a.sort(function(a, b) {
- return sortKey(a.key, b.key);
- });
-
- return a;
- }
-
- nest.map = function(array) {
- return map(array, 0);
- };
-
- nest.entries = function(array) {
- return entries(map(array, 0), 0);
- };
-
- nest.key = function(d) {
- keys.push(d);
- return nest;
- };
-
- // Specifies the order for the most-recently specified key.
- // Note: only applies to entries. Map keys are unordered!
- nest.sortKeys = function(order) {
- sortKeys[keys.length - 1] = order;
- return nest;
- };
-
- // Specifies the order for leaf values.
- // Applies to both maps and entries array.
- nest.sortValues = function(order) {
- sortValues = order;
- return nest;
- };
-
- nest.rollup = function(f) {
- rollup = f;
- return nest;
- };
-
- return nest;
-};
-d3.keys = function(map) {
- var keys = [];
- for (var key in map) keys.push(key);
- return keys;
-};
-d3.values = function(map) {
- var values = [];
- for (var key in map) values.push(map[key]);
- return values;
-};
-d3.entries = function(map) {
- var entries = [];
- for (var key in map) entries.push({key: key, value: map[key]});
- return entries;
-};
-d3.permute = function(array, indexes) {
- var permutes = [],
- i = -1,
- n = indexes.length;
- while (++i < n) permutes[i] = array[indexes[i]];
- return permutes;
-};
-d3.merge = function(arrays) {
- return Array.prototype.concat.apply([], arrays);
-};
-d3.split = function(array, f) {
- var arrays = [],
- values = [],
- value,
- i = -1,
- n = array.length;
- if (arguments.length < 2) f = d3_splitter;
- while (++i < n) {
- if (f.call(values, value = array[i], i)) {
- values = [];
- } else {
- if (!values.length) arrays.push(values);
- values.push(value);
- }
- }
- return arrays;
-};
-
-function d3_splitter(d) {
- return d == null;
-}
-function d3_collapse(s) {
- return s.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
-}
-/**
- * @param {number} start
- * @param {number=} stop
- * @param {number=} step
- */
-d3.range = function(start, stop, step) {
- if (arguments.length < 3) {
- step = 1;
- if (arguments.length < 2) {
- stop = start;
- start = 0;
- }
- }
- if ((stop - start) / step == Infinity) throw new Error("infinite range");
- var range = [],
- i = -1,
- j;
- if (step < 0) while ((j = start + step * ++i) > stop) range.push(j);
- else while ((j = start + step * ++i) < stop) range.push(j);
- return range;
-};
-d3.requote = function(s) {
- return s.replace(d3_requote_re, "\\$&");
-};
-
-var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
-d3.round = function(x, n) {
- return n
- ? Math.round(x * Math.pow(10, n)) * Math.pow(10, -n)
- : Math.round(x);
-};
-d3.xhr = function(url, mime, callback) {
- var req = new XMLHttpRequest;
- if (arguments.length < 3) callback = mime;
- else if (mime && req.overrideMimeType) req.overrideMimeType(mime);
- req.open("GET", url, true);
- req.onreadystatechange = function() {
- if (req.readyState === 4) callback(req.status < 300 ? req : null);
- };
- req.send(null);
-};
-d3.text = function(url, mime, callback) {
- function ready(req) {
- callback(req && req.responseText);
- }
- if (arguments.length < 3) {
- callback = mime;
- mime = null;
- }
- d3.xhr(url, mime, ready);
-};
-d3.json = function(url, callback) {
- d3.text(url, "application/json", function(text) {
- callback(text ? JSON.parse(text) : null);
- });
-};
-d3.html = function(url, callback) {
- d3.text(url, "text/html", function(text) {
- if (text != null) { // Treat empty string as valid HTML.
- var range = document.createRange();
- range.selectNode(document.body);
- text = range.createContextualFragment(text);
- }
- callback(text);
- });
-};
-d3.xml = function(url, mime, callback) {
- function ready(req) {
- callback(req && req.responseXML);
- }
- if (arguments.length < 3) {
- callback = mime;
- mime = null;
- }
- d3.xhr(url, mime, ready);
-};
-d3.ns = {
-
- prefix: {
- svg: "http://www.w3.org/2000/svg",
- xhtml: "http://www.w3.org/1999/xhtml",
- xlink: "http://www.w3.org/1999/xlink",
- xml: "http://www.w3.org/XML/1998/namespace",
- xmlns: "http://www.w3.org/2000/xmlns/"
- },
-
- qualify: function(name) {
- var i = name.indexOf(":");
- return i < 0 ? name : {
- space: d3.ns.prefix[name.substring(0, i)],
- local: name.substring(i + 1)
- };
- }
-
-};
-/** @param {...string} types */
-d3.dispatch = function(types) {
- var dispatch = {},
- type;
- for (var i = 0, n = arguments.length; i < n; i++) {
- type = arguments[i];
- dispatch[type] = d3_dispatch(type);
- }
- return dispatch;
-};
-
-function d3_dispatch(type) {
- var dispatch = {},
- listeners = [];
-
- dispatch.add = function(listener) {
- for (var i = 0; i < listeners.length; i++) {
- if (listeners[i].listener == listener) return dispatch; // already registered
- }
- listeners.push({listener: listener, on: true});
- return dispatch;
- };
-
- dispatch.remove = function(listener) {
- for (var i = 0; i < listeners.length; i++) {
- var l = listeners[i];
- if (l.listener == listener) {
- l.on = false;
- listeners = listeners.slice(0, i).concat(listeners.slice(i + 1));
- break;
- }
- }
- return dispatch;
- };
-
- dispatch.dispatch = function() {
- var ls = listeners; // defensive reference
- for (var i = 0, n = ls.length; i < n; i++) {
- var l = ls[i];
- if (l.on) l.listener.apply(this, arguments);
- }
- };
-
- return dispatch;
-};
-// TODO align
-d3.format = function(specifier) {
- var match = d3_format_re.exec(specifier),
- fill = match[1] || " ",
- sign = match[3] || "",
- zfill = match[5],
- width = +match[6],
- comma = match[7],
- precision = match[8],
- type = match[9],
- scale = 1,
- suffix = "",
- integer = false;
-
- if (precision) precision = +precision.substring(1);
-
- if (zfill) {
- fill = "0"; // TODO align = "=";
- if (comma) width -= Math.floor((width - 1) / 4);
- }
-
- switch (type) {
- case "n": comma = true; type = "g"; break;
- case "%": scale = 100; suffix = "%"; type = "f"; break;
- case "p": scale = 100; suffix = "%"; type = "r"; break;
- case "d": integer = true; precision = 0; break;
- case "s": scale = -1; type = "r"; break;
- }
-
- // If no precision is specified for r, fallback to general notation.
- if (type == "r" && !precision) type = "g";
-
- type = d3_format_types[type] || d3_format_typeDefault;
-
- return function(value) {
-
- // Return the empty string for floats formatted as ints.
- if (integer && (value % 1)) return "";
-
- // Convert negative to positive, and record the sign prefix.
- var negative = (value < 0) && (value = -value) ? "\u2212" : sign;
-
- // Apply the scale, computing it from the value's exponent for si format.
- if (scale < 0) {
- var prefix = d3.formatPrefix(value, precision);
- value *= prefix.scale;
- suffix = prefix.symbol;
- } else {
- value *= scale;
- }
-
- // Convert to the desired precision.
- value = type(value, precision);
-
- // If the fill character is 0, the sign and group is applied after the fill.
- if (zfill) {
- var length = value.length + negative.length;
- if (length < width) value = new Array(width - length + 1).join(fill) + value;
- if (comma) value = d3_format_group(value);
- value = negative + value;
- }
-
- // Otherwise (e.g., space-filling), the sign and group is applied before.
- else {
- if (comma) value = d3_format_group(value);
- value = negative + value;
- var length = value.length;
- if (length < width) value = new Array(width - length + 1).join(fill) + value;
- }
-
- return value + suffix;
- };
-};
-
-// [[fill]align][sign][#][0][width][,][.precision][type]
-var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/;
-
-var d3_format_types = {
- g: function(x, p) { return x.toPrecision(p); },
- e: function(x, p) { return x.toExponential(p); },
- f: function(x, p) { return x.toFixed(p); },
- r: function(x, p) { return d3.round(x, p = d3_format_precision(x, p)).toFixed(Math.max(0, Math.min(20, p))); }
-};
-
-function d3_format_precision(x, p) {
- return p - (x ? 1 + Math.floor(Math.log(x + Math.pow(10, 1 + Math.floor(Math.log(x) / Math.LN10) - p)) / Math.LN10) : 1);
-}
-
-function d3_format_typeDefault(x) {
- return x + "";
-}
-
-// Apply comma grouping for thousands.
-function d3_format_group(value) {
- var i = value.lastIndexOf("."),
- f = i >= 0 ? value.substring(i) : (i = value.length, ""),
- t = [];
- while (i > 0) t.push(value.substring(i -= 3, i + 3));
- return t.reverse().join(",") + f;
-}
-var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);
-
-d3.formatPrefix = function(value, precision) {
- var i = 0;
- if (value) {
- if (value < 0) value *= -1;
- if (precision) value = d3.round(value, d3_format_precision(value, precision));
- i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
- i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3));
- }
- return d3_formatPrefixes[8 + i / 3];
-};
-
-function d3_formatPrefix(d, i) {
- return {
- scale: Math.pow(10, (8 - i) * 3),
- symbol: d
- };
-}
-
-/*
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright 2001 Robert Penner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * - Neither the name of the author nor the names of contributors may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-var d3_ease_quad = d3_ease_poly(2),
- d3_ease_cubic = d3_ease_poly(3);
-
-var d3_ease = {
- linear: function() { return d3_ease_linear; },
- poly: d3_ease_poly,
- quad: function() { return d3_ease_quad; },
- cubic: function() { return d3_ease_cubic; },
- sin: function() { return d3_ease_sin; },
- exp: function() { return d3_ease_exp; },
- circle: function() { return d3_ease_circle; },
- elastic: d3_ease_elastic,
- back: d3_ease_back,
- bounce: function() { return d3_ease_bounce; }
-};
-
-var d3_ease_mode = {
- "in": function(f) { return f; },
- "out": d3_ease_reverse,
- "in-out": d3_ease_reflect,
- "out-in": function(f) { return d3_ease_reflect(d3_ease_reverse(f)); }
-};
-
-d3.ease = function(name) {
- var i = name.indexOf("-"),
- t = i >= 0 ? name.substring(0, i) : name,
- m = i >= 0 ? name.substring(i + 1) : "in";
- return d3_ease_clamp(d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1))));
-};
-
-function d3_ease_clamp(f) {
- return function(t) {
- return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
- };
-}
-
-function d3_ease_reverse(f) {
- return function(t) {
- return 1 - f(1 - t);
- };
-}
-
-function d3_ease_reflect(f) {
- return function(t) {
- return .5 * (t < .5 ? f(2 * t) : (2 - f(2 - 2 * t)));
- };
-}
-
-function d3_ease_linear(t) {
- return t;
-}
-
-function d3_ease_poly(e) {
- return function(t) {
- return Math.pow(t, e);
- }
-}
-
-function d3_ease_sin(t) {
- return 1 - Math.cos(t * Math.PI / 2);
-}
-
-function d3_ease_exp(t) {
- return Math.pow(2, 10 * (t - 1));
-}
-
-function d3_ease_circle(t) {
- return 1 - Math.sqrt(1 - t * t);
-}
-
-function d3_ease_elastic(a, p) {
- var s;
- if (arguments.length < 2) p = 0.45;
- if (arguments.length < 1) { a = 1; s = p / 4; }
- else s = p / (2 * Math.PI) * Math.asin(1 / a);
- return function(t) {
- return 1 + a * Math.pow(2, 10 * -t) * Math.sin((t - s) * 2 * Math.PI / p);
- };
-}
-
-function d3_ease_back(s) {
- if (!s) s = 1.70158;
- return function(t) {
- return t * t * ((s + 1) * t - s);
- };
-}
-
-function d3_ease_bounce(t) {
- return t < 1 / 2.75 ? 7.5625 * t * t
- : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75
- : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375
- : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
-}
-d3.event = null;
-d3.interpolate = function(a, b) {
- var i = d3.interpolators.length, f;
- while (--i >= 0 && !(f = d3.interpolators[i](a, b)));
- return f;
-};
-
-d3.interpolateNumber = function(a, b) {
- b -= a;
- return function(t) { return a + b * t; };
-};
-
-d3.interpolateRound = function(a, b) {
- b -= a;
- return function(t) { return Math.round(a + b * t); };
-};
-
-d3.interpolateString = function(a, b) {
- var m, // current match
- i, // current index
- j, // current index (for coallescing)
- s0 = 0, // start index of current string prefix
- s1 = 0, // end index of current string prefix
- s = [], // string constants and placeholders
- q = [], // number interpolators
- n, // q.length
- o;
-
- // Reset our regular expression!
- d3_interpolate_number.lastIndex = 0;
-
- // Find all numbers in b.
- for (i = 0; m = d3_interpolate_number.exec(b); ++i) {
- if (m.index) s.push(b.substring(s0, s1 = m.index));
- q.push({i: s.length, x: m[0]});
- s.push(null);
- s0 = d3_interpolate_number.lastIndex;
- }
- if (s0 < b.length) s.push(b.substring(s0));
-
- // Find all numbers in a.
- for (i = 0, n = q.length; (m = d3_interpolate_number.exec(a)) && i < n; ++i) {
- o = q[i];
- if (o.x == m[0]) { // The numbers match, so coallesce.
- if (o.i) {
- if (s[o.i + 1] == null) { // This match is followed by another number.
- s[o.i - 1] += o.x;
- s.splice(o.i, 1);
- for (j = i + 1; j < n; ++j) q[j].i--;
- } else { // This match is followed by a string, so coallesce twice.
- s[o.i - 1] += o.x + s[o.i + 1];
- s.splice(o.i, 2);
- for (j = i + 1; j < n; ++j) q[j].i -= 2;
- }
- } else {
- if (s[o.i + 1] == null) { // This match is followed by another number.
- s[o.i] = o.x;
- } else { // This match is followed by a string, so coallesce twice.
- s[o.i] = o.x + s[o.i + 1];
- s.splice(o.i + 1, 1);
- for (j = i + 1; j < n; ++j) q[j].i--;
- }
- }
- q.splice(i, 1);
- n--;
- i--;
- } else {
- o.x = d3.interpolateNumber(parseFloat(m[0]), parseFloat(o.x));
- }
- }
-
- // Remove any numbers in b not found in a.
- while (i < n) {
- o = q.pop();
- if (s[o.i + 1] == null) { // This match is followed by another number.
- s[o.i] = o.x;
- } else { // This match is followed by a string, so coallesce twice.
- s[o.i] = o.x + s[o.i + 1];
- s.splice(o.i + 1, 1);
- }
- n--;
- }
-
- // Special optimization for only a single match.
- if (s.length === 1) {
- return s[0] == null ? q[0].x : function() { return b; };
- }
-
- // Otherwise, interpolate each of the numbers and rejoin the string.
- return function(t) {
- for (i = 0; i < n; ++i) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- };
-};
-
-d3.interpolateRgb = function(a, b) {
- a = d3.rgb(a);
- b = d3.rgb(b);
- var ar = a.r,
- ag = a.g,
- ab = a.b,
- br = b.r - ar,
- bg = b.g - ag,
- bb = b.b - ab;
- return function(t) {
- return "#"
- + d3_rgb_hex(Math.round(ar + br * t))
- + d3_rgb_hex(Math.round(ag + bg * t))
- + d3_rgb_hex(Math.round(ab + bb * t));
- };
-};
-
-// interpolates HSL space, but outputs RGB string (for compatibility)
-d3.interpolateHsl = function(a, b) {
- a = d3.hsl(a);
- b = d3.hsl(b);
- var h0 = a.h,
- s0 = a.s,
- l0 = a.l,
- h1 = b.h - h0,
- s1 = b.s - s0,
- l1 = b.l - l0;
- return function(t) {
- return d3_hsl_rgb(h0 + h1 * t, s0 + s1 * t, l0 + l1 * t).toString();
- };
-};
-
-d3.interpolateArray = function(a, b) {
- var x = [],
- c = [],
- na = a.length,
- nb = b.length,
- n0 = Math.min(a.length, b.length),
- i;
- for (i = 0; i < n0; ++i) x.push(d3.interpolate(a[i], b[i]));
- for (; i < na; ++i) c[i] = a[i];
- for (; i < nb; ++i) c[i] = b[i];
- return function(t) {
- for (i = 0; i < n0; ++i) c[i] = x[i](t);
- return c;
- };
-};
-
-d3.interpolateObject = function(a, b) {
- var i = {},
- c = {},
- k;
- for (k in a) {
- if (k in b) {
- i[k] = d3_interpolateByName(k)(a[k], b[k]);
- } else {
- c[k] = a[k];
- }
- }
- for (k in b) {
- if (!(k in a)) {
- c[k] = b[k];
- }
- }
- return function(t) {
- for (k in i) c[k] = i[k](t);
- return c;
- };
-}
-
-var d3_interpolate_number = /[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,
- d3_interpolate_rgb = {background: 1, fill: 1, stroke: 1};
-
-function d3_interpolateByName(n) {
- return n in d3_interpolate_rgb || /\bcolor\b/.test(n)
- ? d3.interpolateRgb
- : d3.interpolate;
-}
-
-d3.interpolators = [
- d3.interpolateObject,
- function(a, b) { return (b instanceof Array) && d3.interpolateArray(a, b); },
- function(a, b) { return (typeof b === "string") && d3.interpolateString(String(a), b); },
- function(a, b) { return (typeof b === "string" ? b in d3_rgb_names || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Rgb || b instanceof d3_Hsl) && d3.interpolateRgb(String(a), b); },
- function(a, b) { return (typeof b === "number") && d3.interpolateNumber(+a, b); }
-];
-function d3_uninterpolateNumber(a, b) {
- b = b - (a = +a) ? 1 / (b - a) : 0;
- return function(x) { return (x - a) * b; };
-}
-
-function d3_uninterpolateClamp(a, b) {
- b = b - (a = +a) ? 1 / (b - a) : 0;
- return function(x) { return Math.max(0, Math.min(1, (x - a) * b)); };
-}
-d3.rgb = function(r, g, b) {
- return arguments.length === 1
- ? (r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b)
- : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb))
- : d3_rgb(~~r, ~~g, ~~b);
-};
-
-function d3_rgb(r, g, b) {
- return new d3_Rgb(r, g, b);
-}
-
-function d3_Rgb(r, g, b) {
- this.r = r;
- this.g = g;
- this.b = b;
-}
-
-d3_Rgb.prototype.brighter = function(k) {
- k = Math.pow(0.7, arguments.length ? k : 1);
- var r = this.r,
- g = this.g,
- b = this.b,
- i = 30;
- if (!r && !g && !b) return d3_rgb(i, i, i);
- if (r && r < i) r = i;
- if (g && g < i) g = i;
- if (b && b < i) b = i;
- return d3_rgb(
- Math.min(255, Math.floor(r / k)),
- Math.min(255, Math.floor(g / k)),
- Math.min(255, Math.floor(b / k)));
-};
-
-d3_Rgb.prototype.darker = function(k) {
- k = Math.pow(0.7, arguments.length ? k : 1);
- return d3_rgb(
- Math.floor(k * this.r),
- Math.floor(k * this.g),
- Math.floor(k * this.b));
-};
-
-d3_Rgb.prototype.hsl = function() {
- return d3_rgb_hsl(this.r, this.g, this.b);
-};
-
-d3_Rgb.prototype.toString = function() {
- return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
-};
-
-function d3_rgb_hex(v) {
- return v < 0x10
- ? "0" + Math.max(0, v).toString(16)
- : Math.min(255, v).toString(16);
-}
-
-function d3_rgb_parse(format, rgb, hsl) {
- var r = 0, // red channel; int in [0, 255]
- g = 0, // green channel; int in [0, 255]
- b = 0, // blue channel; int in [0, 255]
- m1, // CSS color specification match
- m2, // CSS color specification type (e.g., rgb)
- name;
-
- /* Handle hsl, rgb. */
- m1 = /([a-z]+)\((.*)\)/i.exec(format);
- if (m1) {
- m2 = m1[2].split(",");
- switch (m1[1]) {
- case "hsl": {
- return hsl(
- parseFloat(m2[0]), // degrees
- parseFloat(m2[1]) / 100, // percentage
- parseFloat(m2[2]) / 100 // percentage
- );
- }
- case "rgb": {
- return rgb(
- d3_rgb_parseNumber(m2[0]),
- d3_rgb_parseNumber(m2[1]),
- d3_rgb_parseNumber(m2[2])
- );
- }
- }
- }
-
- /* Named colors. */
- if (name = d3_rgb_names[format]) return rgb(name.r, name.g, name.b);
-
- /* Hexadecimal colors: #rgb and #rrggbb. */
- if (format != null && format.charAt(0) === "#") {
- if (format.length === 4) {
- r = format.charAt(1); r += r;
- g = format.charAt(2); g += g;
- b = format.charAt(3); b += b;
- } else if (format.length === 7) {
- r = format.substring(1, 3);
- g = format.substring(3, 5);
- b = format.substring(5, 7);
- }
- r = parseInt(r, 16);
- g = parseInt(g, 16);
- b = parseInt(b, 16);
- }
-
- return rgb(r, g, b);
-}
-
-function d3_rgb_hsl(r, g, b) {
- var min = Math.min(r /= 255, g /= 255, b /= 255),
- max = Math.max(r, g, b),
- d = max - min,
- h,
- s,
- l = (max + min) / 2;
- if (d) {
- s = l < .5 ? d / (max + min) : d / (2 - max - min);
- if (r == max) h = (g - b) / d + (g < b ? 6 : 0);
- else if (g == max) h = (b - r) / d + 2;
- else h = (r - g) / d + 4;
- h *= 60;
- } else {
- s = h = 0;
- }
- return d3_hsl(h, s, l);
-}
-
-function d3_rgb_parseNumber(c) { // either integer or percentage
- var f = parseFloat(c);
- return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
-}
-
-var d3_rgb_names = {
- aliceblue: "#f0f8ff",
- antiquewhite: "#faebd7",
- aqua: "#00ffff",
- aquamarine: "#7fffd4",
- azure: "#f0ffff",
- beige: "#f5f5dc",
- bisque: "#ffe4c4",
- black: "#000000",
- blanchedalmond: "#ffebcd",
- blue: "#0000ff",
- blueviolet: "#8a2be2",
- brown: "#a52a2a",
- burlywood: "#deb887",
- cadetblue: "#5f9ea0",
- chartreuse: "#7fff00",
- chocolate: "#d2691e",
- coral: "#ff7f50",
- cornflowerblue: "#6495ed",
- cornsilk: "#fff8dc",
- crimson: "#dc143c",
- cyan: "#00ffff",
- darkblue: "#00008b",
- darkcyan: "#008b8b",
- darkgoldenrod: "#b8860b",
- darkgray: "#a9a9a9",
- darkgreen: "#006400",
- darkgrey: "#a9a9a9",
- darkkhaki: "#bdb76b",
- darkmagenta: "#8b008b",
- darkolivegreen: "#556b2f",
- darkorange: "#ff8c00",
- darkorchid: "#9932cc",
- darkred: "#8b0000",
- darksalmon: "#e9967a",
- darkseagreen: "#8fbc8f",
- darkslateblue: "#483d8b",
- darkslategray: "#2f4f4f",
- darkslategrey: "#2f4f4f",
- darkturquoise: "#00ced1",
- darkviolet: "#9400d3",
- deeppink: "#ff1493",
- deepskyblue: "#00bfff",
- dimgray: "#696969",
- dimgrey: "#696969",
- dodgerblue: "#1e90ff",
- firebrick: "#b22222",
- floralwhite: "#fffaf0",
- forestgreen: "#228b22",
- fuchsia: "#ff00ff",
- gainsboro: "#dcdcdc",
- ghostwhite: "#f8f8ff",
- gold: "#ffd700",
- goldenrod: "#daa520",
- gray: "#808080",
- green: "#008000",
- greenyellow: "#adff2f",
- grey: "#808080",
- honeydew: "#f0fff0",
- hotpink: "#ff69b4",
- indianred: "#cd5c5c",
- indigo: "#4b0082",
- ivory: "#fffff0",
- khaki: "#f0e68c",
- lavender: "#e6e6fa",
- lavenderblush: "#fff0f5",
- lawngreen: "#7cfc00",
- lemonchiffon: "#fffacd",
- lightblue: "#add8e6",
- lightcoral: "#f08080",
- lightcyan: "#e0ffff",
- lightgoldenrodyellow: "#fafad2",
- lightgray: "#d3d3d3",
- lightgreen: "#90ee90",
- lightgrey: "#d3d3d3",
- lightpink: "#ffb6c1",
- lightsalmon: "#ffa07a",
- lightseagreen: "#20b2aa",
- lightskyblue: "#87cefa",
- lightslategray: "#778899",
- lightslategrey: "#778899",
- lightsteelblue: "#b0c4de",
- lightyellow: "#ffffe0",
- lime: "#00ff00",
- limegreen: "#32cd32",
- linen: "#faf0e6",
- magenta: "#ff00ff",
- maroon: "#800000",
- mediumaquamarine: "#66cdaa",
- mediumblue: "#0000cd",
- mediumorchid: "#ba55d3",
- mediumpurple: "#9370db",
- mediumseagreen: "#3cb371",
- mediumslateblue: "#7b68ee",
- mediumspringgreen: "#00fa9a",
- mediumturquoise: "#48d1cc",
- mediumvioletred: "#c71585",
- midnightblue: "#191970",
- mintcream: "#f5fffa",
- mistyrose: "#ffe4e1",
- moccasin: "#ffe4b5",
- navajowhite: "#ffdead",
- navy: "#000080",
- oldlace: "#fdf5e6",
- olive: "#808000",
- olivedrab: "#6b8e23",
- orange: "#ffa500",
- orangered: "#ff4500",
- orchid: "#da70d6",
- palegoldenrod: "#eee8aa",
- palegreen: "#98fb98",
- paleturquoise: "#afeeee",
- palevioletred: "#db7093",
- papayawhip: "#ffefd5",
- peachpuff: "#ffdab9",
- peru: "#cd853f",
- pink: "#ffc0cb",
- plum: "#dda0dd",
- powderblue: "#b0e0e6",
- purple: "#800080",
- red: "#ff0000",
- rosybrown: "#bc8f8f",
- royalblue: "#4169e1",
- saddlebrown: "#8b4513",
- salmon: "#fa8072",
- sandybrown: "#f4a460",
- seagreen: "#2e8b57",
- seashell: "#fff5ee",
- sienna: "#a0522d",
- silver: "#c0c0c0",
- skyblue: "#87ceeb",
- slateblue: "#6a5acd",
- slategray: "#708090",
- slategrey: "#708090",
- snow: "#fffafa",
- springgreen: "#00ff7f",
- steelblue: "#4682b4",
- tan: "#d2b48c",
- teal: "#008080",
- thistle: "#d8bfd8",
- tomato: "#ff6347",
- turquoise: "#40e0d0",
- violet: "#ee82ee",
- wheat: "#f5deb3",
- white: "#ffffff",
- whitesmoke: "#f5f5f5",
- yellow: "#ffff00",
- yellowgreen: "#9acd32"
-};
-
-for (var d3_rgb_name in d3_rgb_names) {
- d3_rgb_names[d3_rgb_name] = d3_rgb_parse(
- d3_rgb_names[d3_rgb_name],
- d3_rgb,
- d3_hsl_rgb);
-}
-d3.hsl = function(h, s, l) {
- return arguments.length === 1
- ? (h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l)
- : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl))
- : d3_hsl(+h, +s, +l);
-};
-
-function d3_hsl(h, s, l) {
- return new d3_Hsl(h, s, l);
-}
-
-function d3_Hsl(h, s, l) {
- this.h = h;
- this.s = s;
- this.l = l;
-}
-
-d3_Hsl.prototype.brighter = function(k) {
- k = Math.pow(0.7, arguments.length ? k : 1);
- return d3_hsl(this.h, this.s, this.l / k);
-};
-
-d3_Hsl.prototype.darker = function(k) {
- k = Math.pow(0.7, arguments.length ? k : 1);
- return d3_hsl(this.h, this.s, k * this.l);
-};
-
-d3_Hsl.prototype.rgb = function() {
- return d3_hsl_rgb(this.h, this.s, this.l);
-};
-
-d3_Hsl.prototype.toString = function() {
- return this.rgb().toString();
-};
-
-function d3_hsl_rgb(h, s, l) {
- var m1,
- m2;
-
- /* Some simple corrections for h, s and l. */
- h = h % 360; if (h < 0) h += 360;
- s = s < 0 ? 0 : s > 1 ? 1 : s;
- l = l < 0 ? 0 : l > 1 ? 1 : l;
-
- /* From FvD 13.37, CSS Color Module Level 3 */
- m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
- m1 = 2 * l - m2;
-
- function v(h) {
- if (h > 360) h -= 360;
- else if (h < 0) h += 360;
- if (h < 60) return m1 + (m2 - m1) * h / 60;
- if (h < 180) return m2;
- if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
- return m1;
- }
-
- function vv(h) {
- return Math.round(v(h) * 255);
- }
-
- return d3_rgb(vv(h + 120), vv(h), vv(h - 120));
-}
-function d3_selection(groups) {
- d3_arraySubclass(groups, d3_selectionPrototype);
- return groups;
-}
-
-var d3_select = function(s, n) { return n.querySelector(s); },
- d3_selectAll = function(s, n) { return n.querySelectorAll(s); };
-
-// Prefer Sizzle, if available.
-if (typeof Sizzle === "function") {
- d3_select = function(s, n) { return Sizzle(s, n)[0]; };
- d3_selectAll = function(s, n) { return Sizzle.uniqueSort(Sizzle(s, n)); };
-}
-
-var d3_selectionPrototype = [];
-
-d3.selection = function() {
- return d3_selectionRoot;
-};
-
-d3.selection.prototype = d3_selectionPrototype;
-d3_selectionPrototype.select = function(selector) {
- var subgroups = [],
- subgroup,
- subnode,
- group,
- node;
-
- if (typeof selector !== "function") selector = d3_selection_selector(selector);
-
- for (var j = -1, m = this.length; ++j < m;) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = -1, n = group.length; ++i < n;) {
- if (node = group[i]) {
- subgroup.push(subnode = selector.call(node, node.__data__, i));
- if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
-
- return d3_selection(subgroups);
-};
-
-function d3_selection_selector(selector) {
- return function() {
- return d3_select(selector, this);
- };
-}
-d3_selectionPrototype.selectAll = function(selector) {
- var subgroups = [],
- subgroup,
- node;
-
- if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
-
- for (var j = -1, m = this.length; ++j < m;) {
- for (var group = this[j], i = -1, n = group.length; ++i < n;) {
- if (node = group[i]) {
- subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i)));
- subgroup.parentNode = node;
- }
- }
- }
-
- return d3_selection(subgroups);
-};
-
-function d3_selection_selectorAll(selector) {
- return function() {
- return d3_selectAll(selector, this);
- };
-}
-d3_selectionPrototype.attr = function(name, value) {
- name = d3.ns.qualify(name);
-
- // If no value is specified, return the first value.
- if (arguments.length < 2) {
- var node = this.node();
- return name.local
- ? node.getAttributeNS(name.space, name.local)
- : node.getAttribute(name);
- }
-
- function attrNull() {
- this.removeAttribute(name);
- }
-
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
-
- function attrConstant() {
- this.setAttribute(name, value);
- }
-
- function attrConstantNS() {
- this.setAttributeNS(name.space, name.local, value);
- }
-
- function attrFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttribute(name);
- else this.setAttribute(name, x);
- }
-
- function attrFunctionNS() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttributeNS(name.space, name.local);
- else this.setAttributeNS(name.space, name.local, x);
- }
-
- return this.each(value == null
- ? (name.local ? attrNullNS : attrNull) : (typeof value === "function"
- ? (name.local ? attrFunctionNS : attrFunction)
- : (name.local ? attrConstantNS : attrConstant)));
-};
-d3_selectionPrototype.classed = function(name, value) {
- var names = name.split(d3_selection_classedWhitespace),
- n = names.length,
- i = -1;
- if (arguments.length > 1) {
- while (++i < n) d3_selection_classed.call(this, names[i], value);
- return this;
- } else {
- while (++i < n) if (!d3_selection_classed.call(this, names[i])) return false;
- return true;
- }
-};
-
-var d3_selection_classedWhitespace = /\s+/g;
-
-function d3_selection_classed(name, value) {
- var re = new RegExp("(^|\\s+)" + d3.requote(name) + "(\\s+|$)", "g");
-
- // If no value is specified, return the first value.
- if (arguments.length < 2) {
- var node = this.node();
- if (c = node.classList) return c.contains(name);
- var c = node.className;
- re.lastIndex = 0;
- return re.test(c.baseVal != null ? c.baseVal : c);
- }
-
- function classedAdd() {
- if (c = this.classList) return c.add(name);
- var c = this.className,
- cb = c.baseVal != null,
- cv = cb ? c.baseVal : c;
- re.lastIndex = 0;
- if (!re.test(cv)) {
- cv = d3_collapse(cv + " " + name);
- if (cb) c.baseVal = cv;
- else this.className = cv;
- }
- }
-
- function classedRemove() {
- if (c = this.classList) return c.remove(name);
- var c = this.className,
- cb = c.baseVal != null,
- cv = cb ? c.baseVal : c;
- cv = d3_collapse(cv.replace(re, " "));
- if (cb) c.baseVal = cv;
- else this.className = cv;
- }
-
- function classedFunction() {
- (value.apply(this, arguments)
- ? classedAdd
- : classedRemove).call(this);
- }
-
- return this.each(typeof value === "function"
- ? classedFunction : value
- ? classedAdd
- : classedRemove);
-}
-d3_selectionPrototype.style = function(name, value, priority) {
- if (arguments.length < 3) priority = "";
-
- // If no value is specified, return the first value.
- if (arguments.length < 2) return window
- .getComputedStyle(this.node(), null)
- .getPropertyValue(name);
-
- function styleNull() {
- this.style.removeProperty(name);
- }
-
- function styleConstant() {
- this.style.setProperty(name, value, priority);
- }
-
- function styleFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.style.removeProperty(name);
- else this.style.setProperty(name, x, priority);
- }
-
- return this.each(value == null
- ? styleNull : (typeof value === "function"
- ? styleFunction : styleConstant));
-};
-d3_selectionPrototype.property = function(name, value) {
-
- // If no value is specified, return the first value.
- if (arguments.length < 2) return this.node()[name];
-
- function propertyNull() {
- delete this[name];
- }
-
- function propertyConstant() {
- this[name] = value;
- }
-
- function propertyFunction() {
- var x = value.apply(this, arguments);
- if (x == null) delete this[name];
- else this[name] = x;
- }
-
- return this.each(value == null
- ? propertyNull : (typeof value === "function"
- ? propertyFunction : propertyConstant));
-};
-d3_selectionPrototype.text = function(value) {
- return arguments.length < 1 ? this.node().textContent
- : (this.each(typeof value === "function"
- ? function() { this.textContent = value.apply(this, arguments); }
- : function() { this.textContent = value; }));
-};
-d3_selectionPrototype.html = function(value) {
- return arguments.length < 1 ? this.node().innerHTML
- : (this.each(typeof value === "function"
- ? function() { this.innerHTML = value.apply(this, arguments); }
- : function() { this.innerHTML = value; }));
-};
-// TODO append(node)?
-// TODO append(function)?
-d3_selectionPrototype.append = function(name) {
- name = d3.ns.qualify(name);
-
- function append() {
- return this.appendChild(document.createElement(name));
- }
-
- function appendNS() {
- return this.appendChild(document.createElementNS(name.space, name.local));
- }
-
- return this.select(name.local ? appendNS : append);
-};
-// TODO insert(node, function)?
-// TODO insert(function, string)?
-// TODO insert(function, function)?
-d3_selectionPrototype.insert = function(name, before) {
- name = d3.ns.qualify(name);
-
- function insert() {
- return this.insertBefore(
- document.createElement(name),
- d3_select(before, this));
- }
-
- function insertNS() {
- return this.insertBefore(
- document.createElementNS(name.space, name.local),
- d3_select(before, this));
- }
-
- return this.select(name.local ? insertNS : insert);
-};
-// TODO remove(selector)?
-// TODO remove(node)?
-// TODO remove(function)?
-d3_selectionPrototype.remove = function() {
- return this.each(function() {
- var parent = this.parentNode;
- if (parent) parent.removeChild(this);
- });
-};
-// TODO data(null) for clearing data?
-d3_selectionPrototype.data = function(data, join) {
- var enter = [],
- update = [],
- exit = [];
-
- function bind(group, groupData) {
- var i,
- n = group.length,
- m = groupData.length,
- n0 = Math.min(n, m),
- n1 = Math.max(n, m),
- updateNodes = [],
- enterNodes = [],
- exitNodes = [],
- node,
- nodeData;
-
- if (join) {
- var nodeByKey = {},
- keys = [],
- key,
- j = groupData.length;
-
- for (i = -1; ++i < n;) {
- key = join.call(node = group[i], node.__data__, i);
- if (key in nodeByKey) {
- exitNodes[j++] = node; // duplicate key
- } else {
- nodeByKey[key] = node;
- }
- keys.push(key);
- }
-
- for (i = -1; ++i < m;) {
- node = nodeByKey[key = join.call(groupData, nodeData = groupData[i], i)];
- if (node) {
- node.__data__ = nodeData;
- updateNodes[i] = node;
- enterNodes[i] = exitNodes[i] = null;
- } else {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- updateNodes[i] = exitNodes[i] = null;
- }
- delete nodeByKey[key];
- }
-
- for (i = -1; ++i < n;) {
- if (keys[i] in nodeByKey) {
- exitNodes[i] = group[i];
- }
- }
- } else {
- for (i = -1; ++i < n0;) {
- node = group[i];
- nodeData = groupData[i];
- if (node) {
- node.__data__ = nodeData;
- updateNodes[i] = node;
- enterNodes[i] = exitNodes[i] = null;
- } else {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- updateNodes[i] = exitNodes[i] = null;
- }
- }
- for (; i < m; ++i) {
- enterNodes[i] = d3_selection_dataNode(groupData[i]);
- updateNodes[i] = exitNodes[i] = null;
- }
- for (; i < n1; ++i) {
- exitNodes[i] = group[i];
- enterNodes[i] = updateNodes[i] = null;
- }
- }
-
- enterNodes.update
- = updateNodes;
-
- enterNodes.parentNode
- = updateNodes.parentNode
- = exitNodes.parentNode
- = group.parentNode;
-
- enter.push(enterNodes);
- update.push(updateNodes);
- exit.push(exitNodes);
- }
-
- var i = -1,
- n = this.length,
- group;
- if (typeof data === "function") {
- while (++i < n) {
- bind(group = this[i], data.call(group, group.parentNode.__data__, i));
- }
- } else {
- while (++i < n) {
- bind(group = this[i], data);
- }
- }
-
- var selection = d3_selection(update);
- selection.enter = function() { return d3_selection_enter(enter); };
- selection.exit = function() { return d3_selection(exit); };
- return selection;
-};
-
-function d3_selection_dataNode(data) {
- return {__data__: data};
-}
-function d3_selection_enter(selection) {
- d3_arraySubclass(selection, d3_selection_enterPrototype);
- return selection;
-}
-
-var d3_selection_enterPrototype = [];
-
-d3_selection_enterPrototype.append = d3_selectionPrototype.append;
-d3_selection_enterPrototype.insert = d3_selectionPrototype.insert;
-d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
-d3_selection_enterPrototype.select = function(selector) {
- var subgroups = [],
- subgroup,
- subnode,
- upgroup,
- group,
- node;
-
- for (var j = -1, m = this.length; ++j < m;) {
- upgroup = (group = this[j]).update;
- subgroups.push(subgroup = []);
- subgroup.parentNode = group.parentNode;
- for (var i = -1, n = group.length; ++i < n;) {
- if (node = group[i]) {
- subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i));
- subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
-
- return d3_selection(subgroups);
-};
-// TODO preserve null elements to maintain index?
-d3_selectionPrototype.filter = function(filter) {
- var subgroups = [],
- subgroup,
- group,
- node;
-
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i)) {
- subgroup.push(node);
- }
- }
- }
-
- return d3_selection(subgroups);
-};
-d3_selectionPrototype.map = function(map) {
- return this.each(function() {
- this.__data__ = map.apply(this, arguments);
- });
-};
-d3_selectionPrototype.sort = function(comparator) {
- comparator = d3_selection_sortComparator.apply(this, arguments);
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j].sort(comparator), i = 1, n = group.length, prev = group[0]; i < n; i++) {
- var node = group[i];
- if (node) {
- if (prev) prev.parentNode.insertBefore(node, prev.nextSibling);
- prev = node;
- }
- }
- }
- return this;
-};
-
-function d3_selection_sortComparator(comparator) {
- if (!arguments.length) comparator = d3.ascending;
- return function(a, b) {
- return comparator(a && a.__data__, b && b.__data__);
- };
-}
-// type can be namespaced, e.g., "click.foo"
-// listener can be null for removal
-d3_selectionPrototype.on = function(type, listener, capture) {
- if (arguments.length < 3) capture = false;
-
- // parse the type specifier
- var name = "__on" + type, i = type.indexOf(".");
- if (i > 0) type = type.substring(0, i);
-
- // if called with only one argument, return the current listener
- if (arguments.length < 2) return (i = this.node()[name]) && i._;
-
- // remove the old event listener, and add the new event listener
- return this.each(function(d, i) {
- var node = this;
-
- if (node[name]) node.removeEventListener(type, node[name], capture);
- if (listener) node.addEventListener(type, node[name] = l, capture);
-
- // wrapped event listener that preserves i
- function l(e) {
- var o = d3.event; // Events can be reentrant (e.g., focus).
- d3.event = e;
- try {
- listener.call(node, node.__data__, i);
- } finally {
- d3.event = o;
- }
- }
-
- // stash the unwrapped listener for retrieval
- l._ = listener;
- });
-};
-d3_selectionPrototype.each = function(callback) {
- for (var j = -1, m = this.length; ++j < m;) {
- for (var group = this[j], i = -1, n = group.length; ++i < n;) {
- var node = group[i];
- if (node) callback.call(node, node.__data__, i, j);
- }
- }
- return this;
-};
-//
-// Note: assigning to the arguments array simultaneously changes the value of
-// the corresponding argument!
-//
-// TODO The `this` argument probably shouldn't be the first argument to the
-// callback, anyway, since it's redundant. However, that will require a major
-// version bump due to backwards compatibility, so I'm not changing it right
-// away.
-//
-d3_selectionPrototype.call = function(callback) {
- callback.apply(this, (arguments[0] = this, arguments));
- return this;
-};
-d3_selectionPrototype.empty = function() {
- return !this.node();
-};
-d3_selectionPrototype.node = function(callback) {
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- var node = group[i];
- if (node) return node;
- }
- }
- return null;
-};
-d3_selectionPrototype.transition = function() {
- var subgroups = [],
- subgroup,
- node;
-
- for (var j = -1, m = this.length; ++j < m;) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n;) {
- subgroup.push((node = group[i]) ? {node: node, delay: 0, duration: 250} : null);
- }
- }
-
- return d3_transition(subgroups, d3_transitionInheritId || ++d3_transitionId, Date.now());
-};
-var d3_selectionRoot = d3_selection([[document]]);
-
-d3_selectionRoot[0].parentNode = document.documentElement;
-
-// TODO fast singleton implementation!
-// TODO select(function)
-d3.select = function(selector) {
- return typeof selector === "string"
- ? d3_selectionRoot.select(selector)
- : d3_selection([[selector]]); // assume node
-};
-
-// TODO selectAll(function)
-d3.selectAll = function(selector) {
- return typeof selector === "string"
- ? d3_selectionRoot.selectAll(selector)
- : d3_selection([d3_array(selector)]); // assume node[]
-};
-function d3_transition(groups, id, time) {
- d3_arraySubclass(groups, d3_transitionPrototype);
-
- var tweens = {},
- event = d3.dispatch("start", "end"),
- ease = d3_transitionEase;
-
- groups.id = id;
-
- groups.time = time;
-
- groups.tween = function(name, tween) {
- if (arguments.length < 2) return tweens[name];
- if (tween == null) delete tweens[name];
- else tweens[name] = tween;
- return groups;
- };
-
- groups.ease = function(value) {
- if (!arguments.length) return ease;
- ease = typeof value === "function" ? value : d3.ease.apply(d3, arguments);
- return groups;
- };
-
- groups.each = function(type, listener) {
- if (arguments.length < 2) return d3_transition_each.call(groups, type);
- event[type].add(listener);
- return groups;
- };
-
- d3.timer(function(elapsed) {
- groups.each(function(d, i, j) {
- var tweened = [],
- node = this,
- delay = groups[j][i].delay,
- duration = groups[j][i].duration,
- lock = node.__transition__ || (node.__transition__ = {active: 0, count: 0});
-
- ++lock.count;
-
- delay <= elapsed ? start(elapsed) : d3.timer(start, delay, time);
-
- function start(elapsed) {
- if (lock.active > id) return stop();
- lock.active = id;
-
- for (var tween in tweens) {
- if (tween = tweens[tween].call(node, d, i)) {
- tweened.push(tween);
- }
- }
-
- event.start.dispatch.call(node, d, i);
- if (!tick(elapsed)) d3.timer(tick, 0, time);
- return 1;
- }
-
- function tick(elapsed) {
- if (lock.active !== id) return stop();
-
- var t = (elapsed - delay) / duration,
- e = ease(t),
- n = tweened.length;
-
- while (n > 0) {
- tweened[--n].call(node, e);
- }
-
- if (t >= 1) {
- stop();
- d3_transitionInheritId = id;
- event.end.dispatch.call(node, d, i);
- d3_transitionInheritId = 0;
- return 1;
- }
- }
-
- function stop() {
- if (!--lock.count) delete node.__transition__;
- return 1;
- }
- });
- return 1;
- }, 0, time);
-
- return groups;
-}
-
-var d3_transitionRemove = {};
-
-function d3_transitionNull(d, i, a) {
- return a != "" && d3_transitionRemove;
-}
-
-function d3_transitionTween(b) {
-
- function transitionFunction(d, i, a) {
- var v = b.call(this, d, i);
- return v == null
- ? a != "" && d3_transitionRemove
- : a != v && d3.interpolate(a, v);
- }
-
- function transitionString(d, i, a) {
- return a != b && d3.interpolate(a, b);
- }
-
- return typeof b === "function" ? transitionFunction
- : b == null ? d3_transitionNull
- : (b += "", transitionString);
-}
-
-var d3_transitionPrototype = [],
- d3_transitionId = 0,
- d3_transitionInheritId = 0,
- d3_transitionEase = d3.ease("cubic-in-out");
-
-d3_transitionPrototype.call = d3_selectionPrototype.call;
-
-d3.transition = function() {
- return d3_selectionRoot.transition();
-};
-
-d3.transition.prototype = d3_transitionPrototype;
-d3_transitionPrototype.select = function(selector) {
- var subgroups = [],
- subgroup,
- subnode,
- node;
-
- if (typeof selector !== "function") selector = d3_selection_selector(selector);
-
- for (var j = -1, m = this.length; ++j < m;) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n;) {
- if ((node = group[i]) && (subnode = selector.call(node.node, node.node.__data__, i))) {
- if ("__data__" in node.node) subnode.__data__ = node.node.__data__;
- subgroup.push({node: subnode, delay: node.delay, duration: node.duration});
- } else {
- subgroup.push(null);
- }
- }
- }
-
- return d3_transition(subgroups, this.id, this.time).ease(this.ease());
-};
-d3_transitionPrototype.selectAll = function(selector) {
- var subgroups = [],
- subgroup,
- subnodes,
- node;
-
- if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
-
- for (var j = -1, m = this.length; ++j < m;) {
- for (var group = this[j], i = -1, n = group.length; ++i < n;) {
- if (node = group[i]) {
- subnodes = selector.call(node.node, node.node.__data__, i);
- subgroups.push(subgroup = []);
- for (var k = -1, o = subnodes.length; ++k < o;) {
- subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration});
- }
- }
- }
- }
-
- return d3_transition(subgroups, this.id, this.time).ease(this.ease());
-};
-d3_transitionPrototype.attr = function(name, value) {
- return this.attrTween(name, d3_transitionTween(value));
-};
-
-d3_transitionPrototype.attrTween = function(nameNS, tween) {
- var name = d3.ns.qualify(nameNS);
-
- function attrTween(d, i) {
- var f = tween.call(this, d, i, this.getAttribute(name));
- return f === d3_transitionRemove
- ? (this.removeAttribute(name), null)
- : f && function(t) { this.setAttribute(name, f(t)); };
- }
-
- function attrTweenNS(d, i) {
- var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
- return f === d3_transitionRemove
- ? (this.removeAttributeNS(name.space, name.local), null)
- : f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); };
- }
-
- return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
-};
-d3_transitionPrototype.style = function(name, value, priority) {
- if (arguments.length < 3) priority = "";
- return this.styleTween(name, d3_transitionTween(value), priority);
-};
-
-d3_transitionPrototype.styleTween = function(name, tween, priority) {
- if (arguments.length < 3) priority = "";
- return this.tween("style." + name, function(d, i) {
- var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name));
- return f === d3_transitionRemove
- ? (this.style.removeProperty(name), null)
- : f && function(t) { this.style.setProperty(name, f(t), priority); };
- });
-};
-d3_transitionPrototype.text = function(value) {
- return this.tween("text", function(d, i) {
- this.textContent = typeof value === "function"
- ? value.call(this, d, i)
- : value;
- });
-};
-d3_transitionPrototype.remove = function() {
- return this.each("end", function() {
- var p;
- if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this);
- });
-};
-d3_transitionPrototype.delay = function(value) {
- var groups = this;
- return groups.each(typeof value === "function"
- ? function(d, i, j) { groups[j][i].delay = +value.apply(this, arguments); }
- : (value = +value, function(d, i, j) { groups[j][i].delay = value; }));
-};
-d3_transitionPrototype.duration = function(value) {
- var groups = this;
- return groups.each(typeof value === "function"
- ? function(d, i, j) { groups[j][i].duration = +value.apply(this, arguments); }
- : (value = +value, function(d, i, j) { groups[j][i].duration = value; }));
-};
-function d3_transition_each(callback) {
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- var node = group[i];
- if (node) callback.call(node = node.node, node.__data__, i, j);
- }
- }
- return this;
-}
-d3_transitionPrototype.transition = function() {
- return this.select(d3_this);
-};
-var d3_timer_queue = null,
- d3_timer_interval, // is an interval (or frame) active?
- d3_timer_timeout; // is a timeout active?
-
-// The timer will continue to fire until callback returns true.
-d3.timer = function(callback, delay, then) {
- var found = false,
- t0,
- t1 = d3_timer_queue;
-
- if (arguments.length < 3) {
- if (arguments.length < 2) delay = 0;
- else if (!isFinite(delay)) return;
- then = Date.now();
- }
-
- // See if the callback's already in the queue.
- while (t1) {
- if (t1.callback === callback) {
- t1.then = then;
- t1.delay = delay;
- found = true;
- break;
- }
- t0 = t1;
- t1 = t1.next;
- }
-
- // Otherwise, add the callback to the queue.
- if (!found) d3_timer_queue = {
- callback: callback,
- then: then,
- delay: delay,
- next: d3_timer_queue
- };
-
- // Start animatin'!
- if (!d3_timer_interval) {
- d3_timer_timeout = clearTimeout(d3_timer_timeout);
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
-}
-
-function d3_timer_step() {
- var elapsed,
- now = Date.now(),
- t1 = d3_timer_queue;
-
- while (t1) {
- elapsed = now - t1.then;
- if (elapsed >= t1.delay) t1.flush = t1.callback(elapsed);
- t1 = t1.next;
- }
-
- var delay = d3_timer_flush() - now;
- if (delay > 24) {
- if (isFinite(delay)) {
- clearTimeout(d3_timer_timeout);
- d3_timer_timeout = setTimeout(d3_timer_step, delay);
- }
- d3_timer_interval = 0;
- } else {
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
-}
-
-d3.timer.flush = function() {
- var elapsed,
- now = Date.now(),
- t1 = d3_timer_queue;
-
- while (t1) {
- elapsed = now - t1.then;
- if (!t1.delay) t1.flush = t1.callback(elapsed);
- t1 = t1.next;
- }
-
- d3_timer_flush();
-};
-
-// Flush after callbacks, to avoid concurrent queue modification.
-function d3_timer_flush() {
- var t0 = null,
- t1 = d3_timer_queue,
- then = Infinity;
- while (t1) {
- if (t1.flush) {
- t1 = t0 ? t0.next = t1.next : d3_timer_queue = t1.next;
- } else {
- then = Math.min(then, t1.then + t1.delay);
- t1 = (t0 = t1).next;
- }
- }
- return then;
-}
-
-var d3_timer_frame = window.requestAnimationFrame
- || window.webkitRequestAnimationFrame
- || window.mozRequestAnimationFrame
- || window.oRequestAnimationFrame
- || window.msRequestAnimationFrame
- || function(callback) { setTimeout(callback, 17); };
-function d3_noop() {}
-d3.scale = {};
-
-function d3_scaleExtent(domain) {
- var start = domain[0], stop = domain[domain.length - 1];
- return start < stop ? [start, stop] : [stop, start];
-}
-function d3_scale_nice(domain, nice) {
- var i0 = 0,
- i1 = domain.length - 1,
- x0 = domain[i0],
- x1 = domain[i1],
- dx;
-
- if (x1 < x0) {
- dx = i0; i0 = i1; i1 = dx;
- dx = x0; x0 = x1; x1 = dx;
- }
-
- if (dx = x1 - x0) {
- nice = nice(dx);
- domain[i0] = nice.floor(x0);
- domain[i1] = nice.ceil(x1);
- }
-
- return domain;
-}
-
-function d3_scale_niceDefault() {
- return Math;
-}
-d3.scale.linear = function() {
- return d3_scale_linear([0, 1], [0, 1], d3.interpolate, false);
-};
-
-function d3_scale_linear(domain, range, interpolate, clamp) {
- var output,
- input;
-
- function rescale() {
- var linear = domain.length == 2 ? d3_scale_bilinear : d3_scale_polylinear,
- uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
- output = linear(domain, range, uninterpolate, interpolate);
- input = linear(range, domain, uninterpolate, d3.interpolate);
- return scale;
- }
-
- function scale(x) {
- return output(x);
- }
-
- // Note: requires range is coercible to number!
- scale.invert = function(y) {
- return input(y);
- };
-
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(Number);
- return rescale();
- };
-
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
-
- scale.rangeRound = function(x) {
- return scale.range(x).interpolate(d3.interpolateRound);
- };
-
- scale.clamp = function(x) {
- if (!arguments.length) return clamp;
- clamp = x;
- return rescale();
- };
-
- scale.interpolate = function(x) {
- if (!arguments.length) return interpolate;
- interpolate = x;
- return rescale();
- };
-
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
-
- scale.tickFormat = function(m) {
- return d3_scale_linearTickFormat(domain, m);
- };
-
- scale.nice = function() {
- d3_scale_nice(domain, d3_scale_linearNice);
- return rescale();
- };
-
- scale.copy = function() {
- return d3_scale_linear(domain, range, interpolate, clamp);
- };
-
- return rescale();
-};
-
-function d3_scale_linearRebind(scale, linear) {
- scale.range = d3.rebind(scale, linear.range);
- scale.rangeRound = d3.rebind(scale, linear.rangeRound);
- scale.interpolate = d3.rebind(scale, linear.interpolate);
- scale.clamp = d3.rebind(scale, linear.clamp);
- return scale;
-}
-
-function d3_scale_linearNice(dx) {
- dx = Math.pow(10, Math.round(Math.log(dx) / Math.LN10) - 1);
- return {
- floor: function(x) { return Math.floor(x / dx) * dx; },
- ceil: function(x) { return Math.ceil(x / dx) * dx; }
- };
-}
-
-// TODO Dates? Ugh.
-function d3_scale_linearTickRange(domain, m) {
- var extent = d3_scaleExtent(domain),
- span = extent[1] - extent[0],
- step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)),
- err = m / span * step;
-
- // Filter ticks to get closer to the desired count.
- if (err <= .15) step *= 10;
- else if (err <= .35) step *= 5;
- else if (err <= .75) step *= 2;
-
- // Round start and stop values to step interval.
- extent[0] = Math.ceil(extent[0] / step) * step;
- extent[1] = Math.floor(extent[1] / step) * step + step * .5; // inclusive
- extent[2] = step;
- return extent;
-}
-
-function d3_scale_linearTicks(domain, m) {
- return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
-}
-
-function d3_scale_linearTickFormat(domain, m) {
- return d3.format(",." + Math.max(0, -Math.floor(Math.log(d3_scale_linearTickRange(domain, m)[2]) / Math.LN10 + .01)) + "f");
-}
-function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
- var u = uninterpolate(domain[0], domain[1]),
- i = interpolate(range[0], range[1]);
- return function(x) {
- return i(u(x));
- };
-}
-function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
- var u = [],
- i = [],
- j = 0,
- n = domain.length;
-
- while (++j < n) {
- u.push(uninterpolate(domain[j - 1], domain[j]));
- i.push(interpolate(range[j - 1], range[j]));
- }
-
- return function(x) {
- var j = d3.bisect(domain, x, 1, domain.length - 1) - 1;
- return i[j](u[j](x));
- };
-}
-d3.scale.log = function() {
- return d3_scale_log(d3.scale.linear(), d3_scale_logp);
-};
-
-function d3_scale_log(linear, log) {
- var pow = log.pow;
-
- function scale(x) {
- return linear(log(x));
- }
-
- scale.invert = function(x) {
- return pow(linear.invert(x));
- };
-
- scale.domain = function(x) {
- if (!arguments.length) return linear.domain().map(pow);
- log = x[0] < 0 ? d3_scale_logn : d3_scale_logp;
- pow = log.pow;
- linear.domain(x.map(log));
- return scale;
- };
-
- scale.nice = function() {
- linear.domain(d3_scale_nice(linear.domain(), d3_scale_niceDefault));
- return scale;
- };
-
- scale.ticks = function() {
- var extent = d3_scaleExtent(linear.domain()),
- ticks = [];
- if (extent.every(isFinite)) {
- var i = Math.floor(extent[0]),
- j = Math.ceil(extent[1]),
- u = Math.round(pow(extent[0])),
- v = Math.round(pow(extent[1]));
- if (log === d3_scale_logn) {
- ticks.push(pow(i));
- for (; i++ < j;) for (var k = 9; k > 0; k--) ticks.push(pow(i) * k);
- } else {
- for (; i < j; i++) for (var k = 1; k < 10; k++) ticks.push(pow(i) * k);
- ticks.push(pow(i));
- }
- for (i = 0; ticks[i] < u; i++) {} // strip small values
- for (j = ticks.length; ticks[j - 1] > v; j--) {} // strip big values
- ticks = ticks.slice(i, j);
- }
- return ticks;
- };
-
- scale.tickFormat = function(n, format) {
- if (arguments.length < 2) format = d3_scale_logFormat;
- if (arguments.length < 1) return format;
- var k = n / scale.ticks().length,
- f = log === d3_scale_logn ? (e = -1e-15, Math.floor) : (e = 1e-15, Math.ceil),
- e;
- return function(d) {
- return d / pow(f(log(d) + e)) < k ? format(d) : "";
- };
- };
-
- scale.copy = function() {
- return d3_scale_log(linear.copy(), log);
- };
-
- return d3_scale_linearRebind(scale, linear);
-};
-
-var d3_scale_logFormat = d3.format("e");
-
-function d3_scale_logp(x) {
- return Math.log(x) / Math.LN10;
-}
-
-function d3_scale_logn(x) {
- return -Math.log(-x) / Math.LN10;
-}
-
-d3_scale_logp.pow = function(x) {
- return Math.pow(10, x);
-};
-
-d3_scale_logn.pow = function(x) {
- return -Math.pow(10, -x);
-};
-d3.scale.pow = function() {
- return d3_scale_pow(d3.scale.linear(), 1);
-};
-
-function d3_scale_pow(linear, exponent) {
- var powp = d3_scale_powPow(exponent),
- powb = d3_scale_powPow(1 / exponent);
-
- function scale(x) {
- return linear(powp(x));
- }
-
- scale.invert = function(x) {
- return powb(linear.invert(x));
- };
-
- scale.domain = function(x) {
- if (!arguments.length) return linear.domain().map(powb);
- linear.domain(x.map(powp));
- return scale;
- };
-
- scale.ticks = function(m) {
- return d3_scale_linearTicks(scale.domain(), m);
- };
-
- scale.tickFormat = function(m) {
- return d3_scale_linearTickFormat(scale.domain(), m);
- };
-
- scale.nice = function() {
- return scale.domain(d3_scale_nice(scale.domain(), d3_scale_linearNice));
- };
-
- scale.exponent = function(x) {
- if (!arguments.length) return exponent;
- var domain = scale.domain();
- powp = d3_scale_powPow(exponent = x);
- powb = d3_scale_powPow(1 / exponent);
- return scale.domain(domain);
- };
-
- scale.copy = function() {
- return d3_scale_pow(linear.copy(), exponent);
- };
-
- return d3_scale_linearRebind(scale, linear);
-};
-
-function d3_scale_powPow(e) {
- return function(x) {
- return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
- };
-}
-d3.scale.sqrt = function() {
- return d3.scale.pow().exponent(.5);
-};
-d3.scale.ordinal = function() {
- return d3_scale_ordinal([], {t: "range", x: []});
-};
-
-function d3_scale_ordinal(domain, ranger) {
- var index,
- range,
- rangeBand;
-
- function scale(x) {
- return range[((index[x] || (index[x] = domain.push(x))) - 1) % range.length];
- }
-
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = [];
- index = {};
- var i = -1, n = x.length, xi;
- while (++i < n) if (!index[xi = x[i]]) index[xi] = domain.push(xi);
- return scale[ranger.t](ranger.x, ranger.p);
- };
-
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- rangeBand = 0;
- ranger = {t: "range", x: x};
- return scale;
- };
-
- scale.rangePoints = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0],
- stop = x[1],
- step = (stop - start) / (domain.length - 1 + padding);
- range = domain.length < 2 ? [(start + stop) / 2] : d3.range(start + step * padding / 2, stop + step / 2, step);
- rangeBand = 0;
- ranger = {t: "rangePoints", x: x, p: padding};
- return scale;
- };
-
- scale.rangeBands = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0],
- stop = x[1],
- step = (stop - start) / (domain.length + padding);
- range = d3.range(start + step * padding, stop, step);
- rangeBand = step * (1 - padding);
- ranger = {t: "rangeBands", x: x, p: padding};
- return scale;
- };
-
- scale.rangeRoundBands = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0],
- stop = x[1],
- step = Math.floor((stop - start) / (domain.length + padding)),
- err = stop - start - (domain.length - padding) * step;
- range = d3.range(start + Math.round(err / 2), stop, step);
- rangeBand = Math.round(step * (1 - padding));
- ranger = {t: "rangeRoundBands", x: x, p: padding};
- return scale;
- };
-
- scale.rangeBand = function() {
- return rangeBand;
- };
-
- scale.copy = function() {
- return d3_scale_ordinal(domain, ranger);
- };
-
- return scale.domain(domain);
-};
-/*
- * This product includes color specifications and designs developed by Cynthia
- * Brewer (http://colorbrewer.org/). See lib/colorbrewer for more information.
- */
-
-d3.scale.category10 = function() {
- return d3.scale.ordinal().range(d3_category10);
-};
-
-d3.scale.category20 = function() {
- return d3.scale.ordinal().range(d3_category20);
-};
-
-d3.scale.category20b = function() {
- return d3.scale.ordinal().range(d3_category20b);
-};
-
-d3.scale.category20c = function() {
- return d3.scale.ordinal().range(d3_category20c);
-};
-
-var d3_category10 = [
- "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
- "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"
-];
-
-var d3_category20 = [
- "#1f77b4", "#aec7e8",
- "#ff7f0e", "#ffbb78",
- "#2ca02c", "#98df8a",
- "#d62728", "#ff9896",
- "#9467bd", "#c5b0d5",
- "#8c564b", "#c49c94",
- "#e377c2", "#f7b6d2",
- "#7f7f7f", "#c7c7c7",
- "#bcbd22", "#dbdb8d",
- "#17becf", "#9edae5"
-];
-
-var d3_category20b = [
- "#393b79", "#5254a3", "#6b6ecf", "#9c9ede",
- "#637939", "#8ca252", "#b5cf6b", "#cedb9c",
- "#8c6d31", "#bd9e39", "#e7ba52", "#e7cb94",
- "#843c39", "#ad494a", "#d6616b", "#e7969c",
- "#7b4173", "#a55194", "#ce6dbd", "#de9ed6"
-];
-
-var d3_category20c = [
- "#3182bd", "#6baed6", "#9ecae1", "#c6dbef",
- "#e6550d", "#fd8d3c", "#fdae6b", "#fdd0a2",
- "#31a354", "#74c476", "#a1d99b", "#c7e9c0",
- "#756bb1", "#9e9ac8", "#bcbddc", "#dadaeb",
- "#636363", "#969696", "#bdbdbd", "#d9d9d9"
-];
-d3.scale.quantile = function() {
- return d3_scale_quantile([], []);
-};
-
-function d3_scale_quantile(domain, range) {
- var thresholds;
-
- function rescale() {
- var k = 0,
- n = domain.length,
- q = range.length;
- thresholds = [];
- while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
- return scale;
- }
-
- function scale(x) {
- if (isNaN(x = +x)) return NaN;
- return range[d3.bisect(thresholds, x)];
- }
-
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.filter(function(d) { return !isNaN(d); }).sort(d3.ascending);
- return rescale();
- };
-
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
-
- scale.quantiles = function() {
- return thresholds;
- };
-
- scale.copy = function() {
- return d3_scale_quantile(domain, range); // copy on write!
- };
-
- return rescale();
-};
-d3.scale.quantize = function() {
- return d3_scale_quantize(0, 1, [0, 1]);
-};
-
-function d3_scale_quantize(x0, x1, range) {
- var kx, i;
-
- function scale(x) {
- return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
- }
-
- function rescale() {
- kx = range.length / (x1 - x0);
- i = range.length - 1;
- return scale;
- }
-
- scale.domain = function(x) {
- if (!arguments.length) return [x0, x1];
- x0 = +x[0];
- x1 = +x[x.length - 1];
- return rescale();
- };
-
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
-
- scale.copy = function() {
- return d3_scale_quantize(x0, x1, range); // copy on write
- };
-
- return rescale();
-};
-d3.svg = {};
-d3.svg.arc = function() {
- var innerRadius = d3_svg_arcInnerRadius,
- outerRadius = d3_svg_arcOuterRadius,
- startAngle = d3_svg_arcStartAngle,
- endAngle = d3_svg_arcEndAngle;
-
- function arc() {
- var r0 = innerRadius.apply(this, arguments),
- r1 = outerRadius.apply(this, arguments),
- a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset,
- a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset,
- da = (a1 < a0 && (da = a0, a0 = a1, a1 = da), a1 - a0),
- df = da < Math.PI ? "0" : "1",
- c0 = Math.cos(a0),
- s0 = Math.sin(a0),
- c1 = Math.cos(a1),
- s1 = Math.sin(a1);
- return da >= d3_svg_arcMax
- ? (r0
- ? "M0," + r1
- + "A" + r1 + "," + r1 + " 0 1,1 0," + (-r1)
- + "A" + r1 + "," + r1 + " 0 1,1 0," + r1
- + "M0," + r0
- + "A" + r0 + "," + r0 + " 0 1,0 0," + (-r0)
- + "A" + r0 + "," + r0 + " 0 1,0 0," + r0
- + "Z"
- : "M0," + r1
- + "A" + r1 + "," + r1 + " 0 1,1 0," + (-r1)
- + "A" + r1 + "," + r1 + " 0 1,1 0," + r1
- + "Z")
- : (r0
- ? "M" + r1 * c0 + "," + r1 * s0
- + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1
- + "L" + r0 * c1 + "," + r0 * s1
- + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0
- + "Z"
- : "M" + r1 * c0 + "," + r1 * s0
- + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1
- + "L0,0"
- + "Z");
- }
-
- arc.innerRadius = function(v) {
- if (!arguments.length) return innerRadius;
- innerRadius = d3.functor(v);
- return arc;
- };
-
- arc.outerRadius = function(v) {
- if (!arguments.length) return outerRadius;
- outerRadius = d3.functor(v);
- return arc;
- };
-
- arc.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3.functor(v);
- return arc;
- };
-
- arc.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3.functor(v);
- return arc;
- };
-
- arc.centroid = function() {
- var r = (innerRadius.apply(this, arguments)
- + outerRadius.apply(this, arguments)) / 2,
- a = (startAngle.apply(this, arguments)
- + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset;
- return [Math.cos(a) * r, Math.sin(a) * r];
- };
-
- return arc;
-};
-
-var d3_svg_arcOffset = -Math.PI / 2,
- d3_svg_arcMax = 2 * Math.PI - 1e-6;
-
-function d3_svg_arcInnerRadius(d) {
- return d.innerRadius;
-}
-
-function d3_svg_arcOuterRadius(d) {
- return d.outerRadius;
-}
-
-function d3_svg_arcStartAngle(d) {
- return d.startAngle;
-}
-
-function d3_svg_arcEndAngle(d) {
- return d.endAngle;
-}
-function d3_svg_line(projection) {
- var x = d3_svg_lineX,
- y = d3_svg_lineY,
- interpolate = "linear",
- interpolator = d3_svg_lineInterpolators[interpolate],
- tension = .7;
-
- function line(d) {
- return d.length < 1 ? null : "M" + interpolator(projection(d3_svg_linePoints(this, d, x, y)), tension);
- }
-
- line.x = function(v) {
- if (!arguments.length) return x;
- x = v;
- return line;
- };
-
- line.y = function(v) {
- if (!arguments.length) return y;
- y = v;
- return line;
- };
-
- line.interpolate = function(v) {
- if (!arguments.length) return interpolate;
- interpolator = d3_svg_lineInterpolators[interpolate = v];
- return line;
- };
-
- line.tension = function(v) {
- if (!arguments.length) return tension;
- tension = v;
- return line;
- };
-
- return line;
-}
-
-d3.svg.line = function() {
- return d3_svg_line(Object);
-};
-
-// Converts the specified array of data into an array of points
-// (x-y tuples), by evaluating the specified `x` and `y` functions on each
-// data point. The `this` context of the evaluated functions is the specified
-// "self" object; each function is passed the current datum and index.
-function d3_svg_linePoints(self, d, x, y) {
- var points = [],
- i = -1,
- n = d.length,
- fx = typeof x === "function",
- fy = typeof y === "function",
- value;
- if (fx && fy) {
- while (++i < n) points.push([
- x.call(self, value = d[i], i),
- y.call(self, value, i)
- ]);
- } else if (fx) {
- while (++i < n) points.push([x.call(self, d[i], i), y]);
- } else if (fy) {
- while (++i < n) points.push([x, y.call(self, d[i], i)]);
- } else {
- while (++i < n) points.push([x, y]);
- }
- return points;
-}
-
-// The default `x` property, which references d[0].
-function d3_svg_lineX(d) {
- return d[0];
-}
-
-// The default `y` property, which references d[1].
-function d3_svg_lineY(d) {
- return d[1];
-}
-
-// The various interpolators supported by the `line` class.
-var d3_svg_lineInterpolators = {
- "linear": d3_svg_lineLinear,
- "step-before": d3_svg_lineStepBefore,
- "step-after": d3_svg_lineStepAfter,
- "basis": d3_svg_lineBasis,
- "basis-open": d3_svg_lineBasisOpen,
- "basis-closed": d3_svg_lineBasisClosed,
- "bundle": d3_svg_lineBundle,
- "cardinal": d3_svg_lineCardinal,
- "cardinal-open": d3_svg_lineCardinalOpen,
- "cardinal-closed": d3_svg_lineCardinalClosed,
- "monotone": d3_svg_lineMonotone
-};
-
-// Linear interpolation; generates "L" commands.
-function d3_svg_lineLinear(points) {
- var i = 0,
- n = points.length,
- p = points[0],
- path = [p[0], ",", p[1]];
- while (++i < n) path.push("L", (p = points[i])[0], ",", p[1]);
- return path.join("");
-}
-
-// Step interpolation; generates "H" and "V" commands.
-function d3_svg_lineStepBefore(points) {
- var i = 0,
- n = points.length,
- p = points[0],
- path = [p[0], ",", p[1]];
- while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
- return path.join("");
-}
-
-// Step interpolation; generates "H" and "V" commands.
-function d3_svg_lineStepAfter(points) {
- var i = 0,
- n = points.length,
- p = points[0],
- path = [p[0], ",", p[1]];
- while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
- return path.join("");
-}
-
-// Open cardinal spline interpolation; generates "C" commands.
-function d3_svg_lineCardinalOpen(points, tension) {
- return points.length < 4
- ? d3_svg_lineLinear(points)
- : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1),
- d3_svg_lineCardinalTangents(points, tension));
-}
-
-// Closed cardinal spline interpolation; generates "C" commands.
-function d3_svg_lineCardinalClosed(points, tension) {
- return points.length < 3
- ? d3_svg_lineLinear(points)
- : points[0] + d3_svg_lineHermite((points.push(points[0]), points),
- d3_svg_lineCardinalTangents([points[points.length - 2]]
- .concat(points, [points[1]]), tension));
-}
-
-// Cardinal spline interpolation; generates "C" commands.
-function d3_svg_lineCardinal(points, tension, closed) {
- return points.length < 3
- ? d3_svg_lineLinear(points)
- : points[0] + d3_svg_lineHermite(points,
- d3_svg_lineCardinalTangents(points, tension));
-}
-
-// Hermite spline construction; generates "C" commands.
-function d3_svg_lineHermite(points, tangents) {
- if (tangents.length < 1
- || (points.length != tangents.length
- && points.length != tangents.length + 2)) {
- return d3_svg_lineLinear(points);
- }
-
- var quad = points.length != tangents.length,
- path = "",
- p0 = points[0],
- p = points[1],
- t0 = tangents[0],
- t = t0,
- pi = 1;
-
- if (quad) {
- path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3)
- + "," + p[0] + "," + p[1];
- p0 = points[1];
- pi = 2;
- }
-
- if (tangents.length > 1) {
- t = tangents[1];
- p = points[pi];
- pi++;
- path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1])
- + "," + (p[0] - t[0]) + "," + (p[1] - t[1])
- + "," + p[0] + "," + p[1];
- for (var i = 2; i < tangents.length; i++, pi++) {
- p = points[pi];
- t = tangents[i];
- path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1])
- + "," + p[0] + "," + p[1];
- }
- }
-
- if (quad) {
- var lp = points[pi];
- path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3)
- + "," + lp[0] + "," + lp[1];
- }
-
- return path;
-}
-
-// Generates tangents for a cardinal spline.
-function d3_svg_lineCardinalTangents(points, tension) {
- var tangents = [],
- a = (1 - tension) / 2,
- p0,
- p1 = points[0],
- p2 = points[1],
- i = 1,
- n = points.length;
- while (++i < n) {
- p0 = p1;
- p1 = p2;
- p2 = points[i];
- tangents.push([a * (p2[0] - p0[0]), a * (p2[1] - p0[1])]);
- }
- return tangents;
-}
-
-// B-spline interpolation; generates "C" commands.
-function d3_svg_lineBasis(points) {
- if (points.length < 3) return d3_svg_lineLinear(points);
- var i = 1,
- n = points.length,
- pi = points[0],
- x0 = pi[0],
- y0 = pi[1],
- px = [x0, x0, x0, (pi = points[1])[0]],
- py = [y0, y0, y0, pi[1]],
- path = [x0, ",", y0];
- d3_svg_lineBasisBezier(path, px, py);
- while (++i < n) {
- pi = points[i];
- px.shift(); px.push(pi[0]);
- py.shift(); py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- i = -1;
- while (++i < 2) {
- px.shift(); px.push(pi[0]);
- py.shift(); py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
-}
-
-// Open B-spline interpolation; generates "C" commands.
-function d3_svg_lineBasisOpen(points) {
- if (points.length < 4) return d3_svg_lineLinear(points);
- var path = [],
- i = -1,
- n = points.length,
- pi,
- px = [0],
- py = [0];
- while (++i < 3) {
- pi = points[i];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px)
- + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
- --i; while (++i < n) {
- pi = points[i];
- px.shift(); px.push(pi[0]);
- py.shift(); py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
-}
-
-// Closed B-spline interpolation; generates "C" commands.
-function d3_svg_lineBasisClosed(points) {
- var path,
- i = -1,
- n = points.length,
- m = n + 4,
- pi,
- px = [],
- py = [];
- while (++i < 4) {
- pi = points[i % n];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path = [
- d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",",
- d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)
- ];
- --i; while (++i < m) {
- pi = points[i % n];
- px.shift(); px.push(pi[0]);
- py.shift(); py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
-}
-
-function d3_svg_lineBundle(points, tension) {
- var n = points.length - 1,
- x0 = points[0][0],
- y0 = points[0][1],
- dx = points[n][0] - x0,
- dy = points[n][1] - y0,
- i = -1,
- p,
- t;
- while (++i <= n) {
- p = points[i];
- t = i / n;
- p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
- p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
- }
- return d3_svg_lineBasis(points);
-}
-
-// Returns the dot product of the given four-element vectors.
-function d3_svg_lineDot4(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
-}
-
-// Matrix to transform basis (b-spline) control points to bezier
-// control points. Derived from FvD 11.2.8.
-var d3_svg_lineBasisBezier1 = [0, 2/3, 1/3, 0],
- d3_svg_lineBasisBezier2 = [0, 1/3, 2/3, 0],
- d3_svg_lineBasisBezier3 = [0, 1/6, 2/3, 1/6];
-
-// Pushes a "C" Bézier curve onto the specified path array, given the
-// two specified four-element arrays which define the control points.
-function d3_svg_lineBasisBezier(path, x, y) {
- path.push(
- "C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x),
- ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y),
- ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x),
- ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y),
- ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x),
- ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
-}
-
-// Computes the slope from points p0 to p1.
-function d3_svg_lineSlope(p0, p1) {
- return (p1[1] - p0[1]) / (p1[0] - p0[0]);
-}
-
-// Compute three-point differences for the given points.
-// http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Finite_difference
-function d3_svg_lineFiniteDifferences(points) {
- var i = 0,
- j = points.length - 1,
- m = [],
- p0 = points[0],
- p1 = points[1],
- d = m[0] = d3_svg_lineSlope(p0, p1);
- while (++i < j) {
- m[i] = d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]));
- }
- m[i] = d;
- return m;
-}
-
-// Interpolates the given points using Fritsch-Carlson Monotone cubic Hermite
-// interpolation. Returns an array of tangent vectors. For details, see
-// http://en.wikipedia.org/wiki/Monotone_cubic_interpolation
-function d3_svg_lineMonotoneTangents(points) {
- var tangents = [],
- d,
- a,
- b,
- s,
- m = d3_svg_lineFiniteDifferences(points),
- i = -1,
- j = points.length - 1;
-
- // The first two steps are done by computing finite-differences:
- // 1. Compute the slopes of the secant lines between successive points.
- // 2. Initialize the tangents at every point as the average of the secants.
-
- // Then, for each segment…
- while (++i < j) {
- d = d3_svg_lineSlope(points[i], points[i + 1]);
-
- // 3. If two successive yk = y{k + 1} are equal (i.e., d is zero), then set
- // mk = m{k + 1} = 0 as the spline connecting these points must be flat to
- // preserve monotonicity. Ignore step 4 and 5 for those k.
-
- if (Math.abs(d) < 1e-6) {
- m[i] = m[i + 1] = 0;
- } else {
- // 4. Let ak = mk / dk and bk = m{k + 1} / dk.
- a = m[i] / d;
- b = m[i + 1] / d;
-
- // 5. Prevent overshoot and ensure monotonicity by restricting the
- // magnitude of vector to a circle of radius 3.
- s = a * a + b * b;
- if (s > 9) {
- s = d * 3 / Math.sqrt(s);
- m[i] = s * a;
- m[i + 1] = s * b;
- }
- }
- }
-
- // Compute the normalized tangent vector from the slopes. Note that if x is
- // not monotonic, it's possible that the slope will be infinite, so we protect
- // against NaN by setting the coordinate to zero.
- i = -1; while (++i <= j) {
- s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0])
- / (6 * (1 + m[i] * m[i]));
- tangents.push([s || 0, m[i] * s || 0]);
- }
-
- return tangents;
-}
-
-function d3_svg_lineMonotone(points) {
- return points.length < 3
- ? d3_svg_lineLinear(points)
- : points[0] +
- d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
-}
-d3.svg.line.radial = function() {
- var line = d3_svg_line(d3_svg_lineRadial);
- line.radius = line.x, delete line.x;
- line.angle = line.y, delete line.y;
- return line;
-};
-
-function d3_svg_lineRadial(points) {
- var point,
- i = -1,
- n = points.length,
- r,
- a;
- while (++i < n) {
- point = points[i];
- r = point[0];
- a = point[1] + d3_svg_arcOffset;
- point[0] = r * Math.cos(a);
- point[1] = r * Math.sin(a);
- }
- return points;
-}
-function d3_svg_area(projection) {
- var x0 = d3_svg_lineX,
- x1 = d3_svg_lineX,
- y0 = 0,
- y1 = d3_svg_lineY,
- interpolate,
- i0,
- i1,
- tension = .7;
-
- function area(d) {
- if (d.length < 1) return null;
- var points0 = d3_svg_linePoints(this, d, x0, y0),
- points1 = d3_svg_linePoints(this, d, x0 === x1 ? d3_svg_areaX(points0) : x1, y0 === y1 ? d3_svg_areaY(points0) : y1);
- return "M" + i0(projection(points1), tension)
- + "L" + i1(projection(points0.reverse()), tension)
- + "Z";
- }
-
- area.x = function(x) {
- if (!arguments.length) return x1;
- x0 = x1 = x;
- return area;
- };
-
- area.x0 = function(x) {
- if (!arguments.length) return x0;
- x0 = x;
- return area;
- };
-
- area.x1 = function(x) {
- if (!arguments.length) return x1;
- x1 = x;
- return area;
- };
-
- area.y = function(y) {
- if (!arguments.length) return y1;
- y0 = y1 = y;
- return area;
- };
-
- area.y0 = function(y) {
- if (!arguments.length) return y0;
- y0 = y;
- return area;
- };
-
- area.y1 = function(y) {
- if (!arguments.length) return y1;
- y1 = y;
- return area;
- };
-
- area.interpolate = function(x) {
- if (!arguments.length) return interpolate;
- i0 = d3_svg_lineInterpolators[interpolate = x];
- i1 = i0.reverse || i0;
- return area;
- };
-
- area.tension = function(x) {
- if (!arguments.length) return tension;
- tension = x;
- return area;
- };
-
- return area.interpolate("linear");
-}
-
-d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
-d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
-
-d3.svg.area = function() {
- return d3_svg_area(Object);
-};
-
-function d3_svg_areaX(points) {
- return function(d, i) {
- return points[i][0];
- };
-}
-
-function d3_svg_areaY(points) {
- return function(d, i) {
- return points[i][1];
- };
-}
-d3.svg.area.radial = function() {
- var area = d3_svg_area(d3_svg_lineRadial);
- area.radius = area.x, delete area.x;
- area.innerRadius = area.x0, delete area.x0;
- area.outerRadius = area.x1, delete area.x1;
- area.angle = area.y, delete area.y;
- area.startAngle = area.y0, delete area.y0;
- area.endAngle = area.y1, delete area.y1;
- return area;
-};
-d3.svg.chord = function() {
- var source = d3_svg_chordSource,
- target = d3_svg_chordTarget,
- radius = d3_svg_chordRadius,
- startAngle = d3_svg_arcStartAngle,
- endAngle = d3_svg_arcEndAngle;
-
- // TODO Allow control point to be customized.
-
- function chord(d, i) {
- var s = subgroup(this, source, d, i),
- t = subgroup(this, target, d, i);
- return "M" + s.p0
- + arc(s.r, s.p1) + (equals(s, t)
- ? curve(s.r, s.p1, s.r, s.p0)
- : curve(s.r, s.p1, t.r, t.p0)
- + arc(t.r, t.p1)
- + curve(t.r, t.p1, s.r, s.p0))
- + "Z";
- }
-
- function subgroup(self, f, d, i) {
- var subgroup = f.call(self, d, i),
- r = radius.call(self, subgroup, i),
- a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset,
- a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset;
- return {
- r: r,
- a0: a0,
- a1: a1,
- p0: [r * Math.cos(a0), r * Math.sin(a0)],
- p1: [r * Math.cos(a1), r * Math.sin(a1)]
- };
- }
-
- function equals(a, b) {
- return a.a0 == b.a0 && a.a1 == b.a1;
- }
-
- function arc(r, p) {
- return "A" + r + "," + r + " 0 0,1 " + p;
- }
-
- function curve(r0, p0, r1, p1) {
- return "Q 0,0 " + p1;
- }
-
- chord.radius = function(v) {
- if (!arguments.length) return radius;
- radius = d3.functor(v);
- return chord;
- };
-
- chord.source = function(v) {
- if (!arguments.length) return source;
- source = d3.functor(v);
- return chord;
- };
-
- chord.target = function(v) {
- if (!arguments.length) return target;
- target = d3.functor(v);
- return chord;
- };
-
- chord.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3.functor(v);
- return chord;
- };
-
- chord.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3.functor(v);
- return chord;
- };
-
- return chord;
-};
-
-function d3_svg_chordSource(d) {
- return d.source;
-}
-
-function d3_svg_chordTarget(d) {
- return d.target;
-}
-
-function d3_svg_chordRadius(d) {
- return d.radius;
-}
-
-function d3_svg_chordStartAngle(d) {
- return d.startAngle;
-}
-
-function d3_svg_chordEndAngle(d) {
- return d.endAngle;
-}
-d3.svg.diagonal = function() {
- var source = d3_svg_chordSource,
- target = d3_svg_chordTarget,
- projection = d3_svg_diagonalProjection;
-
- function diagonal(d, i) {
- var p0 = source.call(this, d, i),
- p3 = target.call(this, d, i),
- m = (p0.y + p3.y) / 2,
- p = [p0, {x: p0.x, y: m}, {x: p3.x, y: m}, p3];
- p = p.map(projection);
- return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
- }
-
- diagonal.source = function(x) {
- if (!arguments.length) return source;
- source = d3.functor(x);
- return diagonal;
- };
-
- diagonal.target = function(x) {
- if (!arguments.length) return target;
- target = d3.functor(x);
- return diagonal;
- };
-
- diagonal.projection = function(x) {
- if (!arguments.length) return projection;
- projection = x;
- return diagonal;
- };
-
- return diagonal;
-};
-
-function d3_svg_diagonalProjection(d) {
- return [d.x, d.y];
-}
-d3.svg.diagonal.radial = function() {
- var diagonal = d3.svg.diagonal(),
- projection = d3_svg_diagonalProjection,
- projection_ = diagonal.projection;
-
- diagonal.projection = function(x) {
- return arguments.length
- ? projection_(d3_svg_diagonalRadialProjection(projection = x))
- : projection;
- };
-
- return diagonal;
-};
-
-function d3_svg_diagonalRadialProjection(projection) {
- return function() {
- var d = projection.apply(this, arguments),
- r = d[0],
- a = d[1] + d3_svg_arcOffset;
- return [r * Math.cos(a), r * Math.sin(a)];
- };
-}
-d3.svg.mouse = function(container) {
- return d3_svg_mousePoint(container, d3.event);
-};
-
-// https://bugs.webkit.org/show_bug.cgi?id=44083
-var d3_mouse_bug44083 = /WebKit/.test(navigator.userAgent) ? -1 : 0;
-
-function d3_svg_mousePoint(container, e) {
- var point = (container.ownerSVGElement || container).createSVGPoint();
- if ((d3_mouse_bug44083 < 0) && (window.scrollX || window.scrollY)) {
- var svg = d3.select(document.body)
- .append("svg:svg")
- .style("position", "absolute")
- .style("top", 0)
- .style("left", 0);
- var ctm = svg[0][0].getScreenCTM();
- d3_mouse_bug44083 = !(ctm.f || ctm.e);
- svg.remove();
- }
- if (d3_mouse_bug44083) {
- point.x = e.pageX;
- point.y = e.pageY;
- } else {
- point.x = e.clientX;
- point.y = e.clientY;
- }
- point = point.matrixTransform(container.getScreenCTM().inverse());
- return [point.x, point.y];
-};
-d3.svg.touches = function(container) {
- var touches = d3.event.touches;
- return touches ? d3_array(touches).map(function(touch) {
- var point = d3_svg_mousePoint(container, touch);
- point.identifier = touch.identifier;
- return point;
- }) : [];
-};
-d3.svg.symbol = function() {
- var type = d3_svg_symbolType,
- size = d3_svg_symbolSize;
-
- function symbol(d, i) {
- return (d3_svg_symbols[type.call(this, d, i)]
- || d3_svg_symbols.circle)
- (size.call(this, d, i));
- }
-
- symbol.type = function(x) {
- if (!arguments.length) return type;
- type = d3.functor(x);
- return symbol;
- };
-
- // size of symbol in square pixels
- symbol.size = function(x) {
- if (!arguments.length) return size;
- size = d3.functor(x);
- return symbol;
- };
-
- return symbol;
-};
-
-function d3_svg_symbolSize() {
- return 64;
-}
-
-function d3_svg_symbolType() {
- return "circle";
-}
-
-// TODO cross-diagonal?
-var d3_svg_symbols = {
- "circle": function(size) {
- var r = Math.sqrt(size / Math.PI);
- return "M0," + r
- + "A" + r + "," + r + " 0 1,1 0," + (-r)
- + "A" + r + "," + r + " 0 1,1 0," + r
- + "Z";
- },
- "cross": function(size) {
- var r = Math.sqrt(size / 5) / 2;
- return "M" + -3 * r + "," + -r
- + "H" + -r
- + "V" + -3 * r
- + "H" + r
- + "V" + -r
- + "H" + 3 * r
- + "V" + r
- + "H" + r
- + "V" + 3 * r
- + "H" + -r
- + "V" + r
- + "H" + -3 * r
- + "Z";
- },
- "diamond": function(size) {
- var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)),
- rx = ry * d3_svg_symbolTan30;
- return "M0," + -ry
- + "L" + rx + ",0"
- + " 0," + ry
- + " " + -rx + ",0"
- + "Z";
- },
- "square": function(size) {
- var r = Math.sqrt(size) / 2;
- return "M" + -r + "," + -r
- + "L" + r + "," + -r
- + " " + r + "," + r
- + " " + -r + "," + r
- + "Z";
- },
- "triangle-down": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3),
- ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + ry
- + "L" + rx +"," + -ry
- + " " + -rx + "," + -ry
- + "Z";
- },
- "triangle-up": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3),
- ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + -ry
- + "L" + rx +"," + ry
- + " " + -rx + "," + ry
- + "Z";
- }
-};
-
-d3.svg.symbolTypes = d3.keys(d3_svg_symbols);
-
-var d3_svg_symbolSqrt3 = Math.sqrt(3),
- d3_svg_symbolTan30 = Math.tan(30 * Math.PI / 180);
-d3.svg.axis = function() {
- var scale = d3.scale.linear(),
- orient = "bottom",
- tickMajorSize = 6,
- tickMinorSize = 6,
- tickEndSize = 6,
- tickPadding = 3,
- tickArguments_ = [10],
- tickFormat_,
- tickSubdivide = 0;
-
- function axis(selection) {
- selection.each(function(d, i, j) {
- var g = d3.select(this);
-
- // If selection is a transition, create subtransitions.
- var transition = selection.delay ? function(o) {
- var id = d3_transitionInheritId;
- try {
- d3_transitionInheritId = selection.id;
- return o.transition()
- .delay(selection[j][i].delay)
- .duration(selection[j][i].duration)
- .ease(selection.ease());
- } finally {
- d3_transitionInheritId = id;
- }
- } : Object;
-
- // Ticks.
- var ticks = scale.ticks.apply(scale, tickArguments_),
- tickFormat = tickFormat_ == null ? scale.tickFormat.apply(scale, tickArguments_) : tickFormat_;
-
- // Minor ticks.
- var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide),
- subtick = g.selectAll(".minor").data(subticks, String),
- subtickEnter = subtick.enter().insert("svg:line", "g").attr("class", "tick minor").style("opacity", 1e-6),
- subtickExit = transition(subtick.exit()).style("opacity", 1e-6).remove(),
- subtickUpdate = transition(subtick).style("opacity", 1);
-
- // Major ticks.
- var tick = g.selectAll("g").data(ticks, String),
- tickEnter = tick.enter().insert("svg:g", "path").style("opacity", 1e-6),
- tickExit = transition(tick.exit()).style("opacity", 1e-6).remove(),
- tickUpdate = transition(tick).style("opacity", 1),
- tickTransform;
-
- // Domain.
- var range = d3_scaleExtent(scale.range()),
- path = g.selectAll(".domain").data([0]),
- pathEnter = path.enter().append("svg:path").attr("class", "domain"),
- pathUpdate = transition(path);
-
- // Stash the new scale and grab the old scale.
- var scale0 = this.__chart__ || scale;
- this.__chart__ = scale.copy();
-
- tickEnter.append("svg:line").attr("class", "tick");
- tickEnter.append("svg:text");
- tickUpdate.select("text").text(tickFormat);
-
- switch (orient) {
- case "bottom": {
- tickTransform = d3_svg_axisX;
- subtickUpdate.attr("x2", 0).attr("y2", tickMinorSize);
- tickUpdate.select("line").attr("x2", 0).attr("y2", tickMajorSize);
- tickUpdate.select("text").attr("x", 0).attr("y", Math.max(tickMajorSize, 0) + tickPadding).attr("dy", ".71em").attr("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + tickEndSize + "V0H" + range[1] + "V" + tickEndSize);
- break;
- }
- case "top": {
- tickTransform = d3_svg_axisX;
- subtickUpdate.attr("x2", 0).attr("y2", -tickMinorSize);
- tickUpdate.select("line").attr("x2", 0).attr("y2", -tickMajorSize);
- tickUpdate.select("text").attr("x", 0).attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("dy", "0em").attr("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + -tickEndSize + "V0H" + range[1] + "V" + -tickEndSize);
- break;
- }
- case "left": {
- tickTransform = d3_svg_axisY;
- subtickUpdate.attr("x2", -tickMinorSize).attr("y2", 0);
- tickUpdate.select("line").attr("x2", -tickMajorSize).attr("y2", 0);
- tickUpdate.select("text").attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "end");
- pathUpdate.attr("d", "M" + -tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + -tickEndSize);
- break;
- }
- case "right": {
- tickTransform = d3_svg_axisY;
- subtickUpdate.attr("x2", tickMinorSize).attr("y2", 0);
- tickUpdate.select("line").attr("x2", tickMajorSize).attr("y2", 0);
- tickUpdate.select("text").attr("x", Math.max(tickMajorSize, 0) + tickPadding).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "start");
- pathUpdate.attr("d", "M" + tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + tickEndSize);
- break;
- }
- }
-
- tickEnter.call(tickTransform, scale0);
- tickUpdate.call(tickTransform, scale);
- tickExit.call(tickTransform, scale);
-
- subtickEnter.call(tickTransform, scale0);
- subtickUpdate.call(tickTransform, scale);
- subtickExit.call(tickTransform, scale);
- });
- }
-
- axis.scale = function(x) {
- if (!arguments.length) return scale;
- scale = x;
- return axis;
- };
-
- axis.orient = function(x) {
- if (!arguments.length) return orient;
- orient = x;
- return axis;
- };
-
- axis.ticks = function() {
- if (!arguments.length) return tickArguments_;
- tickArguments_ = arguments;
- return axis;
- };
-
- axis.tickFormat = function(x) {
- if (!arguments.length) return tickFormat_;
- tickFormat_ = x;
- return axis;
- };
-
- axis.tickSize = function(x, y, z) {
- if (!arguments.length) return tickMajorSize;
- var n = arguments.length - 1;
- tickMajorSize = +x;
- tickMinorSize = n > 1 ? +y : tickMajorSize;
- tickEndSize = n > 0 ? +arguments[n] : tickMajorSize;
- return axis;
- };
-
- axis.tickPadding = function(x) {
- if (!arguments.length) return tickPadding;
- tickPadding = +x;
- return axis;
- };
-
- axis.tickSubdivide = function(x) {
- if (!arguments.length) return tickSubdivide;
- tickSubdivide = +x;
- return axis;
- };
-
- return axis;
-};
-
-function d3_svg_axisX(selection, x) {
- selection.attr("transform", function(d) { return "translate(" + x(d) + ",0)"; });
-}
-
-function d3_svg_axisY(selection, y) {
- selection.attr("transform", function(d) { return "translate(0," + y(d) + ")"; });
-}
-
-function d3_svg_axisSubdivide(scale, ticks, m) {
- subticks = [];
- if (m && ticks.length > 1) {
- var extent = d3_scaleExtent(scale.domain()),
- subticks,
- i = -1,
- n = ticks.length,
- d = (ticks[1] - ticks[0]) / ++m,
- j,
- v;
- while (++i < n) {
- for (j = m; --j > 0;) {
- if ((v = +ticks[i] - j * d) >= extent[0]) {
- subticks.push(v);
- }
- }
- }
- for (--i, j = 0; ++j < m && (v = +ticks[i] + j * d) < extent[1];) {
- subticks.push(v);
- }
- }
- return subticks;
-}
-d3.behavior = {};
-d3.behavior.drag = function() {
- var event = d3.dispatch("drag", "dragstart", "dragend");
-
- function drag() {
- this
- .on("mousedown.drag", mousedown)
- .on("touchstart.drag", mousedown);
-
- d3.select(window)
- .on("mousemove.drag", d3_behavior_dragMove)
- .on("touchmove.drag", d3_behavior_dragMove)
- .on("mouseup.drag", d3_behavior_dragUp, true)
- .on("touchend.drag", d3_behavior_dragUp, true)
- .on("click.drag", d3_behavior_dragClick, true);
- }
-
- // snapshot the local context for subsequent dispatch
- function start() {
- d3_behavior_dragEvent = event;
- d3_behavior_dragEventTarget = d3.event.target;
- d3_behavior_dragOffset = d3_behavior_dragPoint((d3_behavior_dragTarget = this).parentNode);
- d3_behavior_dragMoved = 0;
- d3_behavior_dragArguments = arguments;
- }
-
- function mousedown() {
- start.apply(this, arguments);
- d3_behavior_dragDispatch("dragstart");
- }
-
- drag.on = function(type, listener) {
- event[type].add(listener);
- return drag;
- };
-
- return drag;
-};
-
-var d3_behavior_dragEvent,
- d3_behavior_dragEventTarget,
- d3_behavior_dragTarget,
- d3_behavior_dragArguments,
- d3_behavior_dragOffset,
- d3_behavior_dragMoved,
- d3_behavior_dragStopClick;
-
-function d3_behavior_dragDispatch(type) {
- var o = d3.event, p = d3_behavior_dragTarget.parentNode, dx = 0, dy = 0;
-
- if (p) {
- p = d3_behavior_dragPoint(p);
- dx = p[0] - d3_behavior_dragOffset[0];
- dy = p[1] - d3_behavior_dragOffset[1];
- d3_behavior_dragOffset = p;
- d3_behavior_dragMoved |= dx | dy;
- }
-
- try {
- d3.event = {dx: dx, dy: dy};
- d3_behavior_dragEvent[type].dispatch.apply(d3_behavior_dragTarget, d3_behavior_dragArguments);
- } finally {
- d3.event = o;
- }
-
- o.preventDefault();
-}
-
-function d3_behavior_dragPoint(container) {
- return d3.event.touches
- ? d3.svg.touches(container)[0]
- : d3.svg.mouse(container);
-}
-
-function d3_behavior_dragMove() {
- if (!d3_behavior_dragTarget) return;
- var parent = d3_behavior_dragTarget.parentNode;
-
- // O NOES! The drag element was removed from the DOM.
- if (!parent) return d3_behavior_dragUp();
-
- d3_behavior_dragDispatch("drag");
- d3_behavior_dragCancel();
-}
-
-function d3_behavior_dragUp() {
- if (!d3_behavior_dragTarget) return;
- d3_behavior_dragDispatch("dragend");
- d3_behavior_dragTarget = null;
-
- // If the node was moved, prevent the mouseup from propagating.
- // Also prevent the subsequent click from propagating (e.g., for anchors).
- if (d3_behavior_dragMoved && d3_behavior_dragEventTarget === d3.event.target) {
- d3_behavior_dragStopClick = true;
- d3_behavior_dragCancel();
- }
-}
-
-function d3_behavior_dragClick() {
- if (d3_behavior_dragStopClick && d3_behavior_dragEventTarget === d3.event.target) {
- d3_behavior_dragCancel();
- d3_behavior_dragStopClick = false;
- d3_behavior_dragEventTarget = null;
- }
-}
-
-function d3_behavior_dragCancel() {
- d3.event.stopPropagation();
- d3.event.preventDefault();
-}
-// TODO unbind zoom behavior?
-// TODO unbind listener?
-d3.behavior.zoom = function() {
- var xyz = [0, 0, 0],
- event = d3.dispatch("zoom");
-
- function zoom() {
- this
- .on("mousedown.zoom", mousedown)
- .on("mousewheel.zoom", mousewheel)
- .on("DOMMouseScroll.zoom", mousewheel)
- .on("dblclick.zoom", dblclick)
- .on("touchstart.zoom", touchstart);
-
- d3.select(window)
- .on("mousemove.zoom", d3_behavior_zoomMousemove)
- .on("mouseup.zoom", d3_behavior_zoomMouseup)
- .on("touchmove.zoom", d3_behavior_zoomTouchmove)
- .on("touchend.zoom", d3_behavior_zoomTouchup)
- .on("click.zoom", d3_behavior_zoomClick, true);
- }
-
- // snapshot the local context for subsequent dispatch
- function start() {
- d3_behavior_zoomXyz = xyz;
- d3_behavior_zoomDispatch = event.zoom.dispatch;
- d3_behavior_zoomEventTarget = d3.event.target;
- d3_behavior_zoomTarget = this;
- d3_behavior_zoomArguments = arguments;
- }
-
- function mousedown() {
- start.apply(this, arguments);
- d3_behavior_zoomPanning = d3_behavior_zoomLocation(d3.svg.mouse(d3_behavior_zoomTarget));
- d3_behavior_zoomMoved = false;
- d3.event.preventDefault();
- window.focus();
- }
-
- // store starting mouse location
- function mousewheel() {
- start.apply(this, arguments);
- if (!d3_behavior_zoomZooming) d3_behavior_zoomZooming = d3_behavior_zoomLocation(d3.svg.mouse(d3_behavior_zoomTarget));
- d3_behavior_zoomTo(d3_behavior_zoomDelta() + xyz[2], d3.svg.mouse(d3_behavior_zoomTarget), d3_behavior_zoomZooming);
- }
-
- function dblclick() {
- start.apply(this, arguments);
- var mouse = d3.svg.mouse(d3_behavior_zoomTarget);
- d3_behavior_zoomTo(d3.event.shiftKey ? Math.ceil(xyz[2] - 1) : Math.floor(xyz[2] + 1), mouse, d3_behavior_zoomLocation(mouse));
- }
-
- // doubletap detection
- function touchstart() {
- start.apply(this, arguments);
- var touches = d3_behavior_zoomTouchup(),
- touch,
- now = Date.now();
- if ((touches.length === 1) && (now - d3_behavior_zoomLast < 300)) {
- d3_behavior_zoomTo(1 + Math.floor(xyz[2]), touch = touches[0], d3_behavior_zoomLocations[touch.identifier]);
- }
- d3_behavior_zoomLast = now;
- }
-
- zoom.on = function(type, listener) {
- event[type].add(listener);
- return zoom;
- };
-
- return zoom;
-};
-
-var d3_behavior_zoomDiv,
- d3_behavior_zoomPanning,
- d3_behavior_zoomZooming,
- d3_behavior_zoomLocations = {}, // identifier -> location
- d3_behavior_zoomLast = 0,
- d3_behavior_zoomXyz,
- d3_behavior_zoomDispatch,
- d3_behavior_zoomEventTarget,
- d3_behavior_zoomTarget,
- d3_behavior_zoomArguments,
- d3_behavior_zoomMoved,
- d3_behavior_zoomStopClick;
-
-function d3_behavior_zoomLocation(point) {
- return [
- point[0] - d3_behavior_zoomXyz[0],
- point[1] - d3_behavior_zoomXyz[1],
- d3_behavior_zoomXyz[2]
- ];
-}
-
-// detect the pixels that would be scrolled by this wheel event
-function d3_behavior_zoomDelta() {
-
- // mousewheel events are totally broken!
- // https://bugs.webkit.org/show_bug.cgi?id=40441
- // not only that, but Chrome and Safari differ in re. to acceleration!
- if (!d3_behavior_zoomDiv) {
- d3_behavior_zoomDiv = d3.select("body").append("div")
- .style("visibility", "hidden")
- .style("top", 0)
- .style("height", 0)
- .style("width", 0)
- .style("overflow-y", "scroll")
- .append("div")
- .style("height", "2000px")
- .node().parentNode;
- }
-
- var e = d3.event, delta;
- try {
- d3_behavior_zoomDiv.scrollTop = 1000;
- d3_behavior_zoomDiv.dispatchEvent(e);
- delta = 1000 - d3_behavior_zoomDiv.scrollTop;
- } catch (error) {
- delta = e.wheelDelta || (-e.detail * 5);
- }
-
- return delta * .005;
-}
-
-// Note: Since we don't rotate, it's possible for the touches to become
-// slightly detached from their original positions. Thus, we recompute the
-// touch points on touchend as well as touchstart!
-function d3_behavior_zoomTouchup() {
- var touches = d3.svg.touches(d3_behavior_zoomTarget),
- i = -1,
- n = touches.length,
- touch;
- while (++i < n) d3_behavior_zoomLocations[(touch = touches[i]).identifier] = d3_behavior_zoomLocation(touch);
- return touches;
-}
-
-function d3_behavior_zoomTouchmove() {
- var touches = d3.svg.touches(d3_behavior_zoomTarget);
- switch (touches.length) {
-
- // single-touch pan
- case 1: {
- var touch = touches[0];
- d3_behavior_zoomTo(d3_behavior_zoomXyz[2], touch, d3_behavior_zoomLocations[touch.identifier]);
- break;
- }
-
- // double-touch pan + zoom
- case 2: {
- var p0 = touches[0],
- p1 = touches[1],
- p2 = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2],
- l0 = d3_behavior_zoomLocations[p0.identifier],
- l1 = d3_behavior_zoomLocations[p1.identifier],
- l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2, l0[2]];
- d3_behavior_zoomTo(Math.log(d3.event.scale) / Math.LN2 + l0[2], p2, l2);
- break;
- }
- }
-}
-
-function d3_behavior_zoomMousemove() {
- d3_behavior_zoomZooming = null;
- if (d3_behavior_zoomPanning) {
- d3_behavior_zoomMoved = true;
- d3_behavior_zoomTo(d3_behavior_zoomXyz[2], d3.svg.mouse(d3_behavior_zoomTarget), d3_behavior_zoomPanning);
- }
-}
-
-function d3_behavior_zoomMouseup() {
- if (d3_behavior_zoomPanning) {
- if (d3_behavior_zoomMoved && d3_behavior_zoomEventTarget === d3.event.target) {
- d3_behavior_zoomStopClick = true;
- }
- d3_behavior_zoomMousemove();
- d3_behavior_zoomPanning = null;
- }
-}
-
-function d3_behavior_zoomClick() {
- if (d3_behavior_zoomStopClick && d3_behavior_zoomEventTarget === d3.event.target) {
- d3.event.stopPropagation();
- d3.event.preventDefault();
- d3_behavior_zoomStopClick = false;
- d3_behavior_zoomEventTarget = null;
- }
-}
-
-function d3_behavior_zoomTo(z, x0, x1) {
- var K = Math.pow(2, (d3_behavior_zoomXyz[2] = z) - x1[2]),
- x = d3_behavior_zoomXyz[0] = x0[0] - K * x1[0],
- y = d3_behavior_zoomXyz[1] = x0[1] - K * x1[1],
- o = d3.event, // Events can be reentrant (e.g., focus).
- k = Math.pow(2, z);
-
- d3.event = {
- scale: k,
- translate: [x, y],
- transform: function(sx, sy) {
- if (sx) transform(sx, x);
- if (sy) transform(sy, y);
- }
- };
-
- function transform(scale, o) {
- var domain = scale.__domain || (scale.__domain = scale.domain()),
- range = scale.range().map(function(v) { return (v - o) / k; });
- scale.domain(domain).domain(range.map(scale.invert));
- }
-
- try {
- d3_behavior_zoomDispatch.apply(d3_behavior_zoomTarget, d3_behavior_zoomArguments);
- } finally {
- d3.event = o;
- }
-
- o.preventDefault();
-}
-})();
diff --git a/src/js/d3js/d3.layout.js b/src/js/d3js/d3.layout.js
deleted file mode 100644
index 2bfb9d32..00000000
--- a/src/js/d3js/d3.layout.js
+++ /dev/null
@@ -1,1890 +0,0 @@
-(function(){d3.layout = {};
-// Implements hierarchical edge bundling using Holten's algorithm. For each
-// input link, a path is computed that travels through the tree, up the parent
-// hierarchy to the least common ancestor, and then back down to the destination
-// node. Each path is simply an array of nodes.
-d3.layout.bundle = function() {
- return function(links) {
- var paths = [],
- i = -1,
- n = links.length;
- while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
- return paths;
- };
-};
-
-function d3_layout_bundlePath(link) {
- var start = link.source,
- end = link.target,
- lca = d3_layout_bundleLeastCommonAncestor(start, end),
- points = [start];
- while (start !== lca) {
- start = start.parent;
- points.push(start);
- }
- var k = points.length;
- while (end !== lca) {
- points.splice(k, 0, end);
- end = end.parent;
- }
- return points;
-}
-
-function d3_layout_bundleAncestors(node) {
- var ancestors = [],
- parent = node.parent;
- while (parent != null) {
- ancestors.push(node);
- node = parent;
- parent = parent.parent;
- }
- ancestors.push(node);
- return ancestors;
-}
-
-function d3_layout_bundleLeastCommonAncestor(a, b) {
- if (a === b) return a;
- var aNodes = d3_layout_bundleAncestors(a),
- bNodes = d3_layout_bundleAncestors(b),
- aNode = aNodes.pop(),
- bNode = bNodes.pop(),
- sharedNode = null;
- while (aNode === bNode) {
- sharedNode = aNode;
- aNode = aNodes.pop();
- bNode = bNodes.pop();
- }
- return sharedNode;
-}
-d3.layout.chord = function() {
- var chord = {},
- chords,
- groups,
- matrix,
- n,
- padding = 0,
- sortGroups,
- sortSubgroups,
- sortChords;
-
- function relayout() {
- var subgroups = {},
- groupSums = [],
- groupIndex = d3.range(n),
- subgroupIndex = [],
- k,
- x,
- x0,
- i,
- j;
-
- chords = [];
- groups = [];
-
- // Compute the sum.
- k = 0, i = -1; while (++i < n) {
- x = 0, j = -1; while (++j < n) {
- x += matrix[i][j];
- }
- groupSums.push(x);
- subgroupIndex.push(d3.range(n));
- k += x;
- }
-
- // Sort groups…
- if (sortGroups) {
- groupIndex.sort(function(a, b) {
- return sortGroups(groupSums[a], groupSums[b]);
- });
- }
-
- // Sort subgroups…
- if (sortSubgroups) {
- subgroupIndex.forEach(function(d, i) {
- d.sort(function(a, b) {
- return sortSubgroups(matrix[i][a], matrix[i][b]);
- });
- });
- }
-
- // Convert the sum to scaling factor for [0, 2pi].
- // TODO Allow start and end angle to be specified.
- // TODO Allow padding to be specified as percentage?
- k = (2 * Math.PI - padding * n) / k;
-
- // Compute the start and end angle for each group and subgroup.
- x = 0, i = -1; while (++i < n) {
- x0 = x, j = -1; while (++j < n) {
- var di = groupIndex[i],
- dj = subgroupIndex[i][j],
- v = matrix[di][dj];
- subgroups[di + "-" + dj] = {
- index: di,
- subindex: dj,
- startAngle: x,
- endAngle: x += v * k,
- value: v
- };
- }
- groups.push({
- index: di,
- startAngle: x0,
- endAngle: x,
- value: (x - x0) / k
- });
- x += padding;
- }
-
- // Generate chords for each (non-empty) subgroup-subgroup link.
- i = -1; while (++i < n) {
- j = i - 1; while (++j < n) {
- var source = subgroups[i + "-" + j],
- target = subgroups[j + "-" + i];
- if (source.value || target.value) {
- chords.push(source.value < target.value
- ? {source: target, target: source}
- : {source: source, target: target});
- }
- }
- }
-
- if (sortChords) resort();
- }
-
- function resort() {
- chords.sort(function(a, b) {
- return sortChords(a.target.value, b.target.value);
- });
- }
-
- chord.matrix = function(x) {
- if (!arguments.length) return matrix;
- n = (matrix = x) && matrix.length;
- chords = groups = null;
- return chord;
- };
-
- chord.padding = function(x) {
- if (!arguments.length) return padding;
- padding = x;
- chords = groups = null;
- return chord;
- };
-
- chord.sortGroups = function(x) {
- if (!arguments.length) return sortGroups;
- sortGroups = x;
- chords = groups = null;
- return chord;
- };
-
- chord.sortSubgroups = function(x) {
- if (!arguments.length) return sortSubgroups;
- sortSubgroups = x;
- chords = null;
- return chord;
- };
-
- chord.sortChords = function(x) {
- if (!arguments.length) return sortChords;
- sortChords = x;
- if (chords) resort();
- return chord;
- };
-
- chord.chords = function() {
- if (!chords) relayout();
- return chords;
- };
-
- chord.groups = function() {
- if (!groups) relayout();
- return groups;
- };
-
- return chord;
-};
-// A rudimentary force layout using Gauss-Seidel.
-d3.layout.force = function() {
- var force = {},
- event = d3.dispatch("tick"),
- size = [1, 1],
- drag,
- alpha,
- friction = .9,
- linkDistance = d3_layout_forceLinkDistance,
- linkStrength = d3_layout_forceLinkStrength,
- charge = -30,
- gravity = .1,
- theta = .8,
- interval,
- nodes = [],
- links = [],
- distances,
- strengths,
- charges;
-
- function repulse(node) {
- return function(quad, x1, y1, x2, y2) {
- if (quad.point !== node) {
- var dx = quad.cx - node.x,
- dy = quad.cy - node.y,
- dn = 1 / Math.sqrt(dx * dx + dy * dy);
-
- /* Barnes-Hut criterion. */
- if ((x2 - x1) * dn < theta) {
- var k = quad.charge * dn * dn;
- node.px -= dx * k;
- node.py -= dy * k;
- return true;
- }
-
- if (quad.point && isFinite(dn)) {
- var k = quad.pointCharge * dn * dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- }
- return !quad.charge;
- };
- }
-
- function tick() {
- var n = nodes.length,
- m = links.length,
- q,
- i, // current index
- o, // current object
- s, // current source
- t, // current target
- l, // current distance
- k, // current force
- x, // x-distance
- y; // y-distance
-
- // gauss-seidel relaxation for links
- for (i = 0; i < m; ++i) {
- o = links[i];
- s = o.source;
- t = o.target;
- x = t.x - s.x;
- y = t.y - s.y;
- if (l = (x * x + y * y)) {
- l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
- x *= l;
- y *= l;
- t.x -= x * (k = s.weight / (t.weight + s.weight));
- t.y -= y * k;
- s.x += x * (k = 1 - k);
- s.y += y * k;
- }
- }
-
- // apply gravity forces
- if (k = alpha * gravity) {
- x = size[0] / 2;
- y = size[1] / 2;
- i = -1; if (k) while (++i < n) {
- o = nodes[i];
- o.x += (x - o.x) * k;
- o.y += (y - o.y) * k;
- }
- }
-
- // compute quadtree center of mass and apply charge forces
- if (charge) {
- d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
- i = -1; while (++i < n) {
- if (!(o = nodes[i]).fixed) {
- q.visit(repulse(o));
- }
- }
- }
-
- // position verlet integration
- i = -1; while (++i < n) {
- o = nodes[i];
- if (o.fixed) {
- o.x = o.px;
- o.y = o.py;
- } else {
- o.x -= (o.px - (o.px = o.x)) * friction;
- o.y -= (o.py - (o.py = o.y)) * friction;
- }
- }
-
- event.tick.dispatch({type: "tick", alpha: alpha});
-
- // simulated annealing, basically
- return (alpha *= .99) < .005;
- }
-
- force.on = function(type, listener) {
- event[type].add(listener);
- return force;
- };
-
- force.nodes = function(x) {
- if (!arguments.length) return nodes;
- nodes = x;
- return force;
- };
-
- force.links = function(x) {
- if (!arguments.length) return links;
- links = x;
- return force;
- };
-
- force.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return force;
- };
-
- force.linkDistance = function(x) {
- if (!arguments.length) return linkDistance;
- linkDistance = d3.functor(x);
- return force;
- };
-
- // For backwards-compatibility.
- force.distance = force.linkDistance;
-
- force.linkStrength = function(x) {
- if (!arguments.length) return linkStrength;
- linkStrength = d3.functor(x);
- return force;
- };
-
- force.friction = function(x) {
- if (!arguments.length) return friction;
- friction = x;
- return force;
- };
-
- force.charge = function(x) {
- if (!arguments.length) return charge;
- charge = typeof x === "function" ? x : +x;
- return force;
- };
-
- force.gravity = function(x) {
- if (!arguments.length) return gravity;
- gravity = x;
- return force;
- };
-
- force.theta = function(x) {
- if (!arguments.length) return theta;
- theta = x;
- return force;
- };
-
- force.start = function() {
- var i,
- j,
- n = nodes.length,
- m = links.length,
- w = size[0],
- h = size[1],
- neighbors,
- o;
-
- for (i = 0; i < n; ++i) {
- (o = nodes[i]).index = i;
- o.weight = 0;
- }
-
- distances = [];
- strengths = [];
- for (i = 0; i < m; ++i) {
- o = links[i];
- if (typeof o.source == "number") o.source = nodes[o.source];
- if (typeof o.target == "number") o.target = nodes[o.target];
- distances[i] = linkDistance.call(this, o, i);
- strengths[i] = linkStrength.call(this, o, i);
- ++o.source.weight;
- ++o.target.weight;
- }
-
- for (i = 0; i < n; ++i) {
- o = nodes[i];
- if (isNaN(o.x)) o.x = position("x", w);
- if (isNaN(o.y)) o.y = position("y", h);
- if (isNaN(o.px)) o.px = o.x;
- if (isNaN(o.py)) o.py = o.y;
- }
-
- charges = [];
- if (typeof charge === "function") {
- for (i = 0; i < n; ++i) {
- charges[i] = +charge.call(this, nodes[i], i);
- }
- } else {
- for (i = 0; i < n; ++i) {
- charges[i] = charge;
- }
- }
-
- // initialize node position based on first neighbor
- function position(dimension, size) {
- var neighbors = neighbor(i),
- j = -1,
- m = neighbors.length,
- x;
- while (++j < m) if (!isNaN(x = neighbors[j][dimension])) return x;
- return Math.random() * size;
- }
-
- // initialize neighbors lazily
- function neighbor() {
- if (!neighbors) {
- neighbors = [];
- for (j = 0; j < n; ++j) {
- neighbors[j] = [];
- }
- for (j = 0; j < m; ++j) {
- var o = links[j];
- neighbors[o.source.index].push(o.target);
- neighbors[o.target.index].push(o.source);
- }
- }
- return neighbors[i];
- }
-
- return force.resume();
- };
-
- force.resume = function() {
- alpha = .1;
- d3.timer(tick);
- return force;
- };
-
- force.stop = function() {
- alpha = 0;
- return force;
- };
-
- // use `node.call(force.drag)` to make nodes draggable
- force.drag = function() {
- if (!drag) drag = d3.behavior.drag()
- .on("dragstart", dragstart)
- .on("drag", d3_layout_forceDrag)
- .on("dragend", d3_layout_forceDragEnd);
-
- this.on("mouseover.force", d3_layout_forceDragOver)
- .on("mouseout.force", d3_layout_forceDragOut)
- .call(drag);
- };
-
- function dragstart(d) {
- d3_layout_forceDragOver(d3_layout_forceDragNode = d);
- d3_layout_forceDragForce = force;
- }
-
- return force;
-};
-
-var d3_layout_forceDragForce,
- d3_layout_forceDragNode;
-
-function d3_layout_forceDragOver(d) {
- d.fixed |= 2;
-}
-
-function d3_layout_forceDragOut(d) {
- if (d !== d3_layout_forceDragNode) d.fixed &= 1;
-}
-
-function d3_layout_forceDragEnd() {
- d3_layout_forceDrag();
- d3_layout_forceDragNode.fixed &= 1;
- d3_layout_forceDragForce = d3_layout_forceDragNode = null;
-}
-
-function d3_layout_forceDrag() {
- d3_layout_forceDragNode.px += d3.event.dx;
- d3_layout_forceDragNode.py += d3.event.dy;
- d3_layout_forceDragForce.resume(); // restart annealing
-}
-
-function d3_layout_forceAccumulate(quad, alpha, charges) {
- var cx = 0,
- cy = 0;
- quad.charge = 0;
- if (!quad.leaf) {
- var nodes = quad.nodes,
- n = nodes.length,
- i = -1,
- c;
- while (++i < n) {
- c = nodes[i];
- if (c == null) continue;
- d3_layout_forceAccumulate(c, alpha, charges);
- quad.charge += c.charge;
- cx += c.charge * c.cx;
- cy += c.charge * c.cy;
- }
- }
- if (quad.point) {
- // jitter internal nodes that are coincident
- if (!quad.leaf) {
- quad.point.x += Math.random() - .5;
- quad.point.y += Math.random() - .5;
- }
- var k = alpha * charges[quad.point.index];
- quad.charge += quad.pointCharge = k;
- cx += k * quad.point.x;
- cy += k * quad.point.y;
- }
- quad.cx = cx / quad.charge;
- quad.cy = cy / quad.charge;
-}
-
-function d3_layout_forceLinkDistance(link) {
- return 20;
-}
-
-function d3_layout_forceLinkStrength(link) {
- return 1;
-}
-d3.layout.partition = function() {
- var hierarchy = d3.layout.hierarchy(),
- size = [1, 1]; // width, height
-
- function position(node, x, dx, dy) {
- var children = node.children;
- node.x = x;
- node.y = node.depth * dy;
- node.dx = dx;
- node.dy = dy;
- if (children && (n = children.length)) {
- var i = -1,
- n,
- c,
- d;
- dx = node.value ? dx / node.value : 0;
- while (++i < n) {
- position(c = children[i], x, d = c.value * dx, dy);
- x += d;
- }
- }
- }
-
- function depth(node) {
- var children = node.children,
- d = 0;
- if (children && (n = children.length)) {
- var i = -1,
- n;
- while (++i < n) d = Math.max(d, depth(children[i]));
- }
- return 1 + d;
- }
-
- function partition(d, i) {
- var nodes = hierarchy.call(this, d, i);
- position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
- return nodes;
- }
-
- partition.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return partition;
- };
-
- return d3_layout_hierarchyRebind(partition, hierarchy);
-};
-d3.layout.pie = function() {
- var value = Number,
- sort = null,
- startAngle = 0,
- endAngle = 2 * Math.PI;
-
- function pie(data, i) {
-
- // Compute the start angle.
- var a = +(typeof startAngle === "function"
- ? startAngle.apply(this, arguments)
- : startAngle);
-
- // Compute the angular range (end - start).
- var k = (typeof endAngle === "function"
- ? endAngle.apply(this, arguments)
- : endAngle) - startAngle;
-
- // Optionally sort the data.
- var index = d3.range(data.length);
- if (sort != null) index.sort(function(i, j) {
- return sort(data[i], data[j]);
- });
-
- // Compute the numeric values for each data element.
- var values = data.map(value);
-
- // Convert k into a scale factor from value to angle, using the sum.
- k /= values.reduce(function(p, d) { return p + d; }, 0);
-
- // Compute the arcs!
- var arcs = index.map(function(i) {
- return {
- data: data[i],
- value: d = values[i],
- startAngle: a,
- endAngle: a += d * k
- };
- });
-
- // Return the arcs in the original data's order.
- return data.map(function(d, i) {
- return arcs[index[i]];
- });
- }
-
- /**
- * Specifies the value function *x*, which returns a nonnegative numeric value
- * for each datum. The default value function is `Number`. The value function
- * is passed two arguments: the current datum and the current index.
- */
- pie.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return pie;
- };
-
- /**
- * Specifies a sort comparison operator *x*. The comparator is passed two data
- * elements from the data array, a and b; it returns a negative value if a is
- * less than b, a positive value if a is greater than b, and zero if a equals
- * b.
- */
- pie.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return pie;
- };
-
- /**
- * Specifies the overall start angle of the pie chart. Defaults to 0. The
- * start angle can be specified either as a constant or as a function; in the
- * case of a function, it is evaluated once per array (as opposed to per
- * element).
- */
- pie.startAngle = function(x) {
- if (!arguments.length) return startAngle;
- startAngle = x;
- return pie;
- };
-
- /**
- * Specifies the overall end angle of the pie chart. Defaults to 2π. The
- * end angle can be specified either as a constant or as a function; in the
- * case of a function, it is evaluated once per array (as opposed to per
- * element).
- */
- pie.endAngle = function(x) {
- if (!arguments.length) return endAngle;
- endAngle = x;
- return pie;
- };
-
- return pie;
-};
-// data is two-dimensional array of x,y; we populate y0
-d3.layout.stack = function() {
- var values = Object,
- order = d3_layout_stackOrders["default"],
- offset = d3_layout_stackOffsets["zero"],
- out = d3_layout_stackOut,
- x = d3_layout_stackX,
- y = d3_layout_stackY;
-
- function stack(data, index) {
-
- // Convert series to canonical two-dimensional representation.
- var series = data.map(function(d, i) {
- return values.call(stack, d, i);
- });
-
- // Convert each series to canonical [[x,y]] representation.
- var points = series.map(function(d, i) {
- return d.map(function(v, i) {
- return [x.call(stack, v, i), y.call(stack, v, i)];
- });
- });
-
- // Compute the order of series, and permute them.
- var orders = order.call(stack, points, index);
- series = d3.permute(series, orders);
- points = d3.permute(points, orders);
-
- // Compute the baseline…
- var offsets = offset.call(stack, points, index);
-
- // And propagate it to other series.
- var n = series.length,
- m = series[0].length,
- i,
- j,
- o;
- for (j = 0; j < m; ++j) {
- out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
- for (i = 1; i < n; ++i) {
- out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
- }
- }
-
- return data;
- }
-
- stack.values = function(x) {
- if (!arguments.length) return values;
- values = x;
- return stack;
- };
-
- stack.order = function(x) {
- if (!arguments.length) return order;
- order = typeof x === "function" ? x : d3_layout_stackOrders[x];
- return stack;
- };
-
- stack.offset = function(x) {
- if (!arguments.length) return offset;
- offset = typeof x === "function" ? x : d3_layout_stackOffsets[x];
- return stack;
- };
-
- stack.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- return stack;
- };
-
- stack.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- return stack;
- };
-
- stack.out = function(z) {
- if (!arguments.length) return out;
- out = z;
- return stack;
- };
-
- return stack;
-}
-
-function d3_layout_stackX(d) {
- return d.x;
-}
-
-function d3_layout_stackY(d) {
- return d.y;
-}
-
-function d3_layout_stackOut(d, y0, y) {
- d.y0 = y0;
- d.y = y;
-}
-
-var d3_layout_stackOrders = {
-
- "inside-out": function(data) {
- var n = data.length,
- i,
- j,
- max = data.map(d3_layout_stackMaxIndex),
- sums = data.map(d3_layout_stackReduceSum),
- index = d3.range(n).sort(function(a, b) { return max[a] - max[b]; }),
- top = 0,
- bottom = 0,
- tops = [],
- bottoms = [];
- for (i = 0; i < n; ++i) {
- j = index[i];
- if (top < bottom) {
- top += sums[j];
- tops.push(j);
- } else {
- bottom += sums[j];
- bottoms.push(j);
- }
- }
- return bottoms.reverse().concat(tops);
- },
-
- "reverse": function(data) {
- return d3.range(data.length).reverse();
- },
-
- "default": function(data) {
- return d3.range(data.length);
- }
-
-};
-
-var d3_layout_stackOffsets = {
-
- "silhouette": function(data) {
- var n = data.length,
- m = data[0].length,
- sums = [],
- max = 0,
- i,
- j,
- o,
- y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o > max) max = o;
- sums.push(o);
- }
- for (j = 0; j < m; ++j) {
- y0[j] = (max - sums[j]) / 2;
- }
- return y0;
- },
-
- "wiggle": function(data) {
- var n = data.length,
- x = data[0],
- m = x.length,
- max = 0,
- i,
- j,
- k,
- s1,
- s2,
- s3,
- dx,
- o,
- o0,
- y0 = [];
- y0[0] = o = o0 = 0;
- for (j = 1; j < m; ++j) {
- for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
- for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
- for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
- s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
- }
- s2 += s3 * data[i][j][1];
- }
- y0[j] = o -= s1 ? s2 / s1 * dx : 0;
- if (o < o0) o0 = o;
- }
- for (j = 0; j < m; ++j) y0[j] -= o0;
- return y0;
- },
-
- "expand": function(data) {
- var n = data.length,
- m = data[0].length,
- k = 1 / n,
- i,
- j,
- o,
- y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o) for (i = 0; i < n; i++) data[i][j][1] /= o;
- else for (i = 0; i < n; i++) data[i][j][1] = k;
- }
- for (j = 0; j < m; ++j) y0[j] = 0;
- return y0;
- },
-
- "zero": function(data) {
- var j = -1,
- m = data[0].length,
- y0 = [];
- while (++j < m) y0[j] = 0;
- return y0;
- }
-
-};
-
-function d3_layout_stackMaxIndex(array) {
- var i = 1,
- j = 0,
- v = array[0][1],
- k,
- n = array.length;
- for (; i < n; ++i) {
- if ((k = array[i][1]) > v) {
- j = i;
- v = k;
- }
- }
- return j;
-}
-
-function d3_layout_stackReduceSum(d) {
- return d.reduce(d3_layout_stackSum, 0);
-}
-
-function d3_layout_stackSum(p, d) {
- return p + d[1];
-}
-d3.layout.histogram = function() {
- var frequency = true,
- valuer = Number,
- ranger = d3_layout_histogramRange,
- binner = d3_layout_histogramBinSturges;
-
- function histogram(data, i) {
- var bins = [],
- values = data.map(valuer, this),
- range = ranger.call(this, values, i),
- thresholds = binner.call(this, range, values, i),
- bin,
- i = -1,
- n = values.length,
- m = thresholds.length - 1,
- k = frequency ? 1 : 1 / n,
- x;
-
- // Initialize the bins.
- while (++i < m) {
- bin = bins[i] = [];
- bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
- bin.y = 0;
- }
-
- // Fill the bins, ignoring values outside the range.
- i = -1; while(++i < n) {
- x = values[i];
- if ((x >= range[0]) && (x <= range[1])) {
- bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
- bin.y += k;
- bin.push(data[i]);
- }
- }
-
- return bins;
- }
-
- // Specifies how to extract a value from the associated data. The default
- // value function is `Number`, which is equivalent to the identity function.
- histogram.value = function(x) {
- if (!arguments.length) return valuer;
- valuer = x;
- return histogram;
- };
-
- // Specifies the range of the histogram. Values outside the specified range
- // will be ignored. The argument `x` may be specified either as a two-element
- // array representing the minimum and maximum value of the range, or as a
- // function that returns the range given the array of values and the current
- // index `i`. The default range is the extent (minimum and maximum) of the
- // values.
- histogram.range = function(x) {
- if (!arguments.length) return ranger;
- ranger = d3.functor(x);
- return histogram;
- };
-
- // Specifies how to bin values in the histogram. The argument `x` may be
- // specified as a number, in which case the range of values will be split
- // uniformly into the given number of bins. Or, `x` may be an array of
- // threshold values, defining the bins; the specified array must contain the
- // rightmost (upper) value, thus specifying n + 1 values for n bins. Or, `x`
- // may be a function which is evaluated, being passed the range, the array of
- // values, and the current index `i`, returning an array of thresholds. The
- // default bin function will divide the values into uniform bins using
- // Sturges' formula.
- histogram.bins = function(x) {
- if (!arguments.length) return binner;
- binner = typeof x === "number"
- ? function(range) { return d3_layout_histogramBinFixed(range, x); }
- : d3.functor(x);
- return histogram;
- };
-
- // Specifies whether the histogram's `y` value is a count (frequency) or a
- // probability (density). The default value is true.
- histogram.frequency = function(x) {
- if (!arguments.length) return frequency;
- frequency = !!x;
- return histogram;
- };
-
- return histogram;
-};
-
-function d3_layout_histogramBinSturges(range, values) {
- return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
-}
-
-function d3_layout_histogramBinFixed(range, n) {
- var x = -1,
- b = +range[0],
- m = (range[1] - b) / n,
- f = [];
- while (++x <= n) f[x] = m * x + b;
- return f;
-}
-
-function d3_layout_histogramRange(values) {
- return [d3.min(values), d3.max(values)];
-}
-d3.layout.hierarchy = function() {
- var sort = d3_layout_hierarchySort,
- children = d3_layout_hierarchyChildren,
- value = d3_layout_hierarchyValue;
-
- // Recursively compute the node depth and value.
- // Also converts the data representation into a standard hierarchy structure.
- function recurse(data, depth, nodes) {
- var childs = children.call(hierarchy, data, depth),
- node = d3_layout_hierarchyInline ? data : {data: data};
- node.depth = depth;
- nodes.push(node);
- if (childs && (n = childs.length)) {
- var i = -1,
- n,
- c = node.children = [],
- v = 0,
- j = depth + 1;
- while (++i < n) {
- d = recurse(childs[i], j, nodes);
- d.parent = node;
- c.push(d);
- v += d.value;
- }
- if (sort) c.sort(sort);
- if (value) node.value = v;
- } else if (value) {
- node.value = +value.call(hierarchy, data, depth) || 0;
- }
- return node;
- }
-
- // Recursively re-evaluates the node value.
- function revalue(node, depth) {
- var children = node.children,
- v = 0;
- if (children && (n = children.length)) {
- var i = -1,
- n,
- j = depth + 1;
- while (++i < n) v += revalue(children[i], j);
- } else if (value) {
- v = +value.call(hierarchy, d3_layout_hierarchyInline ? node : node.data, depth) || 0;
- }
- if (value) node.value = v;
- return v;
- }
-
- function hierarchy(d) {
- var nodes = [];
- recurse(d, 0, nodes);
- return nodes;
- }
-
- hierarchy.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return hierarchy;
- };
-
- hierarchy.children = function(x) {
- if (!arguments.length) return children;
- children = x;
- return hierarchy;
- };
-
- hierarchy.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return hierarchy;
- };
-
- // Re-evaluates the `value` property for the specified hierarchy.
- hierarchy.revalue = function(root) {
- revalue(root, 0);
- return root;
- };
-
- return hierarchy;
-};
-
-// A method assignment helper for hierarchy subclasses.
-function d3_layout_hierarchyRebind(object, hierarchy) {
- object.sort = d3.rebind(object, hierarchy.sort);
- object.children = d3.rebind(object, hierarchy.children);
- object.links = d3_layout_hierarchyLinks;
- object.value = d3.rebind(object, hierarchy.value);
-
- // If the new API is used, enabling inlining.
- object.nodes = function(d) {
- d3_layout_hierarchyInline = true;
- return (object.nodes = object)(d);
- };
-
- return object;
-}
-
-function d3_layout_hierarchyChildren(d) {
- return d.children;
-}
-
-function d3_layout_hierarchyValue(d) {
- return d.value;
-}
-
-function d3_layout_hierarchySort(a, b) {
- return b.value - a.value;
-}
-
-// Returns an array source+target objects for the specified nodes.
-function d3_layout_hierarchyLinks(nodes) {
- return d3.merge(nodes.map(function(parent) {
- return (parent.children || []).map(function(child) {
- return {source: parent, target: child};
- });
- }));
-}
-
-// For backwards-compatibility, don't enable inlining by default.
-var d3_layout_hierarchyInline = false;
-d3.layout.pack = function() {
- var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort),
- size = [1, 1];
-
- function pack(d, i) {
- var nodes = hierarchy.call(this, d, i),
- root = nodes[0];
-
- // Recursively compute the layout.
- root.x = 0;
- root.y = 0;
- d3_layout_packTree(root);
-
- // Scale the layout to fit the requested size.
- var w = size[0],
- h = size[1],
- k = 1 / Math.max(2 * root.r / w, 2 * root.r / h);
- d3_layout_packTransform(root, w / 2, h / 2, k);
-
- return nodes;
- }
-
- pack.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return pack;
- };
-
- return d3_layout_hierarchyRebind(pack, hierarchy);
-};
-
-function d3_layout_packSort(a, b) {
- return a.value - b.value;
-}
-
-function d3_layout_packInsert(a, b) {
- var c = a._pack_next;
- a._pack_next = b;
- b._pack_prev = a;
- b._pack_next = c;
- c._pack_prev = b;
-}
-
-function d3_layout_packSplice(a, b) {
- a._pack_next = b;
- b._pack_prev = a;
-}
-
-function d3_layout_packIntersects(a, b) {
- var dx = b.x - a.x,
- dy = b.y - a.y,
- dr = a.r + b.r;
- return (dr * dr - dx * dx - dy * dy) > .001; // within epsilon
-}
-
-function d3_layout_packCircle(nodes) {
- var xMin = Infinity,
- xMax = -Infinity,
- yMin = Infinity,
- yMax = -Infinity,
- n = nodes.length,
- a, b, c, j, k;
-
- function bound(node) {
- xMin = Math.min(node.x - node.r, xMin);
- xMax = Math.max(node.x + node.r, xMax);
- yMin = Math.min(node.y - node.r, yMin);
- yMax = Math.max(node.y + node.r, yMax);
- }
-
- // Create node links.
- nodes.forEach(d3_layout_packLink);
-
- // Create first node.
- a = nodes[0];
- a.x = -a.r;
- a.y = 0;
- bound(a);
-
- // Create second node.
- if (n > 1) {
- b = nodes[1];
- b.x = b.r;
- b.y = 0;
- bound(b);
-
- // Create third node and build chain.
- if (n > 2) {
- c = nodes[2];
- d3_layout_packPlace(a, b, c);
- bound(c);
- d3_layout_packInsert(a, c);
- a._pack_prev = c;
- d3_layout_packInsert(c, b);
- b = a._pack_next;
-
- // Now iterate through the rest.
- for (var i = 3; i < n; i++) {
- d3_layout_packPlace(a, b, c = nodes[i]);
-
- // Search for the closest intersection.
- var isect = 0, s1 = 1, s2 = 1;
- for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
- if (d3_layout_packIntersects(j, c)) {
- isect = 1;
- break;
- }
- }
- if (isect == 1) {
- for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
- if (d3_layout_packIntersects(k, c)) {
- if (s2 < s1) {
- isect = -1;
- j = k;
- }
- break;
- }
- }
- }
-
- // Update node chain.
- if (isect == 0) {
- d3_layout_packInsert(a, c);
- b = c;
- bound(c);
- } else if (isect > 0) {
- d3_layout_packSplice(a, j);
- b = j;
- i--;
- } else { // isect < 0
- d3_layout_packSplice(j, b);
- a = j;
- i--;
- }
- }
- }
- }
-
- // Re-center the circles and return the encompassing radius.
- var cx = (xMin + xMax) / 2,
- cy = (yMin + yMax) / 2,
- cr = 0;
- for (var i = 0; i < n; i++) {
- var node = nodes[i];
- node.x -= cx;
- node.y -= cy;
- cr = Math.max(cr, node.r + Math.sqrt(node.x * node.x + node.y * node.y));
- }
-
- // Remove node links.
- nodes.forEach(d3_layout_packUnlink);
-
- return cr;
-}
-
-function d3_layout_packLink(node) {
- node._pack_next = node._pack_prev = node;
-}
-
-function d3_layout_packUnlink(node) {
- delete node._pack_next;
- delete node._pack_prev;
-}
-
-function d3_layout_packTree(node) {
- var children = node.children;
- if (children && children.length) {
- children.forEach(d3_layout_packTree);
- node.r = d3_layout_packCircle(children);
- } else {
- node.r = Math.sqrt(node.value);
- }
-}
-
-function d3_layout_packTransform(node, x, y, k) {
- var children = node.children;
- node.x = (x += k * node.x);
- node.y = (y += k * node.y);
- node.r *= k;
- if (children) {
- var i = -1, n = children.length;
- while (++i < n) d3_layout_packTransform(children[i], x, y, k);
- }
-}
-
-function d3_layout_packPlace(a, b, c) {
- var db = a.r + c.r,
- dx = b.x - a.x,
- dy = b.y - a.y;
- if (db && (dx || dy)) {
- var da = b.r + c.r,
- dc = Math.sqrt(dx * dx + dy * dy),
- cos = Math.max(-1, Math.min(1, (db * db + dc * dc - da * da) / (2 * db * dc))),
- theta = Math.acos(cos),
- x = cos * (db /= dc),
- y = Math.sin(theta) * db;
- c.x = a.x + x * dx + y * dy;
- c.y = a.y + x * dy - y * dx;
- } else {
- c.x = a.x + db;
- c.y = a.y;
- }
-}
-// Implements a hierarchical layout using the cluster (or dendogram) algorithm.
-d3.layout.cluster = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null),
- separation = d3_layout_treeSeparation,
- size = [1, 1]; // width, height
-
- function cluster(d, i) {
- var nodes = hierarchy.call(this, d, i),
- root = nodes[0],
- previousNode,
- x = 0,
- kx,
- ky;
-
- // First walk, computing the initial x & y values.
- d3_layout_treeVisitAfter(root, function(node) {
- var children = node.children;
- if (children && children.length) {
- node.x = d3_layout_clusterX(children);
- node.y = d3_layout_clusterY(children);
- } else {
- node.x = previousNode ? x += separation(node, previousNode) : 0;
- node.y = 0;
- previousNode = node;
- }
- });
-
- // Compute the left-most, right-most, and depth-most nodes for extents.
- var left = d3_layout_clusterLeft(root),
- right = d3_layout_clusterRight(root),
- x0 = left.x - separation(left, right) / 2,
- x1 = right.x + separation(right, left) / 2;
-
- // Second walk, normalizing x & y to the desired size.
- d3_layout_treeVisitAfter(root, function(node) {
- node.x = (node.x - x0) / (x1 - x0) * size[0];
- node.y = (1 - node.y / root.y) * size[1];
- });
-
- return nodes;
- }
-
- cluster.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return cluster;
- };
-
- cluster.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return cluster;
- };
-
- return d3_layout_hierarchyRebind(cluster, hierarchy);
-};
-
-function d3_layout_clusterY(children) {
- return 1 + d3.max(children, function(child) {
- return child.y;
- });
-}
-
-function d3_layout_clusterX(children) {
- return children.reduce(function(x, child) {
- return x + child.x;
- }, 0) / children.length;
-}
-
-function d3_layout_clusterLeft(node) {
- var children = node.children;
- return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
-}
-
-function d3_layout_clusterRight(node) {
- var children = node.children, n;
- return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
-}
-// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
-d3.layout.tree = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null),
- separation = d3_layout_treeSeparation,
- size = [1, 1]; // width, height
-
- function tree(d, i) {
- var nodes = hierarchy.call(this, d, i),
- root = nodes[0];
-
- function firstWalk(node, previousSibling) {
- var children = node.children,
- layout = node._tree;
- if (children && (n = children.length)) {
- var n,
- firstChild = children[0],
- previousChild,
- ancestor = firstChild,
- child,
- i = -1;
- while (++i < n) {
- child = children[i];
- firstWalk(child, previousChild);
- ancestor = apportion(child, previousChild, ancestor);
- previousChild = child;
- }
- d3_layout_treeShift(node);
- var midpoint = .5 * (firstChild._tree.prelim + child._tree.prelim);
- if (previousSibling) {
- layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling);
- layout.mod = layout.prelim - midpoint;
- } else {
- layout.prelim = midpoint;
- }
- } else {
- if (previousSibling) {
- layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling);
- }
- }
- }
-
- function secondWalk(node, x) {
- node.x = node._tree.prelim + x;
- var children = node.children;
- if (children && (n = children.length)) {
- var i = -1,
- n;
- x += node._tree.mod;
- while (++i < n) {
- secondWalk(children[i], x);
- }
- }
- }
-
- function apportion(node, previousSibling, ancestor) {
- if (previousSibling) {
- var vip = node,
- vop = node,
- vim = previousSibling,
- vom = node.parent.children[0],
- sip = vip._tree.mod,
- sop = vop._tree.mod,
- sim = vim._tree.mod,
- som = vom._tree.mod,
- shift;
- while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
- vom = d3_layout_treeLeft(vom);
- vop = d3_layout_treeRight(vop);
- vop._tree.ancestor = node;
- shift = vim._tree.prelim + sim - vip._tree.prelim - sip + separation(vim, vip);
- if (shift > 0) {
- d3_layout_treeMove(d3_layout_treeAncestor(vim, node, ancestor), node, shift);
- sip += shift;
- sop += shift;
- }
- sim += vim._tree.mod;
- sip += vip._tree.mod;
- som += vom._tree.mod;
- sop += vop._tree.mod;
- }
- if (vim && !d3_layout_treeRight(vop)) {
- vop._tree.thread = vim;
- vop._tree.mod += sim - sop;
- }
- if (vip && !d3_layout_treeLeft(vom)) {
- vom._tree.thread = vip;
- vom._tree.mod += sip - som;
- ancestor = node;
- }
- }
- return ancestor;
- }
-
- // Initialize temporary layout variables.
- d3_layout_treeVisitAfter(root, function(node, previousSibling) {
- node._tree = {
- ancestor: node,
- prelim: 0,
- mod: 0,
- change: 0,
- shift: 0,
- number: previousSibling ? previousSibling._tree.number + 1 : 0
- };
- });
-
- // Compute the layout using Buchheim et al.'s algorithm.
- firstWalk(root);
- secondWalk(root, -root._tree.prelim);
-
- // Compute the left-most, right-most, and depth-most nodes for extents.
- var left = d3_layout_treeSearch(root, d3_layout_treeLeftmost),
- right = d3_layout_treeSearch(root, d3_layout_treeRightmost),
- deep = d3_layout_treeSearch(root, d3_layout_treeDeepest),
- x0 = left.x - separation(left, right) / 2,
- x1 = right.x + separation(right, left) / 2,
- y1 = deep.depth || 1;
-
- // Clear temporary layout variables; transform x and y.
- d3_layout_treeVisitAfter(root, function(node) {
- node.x = (node.x - x0) / (x1 - x0) * size[0];
- node.y = node.depth / y1 * size[1];
- delete node._tree;
- });
-
- return nodes;
- }
-
- tree.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return tree;
- };
-
- tree.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return tree;
- };
-
- return d3_layout_hierarchyRebind(tree, hierarchy);
-};
-
-function d3_layout_treeSeparation(a, b) {
- return a.parent == b.parent ? 1 : 2;
-}
-
-// function d3_layout_treeSeparationRadial(a, b) {
-// return (a.parent == b.parent ? 1 : 2) / a.depth;
-// }
-
-function d3_layout_treeLeft(node) {
- var children = node.children;
- return children && children.length ? children[0] : node._tree.thread;
-}
-
-function d3_layout_treeRight(node) {
- var children = node.children,
- n;
- return children && (n = children.length) ? children[n - 1] : node._tree.thread;
-}
-
-function d3_layout_treeSearch(node, compare) {
- var children = node.children;
- if (children && (n = children.length)) {
- var child,
- n,
- i = -1;
- while (++i < n) {
- if (compare(child = d3_layout_treeSearch(children[i], compare), node) > 0) {
- node = child;
- }
- }
- }
- return node;
-}
-
-function d3_layout_treeRightmost(a, b) {
- return a.x - b.x;
-}
-
-function d3_layout_treeLeftmost(a, b) {
- return b.x - a.x;
-}
-
-function d3_layout_treeDeepest(a, b) {
- return a.depth - b.depth;
-}
-
-function d3_layout_treeVisitAfter(node, callback) {
- function visit(node, previousSibling) {
- var children = node.children;
- if (children && (n = children.length)) {
- var child,
- previousChild = null,
- i = -1,
- n;
- while (++i < n) {
- child = children[i];
- visit(child, previousChild);
- previousChild = child;
- }
- }
- callback(node, previousSibling);
- }
- visit(node, null);
-}
-
-function d3_layout_treeShift(node) {
- var shift = 0,
- change = 0,
- children = node.children,
- i = children.length,
- child;
- while (--i >= 0) {
- child = children[i]._tree;
- child.prelim += shift;
- child.mod += shift;
- shift += child.shift + (change += child.change);
- }
-}
-
-function d3_layout_treeMove(ancestor, node, shift) {
- ancestor = ancestor._tree;
- node = node._tree;
- var change = shift / (node.number - ancestor.number);
- ancestor.change += change;
- node.change -= change;
- node.shift += shift;
- node.prelim += shift;
- node.mod += shift;
-}
-
-function d3_layout_treeAncestor(vim, node, ancestor) {
- return vim._tree.ancestor.parent == node.parent
- ? vim._tree.ancestor
- : ancestor;
-}
-// Squarified Treemaps by Mark Bruls, Kees Huizing, and Jarke J. van Wijk
-// Modified to support a target aspect ratio by Jeff Heer
-d3.layout.treemap = function() {
- var hierarchy = d3.layout.hierarchy(),
- round = Math.round,
- size = [1, 1], // width, height
- padding = null,
- pad = d3_layout_treemapPadNull,
- sticky = false,
- stickies,
- ratio = 0.5 * (1 + Math.sqrt(5)); // golden ratio
-
- // Compute the area for each child based on value & scale.
- function scale(children, k) {
- var i = -1,
- n = children.length,
- child,
- area;
- while (++i < n) {
- area = (child = children[i]).value * (k < 0 ? 0 : k);
- child.area = isNaN(area) || area <= 0 ? 0 : area;
- }
- }
-
- // Recursively arranges the specified node's children into squarified rows.
- function squarify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node),
- row = [],
- remaining = children.slice(), // copy-on-write
- child,
- best = Infinity, // the best row score so far
- score, // the current row score
- u = Math.min(rect.dx, rect.dy), // initial orientation
- n;
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while ((n = remaining.length) > 0) {
- row.push(child = remaining[n - 1]);
- row.area += child.area;
- if ((score = worst(row, u)) <= best) { // continue with this orientation
- remaining.pop();
- best = score;
- } else { // abort, and try a different orientation
- row.area -= row.pop().area;
- position(row, u, rect, false);
- u = Math.min(rect.dx, rect.dy);
- row.length = row.area = 0;
- best = Infinity;
- }
- }
- if (row.length) {
- position(row, u, rect, true);
- row.length = row.area = 0;
- }
- children.forEach(squarify);
- }
- }
-
- // Recursively resizes the specified node's children into existing rows.
- // Preserves the existing layout!
- function stickify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node),
- remaining = children.slice(), // copy-on-write
- child,
- row = [];
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while (child = remaining.pop()) {
- row.push(child);
- row.area += child.area;
- if (child.z != null) {
- position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
- row.length = row.area = 0;
- }
- }
- children.forEach(stickify);
- }
- }
-
- // Computes the score for the specified row, as the worst aspect ratio.
- function worst(row, u) {
- var s = row.area,
- r,
- rmax = 0,
- rmin = Infinity,
- i = -1,
- n = row.length;
- while (++i < n) {
- if (!(r = row[i].area)) continue;
- if (r < rmin) rmin = r;
- if (r > rmax) rmax = r;
- }
- s *= s;
- u *= u;
- return s
- ? Math.max((u * rmax * ratio) / s, s / (u * rmin * ratio))
- : Infinity;
- }
-
- // Positions the specified row of nodes. Modifies `rect`.
- function position(row, u, rect, flush) {
- var i = -1,
- n = row.length,
- x = rect.x,
- y = rect.y,
- v = u ? round(row.area / u) : 0,
- o;
- if (u == rect.dx) { // horizontal subdivision
- if (flush || v > rect.dy) v = v ? rect.dy : 0; // over+underflow
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dy = v;
- x += o.dx = v ? round(o.area / v) : 0;
- }
- o.z = true;
- o.dx += rect.x + rect.dx - x; // rounding error
- rect.y += v;
- rect.dy -= v;
- } else { // vertical subdivision
- if (flush || v > rect.dx) v = v ? rect.dx : 0; // over+underflow
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dx = v;
- y += o.dy = v ? round(o.area / v) : 0;
- }
- o.z = false;
- o.dy += rect.y + rect.dy - y; // rounding error
- rect.x += v;
- rect.dx -= v;
- }
- }
-
- function treemap(d) {
- var nodes = stickies || hierarchy(d),
- root = nodes[0];
- root.x = 0;
- root.y = 0;
- root.dx = size[0];
- root.dy = size[1];
- if (stickies) hierarchy.revalue(root);
- scale([root], root.dx * root.dy / root.value);
- (stickies ? stickify : squarify)(root);
- if (sticky) stickies = nodes;
- return nodes;
- }
-
- treemap.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return treemap;
- };
-
- treemap.padding = function(x) {
- if (!arguments.length) return padding;
-
- function padFunction(node) {
- var p = x.call(treemap, node, node.depth);
- return p == null
- ? d3_layout_treemapPadNull(node)
- : d3_layout_treemapPad(node, typeof p === "number" ? [p, p, p, p] : p);
- }
-
- function padConstant(node) {
- return d3_layout_treemapPad(node, x);
- }
-
- var type;
- pad = (padding = x) == null ? d3_layout_treemapPadNull
- : (type = typeof x) === "function" ? padFunction
- : type === "number" ? (x = [x, x, x, x], padConstant)
- : padConstant;
- return treemap;
- };
-
- treemap.round = function(x) {
- if (!arguments.length) return round != Number;
- round = x ? Math.round : Number;
- return treemap;
- };
-
- treemap.sticky = function(x) {
- if (!arguments.length) return sticky;
- sticky = x;
- stickies = null;
- return treemap;
- };
-
- treemap.ratio = function(x) {
- if (!arguments.length) return ratio;
- ratio = x;
- return treemap;
- };
-
- return d3_layout_hierarchyRebind(treemap, hierarchy);
-};
-
-function d3_layout_treemapPadNull(node) {
- return {x: node.x, y: node.y, dx: node.dx, dy: node.dy};
-}
-
-function d3_layout_treemapPad(node, padding) {
- var x = node.x + padding[3],
- y = node.y + padding[0],
- dx = node.dx - padding[1] - padding[3],
- dy = node.dy - padding[0] - padding[2];
- if (dx < 0) { x += dx / 2; dx = 0; }
- if (dy < 0) { y += dy / 2; dy = 0; }
- return {x: x, y: y, dx: dx, dy: dy};
-}
-})();
diff --git a/src/js/date.js b/src/js/date.js
deleted file mode 100644
index 2d52e9ad..00000000
--- a/src/js/date.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Version: 1.0 Alpha-1
- * Build Date: 13-Nov-2007
- * Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
- * License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
- * Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
- */
-Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
-Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;idate)?1:(this=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
-var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
-if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
-if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
-if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
-if(x.month||x.months){this.addMonths(x.month||x.months);}
-if(x.year||x.years){this.addYears(x.year||x.years);}
-if(x.day||x.days){this.addDays(x.day||x.days);}
-return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(valuemax){throw new RangeError(value+" is not a valid value for "+name+".");}
-return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
-if(!x.second&&x.second!==0){x.second=-1;}
-if(!x.minute&&x.minute!==0){x.minute=-1;}
-if(!x.hour&&x.hour!==0){x.hour=-1;}
-if(!x.day&&x.day!==0){x.day=-1;}
-if(!x.month&&x.month!==0){x.month=-1;}
-if(!x.year&&x.year!==0){x.year=-1;}
-if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
-if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
-if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
-if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
-if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
-if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
-if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
-if(x.timezone){this.setTimezone(x.timezone);}
-if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);}
-return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
-var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
-return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};
-Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
-return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
-if(!last&&q[1].length===0){last=true;}
-if(!last){var qx=[];for(var j=0;j0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
-if(rx[1].length1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
-if(args){for(var i=0,px=args.shift();i2)?n:(n+(((n+2000)Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
-var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
-return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
-for(var i=0;i
- is released under the MIT License
-*/
-var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad '}}aa.outerHTML='";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab tags, normalized to work cross-browser)
---------------------------------------------------------------------------------------------------*/
-
-.fc button {
- /* force height to include the border and padding */
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-
- /* dimensions */
- margin: 0;
- height: 2.1em;
- padding: 0 .6em;
-
- /* text & cursor */
- font-size: 1em; /* normalize */
- white-space: nowrap;
- cursor: pointer;
-}
-
-/* Firefox has an annoying inner border */
-.fc button::-moz-focus-inner { margin: 0; padding: 0; }
-
-.fc-state-default { /* non-theme */
- border: 1px solid;
-}
-
-.fc-state-default.fc-corner-left { /* non-theme */
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-
-.fc-state-default.fc-corner-right { /* non-theme */
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-/* icons in buttons */
-
-.fc button .fc-icon { /* non-theme */
- position: relative;
- top: -0.05em; /* seems to be a good adjustment across browsers */
- margin: 0 .2em;
- vertical-align: middle;
-}
-
-/*
- button states
- borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
-*/
-
-.fc-state-default {
- background-color: #f5f5f5;
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
- background-repeat: repeat-x;
- border-color: #e6e6e6 #e6e6e6 #bfbfbf;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- color: #333;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.fc-state-hover,
-.fc-state-down,
-.fc-state-active,
-.fc-state-disabled {
- color: #333333;
- background-color: #e6e6e6;
-}
-
-.fc-state-hover {
- color: #333333;
- text-decoration: none;
- background-position: 0 -15px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
-}
-
-.fc-state-down,
-.fc-state-active {
- background-color: #cccccc;
- background-image: none;
- box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.fc-state-disabled {
- cursor: default;
- background-image: none;
- opacity: 0.65;
- filter: alpha(opacity=65);
- box-shadow: none;
-}
-
-
-/* Buttons Groups
---------------------------------------------------------------------------------------------------*/
-
-.fc-button-group {
- display: inline-block;
-}
-
-/*
-every button that is not first in a button group should scootch over one pixel and cover the
-previous button's border...
-*/
-
-.fc .fc-button-group > * { /* extra precedence b/c buttons have margin set to zero */
- float: left;
- margin: 0 0 0 -1px;
-}
-
-.fc .fc-button-group > :first-child { /* same */
- margin-left: 0;
-}
-
-
-/* Popover
---------------------------------------------------------------------------------------------------*/
-
-.fc-popover {
- position: absolute;
- box-shadow: 0 2px 6px rgba(0,0,0,.15);
-}
-
-.fc-popover .fc-header { /* TODO: be more consistent with fc-head/fc-body */
- padding: 2px 4px;
-}
-
-.fc-popover .fc-header .fc-title {
- margin: 0 2px;
-}
-
-.fc-popover .fc-header .fc-close {
- cursor: pointer;
-}
-
-.fc-ltr .fc-popover .fc-header .fc-title,
-.fc-rtl .fc-popover .fc-header .fc-close {
- float: left;
-}
-
-.fc-rtl .fc-popover .fc-header .fc-title,
-.fc-ltr .fc-popover .fc-header .fc-close {
- float: right;
-}
-
-/* unthemed */
-
-.fc-unthemed .fc-popover {
- border-width: 1px;
- border-style: solid;
-}
-
-.fc-unthemed .fc-popover .fc-header .fc-close {
- font-size: .9em;
- margin-top: 2px;
-}
-
-/* jqui themed */
-
-.fc-popover > .ui-widget-header + .ui-widget-content {
- border-top: 0; /* where they meet, let the header have the border */
-}
-
-
-/* Misc Reusable Components
---------------------------------------------------------------------------------------------------*/
-
-.fc-divider {
- border-style: solid;
- border-width: 1px;
-}
-
-hr.fc-divider {
- height: 0;
- margin: 0;
- padding: 0 0 2px; /* height is unreliable across browsers, so use padding */
- border-width: 1px 0;
-}
-
-.fc-clear {
- clear: both;
-}
-
-.fc-bg,
-.fc-bgevent-skeleton,
-.fc-highlight-skeleton,
-.fc-helper-skeleton {
- /* these element should always cling to top-left/right corners */
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
-
-.fc-bg {
- bottom: 0; /* strech bg to bottom edge */
-}
-
-.fc-bg table {
- height: 100%; /* strech bg to bottom edge */
-}
-
-
-/* Tables
---------------------------------------------------------------------------------------------------*/
-
-.fc table {
- width: 100%;
- table-layout: fixed;
- border-collapse: collapse;
- border-spacing: 0;
- font-size: 1em; /* normalize cross-browser */
-}
-
-.fc th {
- text-align: center;
-}
-
-.fc th,
-.fc td {
- border-style: solid;
- border-width: 1px;
- padding: 0;
- vertical-align: top;
-}
-
-.fc td.fc-today {
- border-style: double; /* overcome neighboring borders */
-}
-
-
-/* Fake Table Rows
---------------------------------------------------------------------------------------------------*/
-
-.fc .fc-row { /* extra precedence to overcome themes w/ .ui-widget-content forcing a 1px border */
- /* no visible border by default. but make available if need be (scrollbar width compensation) */
- border-style: solid;
- border-width: 0;
-}
-
-.fc-row table {
- /* don't put left/right border on anything within a fake row.
- the outer tbody will worry about this */
- border-left: 0 hidden transparent;
- border-right: 0 hidden transparent;
-
- /* no bottom borders on rows */
- border-bottom: 0 hidden transparent;
-}
-
-.fc-row:first-child table {
- border-top: 0 hidden transparent; /* no top border on first row */
-}
-
-
-/* Day Row (used within the header and the DayGrid)
---------------------------------------------------------------------------------------------------*/
-
-.fc-row {
- position: relative;
-}
-
-.fc-row .fc-bg {
- z-index: 1;
-}
-
-/* highlighting cells & background event skeleton */
-
-.fc-row .fc-bgevent-skeleton,
-.fc-row .fc-highlight-skeleton {
- bottom: 0; /* stretch skeleton to bottom of row */
-}
-
-.fc-row .fc-bgevent-skeleton table,
-.fc-row .fc-highlight-skeleton table {
- height: 100%; /* stretch skeleton to bottom of row */
-}
-
-.fc-row .fc-highlight-skeleton td,
-.fc-row .fc-bgevent-skeleton td {
- border-color: transparent;
-}
-
-.fc-row .fc-bgevent-skeleton {
- z-index: 2;
-
-}
-
-.fc-row .fc-highlight-skeleton {
- z-index: 3;
-}
-
-/*
-row content (which contains day/week numbers and events) as well as "helper" (which contains
-temporary rendered events).
-*/
-
-.fc-row .fc-content-skeleton {
- position: relative;
- z-index: 4;
- padding-bottom: 2px; /* matches the space above the events */
-}
-
-.fc-row .fc-helper-skeleton {
- z-index: 5;
-}
-
-.fc-row .fc-content-skeleton td,
-.fc-row .fc-helper-skeleton td {
- /* see-through to the background below */
- background: none; /* in case s are globally styled */
- border-color: transparent;
-
- /* don't put a border between events and/or the day number */
- border-bottom: 0;
-}
-
-.fc-row .fc-content-skeleton tbody td, /* cells with events inside (so NOT the day number cell) */
-.fc-row .fc-helper-skeleton tbody td {
- /* don't put a border between event cells */
- border-top: 0;
-}
-
-
-/* Scrolling Container
---------------------------------------------------------------------------------------------------*/
-
-.fc-scroller { /* this class goes on elements for guaranteed vertical scrollbars */
- overflow-y: scroll;
- overflow-x: hidden;
-}
-
-.fc-scroller > * { /* we expect an immediate inner element */
- position: relative; /* re-scope all positions */
- width: 100%; /* hack to force re-sizing this inner element when scrollbars appear/disappear */
- overflow: hidden; /* don't let negative margins or absolute positioning create further scroll */
-}
-
-
-/* Global Event Styles
---------------------------------------------------------------------------------------------------*/
-
-.fc-event {
- position: relative; /* for resize handle and other inner positioning */
- display: block; /* make the tag block */
- font-size: .85em;
- line-height: 1.3;
- border-radius: 3px;
- border: 1px solid #3a87ad; /* default BORDER color */
- background-color: #3a87ad; /* default BACKGROUND color */
- font-weight: normal; /* undo jqui's ui-widget-header bold */
-}
-
-/* overpower some of bootstrap's and jqui's styles on tags */
-.fc-event,
-.fc-event:hover,
-.ui-widget .fc-event {
- color: #fff; /* default TEXT color */
- text-decoration: none; /* if has an href */
-}
-
-.fc-event[href],
-.fc-event.fc-draggable {
- cursor: pointer; /* give events with links and draggable events a hand mouse pointer */
-}
-
-.fc-not-allowed, /* causes a "warning" cursor. applied on body */
-.fc-not-allowed .fc-event { /* to override an event's custom cursor */
- cursor: not-allowed;
-}
-
-.fc-event .fc-bg { /* the generic .fc-bg already does position */
- z-index: 1;
- background: #fff;
- opacity: .25;
- filter: alpha(opacity=25); /* for IE */
-}
-
-.fc-event .fc-content {
- position: relative;
- z-index: 2;
-}
-
-.fc-event .fc-resizer {
- position: absolute;
- z-index: 3;
-}
-
-
-/* Horizontal Events
---------------------------------------------------------------------------------------------------*/
-
-/* events that are continuing to/from another week. kill rounded corners and butt up against edge */
-
-.fc-ltr .fc-h-event.fc-not-start,
-.fc-rtl .fc-h-event.fc-not-end {
- margin-left: 0;
- border-left-width: 0;
- padding-left: 1px; /* replace the border with padding */
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.fc-ltr .fc-h-event.fc-not-end,
-.fc-rtl .fc-h-event.fc-not-start {
- margin-right: 0;
- border-right-width: 0;
- padding-right: 1px; /* replace the border with padding */
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-/* resizer */
-
-.fc-h-event .fc-resizer { /* positioned it to overcome the event's borders */
- top: -1px;
- bottom: -1px;
- left: -1px;
- right: -1px;
- width: 5px;
-}
-
-/* left resizer */
-.fc-ltr .fc-h-event .fc-start-resizer,
-.fc-ltr .fc-h-event .fc-start-resizer:before,
-.fc-ltr .fc-h-event .fc-start-resizer:after,
-.fc-rtl .fc-h-event .fc-end-resizer,
-.fc-rtl .fc-h-event .fc-end-resizer:before,
-.fc-rtl .fc-h-event .fc-end-resizer:after {
- right: auto; /* ignore the right and only use the left */
- cursor: w-resize;
-}
-
-/* right resizer */
-.fc-ltr .fc-h-event .fc-end-resizer,
-.fc-ltr .fc-h-event .fc-end-resizer:before,
-.fc-ltr .fc-h-event .fc-end-resizer:after,
-.fc-rtl .fc-h-event .fc-start-resizer,
-.fc-rtl .fc-h-event .fc-start-resizer:before,
-.fc-rtl .fc-h-event .fc-start-resizer:after {
- left: auto; /* ignore the left and only use the right */
- cursor: e-resize;
-}
-
-
-/* DayGrid events
-----------------------------------------------------------------------------------------------------
-We use the full "fc-day-grid-event" class instead of using descendants because the event won't
-be a descendant of the grid when it is being dragged.
-*/
-
-.fc-day-grid-event {
- margin: 1px 2px 0; /* spacing between events and edges */
- padding: 0 1px;
-}
-
-
-.fc-day-grid-event .fc-content { /* force events to be one-line tall */
- white-space: nowrap;
- overflow: hidden;
-}
-
-.fc-day-grid-event .fc-time {
- font-weight: bold;
-}
-
-.fc-day-grid-event .fc-resizer { /* enlarge the default hit area */
- left: -3px;
- right: -3px;
- width: 7px;
-}
-
-
-/* Event Limiting
---------------------------------------------------------------------------------------------------*/
-
-/* "more" link that represents hidden events */
-
-a.fc-more {
- margin: 1px 3px;
- font-size: .85em;
- cursor: pointer;
- text-decoration: none;
-}
-
-a.fc-more:hover {
- text-decoration: underline;
-}
-
-.fc-limited { /* rows and cells that are hidden because of a "more" link */
- display: none;
-}
-
-/* popover that appears when "more" link is clicked */
-
-.fc-day-grid .fc-row {
- z-index: 1; /* make the "more" popover one higher than this */
-}
-
-.fc-more-popover {
- z-index: 2;
- width: 220px;
-}
-
-.fc-more-popover .fc-event-container {
- padding: 10px;
-}
-
-/* Toolbar
---------------------------------------------------------------------------------------------------*/
-
-.fc-toolbar {
- text-align: center;
- margin-bottom: 1em;
-}
-
-.fc-toolbar .fc-left {
- float: left;
-}
-
-.fc-toolbar .fc-right {
- float: right;
-}
-
-.fc-toolbar .fc-center {
- display: inline-block;
-}
-
-/* the things within each left/right/center section */
-.fc .fc-toolbar > * > * { /* extra precedence to override button border margins */
- float: left;
- margin-left: .75em;
-}
-
-/* the first thing within each left/center/right section */
-.fc .fc-toolbar > * > :first-child { /* extra precedence to override button border margins */
- margin-left: 0;
-}
-
-/* title text */
-
-.fc-toolbar h2 {
- margin: 0;
-}
-
-/* button layering (for border precedence) */
-
-.fc-toolbar button {
- position: relative;
-}
-
-.fc-toolbar .fc-state-hover,
-.fc-toolbar .ui-state-hover {
- z-index: 2;
-}
-
-.fc-toolbar .fc-state-down {
- z-index: 3;
-}
-
-.fc-toolbar .fc-state-active,
-.fc-toolbar .ui-state-active {
- z-index: 4;
-}
-
-.fc-toolbar button:focus {
- z-index: 5;
-}
-
-
-/* View Structure
---------------------------------------------------------------------------------------------------*/
-
-/* undo twitter bootstrap's box-sizing rules. normalizes positioning techniques */
-/* don't do this for the toolbar because we'll want bootstrap to style those buttons as some pt */
-.fc-view-container *,
-.fc-view-container *:before,
-.fc-view-container *:after {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-.fc-view, /* scope positioning and z-index's for everything within the view */
-.fc-view > table { /* so dragged elements can be above the view's main element */
- position: relative;
- z-index: 1;
-}
-
-/* BasicView
---------------------------------------------------------------------------------------------------*/
-
-/* day row structure */
-
-.fc-basicWeek-view .fc-content-skeleton,
-.fc-basicDay-view .fc-content-skeleton {
- /* we are sure there are no day numbers in these views, so... */
- padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
- padding-bottom: 1em; /* ensure a space at bottom of cell for user selecting/clicking */
-}
-
-.fc-basic-view .fc-body .fc-row {
- min-height: 4em; /* ensure that all rows are at least this tall */
-}
-
-/* a "rigid" row will take up a constant amount of height because content-skeleton is absolute */
-
-.fc-row.fc-rigid {
- overflow: hidden;
-}
-
-.fc-row.fc-rigid .fc-content-skeleton {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
-
-/* week and day number styling */
-
-.fc-basic-view .fc-week-number,
-.fc-basic-view .fc-day-number {
- padding: 0 2px;
-}
-
-.fc-basic-view td.fc-week-number span,
-.fc-basic-view td.fc-day-number {
- padding-top: 2px;
- padding-bottom: 2px;
-}
-
-.fc-basic-view .fc-week-number {
- text-align: center;
-}
-
-.fc-basic-view .fc-week-number span {
- /* work around the way we do column resizing and ensure a minimum width */
- display: inline-block;
- min-width: 1.25em;
-}
-
-.fc-ltr .fc-basic-view .fc-day-number {
- text-align: right;
-}
-
-.fc-rtl .fc-basic-view .fc-day-number {
- text-align: left;
-}
-
-.fc-day-number.fc-other-month {
- opacity: 0.3;
- filter: alpha(opacity=30); /* for IE */
- /* opacity with small font can sometimes look too faded
- might want to set the 'color' property instead
- making day-numbers bold also fixes the problem */
-}
-
-/* AgendaView all-day area
---------------------------------------------------------------------------------------------------*/
-
-.fc-agenda-view .fc-day-grid {
- position: relative;
- z-index: 2; /* so the "more.." popover will be over the time grid */
-}
-
-.fc-agenda-view .fc-day-grid .fc-row {
- min-height: 3em; /* all-day section will never get shorter than this */
-}
-
-.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton {
- padding-top: 1px; /* add a pixel to make sure there are 2px padding above events */
- padding-bottom: 1em; /* give space underneath events for clicking/selecting days */
-}
-
-
-/* TimeGrid axis running down the side (for both the all-day area and the slot area)
---------------------------------------------------------------------------------------------------*/
-
-.fc .fc-axis { /* .fc to overcome default cell styles */
- vertical-align: middle;
- padding: 0 4px;
- white-space: nowrap;
-}
-
-.fc-ltr .fc-axis {
- text-align: right;
-}
-
-.fc-rtl .fc-axis {
- text-align: left;
-}
-
-.ui-widget td.fc-axis {
- font-weight: normal; /* overcome jqui theme making it bold */
-}
-
-
-/* TimeGrid Structure
---------------------------------------------------------------------------------------------------*/
-
-.fc-time-grid-container, /* so scroll container's z-index is below all-day */
-.fc-time-grid { /* so slats/bg/content/etc positions get scoped within here */
- position: relative;
- z-index: 1;
-}
-
-.fc-time-grid {
- min-height: 100%; /* so if height setting is 'auto', .fc-bg stretches to fill height */
-}
-
-.fc-time-grid table { /* don't put outer borders on slats/bg/content/etc */
- border: 0 hidden transparent;
-}
-
-.fc-time-grid > .fc-bg {
- z-index: 1;
-}
-
-.fc-time-grid .fc-slats,
-.fc-time-grid > hr { /* the
AgendaView injects when grid is shorter than scroller */
- position: relative;
- z-index: 2;
-}
-
-.fc-time-grid .fc-bgevent-skeleton,
-.fc-time-grid .fc-content-skeleton {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
-}
-
-.fc-time-grid .fc-bgevent-skeleton {
- z-index: 3;
-}
-
-.fc-time-grid .fc-highlight-skeleton {
- z-index: 4;
-}
-
-.fc-time-grid .fc-content-skeleton {
- z-index: 5;
-}
-
-.fc-time-grid .fc-helper-skeleton {
- z-index: 6;
-}
-
-
-/* TimeGrid Slats (lines that run horizontally)
---------------------------------------------------------------------------------------------------*/
-
-.fc-time-grid .fc-slats td {
- height: 1.5em;
- border-bottom: 0; /* each cell is responsible for its top border */
-}
-
-.fc-time-grid .fc-slats .fc-minor td {
- border-top-style: dotted;
-}
-
-.fc-time-grid .fc-slats .ui-widget-content { /* for jqui theme */
- background: none; /* see through to fc-bg */
-}
-
-
-/* TimeGrid Highlighting Slots
---------------------------------------------------------------------------------------------------*/
-
-.fc-time-grid .fc-highlight-container { /* a div within a cell within the fc-highlight-skeleton */
- position: relative; /* scopes the left/right of the fc-highlight to be in the column */
-}
-
-.fc-time-grid .fc-highlight {
- position: absolute;
- left: 0;
- right: 0;
- /* top and bottom will be in by JS */
-}
-
-
-/* TimeGrid Event Containment
---------------------------------------------------------------------------------------------------*/
-
-.fc-time-grid .fc-event-container, /* a div within a cell within the fc-content-skeleton */
-.fc-time-grid .fc-bgevent-container { /* a div within a cell within the fc-bgevent-skeleton */
- position: relative;
-}
-
-.fc-ltr .fc-time-grid .fc-event-container { /* space on the sides of events for LTR (default) */
- margin: 0 2.5% 0 2px;
-}
-
-.fc-rtl .fc-time-grid .fc-event-container { /* space on the sides of events for RTL */
- margin: 0 2px 0 2.5%;
-}
-
-.fc-time-grid .fc-event,
-.fc-time-grid .fc-bgevent {
- position: absolute;
- z-index: 1; /* scope inner z-index's */
-}
-
-.fc-time-grid .fc-bgevent {
- /* background events always span full width */
- left: 0;
- right: 0;
-}
-
-
-/* Generic Vertical Event
---------------------------------------------------------------------------------------------------*/
-
-.fc-v-event.fc-not-start { /* events that are continuing from another day */
- /* replace space made by the top border with padding */
- border-top-width: 0;
- padding-top: 1px;
-
- /* remove top rounded corners */
- border-top-left-radius: 0;
- border-top-right-radius: 0;
-}
-
-.fc-v-event.fc-not-end {
- /* replace space made by the top border with padding */
- border-bottom-width: 0;
- padding-bottom: 1px;
-
- /* remove bottom rounded corners */
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-
-/* TimeGrid Event Styling
-----------------------------------------------------------------------------------------------------
-We use the full "fc-time-grid-event" class instead of using descendants because the event won't
-be a descendant of the grid when it is being dragged.
-*/
-
-.fc-time-grid-event {
- overflow: hidden; /* don't let the bg flow over rounded corners */
-}
-
-.fc-time-grid-event .fc-time,
-.fc-time-grid-event .fc-title {
- padding: 0 1px;
-}
-
-.fc-time-grid-event .fc-time {
- font-size: .85em;
- white-space: nowrap;
-}
-
-/* short mode, where time and title are on the same line */
-
-.fc-time-grid-event.fc-short .fc-content {
- /* don't wrap to second line (now that contents will be inline) */
- white-space: nowrap;
-}
-
-.fc-time-grid-event.fc-short .fc-time,
-.fc-time-grid-event.fc-short .fc-title {
- /* put the time and title on the same line */
- display: inline-block;
- vertical-align: top;
-}
-
-.fc-time-grid-event.fc-short .fc-time span {
- display: none; /* don't display the full time text... */
-}
-
-.fc-time-grid-event.fc-short .fc-time:before {
- content: attr(data-start); /* ...instead, display only the start time */
-}
-
-.fc-time-grid-event.fc-short .fc-time:after {
- content: "\000A0-\000A0"; /* seperate with a dash, wrapped in nbsp's */
-}
-
-.fc-time-grid-event.fc-short .fc-title {
- font-size: .85em; /* make the title text the same size as the time */
- padding: 0; /* undo padding from above */
-}
-
-/* resizer */
-
-.fc-time-grid-event .fc-resizer {
- left: 0;
- right: 0;
- bottom: 0;
- height: 8px;
- overflow: hidden;
- line-height: 8px;
- font-size: 11px;
- font-family: monospace;
- text-align: center;
- cursor: s-resize;
-}
-
-.fc-time-grid-event .fc-resizer:after {
- content: "=";
-}
diff --git a/src/js/fullcaledar/fullcalendar.js b/src/js/fullcaledar/fullcalendar.js
deleted file mode 100755
index 1dcf68f5..00000000
--- a/src/js/fullcaledar/fullcalendar.js
+++ /dev/null
@@ -1,11170 +0,0 @@
-/*!
- * FullCalendar v2.4.0
- * Docs & License: http://fullcalendar.io/
- * (c) 2015 Adam Shaw
- */
-
-(function(factory) {
- if (typeof define === 'function' && define.amd) {
- define([ 'jquery', 'moment' ], factory);
- }
- else if (typeof exports === 'object') { // Node/CommonJS
- module.exports = factory(require('jquery'), require('moment'));
- }
- else {
- factory(jQuery, moment);
- }
-})(function($, moment) {
-
-;;
-
-var fc = $.fullCalendar = { version: "2.4.0" };
-var fcViews = fc.views = {};
-
-
-$.fn.fullCalendar = function(options) {
- var args = Array.prototype.slice.call(arguments, 1); // for a possible method call
- var res = this; // what this function will return (this jQuery object by default)
-
- this.each(function(i, _element) { // loop each DOM element involved
- var element = $(_element);
- var calendar = element.data('fullCalendar'); // get the existing calendar object (if any)
- var singleRes; // the returned value of this single method call
-
- // a method call
- if (typeof options === 'string') {
- if (calendar && $.isFunction(calendar[options])) {
- singleRes = calendar[options].apply(calendar, args);
- if (!i) {
- res = singleRes; // record the first method call result
- }
- if (options === 'destroy') { // for the destroy method, must remove Calendar object data
- element.removeData('fullCalendar');
- }
- }
- }
- // a new calendar initialization
- else if (!calendar) { // don't initialize twice
- calendar = new Calendar(element, options);
- element.data('fullCalendar', calendar);
- calendar.render();
- }
- });
-
- return res;
-};
-
-
-var complexOptions = [ // names of options that are objects whose properties should be combined
- 'header',
- 'buttonText',
- 'buttonIcons',
- 'themeButtonIcons'
-];
-
-
-// Merges an array of option objects into a single object
-function mergeOptions(optionObjs) {
- return mergeProps(optionObjs, complexOptions);
-}
-
-
-// Given options specified for the calendar's constructor, massages any legacy options into a non-legacy form.
-// Converts View-Option-Hashes into the View-Specific-Options format.
-function massageOverrides(input) {
- var overrides = { views: input.views || {} }; // the output. ensure a `views` hash
- var subObj;
-
- // iterate through all option override properties (except `views`)
- $.each(input, function(name, val) {
- if (name != 'views') {
-
- // could the value be a legacy View-Option-Hash?
- if (
- $.isPlainObject(val) &&
- !/(time|duration|interval)$/i.test(name) && // exclude duration options. might be given as objects
- $.inArray(name, complexOptions) == -1 // complex options aren't allowed to be View-Option-Hashes
- ) {
- subObj = null;
-
- // iterate through the properties of this possible View-Option-Hash value
- $.each(val, function(subName, subVal) {
-
- // is the property targeting a view?
- if (/^(month|week|day|default|basic(Week|Day)?|agenda(Week|Day)?)$/.test(subName)) {
- if (!overrides.views[subName]) { // ensure the view-target entry exists
- overrides.views[subName] = {};
- }
- overrides.views[subName][name] = subVal; // record the value in the `views` object
- }
- else { // a non-View-Option-Hash property
- if (!subObj) {
- subObj = {};
- }
- subObj[subName] = subVal; // accumulate these unrelated values for later
- }
- });
-
- if (subObj) { // non-View-Option-Hash properties? transfer them as-is
- overrides[name] = subObj;
- }
- }
- else {
- overrides[name] = val; // transfer normal options as-is
- }
- }
- });
-
- return overrides;
-}
-
-;;
-
-// exports
-fc.intersectionToSeg = intersectionToSeg;
-fc.applyAll = applyAll;
-fc.debounce = debounce;
-fc.isInt = isInt;
-fc.htmlEscape = htmlEscape;
-fc.cssToStr = cssToStr;
-fc.proxy = proxy;
-fc.capitaliseFirstLetter = capitaliseFirstLetter;
-
-
-/* FullCalendar-specific DOM Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-
-// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left
-// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.
-function compensateScroll(rowEls, scrollbarWidths) {
- if (scrollbarWidths.left) {
- rowEls.css({
- 'border-left-width': 1,
- 'margin-left': scrollbarWidths.left - 1
- });
- }
- if (scrollbarWidths.right) {
- rowEls.css({
- 'border-right-width': 1,
- 'margin-right': scrollbarWidths.right - 1
- });
- }
-}
-
-
-// Undoes compensateScroll and restores all borders/margins
-function uncompensateScroll(rowEls) {
- rowEls.css({
- 'margin-left': '',
- 'margin-right': '',
- 'border-left-width': '',
- 'border-right-width': ''
- });
-}
-
-
-// Make the mouse cursor express that an event is not allowed in the current area
-function disableCursor() {
- $('body').addClass('fc-not-allowed');
-}
-
-
-// Returns the mouse cursor to its original look
-function enableCursor() {
- $('body').removeClass('fc-not-allowed');
-}
-
-
-// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.
-// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering
-// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and
-// reduces the available height.
-function distributeHeight(els, availableHeight, shouldRedistribute) {
-
- // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
- // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
-
- var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element
- var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*
- var flexEls = []; // elements that are allowed to expand. array of DOM nodes
- var flexOffsets = []; // amount of vertical space it takes up
- var flexHeights = []; // actual css height
- var usedHeight = 0;
-
- undistributeHeight(els); // give all elements their natural height
-
- // find elements that are below the recommended height (expandable).
- // important to query for heights in a single first pass (to avoid reflow oscillation).
- els.each(function(i, el) {
- var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;
- var naturalOffset = $(el).outerHeight(true);
-
- if (naturalOffset < minOffset) {
- flexEls.push(el);
- flexOffsets.push(naturalOffset);
- flexHeights.push($(el).height());
- }
- else {
- // this element stretches past recommended height (non-expandable). mark the space as occupied.
- usedHeight += naturalOffset;
- }
- });
-
- // readjust the recommended height to only consider the height available to non-maxed-out rows.
- if (shouldRedistribute) {
- availableHeight -= usedHeight;
- minOffset1 = Math.floor(availableHeight / flexEls.length);
- minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*
- }
-
- // assign heights to all expandable elements
- $(flexEls).each(function(i, el) {
- var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;
- var naturalOffset = flexOffsets[i];
- var naturalHeight = flexHeights[i];
- var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding
-
- if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things
- $(el).height(newHeight);
- }
- });
-}
-
-
-// Undoes distrubuteHeight, restoring all els to their natural height
-function undistributeHeight(els) {
- els.height('');
-}
-
-
-// Given `els`, a jQuery set of cells, find the cell with the largest natural width and set the widths of all the
-// cells to be that width.
-// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
-function matchCellWidths(els) {
- var maxInnerWidth = 0;
-
- els.find('> *').each(function(i, innerEl) {
- var innerWidth = $(innerEl).outerWidth();
- if (innerWidth > maxInnerWidth) {
- maxInnerWidth = innerWidth;
- }
- });
-
- maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance
-
- els.width(maxInnerWidth);
-
- return maxInnerWidth;
-}
-
-
-// Turns a container element into a scroller if its contents is taller than the allotted height.
-// Returns true if the element is now a scroller, false otherwise.
-// NOTE: this method is best because it takes weird zooming dimensions into account
-function setPotentialScroller(containerEl, height) {
- containerEl.height(height).addClass('fc-scroller');
-
- // are scrollbars needed?
- if (containerEl[0].scrollHeight - 1 > containerEl[0].clientHeight) { // !!! -1 because IE is often off-by-one :(
- return true;
- }
-
- unsetScroller(containerEl); // undo
- return false;
-}
-
-
-// Takes an element that might have been a scroller, and turns it back into a normal element.
-function unsetScroller(containerEl) {
- containerEl.height('').removeClass('fc-scroller');
-}
-
-
-/* General DOM Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-fc.getClientRect = getClientRect;
-fc.getContentRect = getContentRect;
-fc.getScrollbarWidths = getScrollbarWidths;
-
-
-// borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51
-function getScrollParent(el) {
- var position = el.css('position'),
- scrollParent = el.parents().filter(function() {
- var parent = $(this);
- return (/(auto|scroll)/).test(
- parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x')
- );
- }).eq(0);
-
- return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;
-}
-
-
-// Queries the outer bounding area of a jQuery element.
-// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
-function getOuterRect(el) {
- var offset = el.offset();
-
- return {
- left: offset.left,
- right: offset.left + el.outerWidth(),
- top: offset.top,
- bottom: offset.top + el.outerHeight()
- };
-}
-
-
-// Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding.
-// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
-// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
-function getClientRect(el) {
- var offset = el.offset();
- var scrollbarWidths = getScrollbarWidths(el);
- var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;
- var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;
-
- return {
- left: left,
- right: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars
- top: top,
- bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars
- };
-}
-
-
-// Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.
-// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).
-function getContentRect(el) {
- var offset = el.offset(); // just outside of border, margin not included
- var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');
- var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');
-
- return {
- left: left,
- right: left + el.width(),
- top: top,
- bottom: top + el.height()
- };
-}
-
-
-// Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.
-// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.
-function getScrollbarWidths(el) {
- var leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars
- var widths = {
- left: 0,
- right: 0,
- top: 0,
- bottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar
- };
-
- if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?
- widths.left = leftRightWidth;
- }
- else {
- widths.right = leftRightWidth;
- }
-
- return widths;
-}
-
-
-// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side
-
-var _isLeftRtlScrollbars = null;
-
-function getIsLeftRtlScrollbars() { // responsible for caching the computation
- if (_isLeftRtlScrollbars === null) {
- _isLeftRtlScrollbars = computeIsLeftRtlScrollbars();
- }
- return _isLeftRtlScrollbars;
-}
-
-function computeIsLeftRtlScrollbars() { // creates an offscreen test element, then removes it
- var el = $('')
- .css({
- position: 'absolute',
- top: -1000,
- left: 0,
- border: 0,
- padding: 0,
- overflow: 'scroll',
- direction: 'rtl'
- })
- .appendTo('body');
- var innerEl = el.children();
- var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar?
- el.remove();
- return res;
-}
-
-
-// Retrieves a jQuery element's computed CSS value as a floating-point number.
-// If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero.
-function getCssFloat(el, prop) {
- return parseFloat(el.css(prop)) || 0;
-}
-
-
-// Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac)
-function isPrimaryMouseButton(ev) {
- return ev.which == 1 && !ev.ctrlKey;
-}
-
-
-/* Geometry
-----------------------------------------------------------------------------------------------------------------------*/
-
-fc.intersectRects = intersectRects;
-
-// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false
-function intersectRects(rect1, rect2) {
- var res = {
- left: Math.max(rect1.left, rect2.left),
- right: Math.min(rect1.right, rect2.right),
- top: Math.max(rect1.top, rect2.top),
- bottom: Math.min(rect1.bottom, rect2.bottom)
- };
-
- if (res.left < res.right && res.top < res.bottom) {
- return res;
- }
- return false;
-}
-
-
-// Returns a new point that will have been moved to reside within the given rectangle
-function constrainPoint(point, rect) {
- return {
- left: Math.min(Math.max(point.left, rect.left), rect.right),
- top: Math.min(Math.max(point.top, rect.top), rect.bottom)
- };
-}
-
-
-// Returns a point that is the center of the given rectangle
-function getRectCenter(rect) {
- return {
- left: (rect.left + rect.right) / 2,
- top: (rect.top + rect.bottom) / 2
- };
-}
-
-
-// Subtracts point2's coordinates from point1's coordinates, returning a delta
-function diffPoints(point1, point2) {
- return {
- left: point1.left - point2.left,
- top: point1.top - point2.top
- };
-}
-
-
-/* Object Ordering by Field
-----------------------------------------------------------------------------------------------------------------------*/
-
-fc.parseFieldSpecs = parseFieldSpecs;
-fc.compareByFieldSpecs = compareByFieldSpecs;
-fc.compareByFieldSpec = compareByFieldSpec;
-fc.flexibleCompare = flexibleCompare;
-
-
-function parseFieldSpecs(input) {
- var specs = [];
- var tokens = [];
- var i, token;
-
- if (typeof input === 'string') {
- tokens = input.split(/\s*,\s*/);
- }
- else if (typeof input === 'function') {
- tokens = [ input ];
- }
- else if ($.isArray(input)) {
- tokens = input;
- }
-
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
-
- if (typeof token === 'string') {
- specs.push(
- token.charAt(0) == '-' ?
- { field: token.substring(1), order: -1 } :
- { field: token, order: 1 }
- );
- }
- else if (typeof token === 'function') {
- specs.push({ func: token });
- }
- }
-
- return specs;
-}
-
-
-function compareByFieldSpecs(obj1, obj2, fieldSpecs) {
- var i;
- var cmp;
-
- for (i = 0; i < fieldSpecs.length; i++) {
- cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i]);
- if (cmp) {
- return cmp;
- }
- }
-
- return 0;
-}
-
-
-function compareByFieldSpec(obj1, obj2, fieldSpec) {
- if (fieldSpec.func) {
- return fieldSpec.func(obj1, obj2);
- }
- return flexibleCompare(obj1[fieldSpec.field], obj2[fieldSpec.field]) *
- (fieldSpec.order || 1);
-}
-
-
-function flexibleCompare(a, b) {
- if (!a && !b) {
- return 0;
- }
- if (b == null) {
- return -1;
- }
- if (a == null) {
- return 1;
- }
- if ($.type(a) === 'string' || $.type(b) === 'string') {
- return String(a).localeCompare(String(b));
- }
- return a - b;
-}
-
-
-/* FullCalendar-specific Misc Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-
-// Creates a basic segment with the intersection of the two ranges. Returns undefined if no intersection.
-// Expects all dates to be normalized to the same timezone beforehand.
-// TODO: move to date section?
-function intersectionToSeg(subjectRange, constraintRange) {
- var subjectStart = subjectRange.start;
- var subjectEnd = subjectRange.end;
- var constraintStart = constraintRange.start;
- var constraintEnd = constraintRange.end;
- var segStart, segEnd;
- var isStart, isEnd;
-
- if (subjectEnd > constraintStart && subjectStart < constraintEnd) { // in bounds at all?
-
- if (subjectStart >= constraintStart) {
- segStart = subjectStart.clone();
- isStart = true;
- }
- else {
- segStart = constraintStart.clone();
- isStart = false;
- }
-
- if (subjectEnd <= constraintEnd) {
- segEnd = subjectEnd.clone();
- isEnd = true;
- }
- else {
- segEnd = constraintEnd.clone();
- isEnd = false;
- }
-
- return {
- start: segStart,
- end: segEnd,
- isStart: isStart,
- isEnd: isEnd
- };
- }
-}
-
-
-/* Date Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-fc.computeIntervalUnit = computeIntervalUnit;
-fc.divideRangeByDuration = divideRangeByDuration;
-fc.divideDurationByDuration = divideDurationByDuration;
-fc.multiplyDuration = multiplyDuration;
-fc.durationHasTime = durationHasTime;
-
-var dayIDs = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ];
-var intervalUnits = [ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond' ];
-
-
-// Diffs the two moments into a Duration where full-days are recorded first, then the remaining time.
-// Moments will have their timezones normalized.
-function diffDayTime(a, b) {
- return moment.duration({
- days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'),
- ms: a.time() - b.time() // time-of-day from day start. disregards timezone
- });
-}
-
-
-// Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations.
-function diffDay(a, b) {
- return moment.duration({
- days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')
- });
-}
-
-
-// Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding.
-function diffByUnit(a, b, unit) {
- return moment.duration(
- Math.round(a.diff(b, unit, true)), // returnFloat=true
- unit
- );
-}
-
-
-// Computes the unit name of the largest whole-unit period of time.
-// For example, 48 hours will be "days" whereas 49 hours will be "hours".
-// Accepts start/end, a range object, or an original duration object.
-function computeIntervalUnit(start, end) {
- var i, unit;
- var val;
-
- for (i = 0; i < intervalUnits.length; i++) {
- unit = intervalUnits[i];
- val = computeRangeAs(unit, start, end);
-
- if (val >= 1 && isInt(val)) {
- break;
- }
- }
-
- return unit; // will be "milliseconds" if nothing else matches
-}
-
-
-// Computes the number of units (like "hours") in the given range.
-// Range can be a {start,end} object, separate start/end args, or a Duration.
-// Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling
-// of month-diffing logic (which tends to vary from version to version).
-function computeRangeAs(unit, start, end) {
-
- if (end != null) { // given start, end
- return end.diff(start, unit, true);
- }
- else if (moment.isDuration(start)) { // given duration
- return start.as(unit);
- }
- else { // given { start, end } range object
- return start.end.diff(start.start, unit, true);
- }
-}
-
-
-// Intelligently divides a range (specified by a start/end params) by a duration
-function divideRangeByDuration(start, end, dur) {
- var months;
-
- if (durationHasTime(dur)) {
- return (end - start) / dur;
- }
- months = dur.asMonths();
- if (Math.abs(months) >= 1 && isInt(months)) {
- return end.diff(start, 'months', true) / months;
- }
- return end.diff(start, 'days', true) / dur.asDays();
-}
-
-
-// Intelligently divides one duration by another
-function divideDurationByDuration(dur1, dur2) {
- var months1, months2;
-
- if (durationHasTime(dur1) || durationHasTime(dur2)) {
- return dur1 / dur2;
- }
- months1 = dur1.asMonths();
- months2 = dur2.asMonths();
- if (
- Math.abs(months1) >= 1 && isInt(months1) &&
- Math.abs(months2) >= 1 && isInt(months2)
- ) {
- return months1 / months2;
- }
- return dur1.asDays() / dur2.asDays();
-}
-
-
-// Intelligently multiplies a duration by a number
-function multiplyDuration(dur, n) {
- var months;
-
- if (durationHasTime(dur)) {
- return moment.duration(dur * n);
- }
- months = dur.asMonths();
- if (Math.abs(months) >= 1 && isInt(months)) {
- return moment.duration({ months: months * n });
- }
- return moment.duration({ days: dur.asDays() * n });
-}
-
-
-// Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms)
-function durationHasTime(dur) {
- return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());
-}
-
-
-function isNativeDate(input) {
- return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;
-}
-
-
-// Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00"
-function isTimeString(str) {
- return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str);
-}
-
-
-/* Logging and Debug
-----------------------------------------------------------------------------------------------------------------------*/
-
-fc.log = function() {
- var console = window.console;
-
- if (console && console.log) {
- return console.log.apply(console, arguments);
- }
-};
-
-fc.warn = function() {
- var console = window.console;
-
- if (console && console.warn) {
- return console.warn.apply(console, arguments);
- }
- else {
- return fc.log.apply(fc, arguments);
- }
-};
-
-
-/* General Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-var hasOwnPropMethod = {}.hasOwnProperty;
-
-
-// Merges an array of objects into a single object.
-// The second argument allows for an array of property names who's object values will be merged together.
-function mergeProps(propObjs, complexProps) {
- var dest = {};
- var i, name;
- var complexObjs;
- var j, val;
- var props;
-
- if (complexProps) {
- for (i = 0; i < complexProps.length; i++) {
- name = complexProps[i];
- complexObjs = [];
-
- // collect the trailing object values, stopping when a non-object is discovered
- for (j = propObjs.length - 1; j >= 0; j--) {
- val = propObjs[j][name];
-
- if (typeof val === 'object') {
- complexObjs.unshift(val);
- }
- else if (val !== undefined) {
- dest[name] = val; // if there were no objects, this value will be used
- break;
- }
- }
-
- // if the trailing values were objects, use the merged value
- if (complexObjs.length) {
- dest[name] = mergeProps(complexObjs);
- }
- }
- }
-
- // copy values into the destination, going from last to first
- for (i = propObjs.length - 1; i >= 0; i--) {
- props = propObjs[i];
-
- for (name in props) {
- if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign
- dest[name] = props[name];
- }
- }
- }
-
- return dest;
-}
-
-
-// Create an object that has the given prototype. Just like Object.create
-function createObject(proto) {
- var f = function() {};
- f.prototype = proto;
- return new f();
-}
-
-
-function copyOwnProps(src, dest) {
- for (var name in src) {
- if (hasOwnProp(src, name)) {
- dest[name] = src[name];
- }
- }
-}
-
-
-// Copies over certain methods with the same names as Object.prototype methods. Overcomes an IE<=8 bug:
-// https://developer.mozilla.org/en-US/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
-function copyNativeMethods(src, dest) {
- var names = [ 'constructor', 'toString', 'valueOf' ];
- var i, name;
-
- for (i = 0; i < names.length; i++) {
- name = names[i];
-
- if (src[name] !== Object.prototype[name]) {
- dest[name] = src[name];
- }
- }
-}
-
-
-function hasOwnProp(obj, name) {
- return hasOwnPropMethod.call(obj, name);
-}
-
-
-// Is the given value a non-object non-function value?
-function isAtomic(val) {
- return /undefined|null|boolean|number|string/.test($.type(val));
-}
-
-
-function applyAll(functions, thisObj, args) {
- if ($.isFunction(functions)) {
- functions = [ functions ];
- }
- if (functions) {
- var i;
- var ret;
- for (i=0; i /g, '>')
- .replace(/'/g, ''')
- .replace(/"/g, '"')
- .replace(/\n/g, '
');
-}
-
-
-function stripHtmlEntities(text) {
- return text.replace(/&.*?;/g, '');
-}
-
-
-// Given a hash of CSS properties, returns a string of CSS.
-// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.
-function cssToStr(cssProps) {
- var statements = [];
-
- $.each(cssProps, function(name, val) {
- if (val != null) {
- statements.push(name + ':' + val);
- }
- });
-
- return statements.join(';');
-}
-
-
-function capitaliseFirstLetter(str) {
- return str.charAt(0).toUpperCase() + str.slice(1);
-}
-
-
-function compareNumbers(a, b) { // for .sort()
- return a - b;
-}
-
-
-function isInt(n) {
- return n % 1 === 0;
-}
-
-
-// Returns a method bound to the given object context.
-// Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with
-// different contexts as identical when binding/unbinding events.
-function proxy(obj, methodName) {
- var method = obj[methodName];
-
- return function() {
- return method.apply(obj, arguments);
- };
-}
-
-
-// Returns a function, that, as long as it continues to be invoked, will not
-// be triggered. The function will be called after it stops being called for
-// N milliseconds.
-// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714
-function debounce(func, wait) {
- var timeoutId;
- var args;
- var context;
- var timestamp; // of most recent call
- var later = function() {
- var last = +new Date() - timestamp;
- if (last < wait && last > 0) {
- timeoutId = setTimeout(later, wait - last);
- }
- else {
- timeoutId = null;
- func.apply(context, args);
- if (!timeoutId) {
- context = args = null;
- }
- }
- };
-
- return function() {
- context = this;
- args = arguments;
- timestamp = +new Date();
- if (!timeoutId) {
- timeoutId = setTimeout(later, wait);
- }
- };
-}
-
-;;
-
-var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/;
-var ambigTimeOrZoneRegex =
- /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/;
-var newMomentProto = moment.fn; // where we will attach our new methods
-var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods
-var allowValueOptimization;
-var setUTCValues; // function defined below
-var setLocalValues; // function defined below
-
-
-// Creating
-// -------------------------------------------------------------------------------------------------
-
-// Creates a new moment, similar to the vanilla moment(...) constructor, but with
-// extra features (ambiguous time, enhanced formatting). When given an existing moment,
-// it will function as a clone (and retain the zone of the moment). Anything else will
-// result in a moment in the local zone.
-fc.moment = function() {
- return makeMoment(arguments);
-};
-
-// Sames as fc.moment, but forces the resulting moment to be in the UTC timezone.
-fc.moment.utc = function() {
- var mom = makeMoment(arguments, true);
-
- // Force it into UTC because makeMoment doesn't guarantee it
- // (if given a pre-existing moment for example)
- if (mom.hasTime()) { // don't give ambiguously-timed moments a UTC zone
- mom.utc();
- }
-
- return mom;
-};
-
-// Same as fc.moment, but when given an ISO8601 string, the timezone offset is preserved.
-// ISO8601 strings with no timezone offset will become ambiguously zoned.
-fc.moment.parseZone = function() {
- return makeMoment(arguments, true, true);
-};
-
-// Builds an enhanced moment from args. When given an existing moment, it clones. When given a
-// native Date, or called with no arguments (the current time), the resulting moment will be local.
-// Anything else needs to be "parsed" (a string or an array), and will be affected by:
-// parseAsUTC - if there is no zone information, should we parse the input in UTC?
-// parseZone - if there is zone information, should we force the zone of the moment?
-function makeMoment(args, parseAsUTC, parseZone) {
- var input = args[0];
- var isSingleString = args.length == 1 && typeof input === 'string';
- var isAmbigTime;
- var isAmbigZone;
- var ambigMatch;
- var mom;
-
- if (moment.isMoment(input)) {
- mom = moment.apply(null, args); // clone it
- transferAmbigs(input, mom); // the ambig flags weren't transfered with the clone
- }
- else if (isNativeDate(input) || input === undefined) {
- mom = moment.apply(null, args); // will be local
- }
- else { // "parsing" is required
- isAmbigTime = false;
- isAmbigZone = false;
-
- if (isSingleString) {
- if (ambigDateOfMonthRegex.test(input)) {
- // accept strings like '2014-05', but convert to the first of the month
- input += '-01';
- args = [ input ]; // for when we pass it on to moment's constructor
- isAmbigTime = true;
- isAmbigZone = true;
- }
- else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {
- isAmbigTime = !ambigMatch[5]; // no time part?
- isAmbigZone = true;
- }
- }
- else if ($.isArray(input)) {
- // arrays have no timezone information, so assume ambiguous zone
- isAmbigZone = true;
- }
- // otherwise, probably a string with a format
-
- if (parseAsUTC || isAmbigTime) {
- mom = moment.utc.apply(moment, args);
- }
- else {
- mom = moment.apply(null, args);
- }
-
- if (isAmbigTime) {
- mom._ambigTime = true;
- mom._ambigZone = true; // ambiguous time always means ambiguous zone
- }
- else if (parseZone) { // let's record the inputted zone somehow
- if (isAmbigZone) {
- mom._ambigZone = true;
- }
- else if (isSingleString) {
- if (mom.utcOffset) {
- mom.utcOffset(input); // if not a valid zone, will assign UTC
- }
- else {
- mom.zone(input); // for moment-pre-2.9
- }
- }
- }
- }
-
- mom._fullCalendar = true; // flag for extended functionality
-
- return mom;
-}
-
-
-// A clone method that works with the flags related to our enhanced functionality.
-// In the future, use moment.momentProperties
-newMomentProto.clone = function() {
- var mom = oldMomentProto.clone.apply(this, arguments);
-
- // these flags weren't transfered with the clone
- transferAmbigs(this, mom);
- if (this._fullCalendar) {
- mom._fullCalendar = true;
- }
-
- return mom;
-};
-
-
-// Week Number
-// -------------------------------------------------------------------------------------------------
-
-
-// Returns the week number, considering the locale's custom week number calcuation
-// `weeks` is an alias for `week`
-newMomentProto.week = newMomentProto.weeks = function(input) {
- var weekCalc = (this._locale || this._lang) // works pre-moment-2.8
- ._fullCalendar_weekCalc;
-
- if (input == null && typeof weekCalc === 'function') { // custom function only works for getter
- return weekCalc(this);
- }
- else if (weekCalc === 'ISO') {
- return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter
- }
-
- return oldMomentProto.week.apply(this, arguments); // local getter/setter
-};
-
-
-// Time-of-day
-// -------------------------------------------------------------------------------------------------
-
-// GETTER
-// Returns a Duration with the hours/minutes/seconds/ms values of the moment.
-// If the moment has an ambiguous time, a duration of 00:00 will be returned.
-//
-// SETTER
-// You can supply a Duration, a Moment, or a Duration-like argument.
-// When setting the time, and the moment has an ambiguous time, it then becomes unambiguous.
-newMomentProto.time = function(time) {
-
- // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar.
- // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins.
- if (!this._fullCalendar) {
- return oldMomentProto.time.apply(this, arguments);
- }
-
- if (time == null) { // getter
- return moment.duration({
- hours: this.hours(),
- minutes: this.minutes(),
- seconds: this.seconds(),
- milliseconds: this.milliseconds()
- });
- }
- else { // setter
-
- this._ambigTime = false; // mark that the moment now has a time
-
- if (!moment.isDuration(time) && !moment.isMoment(time)) {
- time = moment.duration(time);
- }
-
- // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day).
- // Only for Duration times, not Moment times.
- var dayHours = 0;
- if (moment.isDuration(time)) {
- dayHours = Math.floor(time.asDays()) * 24;
- }
-
- // We need to set the individual fields.
- // Can't use startOf('day') then add duration. In case of DST at start of day.
- return this.hours(dayHours + time.hours())
- .minutes(time.minutes())
- .seconds(time.seconds())
- .milliseconds(time.milliseconds());
- }
-};
-
-// Converts the moment to UTC, stripping out its time-of-day and timezone offset,
-// but preserving its YMD. A moment with a stripped time will display no time
-// nor timezone offset when .format() is called.
-newMomentProto.stripTime = function() {
- var a;
-
- if (!this._ambigTime) {
-
- // get the values before any conversion happens
- a = this.toArray(); // array of y/m/d/h/m/s/ms
-
- // TODO: use keepLocalTime in the future
- this.utc(); // set the internal UTC flag (will clear the ambig flags)
- setUTCValues(this, a.slice(0, 3)); // set the year/month/date. time will be zero
-
- // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
- // which clears all ambig flags. Same with setUTCValues with moment-timezone.
- this._ambigTime = true;
- this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset
- }
-
- return this; // for chaining
-};
-
-// Returns if the moment has a non-ambiguous time (boolean)
-newMomentProto.hasTime = function() {
- return !this._ambigTime;
-};
-
-
-// Timezone
-// -------------------------------------------------------------------------------------------------
-
-// Converts the moment to UTC, stripping out its timezone offset, but preserving its
-// YMD and time-of-day. A moment with a stripped timezone offset will display no
-// timezone offset when .format() is called.
-// TODO: look into Moment's keepLocalTime functionality
-newMomentProto.stripZone = function() {
- var a, wasAmbigTime;
-
- if (!this._ambigZone) {
-
- // get the values before any conversion happens
- a = this.toArray(); // array of y/m/d/h/m/s/ms
- wasAmbigTime = this._ambigTime;
-
- this.utc(); // set the internal UTC flag (might clear the ambig flags, depending on Moment internals)
- setUTCValues(this, a); // will set the year/month/date/hours/minutes/seconds/ms
-
- // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore
- this._ambigTime = wasAmbigTime || false;
-
- // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),
- // which clears the ambig flags. Same with setUTCValues with moment-timezone.
- this._ambigZone = true;
- }
-
- return this; // for chaining
-};
-
-// Returns of the moment has a non-ambiguous timezone offset (boolean)
-newMomentProto.hasZone = function() {
- return !this._ambigZone;
-};
-
-
-// this method implicitly marks a zone
-newMomentProto.local = function() {
- var a = this.toArray(); // year,month,date,hours,minutes,seconds,ms as an array
- var wasAmbigZone = this._ambigZone;
-
- oldMomentProto.local.apply(this, arguments);
-
- // ensure non-ambiguous
- // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals
- this._ambigTime = false;
- this._ambigZone = false;
-
- if (wasAmbigZone) {
- // If the moment was ambiguously zoned, the date fields were stored as UTC.
- // We want to preserve these, but in local time.
- // TODO: look into Moment's keepLocalTime functionality
- setLocalValues(this, a);
- }
-
- return this; // for chaining
-};
-
-
-// implicitly marks a zone
-newMomentProto.utc = function() {
- oldMomentProto.utc.apply(this, arguments);
-
- // ensure non-ambiguous
- // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals
- this._ambigTime = false;
- this._ambigZone = false;
-
- return this;
-};
-
-
-// methods for arbitrarily manipulating timezone offset.
-// should clear time/zone ambiguity when called.
-$.each([
- 'zone', // only in moment-pre-2.9. deprecated afterwards
- 'utcOffset'
-], function(i, name) {
- if (oldMomentProto[name]) { // original method exists?
-
- // this method implicitly marks a zone (will probably get called upon .utc() and .local())
- newMomentProto[name] = function(tzo) {
-
- if (tzo != null) { // setter
- // these assignments needs to happen before the original zone method is called.
- // I forget why, something to do with a browser crash.
- this._ambigTime = false;
- this._ambigZone = false;
- }
-
- return oldMomentProto[name].apply(this, arguments);
- };
- }
-});
-
-
-// Formatting
-// -------------------------------------------------------------------------------------------------
-
-newMomentProto.format = function() {
- if (this._fullCalendar && arguments[0]) { // an enhanced moment? and a format string provided?
- return formatDate(this, arguments[0]); // our extended formatting
- }
- if (this._ambigTime) {
- return oldMomentFormat(this, 'YYYY-MM-DD');
- }
- if (this._ambigZone) {
- return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss');
- }
- return oldMomentProto.format.apply(this, arguments);
-};
-
-newMomentProto.toISOString = function() {
- if (this._ambigTime) {
- return oldMomentFormat(this, 'YYYY-MM-DD');
- }
- if (this._ambigZone) {
- return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss');
- }
- return oldMomentProto.toISOString.apply(this, arguments);
-};
-
-
-// Querying
-// -------------------------------------------------------------------------------------------------
-
-// Is the moment within the specified range? `end` is exclusive.
-// FYI, this method is not a standard Moment method, so always do our enhanced logic.
-newMomentProto.isWithin = function(start, end) {
- var a = commonlyAmbiguate([ this, start, end ]);
- return a[0] >= a[1] && a[0] < a[2];
-};
-
-// When isSame is called with units, timezone ambiguity is normalized before the comparison happens.
-// If no units specified, the two moments must be identically the same, with matching ambig flags.
-newMomentProto.isSame = function(input, units) {
- var a;
-
- // only do custom logic if this is an enhanced moment
- if (!this._fullCalendar) {
- return oldMomentProto.isSame.apply(this, arguments);
- }
-
- if (units) {
- a = commonlyAmbiguate([ this, input ], true); // normalize timezones but don't erase times
- return oldMomentProto.isSame.call(a[0], a[1], units);
- }
- else {
- input = fc.moment.parseZone(input); // normalize input
- return oldMomentProto.isSame.call(this, input) &&
- Boolean(this._ambigTime) === Boolean(input._ambigTime) &&
- Boolean(this._ambigZone) === Boolean(input._ambigZone);
- }
-};
-
-// Make these query methods work with ambiguous moments
-$.each([
- 'isBefore',
- 'isAfter'
-], function(i, methodName) {
- newMomentProto[methodName] = function(input, units) {
- var a;
-
- // only do custom logic if this is an enhanced moment
- if (!this._fullCalendar) {
- return oldMomentProto[methodName].apply(this, arguments);
- }
-
- a = commonlyAmbiguate([ this, input ]);
- return oldMomentProto[methodName].call(a[0], a[1], units);
- };
-});
-
-
-// Misc Internals
-// -------------------------------------------------------------------------------------------------
-
-// given an array of moment-like inputs, return a parallel array w/ moments similarly ambiguated.
-// for example, of one moment has ambig time, but not others, all moments will have their time stripped.
-// set `preserveTime` to `true` to keep times, but only normalize zone ambiguity.
-// returns the original moments if no modifications are necessary.
-function commonlyAmbiguate(inputs, preserveTime) {
- var anyAmbigTime = false;
- var anyAmbigZone = false;
- var len = inputs.length;
- var moms = [];
- var i, mom;
-
- // parse inputs into real moments and query their ambig flags
- for (i = 0; i < len; i++) {
- mom = inputs[i];
- if (!moment.isMoment(mom)) {
- mom = fc.moment.parseZone(mom);
- }
- anyAmbigTime = anyAmbigTime || mom._ambigTime;
- anyAmbigZone = anyAmbigZone || mom._ambigZone;
- moms.push(mom);
- }
-
- // strip each moment down to lowest common ambiguity
- // use clones to avoid modifying the original moments
- for (i = 0; i < len; i++) {
- mom = moms[i];
- if (!preserveTime && anyAmbigTime && !mom._ambigTime) {
- moms[i] = mom.clone().stripTime();
- }
- else if (anyAmbigZone && !mom._ambigZone) {
- moms[i] = mom.clone().stripZone();
- }
- }
-
- return moms;
-}
-
-// Transfers all the flags related to ambiguous time/zone from the `src` moment to the `dest` moment
-// TODO: look into moment.momentProperties for this.
-function transferAmbigs(src, dest) {
- if (src._ambigTime) {
- dest._ambigTime = true;
- }
- else if (dest._ambigTime) {
- dest._ambigTime = false;
- }
-
- if (src._ambigZone) {
- dest._ambigZone = true;
- }
- else if (dest._ambigZone) {
- dest._ambigZone = false;
- }
-}
-
-
-// Sets the year/month/date/etc values of the moment from the given array.
-// Inefficient because it calls each individual setter.
-function setMomentValues(mom, a) {
- mom.year(a[0] || 0)
- .month(a[1] || 0)
- .date(a[2] || 0)
- .hours(a[3] || 0)
- .minutes(a[4] || 0)
- .seconds(a[5] || 0)
- .milliseconds(a[6] || 0);
-}
-
-// Can we set the moment's internal date directly?
-allowValueOptimization = '_d' in moment() && 'updateOffset' in moment;
-
-// Utility function. Accepts a moment and an array of the UTC year/month/date/etc values to set.
-// Assumes the given moment is already in UTC mode.
-setUTCValues = allowValueOptimization ? function(mom, a) {
- // simlate what moment's accessors do
- mom._d.setTime(Date.UTC.apply(Date, a));
- moment.updateOffset(mom, false); // keepTime=false
-} : setMomentValues;
-
-// Utility function. Accepts a moment and an array of the local year/month/date/etc values to set.
-// Assumes the given moment is already in local mode.
-setLocalValues = allowValueOptimization ? function(mom, a) {
- // simlate what moment's accessors do
- mom._d.setTime(+new Date( // FYI, there is now way to apply an array of args to a constructor
- a[0] || 0,
- a[1] || 0,
- a[2] || 0,
- a[3] || 0,
- a[4] || 0,
- a[5] || 0,
- a[6] || 0
- ));
- moment.updateOffset(mom, false); // keepTime=false
-} : setMomentValues;
-
-;;
-
-// Single Date Formatting
-// -------------------------------------------------------------------------------------------------
-
-
-// call this if you want Moment's original format method to be used
-function oldMomentFormat(mom, formatStr) {
- return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js
-}
-
-
-// Formats `date` with a Moment formatting string, but allow our non-zero areas and
-// additional token.
-function formatDate(date, formatStr) {
- return formatDateWithChunks(date, getFormatStringChunks(formatStr));
-}
-
-
-function formatDateWithChunks(date, chunks) {
- var s = '';
- var i;
-
- for (i=0; i "MMMM D YYYY"
- formatStr = localeData.longDateFormat(formatStr) || formatStr;
- // BTW, this is not important for `formatDate` because it is impossible to put custom tokens
- // or non-zero areas in Moment's localized format strings.
-
- separator = separator || ' - ';
-
- return formatRangeWithChunks(
- date1,
- date2,
- getFormatStringChunks(formatStr),
- separator,
- isRTL
- );
-}
-fc.formatRange = formatRange; // expose
-
-
-function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) {
- var chunkStr; // the rendering of the chunk
- var leftI;
- var leftStr = '';
- var rightI;
- var rightStr = '';
- var middleI;
- var middleStr1 = '';
- var middleStr2 = '';
- var middleStr = '';
-
- // Start at the leftmost side of the formatting string and continue until you hit a token
- // that is not the same between dates.
- for (leftI=0; leftIleftI; rightI--) {
- chunkStr = formatSimilarChunk(date1, date2, chunks[rightI]);
- if (chunkStr === false) {
- break;
- }
- rightStr = chunkStr + rightStr;
- }
-
- // The area in the middle is different for both of the dates.
- // Collect them distinctly so we can jam them together later.
- for (middleI=leftI; middleI<=rightI; middleI++) {
- middleStr1 += formatDateWithChunk(date1, chunks[middleI]);
- middleStr2 += formatDateWithChunk(date2, chunks[middleI]);
- }
-
- if (middleStr1 || middleStr2) {
- if (isRTL) {
- middleStr = middleStr2 + separator + middleStr1;
- }
- else {
- middleStr = middleStr1 + separator + middleStr2;
- }
- }
-
- return leftStr + middleStr + rightStr;
-}
-
-
-var similarUnitMap = {
- Y: 'year',
- M: 'month',
- D: 'day', // day of month
- d: 'day', // day of week
- // prevents a separator between anything time-related...
- A: 'second', // AM/PM
- a: 'second', // am/pm
- T: 'second', // A/P
- t: 'second', // a/p
- H: 'second', // hour (24)
- h: 'second', // hour (12)
- m: 'second', // minute
- s: 'second' // second
-};
-// TODO: week maybe?
-
-
-// Given a formatting chunk, and given that both dates are similar in the regard the
-// formatting chunk is concerned, format date1 against `chunk`. Otherwise, return `false`.
-function formatSimilarChunk(date1, date2, chunk) {
- var token;
- var unit;
-
- if (typeof chunk === 'string') { // a literal string
- return chunk;
- }
- else if ((token = chunk.token)) {
- unit = similarUnitMap[token.charAt(0)];
- // are the dates the same for this unit of measurement?
- if (unit && date1.isSame(date2, unit)) {
- return oldMomentFormat(date1, token); // would be the same if we used `date2`
- // BTW, don't support custom tokens
- }
- }
-
- return false; // the chunk is NOT the same for the two dates
- // BTW, don't support splitting on non-zero areas
-}
-
-
-// Chunking Utils
-// -------------------------------------------------------------------------------------------------
-
-
-var formatStringChunkCache = {};
-
-
-function getFormatStringChunks(formatStr) {
- if (formatStr in formatStringChunkCache) {
- return formatStringChunkCache[formatStr];
- }
- return (formatStringChunkCache[formatStr] = chunkFormatString(formatStr));
-}
-
-
-// Break the formatting string into an array of chunks
-function chunkFormatString(formatStr) {
- var chunks = [];
- var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g; // TODO: more descrimination
- var match;
-
- while ((match = chunker.exec(formatStr))) {
- if (match[1]) { // a literal string inside [ ... ]
- chunks.push(match[1]);
- }
- else if (match[2]) { // non-zero formatting inside ( ... )
- chunks.push({ maybe: chunkFormatString(match[2]) });
- }
- else if (match[3]) { // a formatting token
- chunks.push({ token: match[3] });
- }
- else if (match[5]) { // an unenclosed literal string
- chunks.push(match[5]);
- }
- }
-
- return chunks;
-}
-
-;;
-
-fc.Class = Class; // export
-
-// class that all other classes will inherit from
-function Class() { }
-
-// called upon a class to create a subclass
-Class.extend = function(members) {
- var superClass = this;
- var subClass;
-
- members = members || {};
-
- // ensure a constructor for the subclass, forwarding all arguments to the super-constructor if it doesn't exist
- if (hasOwnProp(members, 'constructor')) {
- subClass = members.constructor;
- }
- if (typeof subClass !== 'function') {
- subClass = members.constructor = function() {
- superClass.apply(this, arguments);
- };
- }
-
- // build the base prototype for the subclass, which is an new object chained to the superclass's prototype
- subClass.prototype = createObject(superClass.prototype);
-
- // copy each member variable/method onto the the subclass's prototype
- copyOwnProps(members, subClass.prototype);
- copyNativeMethods(members, subClass.prototype); // hack for IE8
-
- // copy over all class variables/methods to the subclass, such as `extend` and `mixin`
- copyOwnProps(superClass, subClass);
-
- return subClass;
-};
-
-// adds new member variables/methods to the class's prototype.
-// can be called with another class, or a plain object hash containing new members.
-Class.mixin = function(members) {
- copyOwnProps(members.prototype || members, this.prototype); // TODO: copyNativeMethods?
-};
-;;
-
-var Emitter = fc.Emitter = Class.extend({
-
- callbackHash: null,
-
-
- on: function(name, callback) {
- this.getCallbacks(name).add(callback);
- return this; // for chaining
- },
-
-
- off: function(name, callback) {
- this.getCallbacks(name).remove(callback);
- return this; // for chaining
- },
-
-
- trigger: function(name) { // args...
- var args = Array.prototype.slice.call(arguments, 1);
-
- this.triggerWith(name, this, args);
-
- return this; // for chaining
- },
-
-
- triggerWith: function(name, context, args) {
- var callbacks = this.getCallbacks(name);
-
- callbacks.fireWith(context, args);
-
- return this; // for chaining
- },
-
-
- getCallbacks: function(name) {
- var callbacks;
-
- if (!this.callbackHash) {
- this.callbackHash = {};
- }
-
- callbacks = this.callbackHash[name];
- if (!callbacks) {
- callbacks = this.callbackHash[name] = $.Callbacks();
- }
-
- return callbacks;
- }
-
-});
-;;
-
-/* A rectangular panel that is absolutely positioned over other content
-------------------------------------------------------------------------------------------------------------------------
-Options:
- - className (string)
- - content (HTML string or jQuery element set)
- - parentEl
- - top
- - left
- - right (the x coord of where the right edge should be. not a "CSS" right)
- - autoHide (boolean)
- - show (callback)
- - hide (callback)
-*/
-
-var Popover = Class.extend({
-
- isHidden: true,
- options: null,
- el: null, // the container element for the popover. generated by this object
- documentMousedownProxy: null, // document mousedown handler bound to `this`
- margin: 10, // the space required between the popover and the edges of the scroll container
-
-
- constructor: function(options) {
- this.options = options || {};
- },
-
-
- // Shows the popover on the specified position. Renders it if not already
- show: function() {
- if (this.isHidden) {
- if (!this.el) {
- this.render();
- }
- this.el.show();
- this.position();
- this.isHidden = false;
- this.trigger('show');
- }
- },
-
-
- // Hides the popover, through CSS, but does not remove it from the DOM
- hide: function() {
- if (!this.isHidden) {
- this.el.hide();
- this.isHidden = true;
- this.trigger('hide');
- }
- },
-
-
- // Creates `this.el` and renders content inside of it
- render: function() {
- var _this = this;
- var options = this.options;
-
- this.el = $('')
- .addClass(options.className || '')
- .css({
- // position initially to the top left to avoid creating scrollbars
- top: 0,
- left: 0
- })
- .append(options.content)
- .appendTo(options.parentEl);
-
- // when a click happens on anything inside with a 'fc-close' className, hide the popover
- this.el.on('click', '.fc-close', function() {
- _this.hide();
- });
-
- if (options.autoHide) {
- $(document).on('mousedown', this.documentMousedownProxy = proxy(this, 'documentMousedown'));
- }
- },
-
-
- // Triggered when the user clicks *anywhere* in the document, for the autoHide feature
- documentMousedown: function(ev) {
- // only hide the popover if the click happened outside the popover
- if (this.el && !$(ev.target).closest(this.el).length) {
- this.hide();
- }
- },
-
-
- // Hides and unregisters any handlers
- removeElement: function() {
- this.hide();
-
- if (this.el) {
- this.el.remove();
- this.el = null;
- }
-
- $(document).off('mousedown', this.documentMousedownProxy);
- },
-
-
- // Positions the popover optimally, using the top/left/right options
- position: function() {
- var options = this.options;
- var origin = this.el.offsetParent().offset();
- var width = this.el.outerWidth();
- var height = this.el.outerHeight();
- var windowEl = $(window);
- var viewportEl = getScrollParent(this.el);
- var viewportTop;
- var viewportLeft;
- var viewportOffset;
- var top; // the "position" (not "offset") values for the popover
- var left; //
-
- // compute top and left
- top = options.top || 0;
- if (options.left !== undefined) {
- left = options.left;
- }
- else if (options.right !== undefined) {
- left = options.right - width; // derive the left value from the right value
- }
- else {
- left = 0;
- }
-
- if (viewportEl.is(window) || viewportEl.is(document)) { // normalize getScrollParent's result
- viewportEl = windowEl;
- viewportTop = 0; // the window is always at the top left
- viewportLeft = 0; // (and .offset() won't work if called here)
- }
- else {
- viewportOffset = viewportEl.offset();
- viewportTop = viewportOffset.top;
- viewportLeft = viewportOffset.left;
- }
-
- // if the window is scrolled, it causes the visible area to be further down
- viewportTop += windowEl.scrollTop();
- viewportLeft += windowEl.scrollLeft();
-
- // constrain to the view port. if constrained by two edges, give precedence to top/left
- if (options.viewportConstrain !== false) {
- top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin);
- top = Math.max(top, viewportTop + this.margin);
- left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin);
- left = Math.max(left, viewportLeft + this.margin);
- }
-
- this.el.css({
- top: top - origin.top,
- left: left - origin.left
- });
- },
-
-
- // Triggers a callback. Calls a function in the option hash of the same name.
- // Arguments beyond the first `name` are forwarded on.
- // TODO: better code reuse for this. Repeat code
- trigger: function(name) {
- if (this.options[name]) {
- this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
- }
- }
-
-});
-
-;;
-
-/* A "coordinate map" converts pixel coordinates into an associated cell, which has an associated date
-------------------------------------------------------------------------------------------------------------------------
-Common interface:
-
- CoordMap.prototype = {
- build: function() {},
- getCell: function(x, y) {}
- };
-
-*/
-
-/* Coordinate map for a grid component
-----------------------------------------------------------------------------------------------------------------------*/
-
-var GridCoordMap = Class.extend({
-
- grid: null, // reference to the Grid
- rowCoords: null, // array of {top,bottom} objects
- colCoords: null, // array of {left,right} objects
-
- containerEl: null, // container element that all coordinates are constrained to. optionally assigned
- bounds: null,
-
-
- constructor: function(grid) {
- this.grid = grid;
- },
-
-
- // Queries the grid for the coordinates of all the cells
- build: function() {
- this.grid.build();
- this.rowCoords = this.grid.computeRowCoords();
- this.colCoords = this.grid.computeColCoords();
- this.computeBounds();
- },
-
-
- // Clears the coordinates data to free up memory
- clear: function() {
- this.grid.clear();
- this.rowCoords = null;
- this.colCoords = null;
- },
-
-
- // Given a coordinate of the document, gets the associated cell. If no cell is underneath, returns null
- getCell: function(x, y) {
- var rowCoords = this.rowCoords;
- var rowCnt = rowCoords.length;
- var colCoords = this.colCoords;
- var colCnt = colCoords.length;
- var hitRow = null;
- var hitCol = null;
- var i, coords;
- var cell;
-
- if (this.inBounds(x, y)) {
-
- for (i = 0; i < rowCnt; i++) {
- coords = rowCoords[i];
- if (y >= coords.top && y < coords.bottom) {
- hitRow = i;
- break;
- }
- }
-
- for (i = 0; i < colCnt; i++) {
- coords = colCoords[i];
- if (x >= coords.left && x < coords.right) {
- hitCol = i;
- break;
- }
- }
-
- if (hitRow !== null && hitCol !== null) {
-
- cell = this.grid.getCell(hitRow, hitCol); // expected to return a fresh object we can modify
- cell.grid = this.grid; // for CellDragListener's isCellsEqual. dragging between grids
-
- // make the coordinates available on the cell object
- $.extend(cell, rowCoords[hitRow], colCoords[hitCol]);
-
- return cell;
- }
- }
-
- return null;
- },
-
-
- // If there is a containerEl, compute the bounds into min/max values
- computeBounds: function() {
- this.bounds = this.containerEl ?
- getClientRect(this.containerEl) : // area within scrollbars
- null;
- },
-
-
- // Determines if the given coordinates are in bounds. If no `containerEl`, always true
- inBounds: function(x, y) {
- var bounds = this.bounds;
-
- if (bounds) {
- return x >= bounds.left && x < bounds.right && y >= bounds.top && y < bounds.bottom;
- }
-
- return true;
- }
-
-});
-
-
-/* Coordinate map that is a combination of multiple other coordinate maps
-----------------------------------------------------------------------------------------------------------------------*/
-
-var ComboCoordMap = Class.extend({
-
- coordMaps: null, // an array of CoordMaps
-
-
- constructor: function(coordMaps) {
- this.coordMaps = coordMaps;
- },
-
-
- // Builds all coordMaps
- build: function() {
- var coordMaps = this.coordMaps;
- var i;
-
- for (i = 0; i < coordMaps.length; i++) {
- coordMaps[i].build();
- }
- },
-
-
- // Queries all coordMaps for the cell underneath the given coordinates, returning the first result
- getCell: function(x, y) {
- var coordMaps = this.coordMaps;
- var cell = null;
- var i;
-
- for (i = 0; i < coordMaps.length && !cell; i++) {
- cell = coordMaps[i].getCell(x, y);
- }
-
- return cell;
- },
-
-
- // Clears all coordMaps
- clear: function() {
- var coordMaps = this.coordMaps;
- var i;
-
- for (i = 0; i < coordMaps.length; i++) {
- coordMaps[i].clear();
- }
- }
-
-});
-
-;;
-
-/* Tracks a drag's mouse movement, firing various handlers
-----------------------------------------------------------------------------------------------------------------------*/
-
-var DragListener = fc.DragListener = Class.extend({
-
- options: null,
-
- isListening: false,
- isDragging: false,
-
- // coordinates of the initial mousedown
- originX: null,
- originY: null,
-
- // handler attached to the document, bound to the DragListener's `this`
- mousemoveProxy: null,
- mouseupProxy: null,
-
- // for IE8 bug-fighting behavior, for now
- subjectEl: null, // the element being draged. optional
- subjectHref: null,
-
- scrollEl: null,
- scrollBounds: null, // { top, bottom, left, right }
- scrollTopVel: null, // pixels per second
- scrollLeftVel: null, // pixels per second
- scrollIntervalId: null, // ID of setTimeout for scrolling animation loop
- scrollHandlerProxy: null, // this-scoped function for handling when scrollEl is scrolled
-
- scrollSensitivity: 30, // pixels from edge for scrolling to start
- scrollSpeed: 200, // pixels per second, at maximum speed
- scrollIntervalMs: 50, // millisecond wait between scroll increment
-
-
- constructor: function(options) {
- options = options || {};
- this.options = options;
- this.subjectEl = options.subjectEl;
- },
-
-
- // Call this when the user does a mousedown. Will probably lead to startListening
- mousedown: function(ev) {
- if (isPrimaryMouseButton(ev)) {
-
- ev.preventDefault(); // prevents native selection in most browsers
-
- this.startListening(ev);
-
- // start the drag immediately if there is no minimum distance for a drag start
- if (!this.options.distance) {
- this.startDrag(ev);
- }
- }
- },
-
-
- // Call this to start tracking mouse movements
- startListening: function(ev) {
- var scrollParent;
-
- if (!this.isListening) {
-
- // grab scroll container and attach handler
- if (ev && this.options.scroll) {
- scrollParent = getScrollParent($(ev.target));
- if (!scrollParent.is(window) && !scrollParent.is(document)) {
- this.scrollEl = scrollParent;
-
- // scope to `this`, and use `debounce` to make sure rapid calls don't happen
- this.scrollHandlerProxy = debounce(proxy(this, 'scrollHandler'), 100);
- this.scrollEl.on('scroll', this.scrollHandlerProxy);
- }
- }
-
- $(document)
- .on('mousemove', this.mousemoveProxy = proxy(this, 'mousemove'))
- .on('mouseup', this.mouseupProxy = proxy(this, 'mouseup'))
- .on('selectstart', this.preventDefault); // prevents native selection in IE<=8
-
- if (ev) {
- this.originX = ev.pageX;
- this.originY = ev.pageY;
- }
- else {
- // if no starting information was given, origin will be the topleft corner of the screen.
- // if so, dx/dy in the future will be the absolute coordinates.
- this.originX = 0;
- this.originY = 0;
- }
-
- this.isListening = true;
- this.listenStart(ev);
- }
- },
-
-
- // Called when drag listening has started (but a real drag has not necessarily began)
- listenStart: function(ev) {
- this.trigger('listenStart', ev);
- },
-
-
- // Called when the user moves the mouse
- mousemove: function(ev) {
- var dx = ev.pageX - this.originX;
- var dy = ev.pageY - this.originY;
- var minDistance;
- var distanceSq; // current distance from the origin, squared
-
- if (!this.isDragging) { // if not already dragging...
- // then start the drag if the minimum distance criteria is met
- minDistance = this.options.distance || 1;
- distanceSq = dx * dx + dy * dy;
- if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem
- this.startDrag(ev);
- }
- }
-
- if (this.isDragging) {
- this.drag(dx, dy, ev); // report a drag, even if this mousemove initiated the drag
- }
- },
-
-
- // Call this to initiate a legitimate drag.
- // This function is called internally from this class, but can also be called explicitly from outside
- startDrag: function(ev) {
-
- if (!this.isListening) { // startDrag must have manually initiated
- this.startListening();
- }
-
- if (!this.isDragging) {
- this.isDragging = true;
- this.dragStart(ev);
- }
- },
-
-
- // Called when the actual drag has started (went beyond minDistance)
- dragStart: function(ev) {
- var subjectEl = this.subjectEl;
-
- this.trigger('dragStart', ev);
-
- // remove a mousedown'd 's href so it is not visited (IE8 bug)
- if ((this.subjectHref = subjectEl ? subjectEl.attr('href') : null)) {
- subjectEl.removeAttr('href');
- }
- },
-
-
- // Called while the mouse is being moved and when we know a legitimate drag is taking place
- drag: function(dx, dy, ev) {
- this.trigger('drag', dx, dy, ev);
- this.updateScroll(ev); // will possibly cause scrolling
- },
-
-
- // Called when the user does a mouseup
- mouseup: function(ev) {
- this.stopListening(ev);
- },
-
-
- // Called when the drag is over. Will not cause listening to stop however.
- // A concluding 'cellOut' event will NOT be triggered.
- stopDrag: function(ev) {
- if (this.isDragging) {
- this.stopScrolling();
- this.dragStop(ev);
- this.isDragging = false;
- }
- },
-
-
- // Called when dragging has been stopped
- dragStop: function(ev) {
- var _this = this;
-
- this.trigger('dragStop', ev);
-
- // restore a mousedown'd 's href (for IE8 bug)
- setTimeout(function() { // must be outside of the click's execution
- if (_this.subjectHref) {
- _this.subjectEl.attr('href', _this.subjectHref);
- }
- }, 0);
- },
-
-
- // Call this to stop listening to the user's mouse events
- stopListening: function(ev) {
- this.stopDrag(ev); // if there's a current drag, kill it
-
- if (this.isListening) {
-
- // remove the scroll handler if there is a scrollEl
- if (this.scrollEl) {
- this.scrollEl.off('scroll', this.scrollHandlerProxy);
- this.scrollHandlerProxy = null;
- }
-
- $(document)
- .off('mousemove', this.mousemoveProxy)
- .off('mouseup', this.mouseupProxy)
- .off('selectstart', this.preventDefault);
-
- this.mousemoveProxy = null;
- this.mouseupProxy = null;
-
- this.isListening = false;
- this.listenStop(ev);
- }
- },
-
-
- // Called when drag listening has stopped
- listenStop: function(ev) {
- this.trigger('listenStop', ev);
- },
-
-
- // Triggers a callback. Calls a function in the option hash of the same name.
- // Arguments beyond the first `name` are forwarded on.
- trigger: function(name) {
- if (this.options[name]) {
- this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));
- }
- },
-
-
- // Stops a given mouse event from doing it's native browser action. In our case, text selection.
- preventDefault: function(ev) {
- ev.preventDefault();
- },
-
-
- /* Scrolling
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Computes and stores the bounding rectangle of scrollEl
- computeScrollBounds: function() {
- var el = this.scrollEl;
-
- this.scrollBounds = el ? getOuterRect(el) : null;
- // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars
- },
-
-
- // Called when the dragging is in progress and scrolling should be updated
- updateScroll: function(ev) {
- var sensitivity = this.scrollSensitivity;
- var bounds = this.scrollBounds;
- var topCloseness, bottomCloseness;
- var leftCloseness, rightCloseness;
- var topVel = 0;
- var leftVel = 0;
-
- if (bounds) { // only scroll if scrollEl exists
-
- // compute closeness to edges. valid range is from 0.0 - 1.0
- topCloseness = (sensitivity - (ev.pageY - bounds.top)) / sensitivity;
- bottomCloseness = (sensitivity - (bounds.bottom - ev.pageY)) / sensitivity;
- leftCloseness = (sensitivity - (ev.pageX - bounds.left)) / sensitivity;
- rightCloseness = (sensitivity - (bounds.right - ev.pageX)) / sensitivity;
-
- // translate vertical closeness into velocity.
- // mouse must be completely in bounds for velocity to happen.
- if (topCloseness >= 0 && topCloseness <= 1) {
- topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up
- }
- else if (bottomCloseness >= 0 && bottomCloseness <= 1) {
- topVel = bottomCloseness * this.scrollSpeed;
- }
-
- // translate horizontal closeness into velocity
- if (leftCloseness >= 0 && leftCloseness <= 1) {
- leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left
- }
- else if (rightCloseness >= 0 && rightCloseness <= 1) {
- leftVel = rightCloseness * this.scrollSpeed;
- }
- }
-
- this.setScrollVel(topVel, leftVel);
- },
-
-
- // Sets the speed-of-scrolling for the scrollEl
- setScrollVel: function(topVel, leftVel) {
-
- this.scrollTopVel = topVel;
- this.scrollLeftVel = leftVel;
-
- this.constrainScrollVel(); // massages into realistic values
-
- // if there is non-zero velocity, and an animation loop hasn't already started, then START
- if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) {
- this.scrollIntervalId = setInterval(
- proxy(this, 'scrollIntervalFunc'), // scope to `this`
- this.scrollIntervalMs
- );
- }
- },
-
-
- // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way
- constrainScrollVel: function() {
- var el = this.scrollEl;
-
- if (this.scrollTopVel < 0) { // scrolling up?
- if (el.scrollTop() <= 0) { // already scrolled all the way up?
- this.scrollTopVel = 0;
- }
- }
- else if (this.scrollTopVel > 0) { // scrolling down?
- if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { // already scrolled all the way down?
- this.scrollTopVel = 0;
- }
- }
-
- if (this.scrollLeftVel < 0) { // scrolling left?
- if (el.scrollLeft() <= 0) { // already scrolled all the left?
- this.scrollLeftVel = 0;
- }
- }
- else if (this.scrollLeftVel > 0) { // scrolling right?
- if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { // already scrolled all the way right?
- this.scrollLeftVel = 0;
- }
- }
- },
-
-
- // This function gets called during every iteration of the scrolling animation loop
- scrollIntervalFunc: function() {
- var el = this.scrollEl;
- var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by
-
- // change the value of scrollEl's scroll
- if (this.scrollTopVel) {
- el.scrollTop(el.scrollTop() + this.scrollTopVel * frac);
- }
- if (this.scrollLeftVel) {
- el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac);
- }
-
- this.constrainScrollVel(); // since the scroll values changed, recompute the velocities
-
- // if scrolled all the way, which causes the vels to be zero, stop the animation loop
- if (!this.scrollTopVel && !this.scrollLeftVel) {
- this.stopScrolling();
- }
- },
-
-
- // Kills any existing scrolling animation loop
- stopScrolling: function() {
- if (this.scrollIntervalId) {
- clearInterval(this.scrollIntervalId);
- this.scrollIntervalId = null;
-
- // when all done with scrolling, recompute positions since they probably changed
- this.scrollStop();
- }
- },
-
-
- // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce)
- scrollHandler: function() {
- // recompute all coordinates, but *only* if this is *not* part of our scrolling animation
- if (!this.scrollIntervalId) {
- this.scrollStop();
- }
- },
-
-
- // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
- scrollStop: function() {
- }
-
-});
-
-;;
-
-/* Tracks mouse movements over a CoordMap and raises events about which cell the mouse is over.
-------------------------------------------------------------------------------------------------------------------------
-options:
-- subjectEl
-- subjectCenter
-*/
-
-var CellDragListener = DragListener.extend({
-
- coordMap: null, // converts coordinates to date cells
- origCell: null, // the cell the mouse was over when listening started
- cell: null, // the cell the mouse is over
- coordAdjust: null, // delta that will be added to the mouse coordinates when computing collisions
-
-
- constructor: function(coordMap, options) {
- DragListener.prototype.constructor.call(this, options); // call the super-constructor
-
- this.coordMap = coordMap;
- },
-
-
- // Called when drag listening starts (but a real drag has not necessarily began).
- // ev might be undefined if dragging was started manually.
- listenStart: function(ev) {
- var subjectEl = this.subjectEl;
- var subjectRect;
- var origPoint;
- var point;
-
- DragListener.prototype.listenStart.apply(this, arguments); // call the super-method
-
- this.computeCoords();
-
- if (ev) {
- origPoint = { left: ev.pageX, top: ev.pageY };
- point = origPoint;
-
- // constrain the point to bounds of the element being dragged
- if (subjectEl) {
- subjectRect = getOuterRect(subjectEl); // used for centering as well
- point = constrainPoint(point, subjectRect);
- }
-
- this.origCell = this.getCell(point.left, point.top);
-
- // treat the center of the subject as the collision point?
- if (subjectEl && this.options.subjectCenter) {
-
- // only consider the area the subject overlaps the cell. best for large subjects
- if (this.origCell) {
- subjectRect = intersectRects(this.origCell, subjectRect) ||
- subjectRect; // in case there is no intersection
- }
-
- point = getRectCenter(subjectRect);
- }
-
- this.coordAdjust = diffPoints(point, origPoint); // point - origPoint
- }
- else {
- this.origCell = null;
- this.coordAdjust = null;
- }
- },
-
-
- // Recomputes the drag-critical positions of elements
- computeCoords: function() {
- this.coordMap.build();
- this.computeScrollBounds();
- },
-
-
- // Called when the actual drag has started
- dragStart: function(ev) {
- var cell;
-
- DragListener.prototype.dragStart.apply(this, arguments); // call the super-method
-
- cell = this.getCell(ev.pageX, ev.pageY); // might be different from this.origCell if the min-distance is large
-
- // report the initial cell the mouse is over
- // especially important if no min-distance and drag starts immediately
- if (cell) {
- this.cellOver(cell);
- }
- },
-
-
- // Called when the drag moves
- drag: function(dx, dy, ev) {
- var cell;
-
- DragListener.prototype.drag.apply(this, arguments); // call the super-method
-
- cell = this.getCell(ev.pageX, ev.pageY);
-
- if (!isCellsEqual(cell, this.cell)) { // a different cell than before?
- if (this.cell) {
- this.cellOut();
- }
- if (cell) {
- this.cellOver(cell);
- }
- }
- },
-
-
- // Called when dragging has been stopped
- dragStop: function() {
- this.cellDone();
- DragListener.prototype.dragStop.apply(this, arguments); // call the super-method
- },
-
-
- // Called when a the mouse has just moved over a new cell
- cellOver: function(cell) {
- this.cell = cell;
- this.trigger('cellOver', cell, isCellsEqual(cell, this.origCell), this.origCell);
- },
-
-
- // Called when the mouse has just moved out of a cell
- cellOut: function() {
- if (this.cell) {
- this.trigger('cellOut', this.cell);
- this.cellDone();
- this.cell = null;
- }
- },
-
-
- // Called after a cellOut. Also called before a dragStop
- cellDone: function() {
- if (this.cell) {
- this.trigger('cellDone', this.cell);
- }
- },
-
-
- // Called when drag listening has stopped
- listenStop: function() {
- DragListener.prototype.listenStop.apply(this, arguments); // call the super-method
-
- this.origCell = this.cell = null;
- this.coordMap.clear();
- },
-
-
- // Called when scrolling has stopped, whether through auto scroll, or the user scrolling
- scrollStop: function() {
- DragListener.prototype.scrollStop.apply(this, arguments); // call the super-method
-
- this.computeCoords(); // cells' absolute positions will be in new places. recompute
- },
-
-
- // Gets the cell underneath the coordinates for the given mouse event
- getCell: function(left, top) {
-
- if (this.coordAdjust) {
- left += this.coordAdjust.left;
- top += this.coordAdjust.top;
- }
-
- return this.coordMap.getCell(left, top);
- }
-
-});
-
-
-// Returns `true` if the cells are identically equal. `false` otherwise.
-// They must have the same row, col, and be from the same grid.
-// Two null values will be considered equal, as two "out of the grid" states are the same.
-function isCellsEqual(cell1, cell2) {
-
- if (!cell1 && !cell2) {
- return true;
- }
-
- if (cell1 && cell2) {
- return cell1.grid === cell2.grid &&
- cell1.row === cell2.row &&
- cell1.col === cell2.col;
- }
-
- return false;
-}
-
-;;
-
-/* Creates a clone of an element and lets it track the mouse as it moves
-----------------------------------------------------------------------------------------------------------------------*/
-
-var MouseFollower = Class.extend({
-
- options: null,
-
- sourceEl: null, // the element that will be cloned and made to look like it is dragging
- el: null, // the clone of `sourceEl` that will track the mouse
- parentEl: null, // the element that `el` (the clone) will be attached to
-
- // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl
- top0: null,
- left0: null,
-
- // the initial position of the mouse
- mouseY0: null,
- mouseX0: null,
-
- // the number of pixels the mouse has moved from its initial position
- topDelta: null,
- leftDelta: null,
-
- mousemoveProxy: null, // document mousemove handler, bound to the MouseFollower's `this`
-
- isFollowing: false,
- isHidden: false,
- isAnimating: false, // doing the revert animation?
-
- constructor: function(sourceEl, options) {
- this.options = options = options || {};
- this.sourceEl = sourceEl;
- this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent
- },
-
-
- // Causes the element to start following the mouse
- start: function(ev) {
- if (!this.isFollowing) {
- this.isFollowing = true;
-
- this.mouseY0 = ev.pageY;
- this.mouseX0 = ev.pageX;
- this.topDelta = 0;
- this.leftDelta = 0;
-
- if (!this.isHidden) {
- this.updatePosition();
- }
-
- $(document).on('mousemove', this.mousemoveProxy = proxy(this, 'mousemove'));
- }
- },
-
-
- // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position.
- // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately.
- stop: function(shouldRevert, callback) {
- var _this = this;
- var revertDuration = this.options.revertDuration;
-
- function complete() {
- this.isAnimating = false;
- _this.removeElement();
-
- this.top0 = this.left0 = null; // reset state for future updatePosition calls
-
- if (callback) {
- callback();
- }
- }
-
- if (this.isFollowing && !this.isAnimating) { // disallow more than one stop animation at a time
- this.isFollowing = false;
-
- $(document).off('mousemove', this.mousemoveProxy);
-
- if (shouldRevert && revertDuration && !this.isHidden) { // do a revert animation?
- this.isAnimating = true;
- this.el.animate({
- top: this.top0,
- left: this.left0
- }, {
- duration: revertDuration,
- complete: complete
- });
- }
- else {
- complete();
- }
- }
- },
-
-
- // Gets the tracking element. Create it if necessary
- getEl: function() {
- var el = this.el;
-
- if (!el) {
- this.sourceEl.width(); // hack to force IE8 to compute correct bounding box
- el = this.el = this.sourceEl.clone()
- .css({
- position: 'absolute',
- visibility: '', // in case original element was hidden (commonly through hideEvents())
- display: this.isHidden ? 'none' : '', // for when initially hidden
- margin: 0,
- right: 'auto', // erase and set width instead
- bottom: 'auto', // erase and set height instead
- width: this.sourceEl.width(), // explicit height in case there was a 'right' value
- height: this.sourceEl.height(), // explicit width in case there was a 'bottom' value
- opacity: this.options.opacity || '',
- zIndex: this.options.zIndex
- })
- .appendTo(this.parentEl);
- }
-
- return el;
- },
-
-
- // Removes the tracking element if it has already been created
- removeElement: function() {
- if (this.el) {
- this.el.remove();
- this.el = null;
- }
- },
-
-
- // Update the CSS position of the tracking element
- updatePosition: function() {
- var sourceOffset;
- var origin;
-
- this.getEl(); // ensure this.el
-
- // make sure origin info was computed
- if (this.top0 === null) {
- this.sourceEl.width(); // hack to force IE8 to compute correct bounding box
- sourceOffset = this.sourceEl.offset();
- origin = this.el.offsetParent().offset();
- this.top0 = sourceOffset.top - origin.top;
- this.left0 = sourceOffset.left - origin.left;
- }
-
- this.el.css({
- top: this.top0 + this.topDelta,
- left: this.left0 + this.leftDelta
- });
- },
-
-
- // Gets called when the user moves the mouse
- mousemove: function(ev) {
- this.topDelta = ev.pageY - this.mouseY0;
- this.leftDelta = ev.pageX - this.mouseX0;
-
- if (!this.isHidden) {
- this.updatePosition();
- }
- },
-
-
- // Temporarily makes the tracking element invisible. Can be called before following starts
- hide: function() {
- if (!this.isHidden) {
- this.isHidden = true;
- if (this.el) {
- this.el.hide();
- }
- }
- },
-
-
- // Show the tracking element after it has been temporarily hidden
- show: function() {
- if (this.isHidden) {
- this.isHidden = false;
- this.updatePosition();
- this.getEl().show();
- }
- }
-
-});
-
-;;
-
-/* A utility class for rendering rows.
-----------------------------------------------------------------------------------------------------------------------*/
-// It leverages methods of the subclass and the View to determine custom rendering behavior for each row "type"
-// (such as highlight rows, day rows, helper rows, etc).
-
-var RowRenderer = Class.extend({
-
- view: null, // a View object
- isRTL: null, // shortcut to the view's isRTL option
- cellHtml: ' ', // plain default HTML used for a cell when no other is available
-
-
- constructor: function(view) {
- this.view = view;
- this.isRTL = view.opt('isRTL');
- },
-
-
- // Renders the HTML for a row, leveraging custom cell-HTML-renderers based on the `rowType`.
- // Also applies the "intro" and "outro" cells, which are specified by the subclass and views.
- // `row` is an optional row number.
- rowHtml: function(rowType, row) {
- var renderCell = this.getHtmlRenderer('cell', rowType);
- var rowCellHtml = '';
- var col;
- var cell;
-
- row = row || 0;
-
- for (col = 0; col < this.colCnt; col++) {
- cell = this.getCell(row, col);
- rowCellHtml += renderCell(cell);
- }
-
- rowCellHtml = this.bookendCells(rowCellHtml, rowType, row); // apply intro and outro
-
- return ' ' + rowCellHtml + ' ';
- },
-
-
- // Applies the "intro" and "outro" HTML to the given cells.
- // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro.
- // `cells` can be an HTML string of 's or a jQuery element
- // `row` is an optional row number.
- bookendCells: function(cells, rowType, row) {
- var intro = this.getHtmlRenderer('intro', rowType)(row || 0);
- var outro = this.getHtmlRenderer('outro', rowType)(row || 0);
- var prependHtml = this.isRTL ? outro : intro;
- var appendHtml = this.isRTL ? intro : outro;
-
- if (typeof cells === 'string') {
- return prependHtml + cells + appendHtml;
- }
- else { // a jQuery element
- return cells.prepend(prependHtml).append(appendHtml);
- }
- },
-
-
- // Returns an HTML-rendering function given a specific `rendererName` (like cell, intro, or outro) and a specific
- // `rowType` (like day, eventSkeleton, helperSkeleton), which is optional.
- // If a renderer for the specific rowType doesn't exist, it will fall back to a generic renderer.
- // We will query the View object first for any custom rendering functions, then the methods of the subclass.
- getHtmlRenderer: function(rendererName, rowType) {
- var view = this.view;
- var generalName; // like "cellHtml"
- var specificName; // like "dayCellHtml". based on rowType
- var provider; // either the View or the RowRenderer subclass, whichever provided the method
- var renderer;
-
- generalName = rendererName + 'Html';
- if (rowType) {
- specificName = rowType + capitaliseFirstLetter(rendererName) + 'Html';
- }
-
- if (specificName && (renderer = view[specificName])) {
- provider = view;
- }
- else if (specificName && (renderer = this[specificName])) {
- provider = this;
- }
- else if ((renderer = view[generalName])) {
- provider = view;
- }
- else if ((renderer = this[generalName])) {
- provider = this;
- }
-
- if (typeof renderer === 'function') {
- return function() {
- return renderer.apply(provider, arguments) || ''; // use correct `this` and always return a string
- };
- }
-
- // the rendered can be a plain string as well. if not specified, always an empty string.
- return function() {
- return renderer || '';
- };
- }
-
-});
-
-;;
-
-/* An abstract class comprised of a "grid" of cells that each represent a specific datetime
-----------------------------------------------------------------------------------------------------------------------*/
-
-var Grid = fc.Grid = RowRenderer.extend({
-
- start: null, // the date of the first cell
- end: null, // the date after the last cell
-
- rowCnt: 0, // number of rows
- colCnt: 0, // number of cols
-
- el: null, // the containing element
- coordMap: null, // a GridCoordMap that converts pixel values to datetimes
- elsByFill: null, // a hash of jQuery element sets used for rendering each fill. Keyed by fill name.
-
- externalDragStartProxy: null, // binds the Grid's scope to externalDragStart (in DayGrid.events)
-
- // derived from options
- colHeadFormat: null, // TODO: move to another class. not applicable to all Grids
- eventTimeFormat: null,
- displayEventTime: null,
- displayEventEnd: null,
-
- // if all cells are the same length of time, the duration they all share. optional.
- // when defined, allows the computeCellRange shortcut, as well as improved resizing behavior.
- cellDuration: null,
-
- // if defined, holds the unit identified (ex: "year" or "month") that determines the level of granularity
- // of the date cells. if not defined, assumes to be day and time granularity.
- largeUnit: null,
-
-
- constructor: function() {
- RowRenderer.apply(this, arguments); // call the super-constructor
-
- this.coordMap = new GridCoordMap(this);
- this.elsByFill = {};
- this.externalDragStartProxy = proxy(this, 'externalDragStart');
- },
-
-
- /* Options
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Generates the format string used for the text in column headers, if not explicitly defined by 'columnFormat'
- // TODO: move to another class. not applicable to all Grids
- computeColHeadFormat: function() {
- // subclasses must implement if they want to use headHtml()
- },
-
-
- // Generates the format string used for event time text, if not explicitly defined by 'timeFormat'
- computeEventTimeFormat: function() {
- return this.view.opt('smallTimeFormat');
- },
-
-
- // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventTime'.
- // Only applies to non-all-day events.
- computeDisplayEventTime: function() {
- return true;
- },
-
-
- // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventEnd'
- computeDisplayEventEnd: function() {
- return true;
- },
-
-
- /* Dates
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Tells the grid about what period of time to display.
- // Any date-related cell system internal data should be generated.
- setRange: function(range) {
- this.start = range.start.clone();
- this.end = range.end.clone();
-
- this.rangeUpdated();
- this.processRangeOptions();
- },
-
-
- // Called when internal variables that rely on the range should be updated
- rangeUpdated: function() {
- },
-
-
- // Updates values that rely on options and also relate to range
- processRangeOptions: function() {
- var view = this.view;
- var displayEventTime;
- var displayEventEnd;
-
- // Populate option-derived settings. Look for override first, then compute if necessary.
- this.colHeadFormat = view.opt('columnFormat') || this.computeColHeadFormat();
-
- this.eventTimeFormat =
- view.opt('eventTimeFormat') ||
- view.opt('timeFormat') || // deprecated
- this.computeEventTimeFormat();
-
- displayEventTime = view.opt('displayEventTime');
- if (displayEventTime == null) {
- displayEventTime = this.computeDisplayEventTime(); // might be based off of range
- }
-
- displayEventEnd = view.opt('displayEventEnd');
- if (displayEventEnd == null) {
- displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range
- }
-
- this.displayEventTime = displayEventTime;
- this.displayEventEnd = displayEventEnd;
- },
-
-
- // Called before the grid's coordinates will need to be queried for cells.
- // Any non-date-related cell system internal data should be built.
- build: function() {
- },
-
-
- // Called after the grid's coordinates are done being relied upon.
- // Any non-date-related cell system internal data should be cleared.
- clear: function() {
- },
-
-
- // Converts a range with an inclusive `start` and an exclusive `end` into an array of segment objects
- rangeToSegs: function(range) {
- // subclasses must implement
- },
-
-
- // Diffs the two dates, returning a duration, based on granularity of the grid
- diffDates: function(a, b) {
- if (this.largeUnit) {
- return diffByUnit(a, b, this.largeUnit);
- }
- else {
- return diffDayTime(a, b);
- }
- },
-
-
- /* Cells
- ------------------------------------------------------------------------------------------------------------------*/
- // NOTE: columns are ordered left-to-right
-
-
- // Gets an object containing row/col number, misc data, and range information about the cell.
- // Accepts row/col values, an object with row/col properties, or a single-number offset from the first cell.
- getCell: function(row, col) {
- var cell;
-
- if (col == null) {
- if (typeof row === 'number') { // a single-number offset
- col = row % this.colCnt;
- row = Math.floor(row / this.colCnt);
- }
- else { // an object with row/col properties
- col = row.col;
- row = row.row;
- }
- }
-
- cell = { row: row, col: col };
-
- $.extend(cell, this.getRowData(row), this.getColData(col));
- $.extend(cell, this.computeCellRange(cell));
-
- return cell;
- },
-
-
- // Given a cell object with index and misc data, generates a range object
- // If the grid is leveraging cellDuration, this doesn't need to be defined. Only computeCellDate does.
- // If being overridden, should return a range with reference-free date copies.
- computeCellRange: function(cell) {
- var date = this.computeCellDate(cell);
-
- return {
- start: date,
- end: date.clone().add(this.cellDuration)
- };
- },
-
-
- // Given a cell, returns its start date. Should return a reference-free date copy.
- computeCellDate: function(cell) {
- // subclasses can implement
- },
-
-
- // Retrieves misc data about the given row
- getRowData: function(row) {
- return {};
- },
-
-
- // Retrieves misc data baout the given column
- getColData: function(col) {
- return {};
- },
-
-
- // Retrieves the element representing the given row
- getRowEl: function(row) {
- // subclasses should implement if leveraging the default getCellDayEl() or computeRowCoords()
- },
-
-
- // Retrieves the element representing the given column
- getColEl: function(col) {
- // subclasses should implement if leveraging the default getCellDayEl() or computeColCoords()
- },
-
-
- // Given a cell object, returns the element that represents the cell's whole-day
- getCellDayEl: function(cell) {
- return this.getColEl(cell.col) || this.getRowEl(cell.row);
- },
-
-
- /* Cell Coordinates
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Computes the top/bottom coordinates of all rows.
- // By default, queries the dimensions of the element provided by getRowEl().
- computeRowCoords: function() {
- var items = [];
- var i, el;
- var top;
-
- for (i = 0; i < this.rowCnt; i++) {
- el = this.getRowEl(i);
- top = el.offset().top;
- items.push({
- top: top,
- bottom: top + el.outerHeight()
- });
- }
-
- return items;
- },
-
-
- // Computes the left/right coordinates of all rows.
- // By default, queries the dimensions of the element provided by getColEl(). Columns can be LTR or RTL.
- computeColCoords: function() {
- var items = [];
- var i, el;
- var left;
-
- for (i = 0; i < this.colCnt; i++) {
- el = this.getColEl(i);
- left = el.offset().left;
- items.push({
- left: left,
- right: left + el.outerWidth()
- });
- }
-
- return items;
- },
-
-
- /* Rendering
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Sets the container element that the grid should render inside of.
- // Does other DOM-related initializations.
- setElement: function(el) {
- var _this = this;
-
- this.el = el;
-
- // attach a handler to the grid's root element.
- // jQuery will take care of unregistering them when removeElement gets called.
- el.on('mousedown', function(ev) {
- if (
- !$(ev.target).is('.fc-event-container *, .fc-more') && // not an an event element, or "more.." link
- !$(ev.target).closest('.fc-popover').length // not on a popover (like the "more.." events one)
- ) {
- _this.dayMousedown(ev);
- }
- });
-
- // attach event-element-related handlers. in Grid.events
- // same garbage collection note as above.
- this.bindSegHandlers();
-
- this.bindGlobalHandlers();
- },
-
-
- // Removes the grid's container element from the DOM. Undoes any other DOM-related attachments.
- // DOES NOT remove any content beforehand (doesn't clear events or call unrenderDates), unlike View
- removeElement: function() {
- this.unbindGlobalHandlers();
-
- this.el.remove();
-
- // NOTE: we don't null-out this.el for the same reasons we don't do it within View::removeElement
- },
-
-
- // Renders the basic structure of grid view before any content is rendered
- renderSkeleton: function() {
- // subclasses should implement
- },
-
-
- // Renders the grid's date-related content (like cells that represent days/times).
- // Assumes setRange has already been called and the skeleton has already been rendered.
- renderDates: function() {
- // subclasses should implement
- },
-
-
- // Unrenders the grid's date-related content
- unrenderDates: function() {
- // subclasses should implement
- },
-
-
- /* Handlers
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Binds DOM handlers to elements that reside outside the grid, such as the document
- bindGlobalHandlers: function() {
- $(document).on('dragstart sortstart', this.externalDragStartProxy); // jqui
- },
-
-
- // Unbinds DOM handlers from elements that reside outside the grid
- unbindGlobalHandlers: function() {
- $(document).off('dragstart sortstart', this.externalDragStartProxy); // jqui
- },
-
-
- // Process a mousedown on an element that represents a day. For day clicking and selecting.
- dayMousedown: function(ev) {
- var _this = this;
- var view = this.view;
- var isSelectable = view.opt('selectable');
- var dayClickCell; // null if invalid dayClick
- var selectionRange; // null if invalid selection
-
- // this listener tracks a mousedown on a day element, and a subsequent drag.
- // if the drag ends on the same day, it is a 'dayClick'.
- // if 'selectable' is enabled, this listener also detects selections.
- var dragListener = new CellDragListener(this.coordMap, {
- //distance: 5, // needs more work if we want dayClick to fire correctly
- scroll: view.opt('dragScroll'),
- dragStart: function() {
- view.unselect(); // since we could be rendering a new selection, we want to clear any old one
- },
- cellOver: function(cell, isOrig, origCell) {
- if (origCell) { // click needs to have started on a cell
- dayClickCell = isOrig ? cell : null; // single-cell selection is a day click
- if (isSelectable) {
- selectionRange = _this.computeSelection(origCell, cell);
- if (selectionRange) {
- _this.renderSelection(selectionRange);
- }
- else {
- disableCursor();
- }
- }
- }
- },
- cellOut: function(cell) {
- dayClickCell = null;
- selectionRange = null;
- _this.unrenderSelection();
- enableCursor();
- },
- listenStop: function(ev) {
- if (dayClickCell) {
- view.triggerDayClick(dayClickCell, _this.getCellDayEl(dayClickCell), ev);
- }
- if (selectionRange) {
- // the selection will already have been rendered. just report it
- view.reportSelection(selectionRange, ev);
- }
- enableCursor();
- }
- });
-
- dragListener.mousedown(ev); // start listening, which will eventually initiate a dragStart
- },
-
-
- /* Event Helper
- ------------------------------------------------------------------------------------------------------------------*/
- // TODO: should probably move this to Grid.events, like we did event dragging / resizing
-
-
- // Renders a mock event over the given range
- renderRangeHelper: function(range, sourceSeg) {
- var fakeEvent = this.fabricateHelperEvent(range, sourceSeg);
-
- this.renderHelper(fakeEvent, sourceSeg); // do the actual rendering
- },
-
-
- // Builds a fake event given a date range it should cover, and a segment is should be inspired from.
- // The range's end can be null, in which case the mock event that is rendered will have a null end time.
- // `sourceSeg` is the internal segment object involved in the drag. If null, something external is dragging.
- fabricateHelperEvent: function(range, sourceSeg) {
- var fakeEvent = sourceSeg ? createObject(sourceSeg.event) : {}; // mask the original event object if possible
-
- fakeEvent.start = range.start.clone();
- fakeEvent.end = range.end ? range.end.clone() : null;
- fakeEvent.allDay = null; // force it to be freshly computed by normalizeEventRange
- this.view.calendar.normalizeEventRange(fakeEvent);
-
- // this extra className will be useful for differentiating real events from mock events in CSS
- fakeEvent.className = (fakeEvent.className || []).concat('fc-helper');
-
- // if something external is being dragged in, don't render a resizer
- if (!sourceSeg) {
- fakeEvent.editable = false;
- }
-
- return fakeEvent;
- },
-
-
- // Renders a mock event
- renderHelper: function(event, sourceSeg) {
- // subclasses must implement
- },
-
-
- // Unrenders a mock event
- unrenderHelper: function() {
- // subclasses must implement
- },
-
-
- /* Selection
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of a selection. Will highlight by default but can be overridden by subclasses.
- renderSelection: function(range) {
- this.renderHighlight(this.selectionRangeToSegs(range));
- },
-
-
- // Unrenders any visual indications of a selection. Will unrender a highlight by default.
- unrenderSelection: function() {
- this.unrenderHighlight();
- },
-
-
- // Given the first and last cells of a selection, returns a range object.
- // Will return something falsy if the selection is invalid (when outside of selectionConstraint for example).
- // Subclasses can override and provide additional data in the range object. Will be passed to renderSelection().
- computeSelection: function(firstCell, lastCell) {
- var dates = [
- firstCell.start,
- firstCell.end,
- lastCell.start,
- lastCell.end
- ];
- var range;
-
- dates.sort(compareNumbers); // sorts chronologically. works with Moments
-
- range = {
- start: dates[0].clone(),
- end: dates[3].clone()
- };
-
- if (!this.view.calendar.isSelectionRangeAllowed(range)) {
- return null;
- }
-
- return range;
- },
-
-
- selectionRangeToSegs: function(range) {
- return this.rangeToSegs(range);
- },
-
-
- /* Highlight
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders an emphasis on the given date range. Given an array of segments.
- renderHighlight: function(segs) {
- this.renderFill('highlight', segs);
- },
-
-
- // Unrenders the emphasis on a date range
- unrenderHighlight: function() {
- this.unrenderFill('highlight');
- },
-
-
- // Generates an array of classNames for rendering the highlight. Used by the fill system.
- highlightSegClasses: function() {
- return [ 'fc-highlight' ];
- },
-
-
- /* Fill System (highlight, background events, business hours)
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a set of rectangles over the given segments of time.
- // MUST RETURN a subset of segs, the segs that were actually rendered.
- // Responsible for populating this.elsByFill. TODO: better API for expressing this requirement
- renderFill: function(type, segs) {
- // subclasses must implement
- },
-
-
- // Unrenders a specific type of fill that is currently rendered on the grid
- unrenderFill: function(type) {
- var el = this.elsByFill[type];
-
- if (el) {
- el.remove();
- delete this.elsByFill[type];
- }
- },
-
-
- // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.
- // Only returns segments that successfully rendered.
- // To be harnessed by renderFill (implemented by subclasses).
- // Analagous to renderFgSegEls.
- renderFillSegEls: function(type, segs) {
- var _this = this;
- var segElMethod = this[type + 'SegEl'];
- var html = '';
- var renderedSegs = [];
- var i;
-
- if (segs.length) {
-
- // build a large concatenation of segment HTML
- for (i = 0; i < segs.length; i++) {
- html += this.fillSegHtml(type, segs[i]);
- }
-
- // Grab individual elements from the combined HTML string. Use each as the default rendering.
- // Then, compute the 'el' for each segment.
- $(html).each(function(i, node) {
- var seg = segs[i];
- var el = $(node);
-
- // allow custom filter methods per-type
- if (segElMethod) {
- el = segElMethod.call(_this, seg, el);
- }
-
- if (el) { // custom filters did not cancel the render
- el = $(el); // allow custom filter to return raw DOM node
-
- // correct element type? (would be bad if a non-TD were inserted into a table for example)
- if (el.is(_this.fillSegTag)) {
- seg.el = el;
- renderedSegs.push(seg);
- }
- }
- });
- }
-
- return renderedSegs;
- },
-
-
- fillSegTag: 'div', // subclasses can override
-
-
- // Builds the HTML needed for one fill segment. Generic enought o work with different types.
- fillSegHtml: function(type, seg) {
-
- // custom hooks per-type
- var classesMethod = this[type + 'SegClasses'];
- var cssMethod = this[type + 'SegCss'];
-
- var classes = classesMethod ? classesMethod.call(this, seg) : [];
- var css = cssToStr(cssMethod ? cssMethod.call(this, seg) : {});
-
- return '<' + this.fillSegTag +
- (classes.length ? ' class="' + classes.join(' ') + '"' : '') +
- (css ? ' style="' + css + '"' : '') +
- ' />';
- },
-
-
- /* Generic rendering utilities for subclasses
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a day-of-week header row.
- // TODO: move to another class. not applicable to all Grids
- headHtml: function() {
- return '' +
- '';
- },
-
-
- // Used by the `headHtml` method, via RowRenderer, for rendering the HTML of a day-of-week header cell
- // TODO: move to another class. not applicable to all Grids
- headCellHtml: function(cell) {
- var view = this.view;
- var date = cell.start;
-
- return '' +
- '' +
- htmlEscape(date.format(this.colHeadFormat)) +
- ' ';
- },
-
-
- // Renders the HTML for a single-day background cell
- bgCellHtml: function(cell) {
- var view = this.view;
- var date = cell.start;
- var classes = this.getDayClasses(date);
-
- classes.unshift('fc-day', view.widgetContentClass);
-
- return ' ';
- },
-
-
- // Computes HTML classNames for a single-day cell
- getDayClasses: function(date) {
- var view = this.view;
- var today = view.calendar.getNow().stripTime();
- var classes = [ 'fc-' + dayIDs[date.day()] ];
-
- if (
- view.intervalDuration.as('months') == 1 &&
- date.month() != view.intervalStart.month()
- ) {
- classes.push('fc-other-month');
- }
-
- if (date.isSame(today, 'day')) {
- classes.push(
- 'fc-today',
- view.highlightStateClass
- );
- }
- else if (date < today) {
- classes.push('fc-past');
- }
- else {
- classes.push('fc-future');
- }
-
- return classes;
- }
-
-});
-
-;;
-
-/* Event-rendering and event-interaction methods for the abstract Grid class
-----------------------------------------------------------------------------------------------------------------------*/
-
-Grid.mixin({
-
- mousedOverSeg: null, // the segment object the user's mouse is over. null if over nothing
- isDraggingSeg: false, // is a segment being dragged? boolean
- isResizingSeg: false, // is a segment being resized? boolean
- isDraggingExternal: false, // jqui-dragging an external element? boolean
- segs: null, // the event segments currently rendered in the grid
-
-
- // Renders the given events onto the grid
- renderEvents: function(events) {
- var segs = this.eventsToSegs(events);
- var bgSegs = [];
- var fgSegs = [];
- var i, seg;
-
- for (i = 0; i < segs.length; i++) {
- seg = segs[i];
-
- if (isBgEvent(seg.event)) {
- bgSegs.push(seg);
- }
- else {
- fgSegs.push(seg);
- }
- }
-
- // Render each different type of segment.
- // Each function may return a subset of the segs, segs that were actually rendered.
- bgSegs = this.renderBgSegs(bgSegs) || bgSegs;
- fgSegs = this.renderFgSegs(fgSegs) || fgSegs;
-
- this.segs = bgSegs.concat(fgSegs);
- },
-
-
- // Unrenders all events currently rendered on the grid
- unrenderEvents: function() {
- this.triggerSegMouseout(); // trigger an eventMouseout if user's mouse is over an event
-
- this.unrenderFgSegs();
- this.unrenderBgSegs();
-
- this.segs = null;
- },
-
-
- // Retrieves all rendered segment objects currently rendered on the grid
- getEventSegs: function() {
- return this.segs || [];
- },
-
-
- /* Foreground Segment Rendering
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders foreground event segments onto the grid. May return a subset of segs that were rendered.
- renderFgSegs: function(segs) {
- // subclasses must implement
- },
-
-
- // Unrenders all currently rendered foreground segments
- unrenderFgSegs: function() {
- // subclasses must implement
- },
-
-
- // Renders and assigns an `el` property for each foreground event segment.
- // Only returns segments that successfully rendered.
- // A utility that subclasses may use.
- renderFgSegEls: function(segs, disableResizing) {
- var view = this.view;
- var html = '';
- var renderedSegs = [];
- var i;
-
- if (segs.length) { // don't build an empty html string
-
- // build a large concatenation of event segment HTML
- for (i = 0; i < segs.length; i++) {
- html += this.fgSegHtml(segs[i], disableResizing);
- }
-
- // Grab individual elements from the combined HTML string. Use each as the default rendering.
- // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.
- $(html).each(function(i, node) {
- var seg = segs[i];
- var el = view.resolveEventEl(seg.event, $(node));
-
- if (el) {
- el.data('fc-seg', seg); // used by handlers
- seg.el = el;
- renderedSegs.push(seg);
- }
- });
- }
-
- return renderedSegs;
- },
-
-
- // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls()
- fgSegHtml: function(seg, disableResizing) {
- // subclasses should implement
- },
-
-
- /* Background Segment Rendering
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders the given background event segments onto the grid.
- // Returns a subset of the segs that were actually rendered.
- renderBgSegs: function(segs) {
- return this.renderFill('bgEvent', segs);
- },
-
-
- // Unrenders all the currently rendered background event segments
- unrenderBgSegs: function() {
- this.unrenderFill('bgEvent');
- },
-
-
- // Renders a background event element, given the default rendering. Called by the fill system.
- bgEventSegEl: function(seg, el) {
- return this.view.resolveEventEl(seg.event, el); // will filter through eventRender
- },
-
-
- // Generates an array of classNames to be used for the default rendering of a background event.
- // Called by the fill system.
- bgEventSegClasses: function(seg) {
- var event = seg.event;
- var source = event.source || {};
-
- return [ 'fc-bgevent' ].concat(
- event.className,
- source.className || []
- );
- },
-
-
- // Generates a semicolon-separated CSS string to be used for the default rendering of a background event.
- // Called by the fill system.
- // TODO: consolidate with getEventSkinCss?
- bgEventSegCss: function(seg) {
- var view = this.view;
- var event = seg.event;
- var source = event.source || {};
-
- return {
- 'background-color':
- event.backgroundColor ||
- event.color ||
- source.backgroundColor ||
- source.color ||
- view.opt('eventBackgroundColor') ||
- view.opt('eventColor')
- };
- },
-
-
- // Generates an array of classNames to be used for the rendering business hours overlay. Called by the fill system.
- businessHoursSegClasses: function(seg) {
- return [ 'fc-nonbusiness', 'fc-bgevent' ];
- },
-
-
- /* Handlers
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Attaches event-element-related handlers to the container element and leverage bubbling
- bindSegHandlers: function() {
- var _this = this;
- var view = this.view;
-
- $.each(
- {
- mouseenter: function(seg, ev) {
- _this.triggerSegMouseover(seg, ev);
- },
- mouseleave: function(seg, ev) {
- _this.triggerSegMouseout(seg, ev);
- },
- click: function(seg, ev) {
- return view.trigger('eventClick', this, seg.event, ev); // can return `false` to cancel
- },
- mousedown: function(seg, ev) {
- if ($(ev.target).is('.fc-resizer') && view.isEventResizable(seg.event)) {
- _this.segResizeMousedown(seg, ev, $(ev.target).is('.fc-start-resizer'));
- }
- else if (view.isEventDraggable(seg.event)) {
- _this.segDragMousedown(seg, ev);
- }
- }
- },
- function(name, func) {
- // attach the handler to the container element and only listen for real event elements via bubbling
- _this.el.on(name, '.fc-event-container > *', function(ev) {
- var seg = $(this).data('fc-seg'); // grab segment data. put there by View::renderEvents
-
- // only call the handlers if there is not a drag/resize in progress
- if (seg && !_this.isDraggingSeg && !_this.isResizingSeg) {
- return func.call(this, seg, ev); // `this` will be the event element
- }
- });
- }
- );
- },
-
-
- // Updates internal state and triggers handlers for when an event element is moused over
- triggerSegMouseover: function(seg, ev) {
- if (!this.mousedOverSeg) {
- this.mousedOverSeg = seg;
- this.view.trigger('eventMouseover', seg.el[0], seg.event, ev);
- }
- },
-
-
- // Updates internal state and triggers handlers for when an event element is moused out.
- // Can be given no arguments, in which case it will mouseout the segment that was previously moused over.
- triggerSegMouseout: function(seg, ev) {
- ev = ev || {}; // if given no args, make a mock mouse event
-
- if (this.mousedOverSeg) {
- seg = seg || this.mousedOverSeg; // if given no args, use the currently moused-over segment
- this.mousedOverSeg = null;
- this.view.trigger('eventMouseout', seg.el[0], seg.event, ev);
- }
- },
-
-
- /* Event Dragging
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Called when the user does a mousedown on an event, which might lead to dragging.
- // Generic enough to work with any type of Grid.
- segDragMousedown: function(seg, ev) {
- var _this = this;
- var view = this.view;
- var calendar = view.calendar;
- var el = seg.el;
- var event = seg.event;
- var dropLocation;
-
- // A clone of the original element that will move with the mouse
- var mouseFollower = new MouseFollower(seg.el, {
- parentEl: view.el,
- opacity: view.opt('dragOpacity'),
- revertDuration: view.opt('dragRevertDuration'),
- zIndex: 2 // one above the .fc-view
- });
-
- // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents
- // of the view.
- var dragListener = new CellDragListener(view.coordMap, {
- distance: 5,
- scroll: view.opt('dragScroll'),
- subjectEl: el,
- subjectCenter: true,
- listenStart: function(ev) {
- mouseFollower.hide(); // don't show until we know this is a real drag
- mouseFollower.start(ev);
- },
- dragStart: function(ev) {
- _this.triggerSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported
- _this.segDragStart(seg, ev);
- view.hideEvent(event); // hide all event segments. our mouseFollower will take over
- },
- cellOver: function(cell, isOrig, origCell) {
-
- // starting cell could be forced (DayGrid.limit)
- if (seg.cell) {
- origCell = seg.cell;
- }
-
- dropLocation = _this.computeEventDrop(origCell, cell, event);
-
- if (dropLocation && !calendar.isEventRangeAllowed(dropLocation, event)) {
- disableCursor();
- dropLocation = null;
- }
-
- // if a valid drop location, have the subclass render a visual indication
- if (dropLocation && view.renderDrag(dropLocation, seg)) {
- mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own
- }
- else {
- mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping)
- }
-
- if (isOrig) {
- dropLocation = null; // needs to have moved cells to be a valid drop
- }
- },
- cellOut: function() { // called before mouse moves to a different cell OR moved out of all cells
- view.unrenderDrag(); // unrender whatever was done in renderDrag
- mouseFollower.show(); // show in case we are moving out of all cells
- dropLocation = null;
- },
- cellDone: function() { // Called after a cellOut OR before a dragStop
- enableCursor();
- },
- dragStop: function(ev) {
- // do revert animation if hasn't changed. calls a callback when finished (whether animation or not)
- mouseFollower.stop(!dropLocation, function() {
- view.unrenderDrag();
- view.showEvent(event);
- _this.segDragStop(seg, ev);
-
- if (dropLocation) {
- view.reportEventDrop(event, dropLocation, this.largeUnit, el, ev);
- }
- });
- },
- listenStop: function() {
- mouseFollower.stop(); // put in listenStop in case there was a mousedown but the drag never started
- }
- });
-
- dragListener.mousedown(ev); // start listening, which will eventually lead to a dragStart
- },
-
-
- // Called before event segment dragging starts
- segDragStart: function(seg, ev) {
- this.isDraggingSeg = true;
- this.view.trigger('eventDragStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
- },
-
-
- // Called after event segment dragging stops
- segDragStop: function(seg, ev) {
- this.isDraggingSeg = false;
- this.view.trigger('eventDragStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
- },
-
-
- // Given the cell an event drag began, and the cell event was dropped, calculates the new start/end/allDay
- // values for the event. Subclasses may override and set additional properties to be used by renderDrag.
- // A falsy returned value indicates an invalid drop.
- computeEventDrop: function(startCell, endCell, event) {
- var calendar = this.view.calendar;
- var dragStart = startCell.start;
- var dragEnd = endCell.start;
- var delta;
- var dropLocation;
-
- if (dragStart.hasTime() === dragEnd.hasTime()) {
- delta = this.diffDates(dragEnd, dragStart);
-
- // if an all-day event was in a timed area and it was dragged to a different time,
- // guarantee an end and adjust start/end to have times
- if (event.allDay && durationHasTime(delta)) {
- dropLocation = {
- start: event.start.clone(),
- end: calendar.getEventEnd(event), // will be an ambig day
- allDay: false // for normalizeEventRangeTimes
- };
- calendar.normalizeEventRangeTimes(dropLocation);
- }
- // othewise, work off existing values
- else {
- dropLocation = {
- start: event.start.clone(),
- end: event.end ? event.end.clone() : null,
- allDay: event.allDay // keep it the same
- };
- }
-
- dropLocation.start.add(delta);
- if (dropLocation.end) {
- dropLocation.end.add(delta);
- }
- }
- else {
- // if switching from day <-> timed, start should be reset to the dropped date, and the end cleared
- dropLocation = {
- start: dragEnd.clone(),
- end: null, // end should be cleared
- allDay: !dragEnd.hasTime()
- };
- }
-
- return dropLocation;
- },
-
-
- // Utility for apply dragOpacity to a jQuery set
- applyDragOpacity: function(els) {
- var opacity = this.view.opt('dragOpacity');
-
- if (opacity != null) {
- els.each(function(i, node) {
- // Don't use jQuery (will set an IE filter), do it the old fashioned way.
- // In IE8, a helper element will disappears if there's a filter.
- node.style.opacity = opacity;
- });
- }
- },
-
-
- /* External Element Dragging
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Called when a jQuery UI drag is initiated anywhere in the DOM
- externalDragStart: function(ev, ui) {
- var view = this.view;
- var el;
- var accept;
-
- if (view.opt('droppable')) { // only listen if this setting is on
- el = $((ui ? ui.item : null) || ev.target);
-
- // Test that the dragged element passes the dropAccept selector or filter function.
- // FYI, the default is "*" (matches all)
- accept = view.opt('dropAccept');
- if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) {
- if (!this.isDraggingExternal) { // prevent double-listening if fired twice
- this.listenToExternalDrag(el, ev, ui);
- }
- }
- }
- },
-
-
- // Called when a jQuery UI drag starts and it needs to be monitored for cell dropping
- listenToExternalDrag: function(el, ev, ui) {
- var _this = this;
- var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create
- var dragListener;
- var dropLocation; // a null value signals an unsuccessful drag
-
- // listener that tracks mouse movement over date-associated pixel regions
- dragListener = new CellDragListener(this.coordMap, {
- listenStart: function() {
- _this.isDraggingExternal = true;
- },
- cellOver: function(cell) {
- dropLocation = _this.computeExternalDrop(cell, meta);
- if (dropLocation) {
- _this.renderDrag(dropLocation); // called without a seg parameter
- }
- else { // invalid drop cell
- disableCursor();
- }
- },
- cellOut: function() {
- dropLocation = null; // signal unsuccessful
- _this.unrenderDrag();
- enableCursor();
- },
- dragStop: function() {
- _this.unrenderDrag();
- enableCursor();
-
- if (dropLocation) { // element was dropped on a valid date/time cell
- _this.view.reportExternalDrop(meta, dropLocation, el, ev, ui);
- }
- },
- listenStop: function() {
- _this.isDraggingExternal = false;
- }
- });
-
- dragListener.startDrag(ev); // start listening immediately
- },
-
-
- // Given a cell to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object),
- // returns start/end dates for the event that would result from the hypothetical drop. end might be null.
- // Returning a null value signals an invalid drop cell.
- computeExternalDrop: function(cell, meta) {
- var dropLocation = {
- start: cell.start.clone(),
- end: null
- };
-
- // if dropped on an all-day cell, and element's metadata specified a time, set it
- if (meta.startTime && !dropLocation.start.hasTime()) {
- dropLocation.start.time(meta.startTime);
- }
-
- if (meta.duration) {
- dropLocation.end = dropLocation.start.clone().add(meta.duration);
- }
-
- if (!this.view.calendar.isExternalDropRangeAllowed(dropLocation, meta.eventProps)) {
- return null;
- }
-
- return dropLocation;
- },
-
-
-
- /* Drag Rendering (for both events and an external elements)
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of an event or external element being dragged.
- // `dropLocation` contains hypothetical start/end/allDay values the event would have if dropped. end can be null.
- // `seg` is the internal segment object that is being dragged. If dragging an external element, `seg` is null.
- // A truthy returned value indicates this method has rendered a helper element.
- renderDrag: function(dropLocation, seg) {
- // subclasses must implement
- },
-
-
- // Unrenders a visual indication of an event or external element being dragged
- unrenderDrag: function() {
- // subclasses must implement
- },
-
-
- /* Resizing
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Called when the user does a mousedown on an event's resizer, which might lead to resizing.
- // Generic enough to work with any type of Grid.
- segResizeMousedown: function(seg, ev, isStart) {
- var _this = this;
- var view = this.view;
- var calendar = view.calendar;
- var el = seg.el;
- var event = seg.event;
- var eventEnd = calendar.getEventEnd(event);
- var dragListener;
- var resizeLocation; // falsy if invalid resize
-
- // Tracks mouse movement over the *grid's* coordinate map
- dragListener = new CellDragListener(this.coordMap, {
- distance: 5,
- scroll: view.opt('dragScroll'),
- subjectEl: el,
- dragStart: function(ev) {
- _this.triggerSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported
- _this.segResizeStart(seg, ev);
- },
- cellOver: function(cell, isOrig, origCell) {
- resizeLocation = isStart ?
- _this.computeEventStartResize(origCell, cell, event) :
- _this.computeEventEndResize(origCell, cell, event);
-
- if (resizeLocation) {
- if (!calendar.isEventRangeAllowed(resizeLocation, event)) {
- disableCursor();
- resizeLocation = null;
- }
- // no change? (TODO: how does this work with timezones?)
- else if (resizeLocation.start.isSame(event.start) && resizeLocation.end.isSame(eventEnd)) {
- resizeLocation = null;
- }
- }
-
- if (resizeLocation) {
- view.hideEvent(event);
- _this.renderEventResize(resizeLocation, seg);
- }
- },
- cellOut: function() { // called before mouse moves to a different cell OR moved out of all cells
- resizeLocation = null;
- },
- cellDone: function() { // resets the rendering to show the original event
- _this.unrenderEventResize();
- view.showEvent(event);
- enableCursor();
- },
- dragStop: function(ev) {
- _this.segResizeStop(seg, ev);
-
- if (resizeLocation) { // valid date to resize to?
- view.reportEventResize(event, resizeLocation, this.largeUnit, el, ev);
- }
- }
- });
-
- dragListener.mousedown(ev); // start listening, which will eventually lead to a dragStart
- },
-
-
- // Called before event segment resizing starts
- segResizeStart: function(seg, ev) {
- this.isResizingSeg = true;
- this.view.trigger('eventResizeStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
- },
-
-
- // Called after event segment resizing stops
- segResizeStop: function(seg, ev) {
- this.isResizingSeg = false;
- this.view.trigger('eventResizeStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy
- },
-
-
- // Returns new date-information for an event segment being resized from its start
- computeEventStartResize: function(startCell, endCell, event) {
- return this.computeEventResize('start', startCell, endCell, event);
- },
-
-
- // Returns new date-information for an event segment being resized from its end
- computeEventEndResize: function(startCell, endCell, event) {
- return this.computeEventResize('end', startCell, endCell, event);
- },
-
-
- // Returns new date-information for an event segment being resized from its start OR end
- // `type` is either 'start' or 'end'
- computeEventResize: function(type, startCell, endCell, event) {
- var calendar = this.view.calendar;
- var delta = this.diffDates(endCell[type], startCell[type]);
- var range;
- var defaultDuration;
-
- // build original values to work from, guaranteeing a start and end
- range = {
- start: event.start.clone(),
- end: calendar.getEventEnd(event),
- allDay: event.allDay
- };
-
- // if an all-day event was in a timed area and was resized to a time, adjust start/end to have times
- if (range.allDay && durationHasTime(delta)) {
- range.allDay = false;
- calendar.normalizeEventRangeTimes(range);
- }
-
- range[type].add(delta); // apply delta to start or end
-
- // if the event was compressed too small, find a new reasonable duration for it
- if (!range.start.isBefore(range.end)) {
-
- defaultDuration = event.allDay ?
- calendar.defaultAllDayEventDuration :
- calendar.defaultTimedEventDuration;
-
- // between the cell's duration and the event's default duration, use the smaller of the two.
- // example: if year-length slots, and compressed to one slot, we don't want the event to be a year long
- if (this.cellDuration && this.cellDuration < defaultDuration) {
- defaultDuration = this.cellDuration;
- }
-
- if (type == 'start') { // resizing the start?
- range.start = range.end.clone().subtract(defaultDuration);
- }
- else { // resizing the end?
- range.end = range.start.clone().add(defaultDuration);
- }
- }
-
- return range;
- },
-
-
- // Renders a visual indication of an event being resized.
- // `range` has the updated dates of the event. `seg` is the original segment object involved in the drag.
- renderEventResize: function(range, seg) {
- // subclasses must implement
- },
-
-
- // Unrenders a visual indication of an event being resized.
- unrenderEventResize: function() {
- // subclasses must implement
- },
-
-
- /* Rendering Utils
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Compute the text that should be displayed on an event's element.
- // `range` can be the Event object itself, or something range-like, with at least a `start`.
- // If event times are disabled, or the event has no time, will return a blank string.
- // If not specified, formatStr will default to the eventTimeFormat setting,
- // and displayEnd will default to the displayEventEnd setting.
- getEventTimeText: function(range, formatStr, displayEnd) {
-
- if (formatStr == null) {
- formatStr = this.eventTimeFormat;
- }
-
- if (displayEnd == null) {
- displayEnd = this.displayEventEnd;
- }
-
- if (this.displayEventTime && range.start.hasTime()) {
- if (displayEnd && range.end) {
- return this.view.formatRange(range, formatStr);
- }
- else {
- return range.start.format(formatStr);
- }
- }
-
- return '';
- },
-
-
- // Generic utility for generating the HTML classNames for an event segment's element
- getSegClasses: function(seg, isDraggable, isResizable) {
- var event = seg.event;
- var classes = [
- 'fc-event',
- seg.isStart ? 'fc-start' : 'fc-not-start',
- seg.isEnd ? 'fc-end' : 'fc-not-end'
- ].concat(
- event.className,
- event.source ? event.source.className : []
- );
-
- if (isDraggable) {
- classes.push('fc-draggable');
- }
- if (isResizable) {
- classes.push('fc-resizable');
- }
-
- return classes;
- },
-
-
- // Utility for generating event skin-related CSS properties
- getEventSkinCss: function(event) {
- var view = this.view;
- var source = event.source || {};
- var eventColor = event.color;
- var sourceColor = source.color;
- var optionColor = view.opt('eventColor');
-
- return {
- 'background-color':
- event.backgroundColor ||
- eventColor ||
- source.backgroundColor ||
- sourceColor ||
- view.opt('eventBackgroundColor') ||
- optionColor,
- 'border-color':
- event.borderColor ||
- eventColor ||
- source.borderColor ||
- sourceColor ||
- view.opt('eventBorderColor') ||
- optionColor,
- color:
- event.textColor ||
- source.textColor ||
- view.opt('eventTextColor')
- };
- },
-
-
- /* Converting events -> ranges -> segs
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Converts an array of event objects into an array of event segment objects.
- // A custom `rangeToSegsFunc` may be given for arbitrarily slicing up events.
- // Doesn't guarantee an order for the resulting array.
- eventsToSegs: function(events, rangeToSegsFunc) {
- var eventRanges = this.eventsToRanges(events);
- var segs = [];
- var i;
-
- for (i = 0; i < eventRanges.length; i++) {
- segs.push.apply(
- segs,
- this.eventRangeToSegs(eventRanges[i], rangeToSegsFunc)
- );
- }
-
- return segs;
- },
-
-
- // Converts an array of events into an array of "range" objects.
- // A "range" object is a plain object with start/end properties denoting the time it covers. Also an event property.
- // For "normal" events, this will be identical to the event's start/end, but for "inverse-background" events,
- // will create an array of ranges that span the time *not* covered by the given event.
- // Doesn't guarantee an order for the resulting array.
- eventsToRanges: function(events) {
- var _this = this;
- var eventsById = groupEventsById(events);
- var ranges = [];
-
- // group by ID so that related inverse-background events can be rendered together
- $.each(eventsById, function(id, eventGroup) {
- if (eventGroup.length) {
- ranges.push.apply(
- ranges,
- isInverseBgEvent(eventGroup[0]) ?
- _this.eventsToInverseRanges(eventGroup) :
- _this.eventsToNormalRanges(eventGroup)
- );
- }
- });
-
- return ranges;
- },
-
-
- // Converts an array of "normal" events (not inverted rendering) into a parallel array of ranges
- eventsToNormalRanges: function(events) {
- var calendar = this.view.calendar;
- var ranges = [];
- var i, event;
- var eventStart, eventEnd;
-
- for (i = 0; i < events.length; i++) {
- event = events[i];
-
- // make copies and normalize by stripping timezone
- eventStart = event.start.clone().stripZone();
- eventEnd = calendar.getEventEnd(event).stripZone();
-
- ranges.push({
- event: event,
- start: eventStart,
- end: eventEnd,
- eventStartMS: +eventStart,
- eventDurationMS: eventEnd - eventStart
- });
- }
-
- return ranges;
- },
-
-
- // Converts an array of events, with inverse-background rendering, into an array of range objects.
- // The range objects will cover all the time NOT covered by the events.
- eventsToInverseRanges: function(events) {
- var view = this.view;
- var viewStart = view.start.clone().stripZone(); // normalize timezone
- var viewEnd = view.end.clone().stripZone(); // normalize timezone
- var normalRanges = this.eventsToNormalRanges(events); // will give us normalized dates we can use w/o copies
- var inverseRanges = [];
- var event0 = events[0]; // assign this to each range's `.event`
- var start = viewStart; // the end of the previous range. the start of the new range
- var i, normalRange;
-
- // ranges need to be in order. required for our date-walking algorithm
- normalRanges.sort(compareNormalRanges);
-
- for (i = 0; i < normalRanges.length; i++) {
- normalRange = normalRanges[i];
-
- // add the span of time before the event (if there is any)
- if (normalRange.start > start) { // compare millisecond time (skip any ambig logic)
- inverseRanges.push({
- event: event0,
- start: start,
- end: normalRange.start
- });
- }
-
- start = normalRange.end;
- }
-
- // add the span of time after the last event (if there is any)
- if (start < viewEnd) { // compare millisecond time (skip any ambig logic)
- inverseRanges.push({
- event: event0,
- start: start,
- end: viewEnd
- });
- }
-
- return inverseRanges;
- },
-
-
- // Slices the given event range into one or more segment objects.
- // A `rangeToSegsFunc` custom slicing function can be given.
- eventRangeToSegs: function(eventRange, rangeToSegsFunc) {
- var segs;
- var i, seg;
-
- eventRange = this.view.calendar.ensureVisibleEventRange(eventRange);
-
- if (rangeToSegsFunc) {
- segs = rangeToSegsFunc(eventRange);
- }
- else {
- segs = this.rangeToSegs(eventRange); // defined by the subclass
- }
-
- for (i = 0; i < segs.length; i++) {
- seg = segs[i];
- seg.event = eventRange.event;
- seg.eventStartMS = eventRange.eventStartMS;
- seg.eventDurationMS = eventRange.eventDurationMS;
- }
-
- return segs;
- },
-
-
- sortSegs: function(segs) {
- segs.sort(proxy(this, 'compareSegs'));
- },
-
-
- // A cmp function for determining which segments should take visual priority
- // DOES NOT WORK ON INVERTED BACKGROUND EVENTS because they have no eventStartMS/eventDurationMS
- compareSegs: function(seg1, seg2) {
- return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first
- seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first
- seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1)
- compareByFieldSpecs(seg1.event, seg2.event, this.view.eventOrderSpecs);
- }
-
-});
-
-
-/* Utilities
-----------------------------------------------------------------------------------------------------------------------*/
-
-
-function isBgEvent(event) { // returns true if background OR inverse-background
- var rendering = getEventRendering(event);
- return rendering === 'background' || rendering === 'inverse-background';
-}
-
-
-function isInverseBgEvent(event) {
- return getEventRendering(event) === 'inverse-background';
-}
-
-
-function getEventRendering(event) {
- return firstDefined((event.source || {}).rendering, event.rendering);
-}
-
-
-function groupEventsById(events) {
- var eventsById = {};
- var i, event;
-
- for (i = 0; i < events.length; i++) {
- event = events[i];
- (eventsById[event._id] || (eventsById[event._id] = [])).push(event);
- }
-
- return eventsById;
-}
-
-
-// A cmp function for determining which non-inverted "ranges" (see above) happen earlier
-function compareNormalRanges(range1, range2) {
- return range1.eventStartMS - range2.eventStartMS; // earlier ranges go first
-}
-
-
-/* External-Dragging-Element Data
-----------------------------------------------------------------------------------------------------------------------*/
-
-// Require all HTML5 data-* attributes used by FullCalendar to have this prefix.
-// A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event.
-fc.dataAttrPrefix = '';
-
-// Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure
-// to be used for Event Object creation.
-// A defined `.eventProps`, even when empty, indicates that an event should be created.
-function getDraggedElMeta(el) {
- var prefix = fc.dataAttrPrefix;
- var eventProps; // properties for creating the event, not related to date/time
- var startTime; // a Duration
- var duration;
- var stick;
-
- if (prefix) { prefix += '-'; }
- eventProps = el.data(prefix + 'event') || null;
-
- if (eventProps) {
- if (typeof eventProps === 'object') {
- eventProps = $.extend({}, eventProps); // make a copy
- }
- else { // something like 1 or true. still signal event creation
- eventProps = {};
- }
-
- // pluck special-cased date/time properties
- startTime = eventProps.start;
- if (startTime == null) { startTime = eventProps.time; } // accept 'time' as well
- duration = eventProps.duration;
- stick = eventProps.stick;
- delete eventProps.start;
- delete eventProps.time;
- delete eventProps.duration;
- delete eventProps.stick;
- }
-
- // fallback to standalone attribute values for each of the date/time properties
- if (startTime == null) { startTime = el.data(prefix + 'start'); }
- if (startTime == null) { startTime = el.data(prefix + 'time'); } // accept 'time' as well
- if (duration == null) { duration = el.data(prefix + 'duration'); }
- if (stick == null) { stick = el.data(prefix + 'stick'); }
-
- // massage into correct data types
- startTime = startTime != null ? moment.duration(startTime) : null;
- duration = duration != null ? moment.duration(duration) : null;
- stick = Boolean(stick);
-
- return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick };
-}
-
-
-;;
-
-/* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week.
-----------------------------------------------------------------------------------------------------------------------*/
-
-var DayGrid = Grid.extend({
-
- numbersVisible: false, // should render a row for day/week numbers? set by outside view. TODO: make internal
- bottomCoordPadding: 0, // hack for extending the hit area for the last row of the coordinate grid
- breakOnWeeks: null, // should create a new row for each week? set by outside view
-
- cellDates: null, // flat chronological array of each cell's dates
- dayToCellOffsets: null, // maps days offsets from grid's start date, to cell offsets
-
- rowEls: null, // set of fake row elements
- dayEls: null, // set of whole-day elements comprising the row's background
- helperEls: null, // set of cell skeleton elements for rendering the mock event "helper"
-
-
- constructor: function() {
- Grid.apply(this, arguments);
-
- this.cellDuration = moment.duration(1, 'day'); // for Grid system
- },
-
-
- // Renders the rows and columns into the component's `this.el`, which should already be assigned.
- // isRigid determins whether the individual rows should ignore the contents and be a constant height.
- // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient.
- renderDates: function(isRigid) {
- var view = this.view;
- var rowCnt = this.rowCnt;
- var colCnt = this.colCnt;
- var cellCnt = rowCnt * colCnt;
- var html = '';
- var row;
- var i, cell;
-
- for (row = 0; row < rowCnt; row++) {
- html += this.dayRowHtml(row, isRigid);
- }
- this.el.html(html);
-
- this.rowEls = this.el.find('.fc-row');
- this.dayEls = this.el.find('.fc-day');
-
- // trigger dayRender with each cell's element
- for (i = 0; i < cellCnt; i++) {
- cell = this.getCell(i);
- view.trigger('dayRender', null, cell.start, this.dayEls.eq(i));
- }
- },
-
-
- unrenderDates: function() {
- this.removeSegPopover();
- },
-
-
- renderBusinessHours: function() {
- var events = this.view.calendar.getBusinessHoursEvents(true); // wholeDay=true
- var segs = this.eventsToSegs(events);
-
- this.renderFill('businessHours', segs, 'bgevent');
- },
-
-
- // Generates the HTML for a single row. `row` is the row number.
- dayRowHtml: function(row, isRigid) {
- var view = this.view;
- var classes = [ 'fc-row', 'fc-week', view.widgetContentClass ];
-
- if (isRigid) {
- classes.push('fc-rigid');
- }
-
- return '' +
- '' +
- '' +
- '' +
- this.rowHtml('day', row) + // leverages RowRenderer. calls dayCellHtml()
- '
' +
- '' +
- '' +
- '' +
- (this.numbersVisible ?
- '' +
- this.rowHtml('number', row) + // leverages RowRenderer. View will define render method
- '' :
- ''
- ) +
- '
' +
- '' +
- '';
- },
-
-
- // Renders the HTML for a whole-day cell. Will eventually end up in the day-row's background.
- // We go through a 'day' row type instead of just doing a 'bg' row type so that the View can do custom rendering
- // specifically for whole-day rows, whereas a 'bg' might also be used for other purposes (TimeGrid bg for example).
- dayCellHtml: function(cell) {
- return this.bgCellHtml(cell);
- },
-
-
- /* Options
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Computes a default column header formatting string if `colFormat` is not explicitly defined
- computeColHeadFormat: function() {
- if (this.rowCnt > 1) { // more than one week row. day numbers will be in each cell
- return 'ddd'; // "Sat"
- }
- else if (this.colCnt > 1) { // multiple days, so full single date string WON'T be in title text
- return this.view.opt('dayOfMonthFormat'); // "Sat 12/10"
- }
- else { // single day, so full single date string will probably be in title text
- return 'dddd'; // "Saturday"
- }
- },
-
-
- // Computes a default event time formatting string if `timeFormat` is not explicitly defined
- computeEventTimeFormat: function() {
- return this.view.opt('extraSmallTimeFormat'); // like "6p" or "6:30p"
- },
-
-
- // Computes a default `displayEventEnd` value if one is not expliclty defined
- computeDisplayEventEnd: function() {
- return this.colCnt == 1; // we'll likely have space if there's only one day
- },
-
-
- /* Cell System
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- rangeUpdated: function() {
- var cellDates;
- var firstDay;
- var rowCnt;
- var colCnt;
-
- this.updateCellDates(); // populates cellDates and dayToCellOffsets
- cellDates = this.cellDates;
-
- if (this.breakOnWeeks) {
- // count columns until the day-of-week repeats
- firstDay = cellDates[0].day();
- for (colCnt = 1; colCnt < cellDates.length; colCnt++) {
- if (cellDates[colCnt].day() == firstDay) {
- break;
- }
- }
- rowCnt = Math.ceil(cellDates.length / colCnt);
- }
- else {
- rowCnt = 1;
- colCnt = cellDates.length;
- }
-
- this.rowCnt = rowCnt;
- this.colCnt = colCnt;
- },
-
-
- // Populates cellDates and dayToCellOffsets
- updateCellDates: function() {
- var view = this.view;
- var date = this.start.clone();
- var dates = [];
- var offset = -1;
- var offsets = [];
-
- while (date.isBefore(this.end)) { // loop each day from start to end
- if (view.isHiddenDay(date)) {
- offsets.push(offset + 0.5); // mark that it's between offsets
- }
- else {
- offset++;
- offsets.push(offset);
- dates.push(date.clone());
- }
- date.add(1, 'days');
- }
-
- this.cellDates = dates;
- this.dayToCellOffsets = offsets;
- },
-
-
- // Given a cell object, generates its start date. Returns a reference-free copy.
- computeCellDate: function(cell) {
- var colCnt = this.colCnt;
- var index = cell.row * colCnt + (this.isRTL ? colCnt - cell.col - 1 : cell.col);
-
- return this.cellDates[index].clone();
- },
-
-
- // Retrieves the element representing the given row
- getRowEl: function(row) {
- return this.rowEls.eq(row);
- },
-
-
- // Retrieves the element representing the given column
- getColEl: function(col) {
- return this.dayEls.eq(col);
- },
-
-
- // Gets the whole-day element associated with the cell
- getCellDayEl: function(cell) {
- return this.dayEls.eq(cell.row * this.colCnt + cell.col);
- },
-
-
- // Overrides Grid's method for when row coordinates are computed
- computeRowCoords: function() {
- var rowCoords = Grid.prototype.computeRowCoords.call(this); // call the super-method
-
- // hack for extending last row (used by AgendaView)
- rowCoords[rowCoords.length - 1].bottom += this.bottomCoordPadding;
-
- return rowCoords;
- },
-
-
- /* Dates
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Slices up a date range by row into an array of segments
- rangeToSegs: function(range) {
- var isRTL = this.isRTL;
- var rowCnt = this.rowCnt;
- var colCnt = this.colCnt;
- var segs = [];
- var first, last; // inclusive cell-offset range for given range
- var row;
- var rowFirst, rowLast; // inclusive cell-offset range for current row
- var isStart, isEnd;
- var segFirst, segLast; // inclusive cell-offset range for segment
- var seg;
-
- range = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold
- first = this.dateToCellOffset(range.start);
- last = this.dateToCellOffset(range.end.subtract(1, 'days')); // offset of inclusive end date
-
- for (row = 0; row < rowCnt; row++) {
- rowFirst = row * colCnt;
- rowLast = rowFirst + colCnt - 1;
-
- // intersect segment's offset range with the row's
- segFirst = Math.max(rowFirst, first);
- segLast = Math.min(rowLast, last);
-
- // deal with in-between indices
- segFirst = Math.ceil(segFirst); // in-between starts round to next cell
- segLast = Math.floor(segLast); // in-between ends round to prev cell
-
- if (segFirst <= segLast) { // was there any intersection with the current row?
-
- // must be matching integers to be the segment's start/end
- isStart = segFirst === first;
- isEnd = segLast === last;
-
- // translate offsets to be relative to start-of-row
- segFirst -= rowFirst;
- segLast -= rowFirst;
-
- seg = { row: row, isStart: isStart, isEnd: isEnd };
- if (isRTL) {
- seg.leftCol = colCnt - segLast - 1;
- seg.rightCol = colCnt - segFirst - 1;
- }
- else {
- seg.leftCol = segFirst;
- seg.rightCol = segLast;
- }
- segs.push(seg);
- }
- }
-
- return segs;
- },
-
-
- // Given a date, returns its chronolocial cell-offset from the first cell of the grid.
- // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.
- // If before the first offset, returns a negative number.
- // If after the last offset, returns an offset past the last cell offset.
- // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.
- dateToCellOffset: function(date) {
- var offsets = this.dayToCellOffsets;
- var day = date.diff(this.start, 'days');
-
- if (day < 0) {
- return offsets[0] - 1;
- }
- else if (day >= offsets.length) {
- return offsets[offsets.length - 1] + 1;
- }
- else {
- return offsets[day];
- }
- },
-
-
- /* Event Drag Visualization
- ------------------------------------------------------------------------------------------------------------------*/
- // TODO: move to DayGrid.event, similar to what we did with Grid's drag methods
-
-
- // Renders a visual indication of an event or external element being dragged.
- // The dropLocation's end can be null. seg can be null. See Grid::renderDrag for more info.
- renderDrag: function(dropLocation, seg) {
-
- // always render a highlight underneath
- this.renderHighlight(this.eventRangeToSegs(dropLocation));
-
- // if a segment from the same calendar but another component is being dragged, render a helper event
- if (seg && !seg.el.closest(this.el).length) {
-
- this.renderRangeHelper(dropLocation, seg);
- this.applyDragOpacity(this.helperEls);
-
- return true; // a helper has been rendered
- }
- },
-
-
- // Unrenders any visual indication of a hovering event
- unrenderDrag: function() {
- this.unrenderHighlight();
- this.unrenderHelper();
- },
-
-
- /* Event Resize Visualization
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of an event being resized
- renderEventResize: function(range, seg) {
- this.renderHighlight(this.eventRangeToSegs(range));
- this.renderRangeHelper(range, seg);
- },
-
-
- // Unrenders a visual indication of an event being resized
- unrenderEventResize: function() {
- this.unrenderHighlight();
- this.unrenderHelper();
- },
-
-
- /* Event Helper
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null.
- renderHelper: function(event, sourceSeg) {
- var helperNodes = [];
- var segs = this.eventsToSegs([ event ]);
- var rowStructs;
-
- segs = this.renderFgSegEls(segs); // assigns each seg's el and returns a subset of segs that were rendered
- rowStructs = this.renderSegRows(segs);
-
- // inject each new event skeleton into each associated row
- this.rowEls.each(function(row, rowNode) {
- var rowEl = $(rowNode); // the .fc-row
- var skeletonEl = $('
'); // will be absolutely positioned
- var skeletonTop;
-
- // If there is an original segment, match the top position. Otherwise, put it at the row's top level
- if (sourceSeg && sourceSeg.row === row) {
- skeletonTop = sourceSeg.el.position().top;
- }
- else {
- skeletonTop = rowEl.find('.fc-content-skeleton tbody').position().top;
- }
-
- skeletonEl.css('top', skeletonTop)
- .find('table')
- .append(rowStructs[row].tbodyEl);
-
- rowEl.append(skeletonEl);
- helperNodes.push(skeletonEl[0]);
- });
-
- this.helperEls = $(helperNodes); // array -> jQuery set
- },
-
-
- // Unrenders any visual indication of a mock helper event
- unrenderHelper: function() {
- if (this.helperEls) {
- this.helperEls.remove();
- this.helperEls = null;
- }
- },
-
-
- /* Fill System (highlight, background events, business hours)
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- fillSegTag: 'td', // override the default tag name
-
-
- // Renders a set of rectangles over the given segments of days.
- // Only returns segments that successfully rendered.
- renderFill: function(type, segs, className) {
- var nodes = [];
- var i, seg;
- var skeletonEl;
-
- segs = this.renderFillSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs
-
- for (i = 0; i < segs.length; i++) {
- seg = segs[i];
- skeletonEl = this.renderFillRow(type, seg, className);
- this.rowEls.eq(seg.row).append(skeletonEl);
- nodes.push(skeletonEl[0]);
- }
-
- this.elsByFill[type] = $(nodes);
-
- return segs;
- },
-
-
- // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.
- renderFillRow: function(type, seg, className) {
- var colCnt = this.colCnt;
- var startCol = seg.leftCol;
- var endCol = seg.rightCol + 1;
- var skeletonEl;
- var trEl;
-
- className = className || type.toLowerCase();
-
- skeletonEl = $(
- '' +
- '
' +
- ''
- );
- trEl = skeletonEl.find('tr');
-
- if (startCol > 0) {
- trEl.append(' ');
- }
-
- trEl.append(
- seg.el.attr('colspan', endCol - startCol)
- );
-
- if (endCol < colCnt) {
- trEl.append(' ');
- }
-
- this.bookendCells(trEl, type);
-
- return skeletonEl;
- }
-
-});
-
-;;
-
-/* Event-rendering methods for the DayGrid class
-----------------------------------------------------------------------------------------------------------------------*/
-
-DayGrid.mixin({
-
- rowStructs: null, // an array of objects, each holding information about a row's foreground event-rendering
-
-
- // Unrenders all events currently rendered on the grid
- unrenderEvents: function() {
- this.removeSegPopover(); // removes the "more.." events popover
- Grid.prototype.unrenderEvents.apply(this, arguments); // calls the super-method
- },
-
-
- // Retrieves all rendered segment objects currently rendered on the grid
- getEventSegs: function() {
- return Grid.prototype.getEventSegs.call(this) // get the segments from the super-method
- .concat(this.popoverSegs || []); // append the segments from the "more..." popover
- },
-
-
- // Renders the given background event segments onto the grid
- renderBgSegs: function(segs) {
-
- // don't render timed background events
- var allDaySegs = $.grep(segs, function(seg) {
- return seg.event.allDay;
- });
-
- return Grid.prototype.renderBgSegs.call(this, allDaySegs); // call the super-method
- },
-
-
- // Renders the given foreground event segments onto the grid
- renderFgSegs: function(segs) {
- var rowStructs;
-
- // render an `.el` on each seg
- // returns a subset of the segs. segs that were actually rendered
- segs = this.renderFgSegEls(segs);
-
- rowStructs = this.rowStructs = this.renderSegRows(segs);
-
- // append to each row's content skeleton
- this.rowEls.each(function(i, rowNode) {
- $(rowNode).find('.fc-content-skeleton > table').append(
- rowStructs[i].tbodyEl
- );
- });
-
- return segs; // return only the segs that were actually rendered
- },
-
-
- // Unrenders all currently rendered foreground event segments
- unrenderFgSegs: function() {
- var rowStructs = this.rowStructs || [];
- var rowStruct;
-
- while ((rowStruct = rowStructs.pop())) {
- rowStruct.tbodyEl.remove();
- }
-
- this.rowStructs = null;
- },
-
-
- // Uses the given events array to generate elements that should be appended to each row's content skeleton.
- // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).
- // PRECONDITION: each segment shoud already have a rendered and assigned `.el`
- renderSegRows: function(segs) {
- var rowStructs = [];
- var segRows;
- var row;
-
- segRows = this.groupSegRows(segs); // group into nested arrays
-
- // iterate each row of segment groupings
- for (row = 0; row < segRows.length; row++) {
- rowStructs.push(
- this.renderSegRow(row, segRows[row])
- );
- }
-
- return rowStructs;
- },
-
-
- // Builds the HTML to be used for the default element for an individual segment
- fgSegHtml: function(seg, disableResizing) {
- var view = this.view;
- var event = seg.event;
- var isDraggable = view.isEventDraggable(event);
- var isResizableFromStart = !disableResizing && event.allDay &&
- seg.isStart && view.isEventResizableFromStart(event);
- var isResizableFromEnd = !disableResizing && event.allDay &&
- seg.isEnd && view.isEventResizableFromEnd(event);
- var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd);
- var skinCss = cssToStr(this.getEventSkinCss(event));
- var timeHtml = '';
- var timeText;
- var titleHtml;
-
- classes.unshift('fc-day-grid-event', 'fc-h-event');
-
- // Only display a timed events time if it is the starting segment
- if (seg.isStart) {
- timeText = this.getEventTimeText(event);
- if (timeText) {
- timeHtml = '' + htmlEscape(timeText) + '';
- }
- }
-
- titleHtml =
- '' +
- (htmlEscape(event.title || '') || ' ') + // we always want one line of height
- '';
-
- return '' +
- '' +
- (this.isRTL ?
- titleHtml + ' ' + timeHtml : // put a natural space in between
- timeHtml + ' ' + titleHtml //
- ) +
- '' +
- (isResizableFromStart ?
- '' :
- ''
- ) +
- (isResizableFromEnd ?
- '' :
- ''
- ) +
- '';
- },
-
-
- // Given a row # and an array of segments all in the same row, render a element, a skeleton that contains
- // the segments. Returns object with a bunch of internal data about how the render was calculated.
- // NOTE: modifies rowSegs
- renderSegRow: function(row, rowSegs) {
- var colCnt = this.colCnt;
- var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
- var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
- var tbody = $('');
- var segMatrix = []; // lookup for which segments are rendered into which level+col cells
- var cellMatrix = []; // lookup for all elements of the level+col matrix
- var loneCellMatrix = []; // lookup for elements that only take up a single column
- var i, levelSegs;
- var col;
- var tr;
- var j, seg;
- var td;
-
- // populates empty cells from the current column (`col`) to `endCol`
- function emptyCellsUntil(endCol) {
- while (col < endCol) {
- // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell
- td = (loneCellMatrix[i - 1] || [])[col];
- if (td) {
- td.attr(
- 'rowspan',
- parseInt(td.attr('rowspan') || 1, 10) + 1
- );
- }
- else {
- td = $(' ');
- tr.append(td);
- }
- cellMatrix[i][col] = td;
- loneCellMatrix[i][col] = td;
- col++;
- }
- }
-
- for (i = 0; i < levelCnt; i++) { // iterate through all levels
- levelSegs = segLevels[i];
- col = 0;
- tr = $(' ');
-
- segMatrix.push([]);
- cellMatrix.push([]);
- loneCellMatrix.push([]);
-
- // levelCnt might be 1 even though there are no actual levels. protect against this.
- // this single empty row is useful for styling.
- if (levelSegs) {
- for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level
- seg = levelSegs[j];
-
- emptyCellsUntil(seg.leftCol);
-
- // create a container that occupies or more columns. append the event element.
- td = $(' ').append(seg.el);
- if (seg.leftCol != seg.rightCol) {
- td.attr('colspan', seg.rightCol - seg.leftCol + 1);
- }
- else { // a single-column segment
- loneCellMatrix[i][col] = td;
- }
-
- while (col <= seg.rightCol) {
- cellMatrix[i][col] = td;
- segMatrix[i][col] = seg;
- col++;
- }
-
- tr.append(td);
- }
- }
-
- emptyCellsUntil(colCnt); // finish off the row
- this.bookendCells(tr, 'eventSkeleton');
- tbody.append(tr);
- }
-
- return { // a "rowStruct"
- row: row, // the row number
- tbodyEl: tbody,
- cellMatrix: cellMatrix,
- segMatrix: segMatrix,
- segLevels: segLevels,
- segs: rowSegs
- };
- },
-
-
- // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.
- // NOTE: modifies segs
- buildSegLevels: function(segs) {
- var levels = [];
- var i, seg;
- var j;
-
- // Give preference to elements with certain criteria, so they have
- // a chance to be closer to the top.
- this.sortSegs(segs);
-
- for (i = 0; i < segs.length; i++) {
- seg = segs[i];
-
- // loop through levels, starting with the topmost, until the segment doesn't collide with other segments
- for (j = 0; j < levels.length; j++) {
- if (!isDaySegCollision(seg, levels[j])) {
- break;
- }
- }
- // `j` now holds the desired subrow index
- seg.level = j;
-
- // create new level array if needed and append segment
- (levels[j] || (levels[j] = [])).push(seg);
- }
-
- // order segments left-to-right. very important if calendar is RTL
- for (j = 0; j < levels.length; j++) {
- levels[j].sort(compareDaySegCols);
- }
-
- return levels;
- },
-
-
- // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row
- groupSegRows: function(segs) {
- var segRows = [];
- var i;
-
- for (i = 0; i < this.rowCnt; i++) {
- segRows.push([]);
- }
-
- for (i = 0; i < segs.length; i++) {
- segRows[segs[i].row].push(segs[i]);
- }
-
- return segRows;
- }
-
-});
-
-
-// Computes whether two segments' columns collide. They are assumed to be in the same row.
-function isDaySegCollision(seg, otherSegs) {
- var i, otherSeg;
-
- for (i = 0; i < otherSegs.length; i++) {
- otherSeg = otherSegs[i];
-
- if (
- otherSeg.leftCol <= seg.rightCol &&
- otherSeg.rightCol >= seg.leftCol
- ) {
- return true;
- }
- }
-
- return false;
-}
-
-
-// A cmp function for determining the leftmost event
-function compareDaySegCols(a, b) {
- return a.leftCol - b.leftCol;
-}
-
-;;
-
-/* Methods relate to limiting the number events for a given day on a DayGrid
-----------------------------------------------------------------------------------------------------------------------*/
-// NOTE: all the segs being passed around in here are foreground segs
-
-DayGrid.mixin({
-
- segPopover: null, // the Popover that holds events that can't fit in a cell. null when not visible
- popoverSegs: null, // an array of segment objects that the segPopover holds. null when not visible
-
-
- removeSegPopover: function() {
- if (this.segPopover) {
- this.segPopover.hide(); // in handler, will call segPopover's removeElement
- }
- },
-
-
- // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid.
- // `levelLimit` can be false (don't limit), a number, or true (should be computed).
- limitRows: function(levelLimit) {
- var rowStructs = this.rowStructs || [];
- var row; // row #
- var rowLevelLimit;
-
- for (row = 0; row < rowStructs.length; row++) {
- this.unlimitRow(row);
-
- if (!levelLimit) {
- rowLevelLimit = false;
- }
- else if (typeof levelLimit === 'number') {
- rowLevelLimit = levelLimit;
- }
- else {
- rowLevelLimit = this.computeRowLevelLimit(row);
- }
-
- if (rowLevelLimit !== false) {
- this.limitRow(row, rowLevelLimit);
- }
- }
- },
-
-
- // Computes the number of levels a row will accomodate without going outside its bounds.
- // Assumes the row is "rigid" (maintains a constant height regardless of what is inside).
- // `row` is the row number.
- computeRowLevelLimit: function(row) {
- var rowEl = this.rowEls.eq(row); // the containing "fake" row div
- var rowHeight = rowEl.height(); // TODO: cache somehow?
- var trEls = this.rowStructs[row].tbodyEl.children();
- var i, trEl;
- var trHeight;
-
- function iterInnerHeights(i, childNode) {
- trHeight = Math.max(trHeight, $(childNode).outerHeight());
- }
-
- // Reveal one level at a time and stop when we find one out of bounds
- for (i = 0; i < trEls.length; i++) {
- trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal)
-
- // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell,
- // so instead, find the tallest inner content element.
- trHeight = 0;
- trEl.find('> td > :first-child').each(iterInnerHeights);
-
- if (trEl.position().top + trHeight > rowHeight) {
- return i;
- }
- }
-
- return false; // should not limit at all
- },
-
-
- // Limits the given grid row to the maximum number of levels and injects "more" links if necessary.
- // `row` is the row number.
- // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.
- limitRow: function(row, levelLimit) {
- var _this = this;
- var rowStruct = this.rowStructs[row];
- var moreNodes = []; // array of "more" links and DOM nodes
- var col = 0; // col #, left-to-right (not chronologically)
- var cell;
- var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right
- var cellMatrix; // a matrix (by level, then column) of all jQuery elements in the row
- var limitedNodes; // array of temporarily hidden level and segment DOM nodes
- var i, seg;
- var segsBelow; // array of segment objects below `seg` in the current `col`
- var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies
- var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)
- var td, rowspan;
- var segMoreNodes; // array of "more" cells that will stand-in for the current seg's cell
- var j;
- var moreTd, moreWrap, moreLink;
-
- // Iterates through empty level cells and places "more" links inside if need be
- function emptyCellsUntil(endCol) { // goes from current `col` to `endCol`
- while (col < endCol) {
- cell = _this.getCell(row, col);
- segsBelow = _this.getCellSegs(cell, levelLimit);
- if (segsBelow.length) {
- td = cellMatrix[levelLimit - 1][col];
- moreLink = _this.renderMoreLink(cell, segsBelow);
- moreWrap = $('').append(moreLink);
- td.append(moreWrap);
- moreNodes.push(moreWrap[0]);
- }
- col++;
- }
- }
-
- if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?
- levelSegs = rowStruct.segLevels[levelLimit - 1];
- cellMatrix = rowStruct.cellMatrix;
-
- limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level elements past the limit
- .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array
-
- // iterate though segments in the last allowable level
- for (i = 0; i < levelSegs.length; i++) {
- seg = levelSegs[i];
- emptyCellsUntil(seg.leftCol); // process empty cells before the segment
-
- // determine *all* segments below `seg` that occupy the same columns
- colSegsBelow = [];
- totalSegsBelow = 0;
- while (col <= seg.rightCol) {
- cell = this.getCell(row, col);
- segsBelow = this.getCellSegs(cell, levelLimit);
- colSegsBelow.push(segsBelow);
- totalSegsBelow += segsBelow.length;
- col++;
- }
-
- if (totalSegsBelow) { // do we need to replace this segment with one or many "more" links?
- td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell
- rowspan = td.attr('rowspan') || 1;
- segMoreNodes = [];
-
- // make a replacement for each column the segment occupies. will be one for each colspan
- for (j = 0; j < colSegsBelow.length; j++) {
- moreTd = $(' ').attr('rowspan', rowspan);
- segsBelow = colSegsBelow[j];
- cell = this.getCell(row, seg.leftCol + j);
- moreLink = this.renderMoreLink(cell, [ seg ].concat(segsBelow)); // count seg as hidden too
- moreWrap = $('').append(moreLink);
- moreTd.append(moreWrap);
- segMoreNodes.push(moreTd[0]);
- moreNodes.push(moreTd[0]);
- }
-
- td.addClass('fc-limited').after($(segMoreNodes)); // hide original and inject replacements
- limitedNodes.push(td[0]);
- }
- }
-
- emptyCellsUntil(this.colCnt); // finish off the level
- rowStruct.moreEls = $(moreNodes); // for easy undoing later
- rowStruct.limitedEls = $(limitedNodes); // for easy undoing later
- }
- },
-
-
- // Reveals all levels and removes all "more"-related elements for a grid's row.
- // `row` is a row number.
- unlimitRow: function(row) {
- var rowStruct = this.rowStructs[row];
-
- if (rowStruct.moreEls) {
- rowStruct.moreEls.remove();
- rowStruct.moreEls = null;
- }
-
- if (rowStruct.limitedEls) {
- rowStruct.limitedEls.removeClass('fc-limited');
- rowStruct.limitedEls = null;
- }
- },
-
-
- // Renders an element that represents hidden event element for a cell.
- // Responsible for attaching click handler as well.
- renderMoreLink: function(cell, hiddenSegs) {
- var _this = this;
- var view = this.view;
-
- return $('')
- .text(
- this.getMoreLinkText(hiddenSegs.length)
- )
- .on('click', function(ev) {
- var clickOption = view.opt('eventLimitClick');
- var date = cell.start;
- var moreEl = $(this);
- var dayEl = _this.getCellDayEl(cell);
- var allSegs = _this.getCellSegs(cell);
-
- // rescope the segments to be within the cell's date
- var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);
- var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);
-
- if (typeof clickOption === 'function') {
- // the returned value can be an atomic option
- clickOption = view.trigger('eventLimitClick', null, {
- date: date,
- dayEl: dayEl,
- moreEl: moreEl,
- segs: reslicedAllSegs,
- hiddenSegs: reslicedHiddenSegs
- }, ev);
- }
-
- if (clickOption === 'popover') {
- _this.showSegPopover(cell, moreEl, reslicedAllSegs);
- }
- else if (typeof clickOption === 'string') { // a view name
- view.calendar.zoomTo(date, clickOption);
- }
- });
- },
-
-
- // Reveals the popover that displays all events within a cell
- showSegPopover: function(cell, moreLink, segs) {
- var _this = this;
- var view = this.view;
- var moreWrap = moreLink.parent(); // the wrapper around the
- var topEl; // the element we want to match the top coordinate of
- var options;
-
- if (this.rowCnt == 1) {
- topEl = view.el; // will cause the popover to cover any sort of header
- }
- else {
- topEl = this.rowEls.eq(cell.row); // will align with top of row
- }
-
- options = {
- className: 'fc-more-popover',
- content: this.renderSegPopoverContent(cell, segs),
- parentEl: this.el,
- top: topEl.offset().top,
- autoHide: true, // when the user clicks elsewhere, hide the popover
- viewportConstrain: view.opt('popoverViewportConstrain'),
- hide: function() {
- // kill everything when the popover is hidden
- _this.segPopover.removeElement();
- _this.segPopover = null;
- _this.popoverSegs = null;
- }
- };
-
- // Determine horizontal coordinate.
- // We use the moreWrap instead of the to avoid border confusion.
- if (this.isRTL) {
- options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border
- }
- else {
- options.left = moreWrap.offset().left - 1; // -1 to be over cell border
- }
-
- this.segPopover = new Popover(options);
- this.segPopover.show();
- },
-
-
- // Builds the inner DOM contents of the segment popover
- renderSegPopoverContent: function(cell, segs) {
- var view = this.view;
- var isTheme = view.opt('theme');
- var title = cell.start.format(view.opt('dayPopoverFormat'));
- var content = $(
- '' +
- ''
- );
- var segContainer = content.find('.fc-event-container');
- var i;
-
- // render each seg's `el` and only return the visible segs
- segs = this.renderFgSegEls(segs, true); // disableResizing=true
- this.popoverSegs = segs;
-
- for (i = 0; i < segs.length; i++) {
-
- // because segments in the popover are not part of a grid coordinate system, provide a hint to any
- // grids that want to do drag-n-drop about which cell it came from
- segs[i].cell = cell;
-
- segContainer.append(segs[i].el);
- }
-
- return content;
- },
-
-
- // Given the events within an array of segment objects, reslice them to be in a single day
- resliceDaySegs: function(segs, dayDate) {
-
- // build an array of the original events
- var events = $.map(segs, function(seg) {
- return seg.event;
- });
-
- var dayStart = dayDate.clone().stripTime();
- var dayEnd = dayStart.clone().add(1, 'days');
- var dayRange = { start: dayStart, end: dayEnd };
-
- // slice the events with a custom slicing function
- segs = this.eventsToSegs(
- events,
- function(range) {
- var seg = intersectionToSeg(range, dayRange); // undefind if no intersection
- return seg ? [ seg ] : []; // must return an array of segments
- }
- );
-
- // force an order because eventsToSegs doesn't guarantee one
- this.sortSegs(segs);
-
- return segs;
- },
-
-
- // Generates the text that should be inside a "more" link, given the number of events it represents
- getMoreLinkText: function(num) {
- var opt = this.view.opt('eventLimitText');
-
- if (typeof opt === 'function') {
- return opt(num);
- }
- else {
- return '+' + num + ' ' + opt;
- }
- },
-
-
- // Returns segments within a given cell.
- // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.
- getCellSegs: function(cell, startLevel) {
- var segMatrix = this.rowStructs[cell.row].segMatrix;
- var level = startLevel || 0;
- var segs = [];
- var seg;
-
- while (level < segMatrix.length) {
- seg = segMatrix[level][cell.col];
- if (seg) {
- segs.push(seg);
- }
- level++;
- }
-
- return segs;
- }
-
-});
-
-;;
-
-/* A component that renders one or more columns of vertical time slots
-----------------------------------------------------------------------------------------------------------------------*/
-
-var TimeGrid = Grid.extend({
-
- slotDuration: null, // duration of a "slot", a distinct time segment on given day, visualized by lines
- snapDuration: null, // granularity of time for dragging and selecting
- minTime: null, // Duration object that denotes the first visible time of any given day
- maxTime: null, // Duration object that denotes the exclusive visible end time of any given day
- colDates: null, // whole-day dates for each column. left to right
- labelFormat: null, // formatting string for times running along vertical axis
- labelInterval: null, // duration of how often a label should be displayed for a slot
-
- dayEls: null, // cells elements in the day-row background
- slatEls: null, // elements running horizontally across all columns
-
- slatTops: null, // an array of top positions, relative to the container. last item holds bottom of last slot
-
- helperEl: null, // cell skeleton element for rendering the mock event "helper"
-
- businessHourSegs: null,
-
-
- constructor: function() {
- Grid.apply(this, arguments); // call the super-constructor
- this.processOptions();
- },
-
-
- // Renders the time grid into `this.el`, which should already be assigned.
- // Relies on the view's colCnt. In the future, this component should probably be self-sufficient.
- renderDates: function() {
- this.el.html(this.renderHtml());
- this.dayEls = this.el.find('.fc-day');
- this.slatEls = this.el.find('.fc-slats tr');
- },
-
-
- renderBusinessHours: function() {
- var events = this.view.calendar.getBusinessHoursEvents();
- this.businessHourSegs = this.renderFill('businessHours', this.eventsToSegs(events), 'bgevent');
- },
-
-
- // Renders the basic HTML skeleton for the grid
- renderHtml: function() {
- return '' +
- '' +
- '' +
- this.rowHtml('slotBg') + // leverages RowRenderer, which will call slotBgCellHtml
- '
' +
- '' +
- '' +
- '' +
- this.slatRowHtml() +
- '
' +
- '';
- },
-
-
- // Renders the HTML for a vertical background cell behind the slots.
- // This method is distinct from 'bg' because we wanted a new `rowType` so the View could customize the rendering.
- slotBgCellHtml: function(cell) {
- return this.bgCellHtml(cell);
- },
-
-
- // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
- slatRowHtml: function() {
- var view = this.view;
- var isRTL = this.isRTL;
- var html = '';
- var slotTime = moment.duration(+this.minTime); // wish there was .clone() for durations
- var slotDate; // will be on the view's first day, but we only care about its time
- var isLabeled;
- var axisHtml;
-
- // Calculate the time for each slot
- while (slotTime < this.maxTime) {
- slotDate = this.start.clone().time(slotTime); // after .time() will be in UTC. but that's good, avoids DST issues
- isLabeled = isInt(divideDurationByDuration(slotTime, this.labelInterval));
-
- axisHtml =
- ' ' +
- (isLabeled ?
- '' + // for matchCellWidths
- htmlEscape(slotDate.format(this.labelFormat)) +
- '' :
- ''
- ) +
- ' ';
-
- html +=
- '' +
- (!isRTL ? axisHtml : '') +
- ' ' +
- (isRTL ? axisHtml : '') +
- " ";
-
- slotTime.add(this.slotDuration);
- }
-
- return html;
- },
-
-
- /* Options
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Parses various options into properties of this object
- processOptions: function() {
- var view = this.view;
- var slotDuration = view.opt('slotDuration');
- var snapDuration = view.opt('snapDuration');
- var input;
-
- slotDuration = moment.duration(slotDuration);
- snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration;
-
- this.slotDuration = slotDuration;
- this.snapDuration = snapDuration;
- this.cellDuration = snapDuration; // for Grid system
-
- this.minTime = moment.duration(view.opt('minTime'));
- this.maxTime = moment.duration(view.opt('maxTime'));
-
- // might be an array value (for TimelineView).
- // if so, getting the most granular entry (the last one probably).
- input = view.opt('slotLabelFormat');
- if ($.isArray(input)) {
- input = input[input.length - 1];
- }
-
- this.labelFormat =
- input ||
- view.opt('axisFormat') || // deprecated
- view.opt('smallTimeFormat'); // the computed default
-
- input = view.opt('slotLabelInterval');
- this.labelInterval = input ?
- moment.duration(input) :
- this.computeLabelInterval(slotDuration);
- },
-
-
- // Computes an automatic value for slotLabelInterval
- computeLabelInterval: function(slotDuration) {
- var i;
- var labelInterval;
- var slotsPerLabel;
-
- // find the smallest stock label interval that results in more than one slots-per-label
- for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {
- labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]);
- slotsPerLabel = divideDurationByDuration(labelInterval, slotDuration);
- if (isInt(slotsPerLabel) && slotsPerLabel > 1) {
- return labelInterval;
- }
- }
-
- return moment.duration(slotDuration); // fall back. clone
- },
-
-
- // Computes a default column header formatting string if `colFormat` is not explicitly defined
- computeColHeadFormat: function() {
- if (this.colCnt > 1) { // multiple days, so full single date string WON'T be in title text
- return this.view.opt('dayOfMonthFormat'); // "Sat 12/10"
- }
- else { // single day, so full single date string will probably be in title text
- return 'dddd'; // "Saturday"
- }
- },
-
-
- // Computes a default event time formatting string if `timeFormat` is not explicitly defined
- computeEventTimeFormat: function() {
- return this.view.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM)
- },
-
-
- // Computes a default `displayEventEnd` value if one is not expliclty defined
- computeDisplayEventEnd: function() {
- return true;
- },
-
-
- /* Cell System
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- rangeUpdated: function() {
- var view = this.view;
- var colDates = [];
- var date;
-
- date = this.start.clone();
- while (date.isBefore(this.end)) {
- colDates.push(date.clone());
- date.add(1, 'day');
- date = view.skipHiddenDays(date);
- }
-
- if (this.isRTL) {
- colDates.reverse();
- }
-
- this.colDates = colDates;
- this.colCnt = colDates.length;
- this.rowCnt = Math.ceil((this.maxTime - this.minTime) / this.snapDuration); // # of vertical snaps
- },
-
-
- // Given a cell object, generates its start date. Returns a reference-free copy.
- computeCellDate: function(cell) {
- var date = this.colDates[cell.col];
- var time = this.computeSnapTime(cell.row);
-
- date = this.view.calendar.rezoneDate(date); // give it a 00:00 time
- date.time(time);
-
- return date;
- },
-
-
- // Retrieves the element representing the given column
- getColEl: function(col) {
- return this.dayEls.eq(col);
- },
-
-
- /* Dates
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day
- computeSnapTime: function(row) {
- return moment.duration(this.minTime + this.snapDuration * row);
- },
-
-
- // Slices up a date range by column into an array of segments
- rangeToSegs: function(range) {
- var colCnt = this.colCnt;
- var segs = [];
- var seg;
- var col;
- var colDate;
- var colRange;
-
- // normalize :(
- range = {
- start: range.start.clone().stripZone(),
- end: range.end.clone().stripZone()
- };
-
- for (col = 0; col < colCnt; col++) {
- colDate = this.colDates[col]; // will be ambig time/timezone
- colRange = {
- start: colDate.clone().time(this.minTime),
- end: colDate.clone().time(this.maxTime)
- };
- seg = intersectionToSeg(range, colRange); // both will be ambig timezone
- if (seg) {
- seg.col = col;
- segs.push(seg);
- }
- }
-
- return segs;
- },
-
-
- /* Coordinates
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- updateSize: function(isResize) { // NOT a standard Grid method
- this.computeSlatTops();
-
- if (isResize) {
- this.updateSegVerticals();
- }
- },
-
-
- // Computes the top/bottom coordinates of each "snap" rows
- computeRowCoords: function() {
- var originTop = this.el.offset().top;
- var items = [];
- var i;
- var item;
-
- for (i = 0; i < this.rowCnt; i++) {
- item = {
- top: originTop + this.computeTimeTop(this.computeSnapTime(i))
- };
- if (i > 0) {
- items[i - 1].bottom = item.top;
- }
- items.push(item);
- }
- item.bottom = item.top + this.computeTimeTop(this.computeSnapTime(i));
-
- return items;
- },
-
-
- // Computes the top coordinate, relative to the bounds of the grid, of the given date.
- // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.
- computeDateTop: function(date, startOfDayDate) {
- return this.computeTimeTop(
- moment.duration(
- date.clone().stripZone() - startOfDayDate.clone().stripTime()
- )
- );
- },
-
-
- // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).
- computeTimeTop: function(time) {
- var slatCoverage = (time - this.minTime) / this.slotDuration; // floating-point value of # of slots covered
- var slatIndex;
- var slatRemainder;
- var slatTop;
- var slatBottom;
-
- // constrain. because minTime/maxTime might be customized
- slatCoverage = Math.max(0, slatCoverage);
- slatCoverage = Math.min(this.slatEls.length, slatCoverage);
-
- slatIndex = Math.floor(slatCoverage); // an integer index of the furthest whole slot
- slatRemainder = slatCoverage - slatIndex;
- slatTop = this.slatTops[slatIndex]; // the top position of the furthest whole slot
-
- if (slatRemainder) { // time spans part-way into the slot
- slatBottom = this.slatTops[slatIndex + 1];
- return slatTop + (slatBottom - slatTop) * slatRemainder; // part-way between slots
- }
- else {
- return slatTop;
- }
- },
-
-
- // Queries each `slatEl` for its position relative to the grid's container and stores it in `slatTops`.
- // Includes the the bottom of the last slat as the last item in the array.
- computeSlatTops: function() {
- var tops = [];
- var top;
-
- this.slatEls.each(function(i, node) {
- top = $(node).position().top;
- tops.push(top);
- });
-
- tops.push(top + this.slatEls.last().outerHeight()); // bottom of the last slat
-
- this.slatTops = tops;
- },
-
-
- /* Event Drag Visualization
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of an event being dragged over the specified date(s).
- // dropLocation's end might be null, as well as `seg`. See Grid::renderDrag for more info.
- // A returned value of `true` signals that a mock "helper" event has been rendered.
- renderDrag: function(dropLocation, seg) {
-
- if (seg) { // if there is event information for this drag, render a helper event
- this.renderRangeHelper(dropLocation, seg);
- this.applyDragOpacity(this.helperEl);
-
- return true; // signal that a helper has been rendered
- }
- else {
- // otherwise, just render a highlight
- this.renderHighlight(this.eventRangeToSegs(dropLocation));
- }
- },
-
-
- // Unrenders any visual indication of an event being dragged
- unrenderDrag: function() {
- this.unrenderHelper();
- this.unrenderHighlight();
- },
-
-
- /* Event Resize Visualization
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of an event being resized
- renderEventResize: function(range, seg) {
- this.renderRangeHelper(range, seg);
- },
-
-
- // Unrenders any visual indication of an event being resized
- unrenderEventResize: function() {
- this.unrenderHelper();
- },
-
-
- /* Event Helper
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a mock "helper" event. `sourceSeg` is the original segment object and might be null (an external drag)
- renderHelper: function(event, sourceSeg) {
- var segs = this.eventsToSegs([ event ]);
- var tableEl;
- var i, seg;
- var sourceEl;
-
- segs = this.renderFgSegEls(segs); // assigns each seg's el and returns a subset of segs that were rendered
- tableEl = this.renderSegTable(segs);
-
- // Try to make the segment that is in the same row as sourceSeg look the same
- for (i = 0; i < segs.length; i++) {
- seg = segs[i];
- if (sourceSeg && sourceSeg.col === seg.col) {
- sourceEl = sourceSeg.el;
- seg.el.css({
- left: sourceEl.css('left'),
- right: sourceEl.css('right'),
- 'margin-left': sourceEl.css('margin-left'),
- 'margin-right': sourceEl.css('margin-right')
- });
- }
- }
-
- this.helperEl = $('')
- .append(tableEl)
- .appendTo(this.el);
- },
-
-
- // Unrenders any mock helper event
- unrenderHelper: function() {
- if (this.helperEl) {
- this.helperEl.remove();
- this.helperEl = null;
- }
- },
-
-
- /* Selection
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.
- renderSelection: function(range) {
- if (this.view.opt('selectHelper')) { // this setting signals that a mock helper event should be rendered
- this.renderRangeHelper(range);
- }
- else {
- this.renderHighlight(this.selectionRangeToSegs(range));
- }
- },
-
-
- // Unrenders any visual indication of a selection
- unrenderSelection: function() {
- this.unrenderHelper();
- this.unrenderHighlight();
- },
-
-
- /* Fill System (highlight, background events, business hours)
- ------------------------------------------------------------------------------------------------------------------*/
-
-
- // Renders a set of rectangles over the given time segments.
- // Only returns segments that successfully rendered.
- renderFill: function(type, segs, className) {
- var segCols;
- var skeletonEl;
- var trEl;
- var col, colSegs;
- var tdEl;
- var containerEl;
- var dayDate;
- var i, seg;
-
- if (segs.length) {
-
- segs = this.renderFillSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs
- segCols = this.groupSegCols(segs); // group into sub-arrays, and assigns 'col' to each seg
-
- className = className || type.toLowerCase();
- skeletonEl = $(
- '' +
- '
' +
- ''
- );
- trEl = skeletonEl.find('tr');
-
- for (col = 0; col < segCols.length; col++) {
- colSegs = segCols[col];
- tdEl = $(' ').appendTo(trEl);
-
- if (colSegs.length) {
- containerEl = $('').appendTo(tdEl);
- dayDate = this.colDates[col];
-
- for (i = 0; i < colSegs.length; i++) {
- seg = colSegs[i];
- containerEl.append(
- seg.el.css({
- top: this.computeDateTop(seg.start, dayDate),
- bottom: -this.computeDateTop(seg.end, dayDate) // the y position of the bottom edge
- })
- );
- }
- }
- }
-
- this.bookendCells(trEl, type);
-
- this.el.append(skeletonEl);
- this.elsByFill[type] = skeletonEl;
- }
-
- return segs;
- }
-
-});
-
-;;
-
-/* Event-rendering methods for the TimeGrid class
-----------------------------------------------------------------------------------------------------------------------*/
-
-TimeGrid.mixin({
-
- eventSkeletonEl: null, // has cells with event-containers, which contain absolutely positioned event elements
-
-
- // Renders the given foreground event segments onto the grid
- renderFgSegs: function(segs) {
- segs = this.renderFgSegEls(segs); // returns a subset of the segs. segs that were actually rendered
-
- this.el.append(
- this.eventSkeletonEl = $('')
- .append(this.renderSegTable(segs))
- );
-
- return segs; // return only the segs that were actually rendered
- },
-
-
- // Unrenders all currently rendered foreground event segments
- unrenderFgSegs: function(segs) {
- if (this.eventSkeletonEl) {
- this.eventSkeletonEl.remove();
- this.eventSkeletonEl = null;
- }
- },
-
-
- // Renders and returns the