airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [15/57] [partial] airavata-php-gateway git commit: AIRAVATA 1632 + Job Description for Admin Dashboard
Date Fri, 01 May 2015 21:33:02 GMT
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php
new file mode 100755
index 0000000..24fd428
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php
@@ -0,0 +1,224 @@
+<?php namespace Illuminate\Database\Query\Grammars;
+
+use Illuminate\Database\Query\Builder;
+
+class SqlServerGrammar extends Grammar {
+
+	/**
+	 * All of the available clause operators.
+	 *
+	 * @var array
+	 */
+	protected $operators = array(
+		'=', '<', '>', '<=', '>=', '!<', '!>', '<>', '!=',
+		'like', 'not like', 'between', 'ilike',
+		'&', '&=', '|', '|=', '^', '^=',
+	);
+
+	/**
+	 * Compile a select query into SQL.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder
+	 * @return string
+	 */
+	public function compileSelect(Builder $query)
+	{
+		$components = $this->compileComponents($query);
+
+		// If an offset is present on the query, we will need to wrap the query in
+		// a big "ANSI" offset syntax block. This is very nasty compared to the
+		// other database systems but is necessary for implementing features.
+		if ($query->offset > 0)
+		{
+			return $this->compileAnsiOffset($query, $components);
+		}
+
+		return $this->concatenate($components);
+	}
+
+	/**
+	 * Compile the "select *" portion of the query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  array  $columns
+	 * @return string
+	 */
+	protected function compileColumns(Builder $query, $columns)
+	{
+		if ( ! is_null($query->aggregate)) return;
+
+		$select = $query->distinct ? 'select distinct ' : 'select ';
+
+		// If there is a limit on the query, but not an offset, we will add the top
+		// clause to the query, which serves as a "limit" type clause within the
+		// SQL Server system similar to the limit keywords available in MySQL.
+		if ($query->limit > 0 && $query->offset <= 0)
+		{
+			$select .= 'top '.$query->limit.' ';
+		}
+
+		return $select.$this->columnize($columns);
+	}
+
+	/**
+	 * Compile the "from" portion of the query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  string  $table
+	 * @return string
+	 */
+	protected function compileFrom(Builder $query, $table)
+	{
+		$from = parent::compileFrom($query, $table);
+
+		if (is_string($query->lock)) return $from.' '.$query->lock;
+
+		if ( ! is_null($query->lock))
+		{
+			return $from.' with(rowlock,'.($query->lock ? 'updlock,' : '').'holdlock)';
+		}
+
+		return $from;
+	}
+
+	/**
+	 * Create a full ANSI offset clause for the query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  array  $components
+	 * @return string
+	 */
+	protected function compileAnsiOffset(Builder $query, $components)
+	{
+		// An ORDER BY clause is required to make this offset query work, so if one does
+		// not exist we'll just create a dummy clause to trick the database and so it
+		// does not complain about the queries for not having an "order by" clause.
+		if ( ! isset($components['orders']))
+		{
+			$components['orders'] = 'order by (select 0)';
+		}
+
+		// We need to add the row number to the query so we can compare it to the offset
+		// and limit values given for the statements. So we will add an expression to
+		// the "select" that will give back the row numbers on each of the records.
+		$orderings = $components['orders'];
+
+		$components['columns'] .= $this->compileOver($orderings);
+
+		unset($components['orders']);
+
+		// Next we need to calculate the constraints that should be placed on the query
+		// to get the right offset and limit from our query but if there is no limit
+		// set we will just handle the offset only since that is all that matters.
+		$constraint = $this->compileRowConstraint($query);
+
+		$sql = $this->concatenate($components);
+
+		// We are now ready to build the final SQL query so we'll create a common table
+		// expression from the query and get the records with row numbers within our
+		// given limit and offset value that we just put on as a query constraint.
+		return $this->compileTableExpression($sql, $constraint);
+	}
+
+	/**
+	 * Compile the over statement for a table expression.
+	 *
+	 * @param  string  $orderings
+	 * @return string
+	 */
+	protected function compileOver($orderings)
+	{
+		return ", row_number() over ({$orderings}) as row_num";
+	}
+
+	/**
+	 * Compile the limit / offset row constraint for a query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @return string
+	 */
+	protected function compileRowConstraint($query)
+	{
+		$start = $query->offset + 1;
+
+		if ($query->limit > 0)
+		{
+			$finish = $query->offset + $query->limit;
+
+			return "between {$start} and {$finish}";
+		}
+
+		return ">= {$start}";
+	}
+
+	/**
+	 * Compile a common table expression for a query.
+	 *
+	 * @param  string  $sql
+	 * @param  string  $constraint
+	 * @return string
+	 */
+	protected function compileTableExpression($sql, $constraint)
+	{
+		return "select * from ({$sql}) as temp_table where row_num {$constraint}";
+	}
+
+	/**
+	 * Compile the "limit" portions of the query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  int  $limit
+	 * @return string
+	 */
+	protected function compileLimit(Builder $query, $limit)
+	{
+		return '';
+	}
+
+	/**
+	 * Compile the "offset" portions of the query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  int  $offset
+	 * @return string
+	 */
+	protected function compileOffset(Builder $query, $offset)
+	{
+		return '';
+	}
+
+	/**
+	 * Compile a truncate table statement into SQL.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @return array
+	 */
+	public function compileTruncate(Builder $query)
+	{
+		return array('truncate table '.$this->wrapTable($query->from) => array());
+	}
+
+	/**
+	 * Get the format for database stored dates.
+	 *
+	 * @return string
+	 */
+	public function getDateFormat()
+	{
+		return 'Y-m-d H:i:s.000';
+	}
+
+	/**
+	 * Wrap a single string in keyword identifiers.
+	 *
+	 * @param  string  $value
+	 * @return string
+	 */
+	protected function wrapValue($value)
+	{
+		if ($value === '*') return $value;
+
+		return '['.str_replace(']', ']]', $value).']';
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php b/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php
new file mode 100755
index 0000000..cea79ed
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php
@@ -0,0 +1,117 @@
+<?php namespace Illuminate\Database\Query;
+
+class JoinClause {
+
+	/**
+	 * The type of join being performed.
+	 *
+	 * @var string
+	 */
+	public $type;
+
+	/**
+	 * The table the join clause is joining to.
+	 *
+	 * @var string
+	 */
+	public $table;
+
+	/**
+	 * The "on" clauses for the join.
+	 *
+	 * @var array
+	 */
+	public $clauses = array();
+
+	/**
+	* The "on" bindings for the join.
+	*
+	* @var array
+	*/
+	public $bindings = array();
+
+	/**
+	 * Create a new join clause instance.
+	 *
+	 * @param  string  $type
+	 * @param  string  $table
+	 * @return void
+	 */
+	public function __construct($type, $table)
+	{
+		$this->type = $type;
+		$this->table = $table;
+	}
+
+	/**
+	 * Add an "on" clause to the join.
+	 *
+	 * @param  string  $first
+	 * @param  string  $operator
+	 * @param  string  $second
+	 * @param  string  $boolean
+	 * @param  bool  $where
+	 * @return $this
+	 */
+	public function on($first, $operator, $second, $boolean = 'and', $where = false)
+	{
+		$this->clauses[] = compact('first', 'operator', 'second', 'boolean', 'where');
+
+		if ($where) $this->bindings[] = $second;
+
+		return $this;
+	}
+
+	/**
+	 * Add an "or on" clause to the join.
+	 *
+	 * @param  string  $first
+	 * @param  string  $operator
+	 * @param  string  $second
+	 * @return \Illuminate\Database\Query\JoinClause
+	 */
+	public function orOn($first, $operator, $second)
+	{
+		return $this->on($first, $operator, $second, 'or');
+	}
+
+	/**
+	 * Add an "on where" clause to the join.
+	 *
+	 * @param  string  $first
+	 * @param  string  $operator
+	 * @param  string  $second
+	 * @param  string  $boolean
+	 * @return \Illuminate\Database\Query\JoinClause
+	 */
+	public function where($first, $operator, $second, $boolean = 'and')
+	{
+		return $this->on($first, $operator, $second, $boolean, true);
+	}
+
+	/**
+	 * Add an "or on where" clause to the join.
+	 *
+	 * @param  string  $first
+	 * @param  string  $operator
+	 * @param  string  $second
+	 * @return \Illuminate\Database\Query\JoinClause
+	 */
+	public function orWhere($first, $operator, $second)
+	{
+		return $this->on($first, $operator, $second, 'or', true);
+	}
+
+	/**
+	 * Add an "on where is null" clause to the join
+	 *
+	 * @param  string  $column
+	 * @param  string  $boolean
+	 * @return \Illuminate\Database\Query\JoinClause
+	 */
+	public function whereNull($column, $boolean = 'and')
+	{
+		return $this->on($column, 'is', new Expression('null'), $boolean, false);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php
new file mode 100644
index 0000000..f77b41d
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php
@@ -0,0 +1,16 @@
+<?php namespace Illuminate\Database\Query\Processors;
+
+class MySqlProcessor extends Processor {
+
+	/**
+	 * Process the results of a column listing query.
+	 *
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processColumnListing($results)
+	{
+		return array_map(function($r) { $r = (object) $r; return $r->column_name; }, $results);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php
new file mode 100755
index 0000000..665379d
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php
@@ -0,0 +1,40 @@
+<?php namespace Illuminate\Database\Query\Processors;
+
+use Illuminate\Database\Query\Builder;
+
+class PostgresProcessor extends Processor {
+
+	/**
+	 * Process an "insert get ID" query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  string  $sql
+	 * @param  array   $values
+	 * @param  string  $sequence
+	 * @return int
+	 */
+	public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
+	{
+		$results = $query->getConnection()->selectFromWriteConnection($sql, $values);
+
+		$sequence = $sequence ?: 'id';
+
+		$result = (array) $results[0];
+
+		$id = $result[$sequence];
+
+		return is_numeric($id) ? (int) $id : $id;
+	}
+
+	/**
+	 * Process the results of a column listing query.
+	 *
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processColumnListing($results)
+	{
+		return array_values(array_map(function($r) { $r = (object) $r; return $r->column_name; }, $results));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php
new file mode 100755
index 0000000..b960092
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php
@@ -0,0 +1,48 @@
+<?php namespace Illuminate\Database\Query\Processors;
+
+use Illuminate\Database\Query\Builder;
+
+class Processor {
+
+	/**
+	 * Process the results of a "select" query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processSelect(Builder $query, $results)
+	{
+		return $results;
+	}
+
+	/**
+	 * Process an  "insert get ID" query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  string  $sql
+	 * @param  array   $values
+	 * @param  string  $sequence
+	 * @return int
+	 */
+	public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
+	{
+		$query->getConnection()->insert($sql, $values);
+
+		$id = $query->getConnection()->getPdo()->lastInsertId($sequence);
+
+		return is_numeric($id) ? (int) $id : $id;
+	}
+
+	/**
+	 * Process the results of a column listing query.
+	 *
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processColumnListing($results)
+	{
+		return $results;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php
new file mode 100644
index 0000000..34493bf
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SQLiteProcessor.php
@@ -0,0 +1,16 @@
+<?php namespace Illuminate\Database\Query\Processors;
+
+class SQLiteProcessor extends Processor {
+
+	/**
+	 * Process the results of a column listing query.
+	 *
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processColumnListing($results)
+	{
+		return array_values(array_map(function($r) { $r = (object) $r; return $r->name; }, $results));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php
new file mode 100755
index 0000000..cfdb432
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php
@@ -0,0 +1,36 @@
+<?php namespace Illuminate\Database\Query\Processors;
+
+use Illuminate\Database\Query\Builder;
+
+class SqlServerProcessor extends Processor {
+
+	/**
+	 * Process an "insert get ID" query.
+	 *
+	 * @param  \Illuminate\Database\Query\Builder  $query
+	 * @param  string  $sql
+	 * @param  array   $values
+	 * @param  string  $sequence
+	 * @return int
+	 */
+	public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
+	{
+		$query->getConnection()->insert($sql, $values);
+
+		$id = $query->getConnection()->getPdo()->lastInsertId();
+
+		return is_numeric($id) ? (int) $id : $id;
+	}
+
+	/**
+	 * Process the results of a column listing query.
+	 *
+	 * @param  array  $results
+	 * @return array
+	 */
+	public function processColumnListing($results)
+	{
+		return array_values(array_map(function($r) { return $r->name; }, $results));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/QueryException.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/QueryException.php b/vendor/laravel/framework/src/Illuminate/Database/QueryException.php
new file mode 100644
index 0000000..e3f9cf2
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/QueryException.php
@@ -0,0 +1,78 @@
+<?php namespace Illuminate\Database;
+
+use PDOException;
+
+class QueryException extends PDOException {
+
+	/**
+	 * The SQL for the query.
+	 *
+	 * @var string
+	 */
+	protected $sql;
+
+	/**
+	 * The bindings for the query.
+	 *
+	 * @var array
+	 */
+	protected $bindings;
+
+	/**
+	 * Create a new query exception instance.
+	 *
+	 * @param  string  $sql
+	 * @param  array  $bindings
+	 * @param  \Exception $previous
+	 * @return void
+	 */
+	public function __construct($sql, array $bindings, $previous)
+	{
+		parent::__construct('', 0, $previous);
+
+		$this->sql = $sql;
+		$this->bindings = $bindings;
+		$this->previous = $previous;
+		$this->code = $previous->getCode();
+		$this->message = $this->formatMessage($sql, $bindings, $previous);
+
+		if ($previous instanceof PDOException)
+		{
+			$this->errorInfo = $previous->errorInfo;
+		}
+	}
+
+	/**
+	 * Format the SQL error message.
+	 *
+	 * @param  string  $sql
+	 * @param  array  $bindings
+	 * @param  \Exception $previous
+	 * @return string
+	 */
+	protected function formatMessage($sql, $bindings, $previous)
+	{
+		return $previous->getMessage().' (SQL: '.str_replace_array('\?', $bindings, $sql).')';
+	}
+
+	/**
+	 * Get the SQL for the query.
+	 *
+	 * @return string
+	 */
+	public function getSql()
+	{
+		return $this->sql;
+	}
+
+	/**
+	 * Get the bindings for the query.
+	 *
+	 * @return array
+	 */
+	public function getBindings()
+	{
+		return $this->bindings;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/README.md
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/README.md b/vendor/laravel/framework/src/Illuminate/Database/README.md
new file mode 100755
index 0000000..5009fc0
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/README.md
@@ -0,0 +1,71 @@
+## Illuminate Database
+
+The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework.
+
+### Usage Instructions
+
+First, create a new "Capsule" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.
+
+```PHP
+use Illuminate\Database\Capsule\Manager as Capsule;
+
+$capsule = new Capsule;
+
+$capsule->addConnection([
+	'driver'    => 'mysql',
+	'host'      => 'localhost',
+	'database'  => 'database',
+	'username'  => 'root',
+	'password'  => 'password',
+	'charset'   => 'utf8',
+	'collation' => 'utf8_unicode_ci',
+	'prefix'    => '',
+]);
+
+// Set the event dispatcher used by Eloquent models... (optional)
+use Illuminate\Events\Dispatcher;
+use Illuminate\Container\Container;
+$capsule->setEventDispatcher(new Dispatcher(new Container));
+
+// Set the cache manager instance used by connections... (optional)
+$capsule->setCacheManager(...);
+
+// Make this Capsule instance available globally via static methods... (optional)
+$capsule->setAsGlobal();
+
+// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
+$capsule->bootEloquent();
+```
+
+Once the Capsule instance has been registered. You may use it like so:
+
+**Using The Query Builder**
+
+```PHP
+$users = Capsule::table('users')->where('votes', '>', 100)->get();
+```
+Other core methods may be accessed directly from the Capsule in the same manner as from the DB facade:
+```PHP
+$results = Capsule::select('select * from users where id = ?', array(1));
+```
+
+**Using The Schema Builder**
+
+```PHP
+Capsule::schema()->create('users', function($table)
+{
+	$table->increments('id');
+	$table->string('email')->unique();
+	$table->timestamps();
+});
+```
+
+**Using The Eloquent ORM**
+
+```PHP
+class User extends Illuminate\Database\Eloquent\Model {}
+
+$users = User::where('votes', '>', 1)->get();
+```
+
+For further documentation on using the various database facilities this library provides, consult the [Laravel framework documentation](http://laravel.com/docs).

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php b/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php
new file mode 100755
index 0000000..86603fc
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php
@@ -0,0 +1,49 @@
+<?php namespace Illuminate\Database;
+
+use Doctrine\DBAL\Driver\PDOSqlite\Driver as DoctrineDriver;
+use Illuminate\Database\Query\Grammars\SQLiteGrammar as QueryGrammar;
+use Illuminate\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar;
+
+class SQLiteConnection extends Connection {
+
+	/**
+	 * Get the default query grammar instance.
+	 *
+	 * @return \Illuminate\Database\Query\Grammars\SQLiteGrammar
+	 */
+	protected function getDefaultQueryGrammar()
+	{
+		return $this->withTablePrefix(new QueryGrammar);
+	}
+
+	/**
+	 * Get the default schema grammar instance.
+	 *
+	 * @return \Illuminate\Database\Schema\Grammars\SQLiteGrammar
+	 */
+	protected function getDefaultSchemaGrammar()
+	{
+		return $this->withTablePrefix(new SchemaGrammar);
+	}
+
+	/**
+	 * Get the default post processor instance.
+	 *
+	 * @return \Illuminate\Database\Query\Processors\Processor
+	 */
+	protected function getDefaultPostProcessor()
+	{
+		return new Query\Processors\SQLiteProcessor;
+	}
+
+	/**
+	 * Get the Doctrine DBAL driver.
+	 *
+	 * @return \Doctrine\DBAL\Driver\PDOSqlite\Driver
+	 */
+	protected function getDoctrineDriver()
+	{
+		return new DoctrineDriver;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php
new file mode 100755
index 0000000..33453ab
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php
@@ -0,0 +1,837 @@
+<?php namespace Illuminate\Database\Schema;
+
+use Closure;
+use Illuminate\Support\Fluent;
+use Illuminate\Database\Connection;
+use Illuminate\Database\Schema\Grammars\Grammar;
+
+class Blueprint {
+
+	/**
+	 * The table the blueprint describes.
+	 *
+	 * @var string
+	 */
+	protected $table;
+
+	/**
+	 * The columns that should be added to the table.
+	 *
+	 * @var array
+	 */
+	protected $columns = array();
+
+	/**
+	 * The commands that should be run for the table.
+	 *
+	 * @var array
+	 */
+	protected $commands = array();
+
+	/**
+	 * The storage engine that should be used for the table.
+	 *
+	 * @var string
+	 */
+	public $engine;
+
+	/**
+	 * Create a new schema blueprint.
+	 *
+	 * @param  string   $table
+	 * @param  \Closure  $callback
+	 * @return void
+	 */
+	public function __construct($table, Closure $callback = null)
+	{
+		$this->table = $table;
+
+		if ( ! is_null($callback)) $callback($this);
+	}
+
+	/**
+	 * Execute the blueprint against the database.
+	 *
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @param  \Illuminate\Database\Schema\Grammars\Grammar $grammar
+	 * @return void
+	 */
+	public function build(Connection $connection, Grammar $grammar)
+	{
+		foreach ($this->toSql($connection, $grammar) as $statement)
+		{
+			$connection->statement($statement);
+		}
+	}
+
+	/**
+	 * Get the raw SQL statements for the blueprint.
+	 *
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @param  \Illuminate\Database\Schema\Grammars\Grammar  $grammar
+	 * @return array
+	 */
+	public function toSql(Connection $connection, Grammar $grammar)
+	{
+		$this->addImpliedCommands();
+
+		$statements = array();
+
+		// Each type of command has a corresponding compiler function on the schema
+		// grammar which is used to build the necessary SQL statements to build
+		// the blueprint element, so we'll just call that compilers function.
+		foreach ($this->commands as $command)
+		{
+			$method = 'compile'.ucfirst($command->name);
+
+			if (method_exists($grammar, $method))
+			{
+				if ( ! is_null($sql = $grammar->$method($this, $command, $connection)))
+				{
+					$statements = array_merge($statements, (array) $sql);
+				}
+			}
+		}
+
+		return $statements;
+	}
+
+	/**
+	 * Add the commands that are implied by the blueprint.
+	 *
+	 * @return void
+	 */
+	protected function addImpliedCommands()
+	{
+		if (count($this->columns) > 0 && ! $this->creating())
+		{
+			array_unshift($this->commands, $this->createCommand('add'));
+		}
+
+		$this->addFluentIndexes();
+	}
+
+	/**
+	 * Add the index commands fluently specified on columns.
+	 *
+	 * @return void
+	 */
+	protected function addFluentIndexes()
+	{
+		foreach ($this->columns as $column)
+		{
+			foreach (array('primary', 'unique', 'index') as $index)
+			{
+				// If the index has been specified on the given column, but is simply
+				// equal to "true" (boolean), no name has been specified for this
+				// index, so we will simply call the index methods without one.
+				if ($column->$index === true)
+				{
+					$this->$index($column->name);
+
+					continue 2;
+				}
+
+				// If the index has been specified on the column and it is something
+				// other than boolean true, we will assume a name was provided on
+				// the index specification, and pass in the name to the method.
+				elseif (isset($column->$index))
+				{
+					$this->$index($column->name, $column->$index);
+
+					continue 2;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Determine if the blueprint has a create command.
+	 *
+	 * @return bool
+	 */
+	protected function creating()
+	{
+		foreach ($this->commands as $command)
+		{
+			if ($command->name == 'create') return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Indicate that the table needs to be created.
+	 *
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function create()
+	{
+		return $this->addCommand('create');
+	}
+
+	/**
+	 * Indicate that the table should be dropped.
+	 *
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function drop()
+	{
+		return $this->addCommand('drop');
+	}
+
+	/**
+	 * Indicate that the table should be dropped if it exists.
+	 *
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropIfExists()
+	{
+		return $this->addCommand('dropIfExists');
+	}
+
+	/**
+	 * Indicate that the given columns should be dropped.
+	 *
+	 * @param  string|array  $columns
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropColumn($columns)
+	{
+		$columns = is_array($columns) ? $columns : (array) func_get_args();
+
+		return $this->addCommand('dropColumn', compact('columns'));
+	}
+
+	/**
+	 * Indicate that the given columns should be renamed.
+	 *
+	 * @param  string  $from
+	 * @param  string  $to
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function renameColumn($from, $to)
+	{
+		return $this->addCommand('renameColumn', compact('from', 'to'));
+	}
+
+	/**
+	 * Indicate that the given primary key should be dropped.
+	 *
+	 * @param  string|array  $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropPrimary($index = null)
+	{
+		return $this->dropIndexCommand('dropPrimary', 'primary', $index);
+	}
+
+	/**
+	 * Indicate that the given unique key should be dropped.
+	 *
+	 * @param  string|array  $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropUnique($index)
+	{
+		return $this->dropIndexCommand('dropUnique', 'unique', $index);
+	}
+
+	/**
+	 * Indicate that the given index should be dropped.
+	 *
+	 * @param  string|array  $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropIndex($index)
+	{
+		return $this->dropIndexCommand('dropIndex', 'index', $index);
+	}
+
+	/**
+	 * Indicate that the given foreign key should be dropped.
+	 *
+	 * @param  string  $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dropForeign($index)
+	{
+		return $this->dropIndexCommand('dropForeign', 'foreign', $index);
+	}
+
+	/**
+	 * Indicate that the timestamp columns should be dropped.
+	 *
+	 * @return void
+	 */
+	public function dropTimestamps()
+	{
+		$this->dropColumn('created_at', 'updated_at');
+	}
+
+	/**
+	* Indicate that the soft delete column should be dropped.
+	*
+	* @return void
+	*/
+	public function dropSoftDeletes()
+	{
+		$this->dropColumn('deleted_at');
+	}
+
+	/**
+	 * Rename the table to a given name.
+	 *
+	 * @param  string  $to
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function rename($to)
+	{
+		return $this->addCommand('rename', compact('to'));
+	}
+
+	/**
+	 * Specify the primary key(s) for the table.
+	 *
+	 * @param  string|array  $columns
+	 * @param  string  $name
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function primary($columns, $name = null)
+	{
+		return $this->indexCommand('primary', $columns, $name);
+	}
+
+	/**
+	 * Specify a unique index for the table.
+	 *
+	 * @param  string|array  $columns
+	 * @param  string  $name
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function unique($columns, $name = null)
+	{
+		return $this->indexCommand('unique', $columns, $name);
+	}
+
+	/**
+	 * Specify an index for the table.
+	 *
+	 * @param  string|array  $columns
+	 * @param  string  $name
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function index($columns, $name = null)
+	{
+		return $this->indexCommand('index', $columns, $name);
+	}
+
+	/**
+	 * Specify a foreign key for the table.
+	 *
+	 * @param  string|array  $columns
+	 * @param  string  $name
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function foreign($columns, $name = null)
+	{
+		return $this->indexCommand('foreign', $columns, $name);
+	}
+
+	/**
+	 * Create a new auto-incrementing integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function increments($column)
+	{
+		return $this->unsignedInteger($column, true);
+	}
+
+	/**
+	 * Create a new auto-incrementing big integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function bigIncrements($column)
+	{
+		return $this->unsignedBigInteger($column, true);
+	}
+
+	/**
+	 * Create a new char column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  int  $length
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function char($column, $length = 255)
+	{
+		return $this->addColumn('char', $column, compact('length'));
+	}
+
+	/**
+	 * Create a new string column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  int  $length
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function string($column, $length = 255)
+	{
+		return $this->addColumn('string', $column, compact('length'));
+	}
+
+	/**
+	 * Create a new text column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function text($column)
+	{
+		return $this->addColumn('text', $column);
+	}
+
+	/**
+	 * Create a new medium text column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function mediumText($column)
+	{
+		return $this->addColumn('mediumText', $column);
+	}
+
+	/**
+	 * Create a new long text column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function longText($column)
+	{
+		return $this->addColumn('longText', $column);
+	}
+
+	/**
+	 * Create a new integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @param  bool  $unsigned
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function integer($column, $autoIncrement = false, $unsigned = false)
+	{
+		return $this->addColumn('integer', $column, compact('autoIncrement', 'unsigned'));
+	}
+
+	/**
+	 * Create a new big integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @param  bool  $unsigned
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function bigInteger($column, $autoIncrement = false, $unsigned = false)
+	{
+		return $this->addColumn('bigInteger', $column, compact('autoIncrement', 'unsigned'));
+	}
+
+	/**
+	 * Create a new medium integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @param  bool  $unsigned
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function mediumInteger($column, $autoIncrement = false, $unsigned = false)
+	{
+		return $this->addColumn('mediumInteger', $column, compact('autoIncrement', 'unsigned'));
+	}
+
+	/**
+	 * Create a new tiny integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @param  bool  $unsigned
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function tinyInteger($column, $autoIncrement = false, $unsigned = false)
+	{
+		return $this->addColumn('tinyInteger', $column, compact('autoIncrement', 'unsigned'));
+	}
+
+	/**
+	 * Create a new small integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @param  bool  $unsigned
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function smallInteger($column, $autoIncrement = false, $unsigned = false)
+	{
+		return $this->addColumn('smallInteger', $column, compact('autoIncrement', 'unsigned'));
+	}
+
+	/**
+	 * Create a new unsigned integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function unsignedInteger($column, $autoIncrement = false)
+	{
+		return $this->integer($column, $autoIncrement, true);
+	}
+
+	/**
+	 * Create a new unsigned big integer column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  bool  $autoIncrement
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function unsignedBigInteger($column, $autoIncrement = false)
+	{
+		return $this->bigInteger($column, $autoIncrement, true);
+	}
+
+	/**
+	 * Create a new float column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  int     $total
+	 * @param  int     $places
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function float($column, $total = 8, $places = 2)
+	{
+		return $this->addColumn('float', $column, compact('total', 'places'));
+	}
+
+	/**
+	 * Create a new double column on the table.
+	 *
+	 * @param  string   $column
+	 * @param  int|null	$total
+	 * @param  int|null $places
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function double($column, $total = null, $places = null)
+	{
+		return $this->addColumn('double', $column, compact('total', 'places'));
+	}
+
+	/**
+	 * Create a new decimal column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  int     $total
+	 * @param  int     $places
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function decimal($column, $total = 8, $places = 2)
+	{
+		return $this->addColumn('decimal', $column, compact('total', 'places'));
+	}
+
+	/**
+	 * Create a new boolean column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function boolean($column)
+	{
+		return $this->addColumn('boolean', $column);
+	}
+
+	/**
+	 * Create a new enum column on the table.
+	 *
+	 * @param  string  $column
+	 * @param  array   $allowed
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function enum($column, array $allowed)
+	{
+		return $this->addColumn('enum', $column, compact('allowed'));
+	}
+
+	/**
+	 * Create a new date column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function date($column)
+	{
+		return $this->addColumn('date', $column);
+	}
+
+	/**
+	 * Create a new date-time column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function dateTime($column)
+	{
+		return $this->addColumn('dateTime', $column);
+	}
+
+	/**
+	 * Create a new time column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function time($column)
+	{
+		return $this->addColumn('time', $column);
+	}
+
+	/**
+	 * Create a new timestamp column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function timestamp($column)
+	{
+		return $this->addColumn('timestamp', $column);
+	}
+
+	/**
+	 * Add nullable creation and update timestamps to the table.
+	 *
+	 * @return void
+	 */
+	public function nullableTimestamps()
+	{
+		$this->timestamp('created_at')->nullable();
+
+		$this->timestamp('updated_at')->nullable();
+	}
+
+	/**
+	 * Add creation and update timestamps to the table.
+	 *
+	 * @return void
+	 */
+	public function timestamps()
+	{
+		$this->timestamp('created_at');
+
+		$this->timestamp('updated_at');
+	}
+
+	/**
+	 * Add a "deleted at" timestamp for the table.
+	 *
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function softDeletes()
+	{
+		return $this->timestamp('deleted_at')->nullable();
+	}
+
+	/**
+	 * Create a new binary column on the table.
+	 *
+	 * @param  string  $column
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function binary($column)
+	{
+		return $this->addColumn('binary', $column);
+	}
+
+	/**
+	 * Add the proper columns for a polymorphic table.
+	 *
+	 * @param  string  $name
+	 * @param  string|null  $indexName
+	 * @return void
+	 */
+	public function morphs($name, $indexName = null)
+	{
+		$this->unsignedInteger("{$name}_id");
+
+		$this->string("{$name}_type");
+
+		$this->index(array("{$name}_id", "{$name}_type"), $indexName);
+	}
+
+	/**
+	 * Adds the `remember_token` column to the table.
+	 *
+	 * @return \Illuminate\Support\Fluent
+	 */
+	public function rememberToken()
+	{
+		return $this->string('remember_token', 100)->nullable();
+	}
+
+	/**
+	 * Create a new drop index command on the blueprint.
+	 *
+	 * @param  string  $command
+	 * @param  string  $type
+	 * @param  string|array  $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	protected function dropIndexCommand($command, $type, $index)
+	{
+		$columns = array();
+
+		// If the given "index" is actually an array of columns, the developer means
+		// to drop an index merely by specifying the columns involved without the
+		// conventional name, so we will build the index name from the columns.
+		if (is_array($index))
+		{
+			$columns = $index;
+
+			$index = $this->createIndexName($type, $columns);
+		}
+
+		return $this->indexCommand($command, $columns, $index);
+	}
+
+	/**
+	 * Add a new index command to the blueprint.
+	 *
+	 * @param  string        $type
+	 * @param  string|array  $columns
+	 * @param  string        $index
+	 * @return \Illuminate\Support\Fluent
+	 */
+	protected function indexCommand($type, $columns, $index)
+	{
+		$columns = (array) $columns;
+
+		// If no name was specified for this index, we will create one using a basic
+		// convention of the table name, followed by the columns, followed by an
+		// index type, such as primary or index, which makes the index unique.
+		if (is_null($index))
+		{
+			$index = $this->createIndexName($type, $columns);
+		}
+
+		return $this->addCommand($type, compact('index', 'columns'));
+	}
+
+	/**
+	 * Create a default index name for the table.
+	 *
+	 * @param  string  $type
+	 * @param  array   $columns
+	 * @return string
+	 */
+	protected function createIndexName($type, array $columns)
+	{
+		$index = strtolower($this->table.'_'.implode('_', $columns).'_'.$type);
+
+		return str_replace(array('-', '.'), '_', $index);
+	}
+
+	/**
+	 * Add a new column to the blueprint.
+	 *
+	 * @param  string  $type
+	 * @param  string  $name
+	 * @param  array   $parameters
+	 * @return \Illuminate\Support\Fluent
+	 */
+	protected function addColumn($type, $name, array $parameters = array())
+	{
+		$attributes = array_merge(compact('type', 'name'), $parameters);
+
+		$this->columns[] = $column = new Fluent($attributes);
+
+		return $column;
+	}
+
+	/**
+	 * Remove a column from the schema blueprint.
+	 *
+	 * @param  string  $name
+	 * @return $this
+	 */
+	public function removeColumn($name)
+	{
+		$this->columns = array_values(array_filter($this->columns, function($c) use ($name)
+		{
+			return $c['attributes']['name'] != $name;
+		}));
+
+		return $this;
+	}
+
+	/**
+	 * Add a new command to the blueprint.
+	 *
+	 * @param  string  $name
+	 * @param  array  $parameters
+	 * @return \Illuminate\Support\Fluent
+	 */
+	protected function addCommand($name, array $parameters = array())
+	{
+		$this->commands[] = $command = $this->createCommand($name, $parameters);
+
+		return $command;
+	}
+
+	/**
+	 * Create a new Fluent command.
+	 *
+	 * @param  string  $name
+	 * @param  array   $parameters
+	 * @return \Illuminate\Support\Fluent
+	 */
+	protected function createCommand($name, array $parameters = array())
+	{
+		return new Fluent(array_merge(compact('name'), $parameters));
+	}
+
+	/**
+	 * Get the table the blueprint describes.
+	 *
+	 * @return string
+	 */
+	public function getTable()
+	{
+		return $this->table;
+	}
+
+	/**
+	 * Get the columns that should be added.
+	 *
+	 * @return array
+	 */
+	public function getColumns()
+	{
+		return $this->columns;
+	}
+
+	/**
+	 * Get the commands on the blueprint.
+	 *
+	 * @return array
+	 */
+	public function getCommands()
+	{
+		return $this->commands;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php
new file mode 100755
index 0000000..707909b
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php
@@ -0,0 +1,223 @@
+<?php namespace Illuminate\Database\Schema;
+
+use Closure;
+use Illuminate\Database\Connection;
+
+class Builder {
+
+	/**
+	 * The database connection instance.
+	 *
+	 * @var \Illuminate\Database\Connection
+	 */
+	protected $connection;
+
+	/**
+	 * The schema grammar instance.
+	 *
+	 * @var \Illuminate\Database\Schema\Grammars\Grammar
+	 */
+	protected $grammar;
+
+	/**
+	 * The Blueprint resolver callback.
+	 *
+	 * @var \Closure
+	 */
+	protected $resolver;
+
+	/**
+	 * Create a new database Schema manager.
+	 *
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @return void
+	 */
+	public function __construct(Connection $connection)
+	{
+		$this->connection = $connection;
+		$this->grammar = $connection->getSchemaGrammar();
+	}
+
+	/**
+	 * Determine if the given table exists.
+	 *
+	 * @param  string  $table
+	 * @return bool
+	 */
+	public function hasTable($table)
+	{
+		$sql = $this->grammar->compileTableExists();
+
+		$table = $this->connection->getTablePrefix().$table;
+
+		return count($this->connection->select($sql, array($table))) > 0;
+	}
+
+	/**
+	 * Determine if the given table has a given column.
+	 *
+	 * @param  string  $table
+	 * @param  string  $column
+	 * @return bool
+	 */
+	public function hasColumn($table, $column)
+	{
+		$column = strtolower($column);
+
+		return in_array($column, array_map('strtolower', $this->getColumnListing($table)));
+	}
+
+	/**
+	 * Get the column listing for a given table.
+	 *
+	 * @param  string  $table
+	 * @return array
+	 */
+	public function getColumnListing($table)
+	{
+		$table = $this->connection->getTablePrefix().$table;
+
+		$results = $this->connection->select($this->grammar->compileColumnExists($table));
+
+		return $this->connection->getPostProcessor()->processColumnListing($results);
+	}
+
+	/**
+	 * Modify a table on the schema.
+	 *
+	 * @param  string    $table
+	 * @param  \Closure  $callback
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	public function table($table, Closure $callback)
+	{
+		$this->build($this->createBlueprint($table, $callback));
+	}
+
+	/**
+	 * Create a new table on the schema.
+	 *
+	 * @param  string    $table
+	 * @param  \Closure  $callback
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	public function create($table, Closure $callback)
+	{
+		$blueprint = $this->createBlueprint($table);
+
+		$blueprint->create();
+
+		$callback($blueprint);
+
+		$this->build($blueprint);
+	}
+
+	/**
+	 * Drop a table from the schema.
+	 *
+	 * @param  string  $table
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	public function drop($table)
+	{
+		$blueprint = $this->createBlueprint($table);
+
+		$blueprint->drop();
+
+		$this->build($blueprint);
+	}
+
+	/**
+	 * Drop a table from the schema if it exists.
+	 *
+	 * @param  string  $table
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	public function dropIfExists($table)
+	{
+		$blueprint = $this->createBlueprint($table);
+
+		$blueprint->dropIfExists();
+
+		$this->build($blueprint);
+	}
+
+	/**
+	 * Rename a table on the schema.
+	 *
+	 * @param  string  $from
+	 * @param  string  $to
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	public function rename($from, $to)
+	{
+		$blueprint = $this->createBlueprint($from);
+
+		$blueprint->rename($to);
+
+		$this->build($blueprint);
+	}
+
+	/**
+	 * Execute the blueprint to build / modify the table.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @return void
+	 */
+	protected function build(Blueprint $blueprint)
+	{
+		$blueprint->build($this->connection, $this->grammar);
+	}
+
+	/**
+	 * Create a new command set with a Closure.
+	 *
+	 * @param  string    $table
+	 * @param  \Closure  $callback
+	 * @return \Illuminate\Database\Schema\Blueprint
+	 */
+	protected function createBlueprint($table, Closure $callback = null)
+	{
+		if (isset($this->resolver))
+		{
+			return call_user_func($this->resolver, $table, $callback);
+		}
+
+		return new Blueprint($table, $callback);
+	}
+
+	/**
+	 * Get the database connection instance.
+	 *
+	 * @return \Illuminate\Database\Connection
+	 */
+	public function getConnection()
+	{
+		return $this->connection;
+	}
+
+	/**
+	 * Set the database connection instance.
+	 *
+	 * @param  \Illuminate\Database\Connection
+	 * @return $this
+	 */
+	public function setConnection(Connection $connection)
+	{
+		$this->connection = $connection;
+
+		return $this;
+	}
+
+	/**
+	 * Set the Schema Blueprint resolver callback.
+	 *
+	 * @param  \Closure  $resolver
+	 * @return void
+	 */
+	public function blueprintResolver(Closure $resolver)
+	{
+		$this->resolver = $resolver;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php
new file mode 100755
index 0000000..b45d095
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php
@@ -0,0 +1,270 @@
+<?php namespace Illuminate\Database\Schema\Grammars;
+
+use Illuminate\Support\Fluent;
+use Doctrine\DBAL\Schema\Column;
+use Doctrine\DBAL\Schema\TableDiff;
+use Illuminate\Database\Connection;
+use Illuminate\Database\Query\Expression;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Grammar as BaseGrammar;
+use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager;
+
+abstract class Grammar extends BaseGrammar {
+
+	/**
+	 * Compile a rename column command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @return array
+	 */
+	public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection)
+	{
+		$schema = $connection->getDoctrineSchemaManager();
+
+		$table = $this->getTablePrefix().$blueprint->getTable();
+
+		$column = $connection->getDoctrineColumn($table, $command->from);
+
+		$tableDiff = $this->getRenamedDiff($blueprint, $command, $column, $schema);
+
+		return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff);
+	}
+
+	/**
+	 * Get a new column instance with the new column name.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @param  \Doctrine\DBAL\Schema\Column  $column
+	 * @param  \Doctrine\DBAL\Schema\AbstractSchemaManager  $schema
+	 * @return \Doctrine\DBAL\Schema\TableDiff
+	 */
+	protected function getRenamedDiff(Blueprint $blueprint, Fluent $command, Column $column, SchemaManager $schema)
+	{
+		$tableDiff = $this->getDoctrineTableDiff($blueprint, $schema);
+
+		return $this->setRenamedColumns($tableDiff, $command, $column);
+	}
+
+	/**
+	 * Set the renamed columns on the table diff.
+	 *
+	 * @param  \Doctrine\DBAL\Schema\TableDiff  $tableDiff
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @param  \Doctrine\DBAL\Schema\Column  $column
+	 * @return \Doctrine\DBAL\Schema\TableDiff
+	 */
+	protected function setRenamedColumns(TableDiff $tableDiff, Fluent $command, Column $column)
+	{
+		$newColumn = new Column($command->to, $column->getType(), $column->toArray());
+
+		$tableDiff->renamedColumns = array($command->from => $newColumn);
+
+		return $tableDiff;
+	}
+
+	/**
+	 * Compile a foreign key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileForeign(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		$on = $this->wrapTable($command->on);
+
+		// We need to prepare several of the elements of the foreign key definition
+		// before we can create the SQL, such as wrapping the tables and convert
+		// an array of columns to comma-delimited strings for the SQL queries.
+		$columns = $this->columnize($command->columns);
+
+		$onColumns = $this->columnize((array) $command->references);
+
+		$sql = "alter table {$table} add constraint {$command->index} ";
+
+		$sql .= "foreign key ({$columns}) references {$on} ({$onColumns})";
+
+		// Once we have the basic foreign key creation statement constructed we can
+		// build out the syntax for what should happen on an update or delete of
+		// the affected columns, which will get something like "cascade", etc.
+		if ( ! is_null($command->onDelete))
+		{
+			$sql .= " on delete {$command->onDelete}";
+		}
+
+		if ( ! is_null($command->onUpdate))
+		{
+			$sql .= " on update {$command->onUpdate}";
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Compile the blueprint's column definitions.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @return array
+	 */
+	protected function getColumns(Blueprint $blueprint)
+	{
+		$columns = array();
+
+		foreach ($blueprint->getColumns() as $column)
+		{
+			// Each of the column types have their own compiler functions which are tasked
+			// with turning the column definition into its SQL format for this platform
+			// used by the connection. The column's modifiers are compiled and added.
+			$sql = $this->wrap($column).' '.$this->getType($column);
+
+			$columns[] = $this->addModifiers($sql, $blueprint, $column);
+		}
+
+		return $columns;
+	}
+
+	/**
+	 * Add the column modifiers to the definition.
+	 *
+	 * @param  string  $sql
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function addModifiers($sql, Blueprint $blueprint, Fluent $column)
+	{
+		foreach ($this->modifiers as $modifier)
+		{
+			if (method_exists($this, $method = "modify{$modifier}"))
+			{
+				$sql .= $this->{$method}($blueprint, $column);
+			}
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Get the primary key command if it exists on the blueprint.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  string  $name
+	 * @return \Illuminate\Support\Fluent|null
+	 */
+	protected function getCommandByName(Blueprint $blueprint, $name)
+	{
+		$commands = $this->getCommandsByName($blueprint, $name);
+
+		if (count($commands) > 0)
+		{
+			return reset($commands);
+		}
+	}
+
+	/**
+	 * Get all of the commands with a given name.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  string  $name
+	 * @return array
+	 */
+	protected function getCommandsByName(Blueprint $blueprint, $name)
+	{
+		return array_filter($blueprint->getCommands(), function($value) use ($name)
+		{
+			return $value->name == $name;
+		});
+	}
+
+	/**
+	 * Get the SQL for the column data type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function getType(Fluent $column)
+	{
+		return $this->{"type".ucfirst($column->type)}($column);
+	}
+
+	/**
+	 * Add a prefix to an array of values.
+	 *
+	 * @param  string  $prefix
+	 * @param  array   $values
+	 * @return array
+	 */
+	public function prefixArray($prefix, array $values)
+	{
+		return array_map(function($value) use ($prefix)
+		{
+			return $prefix.' '.$value;
+
+		}, $values);
+	}
+
+	/**
+	 * Wrap a table in keyword identifiers.
+	 *
+	 * @param  mixed   $table
+	 * @return string
+	 */
+	public function wrapTable($table)
+	{
+		if ($table instanceof Blueprint) $table = $table->getTable();
+
+		return parent::wrapTable($table);
+	}
+
+	/**
+	 * Wrap a value in keyword identifiers.
+	 *
+	 * @param  string  $value
+	 * @return string
+	 */
+	public function wrap($value)
+	{
+		if ($value instanceof Fluent) $value = $value->name;
+
+		return parent::wrap($value);
+	}
+
+	/**
+	 * Format a value so that it can be used in "default" clauses.
+	 *
+	 * @param  mixed   $value
+	 * @return string
+	 */
+	protected function getDefaultValue($value)
+	{
+		if ($value instanceof Expression) return $value;
+
+		if (is_bool($value)) return "'".(int) $value."'";
+
+		return "'".strval($value)."'";
+	}
+
+	/**
+	 * Create an empty Doctrine DBAL TableDiff from the Blueprint.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Doctrine\DBAL\Schema\AbstractSchemaManager  $schema
+	 * @return \Doctrine\DBAL\Schema\TableDiff
+	 */
+	protected function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema)
+	{
+		$table = $this->getTablePrefix().$blueprint->getTable();
+
+		$tableDiff = new TableDiff($table);
+
+		$tableDiff->fromTable = $schema->listTableDetails($table);
+
+		return $tableDiff;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
new file mode 100755
index 0000000..c4ef6a5
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
@@ -0,0 +1,595 @@
+<?php namespace Illuminate\Database\Schema\Grammars;
+
+use Illuminate\Support\Fluent;
+use Illuminate\Database\Connection;
+use Illuminate\Database\Schema\Blueprint;
+
+class MySqlGrammar extends Grammar {
+
+	/**
+	 * The possible column modifiers.
+	 *
+	 * @var array
+	 */
+	protected $modifiers = array('Unsigned', 'Nullable', 'Default', 'Increment', 'Comment', 'After');
+
+	/**
+	 * The possible column serials
+	 *
+	 * @var array
+	 */
+	protected $serials = array('bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger');
+
+	/**
+	 * Compile the query to determine the list of tables.
+	 *
+	 * @return string
+	 */
+	public function compileTableExists()
+	{
+		return 'select * from information_schema.tables where table_schema = ? and table_name = ?';
+	}
+
+	/**
+	 * Compile the query to determine the list of columns.
+	 *
+	 * @return string
+	 */
+	public function compileColumnExists()
+	{
+		return "select column_name from information_schema.columns where table_schema = ? and table_name = ?";
+	}
+
+	/**
+	 * Compile a create table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @return string
+	 */
+	public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection)
+	{
+		$columns = implode(', ', $this->getColumns($blueprint));
+
+		$sql = 'create table '.$this->wrapTable($blueprint)." ($columns)";
+
+		// Once we have the primary SQL, we can add the encoding option to the SQL for
+		// the table.  Then, we can check if a storage engine has been supplied for
+		// the table. If so, we will add the engine declaration to the SQL query.
+		$sql = $this->compileCreateEncoding($sql, $connection);
+
+		if (isset($blueprint->engine))
+		{
+			$sql .= ' engine = '.$blueprint->engine;
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Append the character set specifications to a command.
+	 *
+	 * @param  string  $sql
+	 * @param  \Illuminate\Database\Connection  $connection
+	 * @return string
+	 */
+	protected function compileCreateEncoding($sql, Connection $connection)
+	{
+		if ( ! is_null($charset = $connection->getConfig('charset')))
+		{
+			$sql .= ' default character set '.$charset;
+		}
+
+		if ( ! is_null($collation = $connection->getConfig('collation')))
+		{
+			$sql .= ' collate '.$collation;
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Compile an add column command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileAdd(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		$columns = $this->prefixArray('add', $this->getColumns($blueprint));
+
+		return 'alter table '.$table.' '.implode(', ', $columns);
+	}
+
+	/**
+	 * Compile a primary key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compilePrimary(Blueprint $blueprint, Fluent $command)
+	{
+		$command->name(null);
+
+		return $this->compileKey($blueprint, $command, 'primary key');
+	}
+
+	/**
+	 * Compile a unique key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileUnique(Blueprint $blueprint, Fluent $command)
+	{
+		return $this->compileKey($blueprint, $command, 'unique');
+	}
+
+	/**
+	 * Compile a plain index key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileIndex(Blueprint $blueprint, Fluent $command)
+	{
+		return $this->compileKey($blueprint, $command, 'index');
+	}
+
+	/**
+	 * Compile an index creation command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @param  string  $type
+	 * @return string
+	 */
+	protected function compileKey(Blueprint $blueprint, Fluent $command, $type)
+	{
+		$columns = $this->columnize($command->columns);
+
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} add {$type} {$command->index}($columns)";
+	}
+
+	/**
+	 * Compile a drop table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDrop(Blueprint $blueprint, Fluent $command)
+	{
+		return 'drop table '.$this->wrapTable($blueprint);
+	}
+
+	/**
+	 * Compile a drop table (if exists) command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropIfExists(Blueprint $blueprint, Fluent $command)
+	{
+		return 'drop table if exists '.$this->wrapTable($blueprint);
+	}
+
+	/**
+	 * Compile a drop column command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropColumn(Blueprint $blueprint, Fluent $command)
+	{
+		$columns = $this->prefixArray('drop', $this->wrapArray($command->columns));
+
+		$table = $this->wrapTable($blueprint);
+
+		return 'alter table '.$table.' '.implode(', ', $columns);
+	}
+
+	/**
+	 * Compile a drop primary key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropPrimary(Blueprint $blueprint, Fluent $command)
+	{
+		return 'alter table '.$this->wrapTable($blueprint).' drop primary key';
+	}
+
+	/**
+	 * Compile a drop unique key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropUnique(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} drop index {$command->index}";
+	}
+
+	/**
+	 * Compile a drop index command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropIndex(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} drop index {$command->index}";
+	}
+
+	/**
+	 * Compile a drop foreign key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropForeign(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} drop foreign key {$command->index}";
+	}
+
+	/**
+	 * Compile a rename table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileRename(Blueprint $blueprint, Fluent $command)
+	{
+		$from = $this->wrapTable($blueprint);
+
+		return "rename table {$from} to ".$this->wrapTable($command->to);
+	}
+
+	/**
+	 * Create the column definition for a char type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeChar(Fluent $column)
+	{
+		return "char({$column->length})";
+	}
+
+	/**
+	 * Create the column definition for a string type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeString(Fluent $column)
+	{
+		return "varchar({$column->length})";
+	}
+
+	/**
+	 * Create the column definition for a text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeText(Fluent $column)
+	{
+		return 'text';
+	}
+
+	/**
+	 * Create the column definition for a medium text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeMediumText(Fluent $column)
+	{
+		return 'mediumtext';
+	}
+
+	/**
+	 * Create the column definition for a long text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeLongText(Fluent $column)
+	{
+		return 'longtext';
+	}
+
+	/**
+	 * Create the column definition for a big integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBigInteger(Fluent $column)
+	{
+		return 'bigint';
+	}
+
+	/**
+	 * Create the column definition for a integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeInteger(Fluent $column)
+	{
+		return 'int';
+	}
+
+	/**
+	 * Create the column definition for a medium integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeMediumInteger(Fluent $column)
+	{
+		return 'mediumint';
+	}
+
+	/**
+	 * Create the column definition for a tiny integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTinyInteger(Fluent $column)
+	{
+		return 'tinyint';
+	}
+
+	/**
+	 * Create the column definition for a small integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeSmallInteger(Fluent $column)
+	{
+		return 'smallint';
+	}
+
+	/**
+	 * Create the column definition for a float type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeFloat(Fluent $column)
+	{
+		return "float({$column->total}, {$column->places})";
+	}
+
+	/**
+	 * Create the column definition for a double type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDouble(Fluent $column)
+	{
+		if ($column->total && $column->places)
+		{
+			return "double({$column->total}, {$column->places})";
+		}
+
+		return 'double';
+	}
+
+	/**
+	 * Create the column definition for a decimal type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDecimal(Fluent $column)
+	{
+		return "decimal({$column->total}, {$column->places})";
+	}
+
+	/**
+	 * Create the column definition for a boolean type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBoolean(Fluent $column)
+	{
+		return 'tinyint(1)';
+	}
+
+	/**
+	 * Create the column definition for an enum type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeEnum(Fluent $column)
+	{
+		return "enum('".implode("', '", $column->allowed)."')";
+	}
+
+	/**
+	 * Create the column definition for a date type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDate(Fluent $column)
+	{
+		return 'date';
+	}
+
+	/**
+	 * Create the column definition for a date-time type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDateTime(Fluent $column)
+	{
+		return 'datetime';
+	}
+
+	/**
+	 * Create the column definition for a time type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTime(Fluent $column)
+	{
+		return 'time';
+	}
+
+	/**
+	 * Create the column definition for a timestamp type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTimestamp(Fluent $column)
+	{
+		if ( ! $column->nullable) return 'timestamp default 0';
+
+		return 'timestamp';
+	}
+
+	/**
+	 * Create the column definition for a binary type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBinary(Fluent $column)
+	{
+		return 'blob';
+	}
+
+	/**
+	 * Get the SQL for an unsigned column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyUnsigned(Blueprint $blueprint, Fluent $column)
+	{
+		if ($column->unsigned) return ' unsigned';
+	}
+
+	/**
+	 * Get the SQL for a nullable column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyNullable(Blueprint $blueprint, Fluent $column)
+	{
+		return $column->nullable ? ' null' : ' not null';
+	}
+
+	/**
+	 * Get the SQL for a default column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyDefault(Blueprint $blueprint, Fluent $column)
+	{
+		if ( ! is_null($column->default))
+		{
+			return " default ".$this->getDefaultValue($column->default);
+		}
+	}
+
+	/**
+	 * Get the SQL for an auto-increment column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
+	{
+		if (in_array($column->type, $this->serials) && $column->autoIncrement)
+		{
+			return ' auto_increment primary key';
+		}
+	}
+
+	/**
+	 * Get the SQL for an "after" column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyAfter(Blueprint $blueprint, Fluent $column)
+	{
+		if ( ! is_null($column->after))
+		{
+			return ' after '.$this->wrap($column->after);
+		}
+	}
+
+	/**
+	 * Get the SQL for an "comment" column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyComment(Blueprint $blueprint, Fluent $column)
+	{
+		if ( ! is_null($column->comment))
+		{
+			return ' comment "'.$column->comment.'"';
+		}
+	}
+
+	/**
+	 * Wrap a single string in keyword identifiers.
+	 *
+	 * @param  string  $value
+	 * @return string
+	 */
+	protected function wrapValue($value)
+	{
+		if ($value === '*') return $value;
+
+		return '`'.str_replace('`', '``', $value).'`';
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
----------------------------------------------------------------------
diff --git a/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
new file mode 100755
index 0000000..7691617
--- /dev/null
+++ b/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
@@ -0,0 +1,489 @@
+<?php namespace Illuminate\Database\Schema\Grammars;
+
+use Illuminate\Support\Fluent;
+use Illuminate\Database\Schema\Blueprint;
+
+class PostgresGrammar extends Grammar {
+
+	/**
+	 * The possible column modifiers.
+	 *
+	 * @var array
+	 */
+	protected $modifiers = array('Increment', 'Nullable', 'Default');
+
+	/**
+	 * The columns available as serials.
+	 *
+	 * @var array
+	 */
+	protected $serials = array('bigInteger', 'integer');
+
+	/**
+	 * Compile the query to determine if a table exists.
+	 *
+	 * @return string
+	 */
+	public function compileTableExists()
+	{
+		return 'select * from information_schema.tables where table_name = ?';
+	}
+
+	/**
+	 * Compile the query to determine the list of columns.
+	 *
+	 * @param  string  $table
+	 * @return string
+	 */
+	public function compileColumnExists($table)
+	{
+		return "select column_name from information_schema.columns where table_name = '$table'";
+	}
+
+	/**
+	 * Compile a create table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileCreate(Blueprint $blueprint, Fluent $command)
+	{
+		$columns = implode(', ', $this->getColumns($blueprint));
+
+		return 'create table '.$this->wrapTable($blueprint)." ($columns)";
+	}
+
+	/**
+	 * Compile a create table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileAdd(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		$columns = $this->prefixArray('add column', $this->getColumns($blueprint));
+
+		return 'alter table '.$table.' '.implode(', ', $columns);
+	}
+
+	/**
+	 * Compile a primary key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compilePrimary(Blueprint $blueprint, Fluent $command)
+	{
+		$columns = $this->columnize($command->columns);
+
+		return 'alter table '.$this->wrapTable($blueprint)." add primary key ({$columns})";
+	}
+
+	/**
+	 * Compile a unique key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileUnique(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		$columns = $this->columnize($command->columns);
+
+		return "alter table $table add constraint {$command->index} unique ($columns)";
+	}
+
+	/**
+	 * Compile a plain index key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileIndex(Blueprint $blueprint, Fluent $command)
+	{
+		$columns = $this->columnize($command->columns);
+
+		return "create index {$command->index} on ".$this->wrapTable($blueprint)." ({$columns})";
+	}
+
+	/**
+	 * Compile a drop table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDrop(Blueprint $blueprint, Fluent $command)
+	{
+		return 'drop table '.$this->wrapTable($blueprint);
+	}
+
+	/**
+	 * Compile a drop table (if exists) command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropIfExists(Blueprint $blueprint, Fluent $command)
+	{
+		return 'drop table if exists '.$this->wrapTable($blueprint);
+	}
+
+	/**
+	 * Compile a drop column command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropColumn(Blueprint $blueprint, Fluent $command)
+	{
+		$columns = $this->prefixArray('drop column', $this->wrapArray($command->columns));
+
+		$table = $this->wrapTable($blueprint);
+
+		return 'alter table '.$table.' '.implode(', ', $columns);
+	}
+
+	/**
+	 * Compile a drop primary key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropPrimary(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $blueprint->getTable();
+
+		return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$table}_pkey";
+	}
+
+	/**
+	 * Compile a drop unique key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropUnique(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} drop constraint {$command->index}";
+	}
+
+	/**
+	 * Compile a drop index command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropIndex(Blueprint $blueprint, Fluent $command)
+	{
+		return "drop index {$command->index}";
+	}
+
+	/**
+	 * Compile a drop foreign key command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileDropForeign(Blueprint $blueprint, Fluent $command)
+	{
+		$table = $this->wrapTable($blueprint);
+
+		return "alter table {$table} drop constraint {$command->index}";
+	}
+
+	/**
+	 * Compile a rename table command.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $command
+	 * @return string
+	 */
+	public function compileRename(Blueprint $blueprint, Fluent $command)
+	{
+		$from = $this->wrapTable($blueprint);
+
+		return "alter table {$from} rename to ".$this->wrapTable($command->to);
+	}
+
+	/**
+	 * Create the column definition for a char type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeChar(Fluent $column)
+	{
+		return "char({$column->length})";
+	}
+
+	/**
+	 * Create the column definition for a string type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeString(Fluent $column)
+	{
+		return "varchar({$column->length})";
+	}
+
+	/**
+	 * Create the column definition for a text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeText(Fluent $column)
+	{
+		return 'text';
+	}
+
+	/**
+	 * Create the column definition for a medium text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeMediumText(Fluent $column)
+	{
+		return 'text';
+	}
+
+	/**
+	 * Create the column definition for a long text type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeLongText(Fluent $column)
+	{
+		return 'text';
+	}
+
+	/**
+	 * Create the column definition for a integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeInteger(Fluent $column)
+	{
+		return $column->autoIncrement ? 'serial' : 'integer';
+	}
+
+	/**
+	 * Create the column definition for a big integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBigInteger(Fluent $column)
+	{
+		return $column->autoIncrement ? 'bigserial' : 'bigint';
+	}
+
+	/**
+	 * Create the column definition for a medium integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeMediumInteger(Fluent $column)
+	{
+		return 'integer';
+	}
+
+	/**
+	 * Create the column definition for a tiny integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTinyInteger(Fluent $column)
+	{
+		return 'smallint';
+	}
+
+	/**
+	 * Create the column definition for a small integer type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeSmallInteger(Fluent $column)
+	{
+		return 'smallint';
+	}
+
+	/**
+	 * Create the column definition for a float type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeFloat(Fluent $column)
+	{
+		return 'real';
+	}
+
+	/**
+	 * Create the column definition for a double type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDouble(Fluent $column)
+	{
+		return 'double precision';
+	}
+
+	/**
+	 * Create the column definition for a decimal type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDecimal(Fluent $column)
+	{
+		return "decimal({$column->total}, {$column->places})";
+	}
+
+	/**
+	 * Create the column definition for a boolean type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBoolean(Fluent $column)
+	{
+		return 'boolean';
+	}
+
+	/**
+	 * Create the column definition for an enum type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeEnum(Fluent $column)
+	{
+		$allowed = array_map(function($a) { return "'".$a."'"; }, $column->allowed);
+
+		return "varchar(255) check (\"{$column->name}\" in (".implode(', ', $allowed)."))";
+	}
+
+	/**
+	 * Create the column definition for a date type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDate(Fluent $column)
+	{
+		return 'date';
+	}
+
+	/**
+	 * Create the column definition for a date-time type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeDateTime(Fluent $column)
+	{
+		return 'timestamp';
+	}
+
+	/**
+	 * Create the column definition for a time type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTime(Fluent $column)
+	{
+		return 'time';
+	}
+
+	/**
+	 * Create the column definition for a timestamp type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeTimestamp(Fluent $column)
+	{
+		return 'timestamp';
+	}
+
+	/**
+	 * Create the column definition for a binary type.
+	 *
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string
+	 */
+	protected function typeBinary(Fluent $column)
+	{
+		return 'bytea';
+	}
+
+	/**
+	 * Get the SQL for a nullable column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyNullable(Blueprint $blueprint, Fluent $column)
+	{
+		return $column->nullable ? ' null' : ' not null';
+	}
+
+	/**
+	 * Get the SQL for a default column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyDefault(Blueprint $blueprint, Fluent $column)
+	{
+		if ( ! is_null($column->default))
+		{
+			return " default ".$this->getDefaultValue($column->default);
+		}
+	}
+
+	/**
+	 * Get the SQL for an auto-increment column modifier.
+	 *
+	 * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
+	 * @param  \Illuminate\Support\Fluent  $column
+	 * @return string|null
+	 */
+	protected function modifyIncrement(Blueprint $blueprint, Fluent $column)
+	{
+		if (in_array($column->type, $this->serials) && $column->autoIncrement)
+		{
+			return ' primary key';
+		}
+	}
+
+}


Mime
View raw message