Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE358177E4 for ; Fri, 1 May 2015 21:32:48 +0000 (UTC) Received: (qmail 95091 invoked by uid 500); 1 May 2015 21:32:48 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 94933 invoked by uid 500); 1 May 2015 21:32:48 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 94551 invoked by uid 99); 1 May 2015 21:32:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2015 21:32:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 49D66E2F1B; Fri, 1 May 2015 21:32:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndoshi@apache.org To: commits@airavata.apache.org Date: Fri, 01 May 2015 21:32:52 -0000 Message-Id: <6ba1e9fbfd6a431a8f8a7379ce779d8a@git.apache.org> In-Reply-To: <75facea618c04426a66df940fb7893c3@git.apache.org> References: <75facea618c04426a66df940fb7893c3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/57] [partial] airavata-php-gateway git commit: AIRAVATA 1632 + Job Description for Admin Dashboard http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php b/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php new file mode 100755 index 0000000..bd66ab3 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php @@ -0,0 +1,199 @@ +buildSession(parent::callCustomCreator($driver)); + } + + /** + * Create an instance of the "array" session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createArrayDriver() + { + return new Store($this->app['config']['session.cookie'], new NullSessionHandler); + } + + /** + * Create an instance of the "cookie" session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createCookieDriver() + { + $lifetime = $this->app['config']['session.lifetime']; + + return $this->buildSession(new CookieSessionHandler($this->app['cookie'], $lifetime)); + } + + /** + * Create an instance of the file session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createFileDriver() + { + return $this->createNativeDriver(); + } + + /** + * Create an instance of the file session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createNativeDriver() + { + $path = $this->app['config']['session.files']; + + return $this->buildSession(new FileSessionHandler($this->app['files'], $path)); + } + + /** + * Create an instance of the database session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createDatabaseDriver() + { + $connection = $this->getDatabaseConnection(); + + $table = $this->app['config']['session.table']; + + return $this->buildSession(new DatabaseSessionHandler($connection, $table)); + } + + /** + * Get the database connection for the database driver. + * + * @return \Illuminate\Database\Connection + */ + protected function getDatabaseConnection() + { + $connection = $this->app['config']['session.connection']; + + return $this->app['db']->connection($connection); + } + + /** + * Create an instance of the APC session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createApcDriver() + { + return $this->createCacheBased('apc'); + } + + /** + * Create an instance of the Memcached session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createMemcachedDriver() + { + return $this->createCacheBased('memcached'); + } + + /** + * Create an instance of the Wincache session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createWincacheDriver() + { + return $this->createCacheBased('wincache'); + } + + /** + * Create an instance of the Redis session driver. + * + * @return \Illuminate\Session\Store + */ + protected function createRedisDriver() + { + $handler = $this->createCacheHandler('redis'); + + $handler->getCache()->getStore()->setConnection($this->app['config']['session.connection']); + + return $this->buildSession($handler); + } + + /** + * Create an instance of a cache driven driver. + * + * @param string $driver + * @return \Illuminate\Session\Store + */ + protected function createCacheBased($driver) + { + return $this->buildSession($this->createCacheHandler($driver)); + } + + /** + * Create the cache based session handler instance. + * + * @param string $driver + * @return \Illuminate\Session\CacheBasedSessionHandler + */ + protected function createCacheHandler($driver) + { + $minutes = $this->app['config']['session.lifetime']; + + return new CacheBasedSessionHandler($this->app['cache']->driver($driver), $minutes); + } + + /** + * Build the session instance. + * + * @param \SessionHandlerInterface $handler + * @return \Illuminate\Session\Store + */ + protected function buildSession($handler) + { + return new Store($this->app['config']['session.cookie'], $handler); + } + + /** + * Get the session configuration. + * + * @return array + */ + public function getSessionConfig() + { + return $this->app['config']['session']; + } + + /** + * Get the default session driver name. + * + * @return string + */ + public function getDefaultDriver() + { + return $this->app['config']['session.driver']; + } + + /** + * Set the default session driver name. + * + * @param string $name + * @return void + */ + public function setDefaultDriver($name) + { + $this->app['config']['session.driver'] = $name; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php b/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php new file mode 100755 index 0000000..0efe172 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php @@ -0,0 +1,65 @@ +setupDefaultDriver(); + + $this->registerSessionManager(); + + $this->registerSessionDriver(); + } + + /** + * Setup the default session driver for the application. + * + * @return void + */ + protected function setupDefaultDriver() + { + if ($this->app->runningInConsole()) + { + $this->app['config']['session.driver'] = 'array'; + } + } + + /** + * Register the session manager instance. + * + * @return void + */ + protected function registerSessionManager() + { + $this->app->bindShared('session', function($app) + { + return new SessionManager($app); + }); + } + + /** + * Register the session driver instance. + * + * @return void + */ + protected function registerSessionDriver() + { + $this->app->bindShared('session.store', function($app) + { + // First, we will create the session manager which is responsible for the + // creation of the various session drivers when they are needed by the + // application instance, and will resolve them on a lazy load basis. + $manager = $app['session']; + + return $manager->driver(); + }); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Session/Store.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Session/Store.php b/vendor/laravel/framework/src/Illuminate/Session/Store.php new file mode 100755 index 0000000..b41f4a7 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Session/Store.php @@ -0,0 +1,630 @@ +setId($id); + $this->name = $name; + $this->handler = $handler; + $this->metaBag = new MetadataBag; + } + + /** + * {@inheritdoc} + */ + public function start() + { + $this->loadSession(); + + if ( ! $this->has('_token')) $this->regenerateToken(); + + return $this->started = true; + } + + /** + * Load the session data from the handler. + * + * @return void + */ + protected function loadSession() + { + $this->attributes = $this->readFromHandler(); + + foreach (array_merge($this->bags, array($this->metaBag)) as $bag) + { + $this->initializeLocalBag($bag); + + $bag->initialize($this->bagData[$bag->getStorageKey()]); + } + } + + /** + * Read the session data from the handler. + * + * @return array + */ + protected function readFromHandler() + { + $data = $this->handler->read($this->getId()); + + return $data ? unserialize($data) : array(); + } + + /** + * Initialize a bag in storage if it doesn't exist. + * + * @param \Symfony\Component\HttpFoundation\Session\SessionBagInterface $bag + * @return void + */ + protected function initializeLocalBag($bag) + { + $this->bagData[$bag->getStorageKey()] = $this->pull($bag->getStorageKey(), []); + } + + /** + * {@inheritdoc} + */ + public function getId() + { + return $this->id; + } + + /** + * {@inheritdoc} + */ + public function setId($id) + { + if ( ! $this->isValidId($id)) + { + $id = $this->generateSessionId(); + } + + $this->id = $id; + } + + /** + * Determine if this is a valid session ID. + * + * @param string $id + * @return bool + */ + public function isValidId($id) + { + return is_string($id) && preg_match('/^[a-f0-9]{40}$/', $id); + } + + /** + * Get a new, random session ID. + * + * @return string + */ + protected function generateSessionId() + { + return sha1(uniqid('', true).str_random(25).microtime(true)); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * {@inheritdoc} + */ + public function invalidate($lifetime = null) + { + $this->attributes = array(); + + $this->migrate(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function migrate($destroy = false, $lifetime = null) + { + if ($destroy) $this->handler->destroy($this->getId()); + + $this->setExists(false); + + $this->id = $this->generateSessionId(); return true; + } + + /** + * Generate a new session identifier. + * + * @param bool $destroy + * @return bool + */ + public function regenerate($destroy = false) + { + return $this->migrate($destroy); + } + + /** + * {@inheritdoc} + */ + public function save() + { + $this->addBagDataToSession(); + + $this->ageFlashData(); + + $this->handler->write($this->getId(), serialize($this->attributes)); + + $this->started = false; + } + + /** + * Merge all of the bag data into the session. + * + * @return void + */ + protected function addBagDataToSession() + { + foreach (array_merge($this->bags, array($this->metaBag)) as $bag) + { + $this->put($bag->getStorageKey(), $this->bagData[$bag->getStorageKey()]); + } + } + + /** + * Age the flash data for the session. + * + * @return void + */ + public function ageFlashData() + { + foreach ($this->get('flash.old', array()) as $old) { $this->forget($old); } + + $this->put('flash.old', $this->get('flash.new', array())); + + $this->put('flash.new', array()); + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + return ! is_null($this->get($name)); + } + + /** + * {@inheritdoc} + */ + public function get($name, $default = null) + { + return array_get($this->attributes, $name, $default); + } + + /** + * Get the value of a given key and then forget it. + * + * @param string $key + * @param string $default + * @return mixed + */ + public function pull($key, $default = null) + { + return array_pull($this->attributes, $key, $default); + } + + /** + * Determine if the session contains old input. + * + * @param string $key + * @return bool + */ + public function hasOldInput($key = null) + { + $old = $this->getOldInput($key); + + return is_null($key) ? count($old) > 0 : ! is_null($old); + } + + /** + * Get the requested item from the flashed input array. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function getOldInput($key = null, $default = null) + { + $input = $this->get('_old_input', array()); + + // Input that is flashed to the session can be easily retrieved by the + // developer, making repopulating old forms and the like much more + // convenient, since the request's previous input is available. + return array_get($input, $key, $default); + } + + /** + * {@inheritdoc} + */ + public function set($name, $value) + { + array_set($this->attributes, $name, $value); + } + + /** + * Put a key / value pair or array of key / value pairs in the session. + * + * @param string|array $key + * @param mixed|null $value + * @return void + */ + public function put($key, $value = null) + { + if ( ! is_array($key)) $key = array($key => $value); + + foreach ($key as $arrayKey => $arrayValue) + { + $this->set($arrayKey, $arrayValue); + } + } + + /** + * Push a value onto a session array. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function push($key, $value) + { + $array = $this->get($key, array()); + + $array[] = $value; + + $this->put($key, $array); + } + + /** + * Flash a key / value pair to the session. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function flash($key, $value) + { + $this->put($key, $value); + + $this->push('flash.new', $key); + + $this->removeFromOldFlashData(array($key)); + } + + /** + * Flash an input array to the session. + * + * @param array $value + * @return void + */ + public function flashInput(array $value) + { + $this->flash('_old_input', $value); + } + + /** + * Reflash all of the session flash data. + * + * @return void + */ + public function reflash() + { + $this->mergeNewFlashes($this->get('flash.old', array())); + + $this->put('flash.old', array()); + } + + /** + * Reflash a subset of the current flash data. + * + * @param array|mixed $keys + * @return void + */ + public function keep($keys = null) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + $this->mergeNewFlashes($keys); + + $this->removeFromOldFlashData($keys); + } + + /** + * Merge new flash keys into the new flash array. + * + * @param array $keys + * @return void + */ + protected function mergeNewFlashes(array $keys) + { + $values = array_unique(array_merge($this->get('flash.new', array()), $keys)); + + $this->put('flash.new', $values); + } + + /** + * Remove the given keys from the old flash data. + * + * @param array $keys + * @return void + */ + protected function removeFromOldFlashData(array $keys) + { + $this->put('flash.old', array_diff($this->get('flash.old', array()), $keys)); + } + + /** + * {@inheritdoc} + */ + public function all() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function replace(array $attributes) + { + foreach ($attributes as $key => $value) + { + $this->put($key, $value); + } + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + return array_pull($this->attributes, $name); + } + + /** + * Remove an item from the session. + * + * @param string $key + * @return void + */ + public function forget($key) + { + array_forget($this->attributes, $key); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->attributes = array(); + + foreach ($this->bags as $bag) + { + $bag->clear(); + } + } + + /** + * Remove all of the items from the session. + * + * @return void + */ + public function flush() + { + $this->clear(); + } + + /** + * {@inheritdoc} + */ + public function isStarted() + { + return $this->started; + } + + /** + * {@inheritdoc} + */ + public function registerBag(SessionBagInterface $bag) + { + $this->bags[$bag->getStorageKey()] = $bag; + } + + /** + * {@inheritdoc} + */ + public function getBag($name) + { + return array_get($this->bags, $name, function() + { + throw new \InvalidArgumentException("Bag not registered."); + }); + } + + /** + * {@inheritdoc} + */ + public function getMetadataBag() + { + return $this->metaBag; + } + + /** + * Get the raw bag data array for a given bag. + * + * @param string $name + * @return array + */ + public function getBagData($name) + { + return array_get($this->bagData, $name, array()); + } + + /** + * Get the CSRF token value. + * + * @return string + */ + public function token() + { + return $this->get('_token'); + } + + /** + * Get the CSRF token value. + * + * @return string + */ + public function getToken() + { + return $this->token(); + } + + /** + * Regenerate the CSRF token value. + * + * @return void + */ + public function regenerateToken() + { + $this->put('_token', str_random(40)); + } + + /** + * Set the existence of the session on the handler if applicable. + * + * @param bool $value + * @return void + */ + public function setExists($value) + { + if ($this->handler instanceof ExistenceAwareInterface) + { + $this->handler->setExists($value); + } + } + + /** + * Get the underlying session handler implementation. + * + * @return \SessionHandlerInterface + */ + public function getHandler() + { + return $this->handler; + } + + /** + * Determine if the session handler needs a request. + * + * @return bool + */ + public function handlerNeedsRequest() + { + return $this->handler instanceof CookieSessionHandler; + } + + /** + * Set the request on the handler instance. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @return void + */ + public function setRequestOnHandler(Request $request) + { + if ($this->handlerNeedsRequest()) + { + $this->handler->setRequest($request); + } + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php b/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php new file mode 100755 index 0000000..0bc5841 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php @@ -0,0 +1,3 @@ +=5.4.0", + "illuminate/cache": "4.2.*", + "illuminate/cookie": "4.2.*", + "illuminate/encryption": "4.2.*", + "illuminate/support": "4.2.*", + "nesbot/carbon": "~1.0", + "symfony/finder": "2.5.*", + "symfony/http-foundation": "2.5.*" + }, + "require-dev": { + "illuminate/console": "4.2.*" + }, + "autoload": { + "psr-0": { + "Illuminate\\Session": "" + } + }, + "target-dir": "Illuminate/Session", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "minimum-stability": "dev" +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Arr.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Arr.php b/vendor/laravel/framework/src/Illuminate/Support/Arr.php new file mode 100755 index 0000000..e76a3dd --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Arr.php @@ -0,0 +1,386 @@ + $value) + { + list($innerKey, $innerValue) = call_user_func($callback, $key, $value); + + $results[$innerKey] = $innerValue; + } + + return $results; + } + + /** + * Divide an array into two arrays. One with keys and the other with values. + * + * @param array $array + * @return array + */ + public static function divide($array) + { + return array(array_keys($array), array_values($array)); + } + + /** + * Flatten a multi-dimensional associative array with dots. + * + * @param array $array + * @param string $prepend + * @return array + */ + public static function dot($array, $prepend = '') + { + $results = array(); + + foreach ($array as $key => $value) + { + if (is_array($value)) + { + $results = array_merge($results, static::dot($value, $prepend.$key.'.')); + } + else + { + $results[$prepend.$key] = $value; + } + } + + return $results; + } + + /** + * Get all of the given array except for a specified array of items. + * + * @param array $array + * @param array|string $keys + * @return array + */ + public static function except($array, $keys) + { + return array_diff_key($array, array_flip((array) $keys)); + } + + /** + * Fetch a flattened array of a nested array element. + * + * @param array $array + * @param string $key + * @return array + */ + public static function fetch($array, $key) + { + foreach (explode('.', $key) as $segment) + { + $results = array(); + + foreach ($array as $value) + { + if (array_key_exists($segment, $value = (array) $value)) + { + $results[] = $value[$segment]; + } + } + + $array = array_values($results); + } + + return array_values($results); + } + + /** + * Return the first element in an array passing a given truth test. + * + * @param array $array + * @param \Closure $callback + * @param mixed $default + * @return mixed + */ + public static function first($array, $callback, $default = null) + { + foreach ($array as $key => $value) + { + if (call_user_func($callback, $key, $value)) return $value; + } + + return value($default); + } + + /** + * Return the last element in an array passing a given truth test. + * + * @param array $array + * @param \Closure $callback + * @param mixed $default + * @return mixed + */ + public static function last($array, $callback, $default = null) + { + return static::first(array_reverse($array), $callback, $default); + } + + /** + * Flatten a multi-dimensional array into a single level. + * + * @param array $array + * @return array + */ + public static function flatten($array) + { + $return = array(); + + array_walk_recursive($array, function($x) use (&$return) { $return[] = $x; }); + + return $return; + } + + /** + * Remove one or many array items from a given array using "dot" notation. + * + * @param array $array + * @param array|string $keys + * @return void + */ + public static function forget(&$array, $keys) + { + $original =& $array; + + foreach ((array) $keys as $key) + { + $parts = explode('.', $key); + + while (count($parts) > 1) + { + $part = array_shift($parts); + + if (isset($array[$part]) && is_array($array[$part])) + { + $array =& $array[$part]; + } + } + + unset($array[array_shift($parts)]); + + // clean up after each pass + $array =& $original; + } + } + + /** + * Get an item from an array using "dot" notation. + * + * @param array $array + * @param string $key + * @param mixed $default + * @return mixed + */ + public static function get($array, $key, $default = null) + { + if (is_null($key)) return $array; + + if (isset($array[$key])) return $array[$key]; + + foreach (explode('.', $key) as $segment) + { + if ( ! is_array($array) || ! array_key_exists($segment, $array)) + { + return value($default); + } + + $array = $array[$segment]; + } + + return $array; + } + + /** + * Check if an item exists in an array using "dot" notation. + * + * @param array $array + * @param string $key + * @return bool + */ + public static function has($array, $key) + { + if (empty($array) || is_null($key)) return false; + + if (array_key_exists($key, $array)) return true; + + foreach (explode('.', $key) as $segment) + { + if ( ! is_array($array) || ! array_key_exists($segment, $array)) + { + return false; + } + + $array = $array[$segment]; + } + + return true; + } + + /** + * Get a subset of the items from the given array. + * + * @param array $array + * @param array|string $keys + * @return array + */ + public static function only($array, $keys) + { + return array_intersect_key($array, array_flip((array) $keys)); + } + + /** + * Pluck an array of values from an array. + * + * @param array $array + * @param string $value + * @param string $key + * @return array + */ + public static function pluck($array, $value, $key = null) + { + $results = array(); + + foreach ($array as $item) + { + $itemValue = is_object($item) ? $item->{$value} : $item[$value]; + + // If the key is "null", we will just append the value to the array and keep + // looping. Otherwise we will key the array using the value of the key we + // received from the developer. Then we'll return the final array form. + if (is_null($key)) + { + $results[] = $itemValue; + } + else + { + $itemKey = is_object($item) ? $item->{$key} : $item[$key]; + + $results[$itemKey] = $itemValue; + } + } + + return $results; + } + + /** + * Get a value from the array, and remove it. + * + * @param array $array + * @param string $key + * @param mixed $default + * @return mixed + */ + public static function pull(&$array, $key, $default = null) + { + $value = static::get($array, $key, $default); + + static::forget($array, $key); + + return $value; + } + + /** + * Set an array item to a given value using "dot" notation. + * + * If no key is given to the method, the entire array will be replaced. + * + * @param array $array + * @param string $key + * @param mixed $value + * @return array + */ + public static function set(&$array, $key, $value) + { + if (is_null($key)) return $array = $value; + + $keys = explode('.', $key); + + while (count($keys) > 1) + { + $key = array_shift($keys); + + // If the key doesn't exist at this depth, we will just create an empty array + // to hold the next value, allowing us to create the arrays to hold final + // values at the correct depth. Then we'll keep digging into the array. + if ( ! isset($array[$key]) || ! is_array($array[$key])) + { + $array[$key] = array(); + } + + $array =& $array[$key]; + } + + $array[array_shift($keys)] = $value; + + return $array; + } + + /** + * Sort the array using the given Closure. + * + * @param array $array + * @param \Closure $callback + * @return array + */ + public static function sort($array, Closure $callback) + { + return Collection::make($array)->sortBy($callback)->all(); + } + + /** + * Filter the array using the given Closure. + * + * @param array $array + * @param \Closure $callback + * @return array + */ + public static function where($array, Closure $callback) + { + $filtered = array(); + + foreach ($array as $key => $value) + { + if (call_user_func($callback, $key, $value)) $filtered[$key] = $value; + } + + return $filtered; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php b/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php new file mode 100755 index 0000000..806ef45 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/ClassLoader.php @@ -0,0 +1,107 @@ +items = $items; + } + + /** + * Create a new collection instance if the value isn't one already. + * + * @param mixed $items + * @return static + */ + public static function make($items) + { + if (is_null($items)) return new static; + + if ($items instanceof Collection) return $items; + + return new static(is_array($items) ? $items : array($items)); + } + + /** + * Get all of the items in the collection. + * + * @return array + */ + public function all() + { + return $this->items; + } + + /** + * Collapse the collection items into a single array. + * + * @return static + */ + public function collapse() + { + $results = array(); + + foreach ($this->items as $values) + { + if ($values instanceof Collection) $values = $values->all(); + + $results = array_merge($results, $values); + } + + return new static($results); + } + + /** + * Determine if an item exists in the collection. + * + * @param mixed $value + * @return bool + */ + public function contains($value) + { + if ($value instanceof Closure) + { + return ! is_null($this->first($value)); + } + + return in_array($value, $this->items); + } + + /** + * Diff the collection with the given items. + * + * @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items + * @return static + */ + public function diff($items) + { + return new static(array_diff($this->items, $this->getArrayableItems($items))); + } + + /** + * Execute a callback over each item. + * + * @param \Closure $callback + * @return $this + */ + public function each(Closure $callback) + { + array_map($callback, $this->items); + + return $this; + } + + /** + * Fetch a nested element of the collection. + * + * @param string $key + * @return static + */ + public function fetch($key) + { + return new static(array_fetch($this->items, $key)); + } + + /** + * Run a filter over each of the items. + * + * @param \Closure $callback + * @return static + */ + public function filter(Closure $callback) + { + return new static(array_filter($this->items, $callback)); + } + + /** + * Get the first item from the collection. + * + * @param \Closure $callback + * @param mixed $default + * @return mixed|null + */ + public function first(Closure $callback = null, $default = null) + { + if (is_null($callback)) + { + return count($this->items) > 0 ? reset($this->items) : null; + } + + return array_first($this->items, $callback, $default); + } + + /** + * Get a flattened array of the items in the collection. + * + * @return static + */ + public function flatten() + { + return new static(array_flatten($this->items)); + } + + /** + * Flip the items in the collection. + * + * @return static + */ + public function flip() + { + return new static(array_flip($this->items)); + } + + /** + * Remove an item from the collection by key. + * + * @param mixed $key + * @return void + */ + public function forget($key) + { + unset($this->items[$key]); + } + + /** + * Get an item from the collection by key. + * + * @param mixed $key + * @param mixed $default + * @return mixed + */ + public function get($key, $default = null) + { + if ($this->offsetExists($key)) + { + return $this->items[$key]; + } + + return value($default); + } + + /** + * Group an associative array by a field or Closure value. + * + * @param callable|string $groupBy + * @return static + */ + public function groupBy($groupBy) + { + $results = array(); + + foreach ($this->items as $key => $value) + { + $results[$this->getGroupByKey($groupBy, $key, $value)][] = $value; + } + + return new static($results); + } + + /** + * Get the "group by" key value. + * + * @param callable|string $groupBy + * @param string $key + * @param mixed $value + * @return string + */ + protected function getGroupByKey($groupBy, $key, $value) + { + if ( ! is_string($groupBy) && is_callable($groupBy)) + { + return $groupBy($value, $key); + } + + return data_get($value, $groupBy); + } + + /** + * Key an associative array by a field. + * + * @param string $keyBy + * @return static + */ + public function keyBy($keyBy) + { + $results = []; + + foreach ($this->items as $item) + { + $key = data_get($item, $keyBy); + + $results[$key] = $item; + } + + return new static($results); + } + + /** + * Determine if an item exists in the collection by key. + * + * @param mixed $key + * @return bool + */ + public function has($key) + { + return $this->offsetExists($key); + } + + /** + * Concatenate values of a given key as a string. + * + * @param string $value + * @param string $glue + * @return string + */ + public function implode($value, $glue = null) + { + return implode($glue, $this->lists($value)); + } + + /** + * Intersect the collection with the given items. + * + * @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items + * @return static + */ + public function intersect($items) + { + return new static(array_intersect($this->items, $this->getArrayableItems($items))); + } + + /** + * Determine if the collection is empty or not. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->items); + } + + /** + * Get the keys of the collection items. + * + * @return array + */ + public function keys() + { + return array_keys($this->items); + } + + /** + * Get the last item from the collection. + * + * @return mixed|null + */ + public function last() + { + return count($this->items) > 0 ? end($this->items) : null; + } + + /** + * Get an array with the values of a given key. + * + * @param string $value + * @param string $key + * @return array + */ + public function lists($value, $key = null) + { + return array_pluck($this->items, $value, $key); + } + + /** + * Run a map over each of the items. + * + * @param \Closure $callback + * @return static + */ + public function map(Closure $callback) + { + return new static(array_map($callback, $this->items, array_keys($this->items))); + } + + /** + * Merge the collection with the given items. + * + * @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items + * @return static + */ + public function merge($items) + { + return new static(array_merge($this->items, $this->getArrayableItems($items))); + } + + /** + * Get and remove the last item from the collection. + * + * @return mixed|null + */ + public function pop() + { + return array_pop($this->items); + } + + /** + * Push an item onto the beginning of the collection. + * + * @param mixed $value + * @return void + */ + public function prepend($value) + { + array_unshift($this->items, $value); + } + + /** + * Push an item onto the end of the collection. + * + * @param mixed $value + * @return void + */ + public function push($value) + { + $this->items[] = $value; + } + + /** + * Pulls an item from the collection. + * + * @param mixed $key + * @param mixed $default + * @return mixed + */ + public function pull($key, $default = null) + { + return array_pull($this->items, $key, $default); + } + + /** + * Put an item in the collection by key. + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function put($key, $value) + { + $this->items[$key] = $value; + } + + /** + * Get one or more items randomly from the collection. + * + * @param int $amount + * @return mixed + */ + public function random($amount = 1) + { + if ($this->isEmpty()) return null; + + $keys = array_rand($this->items, $amount); + + return is_array($keys) ? array_intersect_key($this->items, array_flip($keys)) : $this->items[$keys]; + } + + /** + * Reduce the collection to a single value. + * + * @param callable $callback + * @param mixed $initial + * @return mixed + */ + public function reduce(callable $callback, $initial = null) + { + return array_reduce($this->items, $callback, $initial); + } + + /** + * Create a collection of all elements that do not pass a given truth test. + * + * @param \Closure|mixed $callback + * @return static + */ + public function reject($callback) + { + if ($callback instanceof Closure) + { + return $this->filter(function($item) use ($callback) + { + return ! $callback($item); + }); + } + + return $this->filter(function($item) use ($callback) + { + return $item != $callback; + }); + } + + /** + * Reverse items order. + * + * @return static + */ + public function reverse() + { + return new static(array_reverse($this->items)); + } + + /** + * Search the collection for a given value and return the corresponding key if successful. + * + * @param mixed $value + * @param bool $strict + * @return mixed + */ + public function search($value, $strict = false) + { + return array_search($value, $this->items, $strict); + } + + /** + * Get and remove the first item from the collection. + * + * @return mixed|null + */ + public function shift() + { + return array_shift($this->items); + } + + /** + * Shuffle the items in the collection. + * + * @return $this + */ + public function shuffle() + { + shuffle($this->items); + + return $this; + } + + /** + * Slice the underlying collection array. + * + * @param int $offset + * @param int $length + * @param bool $preserveKeys + * @return static + */ + public function slice($offset, $length = null, $preserveKeys = false) + { + return new static(array_slice($this->items, $offset, $length, $preserveKeys)); + } + + /** + * Chunk the underlying collection array. + * + * @param int $size + * @param bool $preserveKeys + * @return static + */ + public function chunk($size, $preserveKeys = false) + { + $chunks = new static; + + foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) + { + $chunks->push(new static($chunk)); + } + + return $chunks; + } + + /** + * Sort through each item with a callback. + * + * @param \Closure $callback + * @return $this + */ + public function sort(Closure $callback) + { + uasort($this->items, $callback); + + return $this; + } + + /** + * Sort the collection using the given Closure. + * + * @param \Closure|string $callback + * @param int $options + * @param bool $descending + * @return $this + */ + public function sortBy($callback, $options = SORT_REGULAR, $descending = false) + { + $results = array(); + + if (is_string($callback)) $callback = + $this->valueRetriever($callback); + + // First we will loop through the items and get the comparator from a callback + // function which we were given. Then, we will sort the returned values and + // and grab the corresponding values for the sorted keys from this array. + foreach ($this->items as $key => $value) + { + $results[$key] = $callback($value); + } + + $descending ? arsort($results, $options) + : asort($results, $options); + + // Once we have sorted all of the keys in the array, we will loop through them + // and grab the corresponding model so we can set the underlying items list + // to the sorted version. Then we'll just return the collection instance. + foreach (array_keys($results) as $key) + { + $results[$key] = $this->items[$key]; + } + + $this->items = $results; + + return $this; + } + + /** + * Sort the collection in descending order using the given Closure. + * + * @param \Closure|string $callback + * @param int $options + * @return $this + */ + public function sortByDesc($callback, $options = SORT_REGULAR) + { + return $this->sortBy($callback, $options, true); + } + + /** + * Splice portion of the underlying collection array. + * + * @param int $offset + * @param int $length + * @param mixed $replacement + * @return static + */ + public function splice($offset, $length = 0, $replacement = array()) + { + return new static(array_splice($this->items, $offset, $length, $replacement)); + } + + /** + * Get the sum of the given values. + * + * @param \Closure $callback + * @return mixed + */ + public function sum($callback = null) + { + if (is_null($callback)) + { + return array_sum($this->items); + } + + if (is_string($callback)) + { + $callback = $this->valueRetriever($callback); + } + + return $this->reduce(function($result, $item) use ($callback) + { + return $result += $callback($item); + + }, 0); + } + + /** + * Take the first or last {$limit} items. + * + * @param int $limit + * @return static + */ + public function take($limit = null) + { + if ($limit < 0) return $this->slice($limit, abs($limit)); + + return $this->slice(0, $limit); + } + + /** + * Transform each item in the collection using a callback. + * + * @param \Closure $callback + * @return $this + */ + public function transform(Closure $callback) + { + $this->items = array_map($callback, $this->items); + + return $this; + } + + /** + * Return only unique items from the collection array. + * + * @return static + */ + public function unique() + { + return new static(array_unique($this->items)); + } + + /** + * Reset the keys on the underlying array. + * + * @return static + */ + public function values() + { + $this->items = array_values($this->items); + + return $this; + } + + /** + * Get a value retrieving callback. + * + * @param string $value + * @return \Closure + */ + protected function valueRetriever($value) + { + return function($item) use ($value) + { + return data_get($item, $value); + }; + } + + /** + * Get the collection of items as a plain array. + * + * @return array + */ + public function toArray() + { + return array_map(function($value) + { + return $value instanceof ArrayableInterface ? $value->toArray() : $value; + + }, $this->items); + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize() + { + return $this->toArray(); + } + + /** + * Get the collection of items as JSON. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->toArray(), $options); + } + + /** + * Get an iterator for the items. + * + * @return \ArrayIterator + */ + public function getIterator() + { + return new ArrayIterator($this->items); + } + + /** + * Get a CachingIterator instance. + * + * @param int $flags + * @return \CachingIterator + */ + public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING) + { + return new CachingIterator($this->getIterator(), $flags); + } + + /** + * Count the number of items in the collection. + * + * @return int + */ + public function count() + { + return count($this->items); + } + + /** + * Determine if an item exists at an offset. + * + * @param mixed $key + * @return bool + */ + public function offsetExists($key) + { + return array_key_exists($key, $this->items); + } + + /** + * Get an item at a given offset. + * + * @param mixed $key + * @return mixed + */ + public function offsetGet($key) + { + return $this->items[$key]; + } + + /** + * Set the item at a given offset. + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value) + { + if (is_null($key)) + { + $this->items[] = $value; + } + else + { + $this->items[$key] = $value; + } + } + + /** + * Unset the item at a given offset. + * + * @param string $key + * @return void + */ + public function offsetUnset($key) + { + unset($this->items[$key]); + } + + /** + * Convert the collection to its string representation. + * + * @return string + */ + public function __toString() + { + return $this->toJson(); + } + + /** + * Results array of items from Collection or ArrayableInterface. + * + * @param \Illuminate\Support\Collection|\Illuminate\Support\Contracts\ArrayableInterface|array $items + * @return array + */ + protected function getArrayableItems($items) + { + if ($items instanceof Collection) + { + $items = $items->all(); + } + elseif ($items instanceof ArrayableInterface) + { + $items = $items->toArray(); + } + + return $items; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Contracts/ArrayableInterface.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Contracts/ArrayableInterface.php b/vendor/laravel/framework/src/Illuminate/Support/Contracts/ArrayableInterface.php new file mode 100755 index 0000000..0383492 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Contracts/ArrayableInterface.php @@ -0,0 +1,12 @@ +getEngineResolver()->resolve('blade')->getCompiler(); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php new file mode 100755 index 0000000..dbcca06 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/Cache.php @@ -0,0 +1,16 @@ +cookie($key, null)); + } + + /** + * Retrieve a cookie from the request. + * + * @param string $key + * @param mixed $default + * @return string + */ + public static function get($key = null, $default = null) + { + return static::$app['request']->cookie($key, $default); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() { return 'cookie'; } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php new file mode 100755 index 0000000..d5992bb --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php @@ -0,0 +1,15 @@ +instance(static::getFacadeAccessor(), $instance); + } + + /** + * Initiate a mock expectation on the facade. + * + * @param mixed + * @return \Mockery\Expectation + */ + public static function shouldReceive() + { + $name = static::getFacadeAccessor(); + + if (static::isMock()) + { + $mock = static::$resolvedInstance[$name]; + } + else + { + $mock = static::createFreshMockInstance($name); + } + + return call_user_func_array(array($mock, 'shouldReceive'), func_get_args()); + } + + /** + * Create a fresh mock instance for the given class. + * + * @param string $name + * @return \Mockery\Expectation + */ + protected static function createFreshMockInstance($name) + { + static::$resolvedInstance[$name] = $mock = static::createMockByName($name); + + if (isset(static::$app)) + { + static::$app->instance($name, $mock); + } + + return $mock; + } + + /** + * Create a fresh mock instance for the given class. + * + * @param string $name + * @return \Mockery\Expectation + */ + protected static function createMockByName($name) + { + $class = static::getMockableClass($name); + + return $class ? \Mockery::mock($class) : \Mockery::mock(); + } + + /** + * Determines whether a mock is set as the instance of the facade. + * + * @return bool + */ + protected static function isMock() + { + $name = static::getFacadeAccessor(); + + return isset(static::$resolvedInstance[$name]) && static::$resolvedInstance[$name] instanceof MockInterface; + } + + /** + * Get the mockable class for the bound instance. + * + * @return string + */ + protected static function getMockableClass() + { + if ($root = static::getFacadeRoot()) return get_class($root); + } + + /** + * Get the root object behind the facade. + * + * @return mixed + */ + public static function getFacadeRoot() + { + return static::resolveFacadeInstance(static::getFacadeAccessor()); + } + + /** + * Get the registered name of the component. + * + * @return string + * + * @throws \RuntimeException + */ + protected static function getFacadeAccessor() + { + throw new \RuntimeException("Facade does not implement getFacadeAccessor method."); + } + + /** + * Resolve the facade root instance from the container. + * + * @param string $name + * @return mixed + */ + protected static function resolveFacadeInstance($name) + { + if (is_object($name)) return $name; + + if (isset(static::$resolvedInstance[$name])) + { + return static::$resolvedInstance[$name]; + } + + return static::$resolvedInstance[$name] = static::$app[$name]; + } + + /** + * Clear a resolved facade instance. + * + * @param string $name + * @return void + */ + public static function clearResolvedInstance($name) + { + unset(static::$resolvedInstance[$name]); + } + + /** + * Clear all of the resolved instances. + * + * @return void + */ + public static function clearResolvedInstances() + { + static::$resolvedInstance = array(); + } + + /** + * Get the application instance behind the facade. + * + * @return \Illuminate\Foundation\Application + */ + public static function getFacadeApplication() + { + return static::$app; + } + + /** + * Set the application instance. + * + * @param \Illuminate\Foundation\Application $app + * @return void + */ + public static function setFacadeApplication($app) + { + static::$app = $app; + } + + /** + * Handle dynamic, static calls to the object. + * + * @param string $method + * @param array $args + * @return mixed + */ + public static function __callStatic($method, $args) + { + $instance = static::getFacadeRoot(); + + switch (count($args)) + { + case 0: + return $instance->$method(); + + case 1: + return $instance->$method($args[0]); + + case 2: + return $instance->$method($args[0], $args[1]); + + case 3: + return $instance->$method($args[0], $args[1], $args[2]); + + case 4: + return $instance->$method($args[0], $args[1], $args[2], $args[3]); + + default: + return call_user_func_array(array($instance, $method), $args); + } + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php new file mode 100755 index 0000000..058203d --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/File.php @@ -0,0 +1,15 @@ +input($key, $default); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() { return 'request'; } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php new file mode 100755 index 0000000..fe2b8b4 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/Lang.php @@ -0,0 +1,15 @@ +make($view, $data), $status, $headers); + } + + /** + * Return a new JSON response from the application. + * + * @param string|array $data + * @param int $status + * @param array $headers + * @param int $options + * @return \Illuminate\Http\JsonResponse + */ + public static function json($data = array(), $status = 200, array $headers = array(), $options = 0) + { + if ($data instanceof ArrayableInterface) + { + $data = $data->toArray(); + } + + return new JsonResponse($data, $status, $headers, $options); + } + + /** + * Return a new JSONP response from the application. + * + * @param string $callback + * @param string|array $data + * @param int $status + * @param array $headers + * @param int $options + * @return \Illuminate\Http\JsonResponse + */ + public static function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0) + { + return static::json($data, $status, $headers, $options)->setCallback($callback); + } + + /** + * Return a new streamed response from the application. + * + * @param \Closure $callback + * @param int $status + * @param array $headers + * @return \Symfony\Component\HttpFoundation\StreamedResponse + */ + public static function stream($callback, $status = 200, array $headers = array()) + { + return new StreamedResponse($callback, $status, $headers); + } + + /** + * Create a new file download response. + * + * @param \SplFileInfo|string $file + * @param string $name + * @param array $headers + * @param null|string $disposition + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse + */ + public static function download($file, $name = null, array $headers = array(), $disposition = 'attachment') + { + $response = new BinaryFileResponse($file, 200, $headers, true, $disposition); + + if ( ! is_null($name)) + { + return $response->setContentDisposition($disposition, $name, str_replace('%', '', Str::ascii($name))); + } + + return $response; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/Route.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Route.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Route.php new file mode 100755 index 0000000..3f1fa48 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/Route.php @@ -0,0 +1,15 @@ +connection($name)->getSchemaBuilder(); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return static::$app['db']->connection()->getSchemaBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php b/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php new file mode 100755 index 0000000..fdc6c7f --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Support/Facades/Session.php @@ -0,0 +1,16 @@ +