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 2912C177F5 for ; Fri, 1 May 2015 21:32:50 +0000 (UTC) Received: (qmail 96613 invoked by uid 500); 1 May 2015 21:32:50 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 96505 invoked by uid 500); 1 May 2015 21:32:49 -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 95088 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 AF56AE41E4; 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:33:09 -0000 Message-Id: In-Reply-To: <75facea618c04426a66df940fb7893c3@git.apache.org> References: <75facea618c04426a66df940fb7893c3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/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/Cache/MemcachedConnector.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php new file mode 100755 index 0000000..e860c07 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php @@ -0,0 +1,47 @@ +getMemcached(); + + // For each server in the array, we'll just extract the configuration and add + // the server to the Memcached connection. Once we have added all of these + // servers we'll verify the connection is successful and return it back. + foreach ($servers as $server) + { + $memcached->addServer( + $server['host'], $server['port'], $server['weight'] + ); + } + + if ($memcached->getVersion() === false) + { + throw new \RuntimeException("Could not establish Memcached connection."); + } + + return $memcached; + } + + /** + * Get a new Memcached instance. + * + * @return \Memcached + */ + protected function getMemcached() + { + return new Memcached; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php new file mode 100755 index 0000000..5e50946 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php @@ -0,0 +1,138 @@ +memcached = $memcached; + $this->prefix = strlen($prefix) > 0 ? $prefix.':' : ''; + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + public function get($key) + { + $value = $this->memcached->get($this->prefix.$key); + + if ($this->memcached->getResultCode() == 0) + { + return $value; + } + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + $this->memcached->set($this->prefix.$key, $value, $minutes * 60); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + */ + public function increment($key, $value = 1) + { + return $this->memcached->increment($this->prefix.$key, $value); + } + + /** + * Decrement the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + */ + public function decrement($key, $value = 1) + { + return $this->memcached->decrement($this->prefix.$key, $value); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function forever($key, $value) + { + return $this->put($key, $value, 0); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + public function forget($key) + { + $this->memcached->delete($this->prefix.$key); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + $this->memcached->flush(); + } + + /** + * Get the underlying Memcached connection. + * + * @return \Memcached + */ + public function getMemcached() + { + return $this->memcached; + } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php b/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php new file mode 100755 index 0000000..51d7f50 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php @@ -0,0 +1,103 @@ +redis = $redis; + $this->connection = $connection; + $this->prefix = strlen($prefix) > 0 ? $prefix.':' : ''; + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + public function get($key) + { + if ( ! is_null($value = $this->connection()->get($this->prefix.$key))) + { + return is_numeric($value) ? $value : unserialize($value); + } + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + $value = is_numeric($value) ? $value : serialize($value); + + $minutes = max(1, $minutes); + + $this->connection()->setex($this->prefix.$key, $minutes * 60, $value); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int + */ + public function increment($key, $value = 1) + { + return $this->connection()->incrby($this->prefix.$key, $value); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int + */ + public function decrement($key, $value = 1) + { + return $this->connection()->decrby($this->prefix.$key, $value); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function forever($key, $value) + { + $value = is_numeric($value) ? $value : serialize($value); + + $this->connection()->set($this->prefix.$key, $value); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + public function forget($key) + { + $this->connection()->del($this->prefix.$key); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + $this->connection()->flushdb(); + } + + /** + * Begin executing a new tags operation. + * + * @param array|mixed $names + * @return \Illuminate\Cache\RedisTaggedCache + */ + public function tags($names) + { + return new RedisTaggedCache($this, new TagSet($this, is_array($names) ? $names : func_get_args())); + } + + /** + * Get the Redis connection instance. + * + * @return \Predis\ClientInterface + */ + public function connection() + { + return $this->redis->connection($this->connection); + } + + /** + * Set the connection name to be used. + * + * @param string $connection + * @return void + */ + public function setConnection($connection) + { + $this->connection = $connection; + } + + /** + * Get the Redis database instance. + * + * @return \Illuminate\Redis\Database + */ + public function getRedis() + { + return $this->redis; + } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php b/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php new file mode 100644 index 0000000..bd54827 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php @@ -0,0 +1,90 @@ +pushForeverKeys($namespace = $this->tags->getNamespace(), $key); + + $this->store->forever(sha1($namespace).':'.$key, $value); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + $this->deleteForeverKeys(); + + parent::flush(); + } + + /** + * Store a copy of the full key for each namespace segment. + * + * @param string $namespace + * @param string $key + * @return void + */ + protected function pushForeverKeys($namespace, $key) + { + $fullKey = $this->getPrefix().sha1($namespace).':'.$key; + + foreach (explode('|', $namespace) as $segment) + { + $this->store->connection()->lpush($this->foreverKey($segment), $fullKey); + } + } + + /** + * Delete all of the items that were stored forever. + * + * @return void + */ + protected function deleteForeverKeys() + { + foreach (explode('|', $this->tags->getNamespace()) as $segment) + { + $this->deleteForeverValues($segment = $this->foreverKey($segment)); + + $this->store->connection()->del($segment); + } + } + + /** + * Delete all of the keys that have been stored forever. + * + * @param string $foreverKey + * @return void + */ + protected function deleteForeverValues($foreverKey) + { + $forever = array_unique($this->store->connection()->lrange($foreverKey, 0, -1)); + + if (count($forever) > 0) + { + call_user_func_array(array($this->store->connection(), 'del'), $forever); + } + } + + /** + * Get the forever reference key for the segment. + * + * @param string $segment + * @return string + */ + protected function foreverKey($segment) + { + return $this->getPrefix().$segment.':forever'; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/Repository.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/Repository.php b/vendor/laravel/framework/src/Illuminate/Cache/Repository.php new file mode 100755 index 0000000..f87f29b --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/Repository.php @@ -0,0 +1,284 @@ +store = $store; + } + + /** + * Determine if an item exists in the cache. + * + * @param string $key + * @return bool + */ + public function has($key) + { + return ! is_null($this->get($key)); + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function get($key, $default = null) + { + $value = $this->store->get($key); + + return ! is_null($value) ? $value : value($default); + } + + /** + * Retrieve an item from the cache and delete it. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function pull($key, $default = null) + { + $value = $this->get($key, $default); + + $this->forget($key); + + return $value; + } + + /** + * Store an item in the cache. + * + * @param string $key + * @param mixed $value + * @param \DateTime|int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + $minutes = $this->getMinutes($minutes); + + if ( ! is_null($minutes)) + { + $this->store->put($key, $value, $minutes); + } + } + + /** + * Store an item in the cache if the key does not exist. + * + * @param string $key + * @param mixed $value + * @param \DateTime|int $minutes + * @return bool + */ + public function add($key, $value, $minutes) + { + if (is_null($this->get($key))) + { + $this->put($key, $value, $minutes); return true; + } + + return false; + } + + /** + * Get an item from the cache, or store the default value. + * + * @param string $key + * @param \DateTime|int $minutes + * @param \Closure $callback + * @return mixed + */ + public function remember($key, $minutes, Closure $callback) + { + // If the item exists in the cache we will just return this immediately + // otherwise we will execute the given Closure and cache the result + // of that execution for the given number of minutes in storage. + if ( ! is_null($value = $this->get($key))) + { + return $value; + } + + $this->put($key, $value = $callback(), $minutes); + + return $value; + } + + /** + * Get an item from the cache, or store the default value forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + */ + public function sear($key, Closure $callback) + { + return $this->rememberForever($key, $callback); + } + + /** + * Get an item from the cache, or store the default value forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + */ + public function rememberForever($key, Closure $callback) + { + // If the item exists in the cache we will just return this immediately + // otherwise we will execute the given Closure and cache the result + // of that execution for the given number of minutes. It's easy. + if ( ! is_null($value = $this->get($key))) + { + return $value; + } + + $this->forever($key, $value = $callback()); + + return $value; + } + + /** + * Get the default cache time. + * + * @return int + */ + public function getDefaultCacheTime() + { + return $this->default; + } + + /** + * Set the default cache time in minutes. + * + * @param int $minutes + * @return void + */ + public function setDefaultCacheTime($minutes) + { + $this->default = $minutes; + } + + /** + * Get the cache store implementation. + * + * @return \Illuminate\Cache\StoreInterface + */ + public function getStore() + { + return $this->store; + } + + /** + * Determine if a cached value exists. + * + * @param string $key + * @return bool + */ + public function offsetExists($key) + { + return $this->has($key); + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + public function offsetGet($key) + { + return $this->get($key); + } + + /** + * Store an item in the cache for the default time. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value) + { + $this->put($key, $value, $this->default); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + public function offsetUnset($key) + { + return $this->forget($key); + } + + /** + * Calculate the number of minutes with the given duration. + * + * @param \DateTime|int $duration + * @return int|null + */ + protected function getMinutes($duration) + { + if ($duration instanceof DateTime) + { + $fromNow = Carbon::instance($duration)->diffInMinutes(); + + return $fromNow > 0 ? $fromNow : null; + } + + return is_string($duration) ? (int) $duration : $duration; + } + + /** + * Handle dynamic calls into macros or pass missing methods to the store. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + if (static::hasMacro($method)) + { + return $this->macroCall($method, $parameters); + } + + return call_user_func_array(array($this->store, $method), $parameters); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/StoreInterface.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/StoreInterface.php b/vendor/laravel/framework/src/Illuminate/Cache/StoreInterface.php new file mode 100755 index 0000000..b07686f --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/StoreInterface.php @@ -0,0 +1,72 @@ +store = $store; + $this->names = $names; + } + + /** + * Reset all tags in the set. + * + * @return void + */ + public function reset() + { + array_walk($this->names, array($this, 'resetTag')); + } + + /** + * Get the unique tag identifier for a given tag. + * + * @param string $name + * @return string + */ + public function tagId($name) + { + return $this->store->get($this->tagKey($name)) ?: $this->resetTag($name); + } + + /** + * Get an array of tag identifiers for all of the tags in the set. + * + * @return array + */ + protected function tagIds() + { + return array_map(array($this, 'tagId'), $this->names); + } + + /** + * Get a unique namespace that changes when any of the tags are flushed. + * + * @return string + */ + public function getNamespace() + { + return implode('|', $this->tagIds()); + } + + /** + * Reset the tag and return the new tag identifier + * + * @param string $name + * @return string + */ + public function resetTag($name) + { + $this->store->forever($this->tagKey($name), $id = str_replace('.', '', uniqid('', true))); + + return $id; + } + + /** + * Get the tag identifier key for a given tag. + * + * @param string $name + * @return string + */ + public function tagKey($name) + { + return 'tag:'.$name.':key'; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php b/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php new file mode 100644 index 0000000..c0b965d --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php @@ -0,0 +1,27 @@ +tags($name); + } + + /** + * Begin executing a new tags operation. + * + * @param array|mixed $names + * @return \Illuminate\Cache\TaggedCache + */ + public function tags($names) + { + return new TaggedCache($this, new TagSet($this, is_array($names) ? $names : func_get_args())); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php b/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php new file mode 100644 index 0000000..6b9eb7a --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php @@ -0,0 +1,244 @@ +tags = $tags; + $this->store = $store; + } + + /** + * Determine if an item exists in the cache. + * + * @param string $key + * @return bool + */ + public function has($key) + { + return ! is_null($this->get($key)); + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function get($key, $default = null) + { + $value = $this->store->get($this->taggedItemKey($key)); + + return ! is_null($value) ? $value : value($default); + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param \DateTime|int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + $minutes = $this->getMinutes($minutes); + + if ( ! is_null($minutes)) + { + $this->store->put($this->taggedItemKey($key), $value, $minutes); + } + } + + /** + * Store an item in the cache if the key does not exist. + * + * @param string $key + * @param mixed $value + * @param \DateTime|int $minutes + * @return bool + */ + public function add($key, $value, $minutes) + { + if (is_null($this->get($key))) + { + $this->put($key, $value, $minutes); return true; + } + + return false; + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function increment($key, $value = 1) + { + $this->store->increment($this->taggedItemKey($key), $value); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function decrement($key, $value = 1) + { + $this->store->decrement($this->taggedItemKey($key), $value); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function forever($key, $value) + { + $this->store->forever($this->taggedItemKey($key), $value); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return bool + */ + public function forget($key) + { + return $this->store->forget($this->taggedItemKey($key)); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + $this->tags->reset(); + } + + /** + * Get an item from the cache, or store the default value. + * + * @param string $key + * @param \DateTime|int $minutes + * @param \Closure $callback + * @return mixed + */ + public function remember($key, $minutes, Closure $callback) + { + // If the item exists in the cache we will just return this immediately + // otherwise we will execute the given Closure and cache the result + // of that execution for the given number of minutes in storage. + if ( ! is_null($value = $this->get($key))) return $value; + + $this->put($key, $value = $callback(), $minutes); + + return $value; + } + + /** + * Get an item from the cache, or store the default value forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + */ + public function sear($key, Closure $callback) + { + return $this->rememberForever($key, $callback); + } + + /** + * Get an item from the cache, or store the default value forever. + * + * @param string $key + * @param \Closure $callback + * @return mixed + */ + public function rememberForever($key, Closure $callback) + { + // If the item exists in the cache we will just return this immediately + // otherwise we will execute the given Closure and cache the result + // of that execution for the given number of minutes. It's easy. + if ( ! is_null($value = $this->get($key))) return $value; + + $this->forever($key, $value = $callback()); + + return $value; + } + + /** + * Get a fully qualified key for a tagged item. + * + * @param string $key + * @return string + */ + public function taggedItemKey($key) + { + return sha1($this->tags->getNamespace()).':'.$key; + } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->store->getPrefix(); + } + + /** + * Calculate the number of minutes with the given duration. + * + * @param \DateTime|int $duration + * @return int|null + */ + protected function getMinutes($duration) + { + if ($duration instanceof DateTime) + { + $fromNow = Carbon::instance($duration)->diffInMinutes(); + + return $fromNow > 0 ? $fromNow : null; + } + + return is_string($duration) ? (int) $duration : $duration; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php b/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php new file mode 100755 index 0000000..43dd617 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php @@ -0,0 +1,119 @@ +prefix = $prefix; + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + public function get($key) + { + $value = wincache_ucache_get($this->prefix.$key); + + if ($value !== false) + { + return $value; + } + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + wincache_ucache_set($this->prefix.$key, $value, $minutes * 60); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + */ + public function increment($key, $value = 1) + { + return wincache_ucache_inc($this->prefix.$key, $value); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int|bool + */ + public function decrement($key, $value = 1) + { + return wincache_ucache_dec($this->prefix.$key, $value); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function forever($key, $value) + { + return $this->put($key, $value, 0); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + public function forget($key) + { + wincache_ucache_delete($this->prefix.$key); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + wincache_ucache_clear(); + } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php b/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php new file mode 100755 index 0000000..c7786e2 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php @@ -0,0 +1,119 @@ +prefix = $prefix; + } + + /** + * Retrieve an item from the cache by key. + * + * @param string $key + * @return mixed + */ + public function get($key) + { + $value = xcache_get($this->prefix.$key); + + if (isset($value)) + { + return $value; + } + } + + /** + * Store an item in the cache for a given number of minutes. + * + * @param string $key + * @param mixed $value + * @param int $minutes + * @return void + */ + public function put($key, $value, $minutes) + { + xcache_set($this->prefix.$key, $value, $minutes * 60); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int + */ + public function increment($key, $value = 1) + { + return xcache_inc($this->prefix.$key, $value); + } + + /** + * Increment the value of an item in the cache. + * + * @param string $key + * @param mixed $value + * @return int + */ + public function decrement($key, $value = 1) + { + return xcache_dec($this->prefix.$key, $value); + } + + /** + * Store an item in the cache indefinitely. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function forever($key, $value) + { + return $this->put($key, $value, 0); + } + + /** + * Remove an item from the cache. + * + * @param string $key + * @return void + */ + public function forget($key) + { + xcache_unset($this->prefix.$key); + } + + /** + * Remove all items from the cache. + * + * @return void + */ + public function flush() + { + xcache_clear_cache(XC_TYPE_VAR); + } + + /** + * Get the cache key prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Cache/composer.json ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Cache/composer.json b/vendor/laravel/framework/src/Illuminate/Cache/composer.json new file mode 100755 index 0000000..441833d --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Cache/composer.json @@ -0,0 +1,31 @@ +{ + "name": "illuminate/cache", + "license": "MIT", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "require": { + "php": ">=5.4.0", + "illuminate/support": "4.2.*", + "nesbot/carbon": "~1.0" + }, + "require-dev": { + "illuminate/database": "4.2.*", + "illuminate/encryption": "4.2.*", + "illuminate/filesystem": "4.2.*", + "illuminate/redis": "4.2.*" + }, + "autoload": { + "psr-0": {"Illuminate\\Cache": ""} + }, + "target-dir": "Illuminate/Cache", + "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/Config/EnvironmentVariables.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariables.php b/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariables.php new file mode 100644 index 0000000..dfe89aa --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariables.php @@ -0,0 +1,45 @@ +loader = $loader; + } + + /** + * Load the server variables for a given environment. + * + * @param string $environment + */ + public function load($environment = null) + { + foreach ($this->loader->load($environment) as $key => $value) + { + $_ENV[$key] = $value; + + $_SERVER[$key] = $value; + + putenv("{$key}={$value}"); + } + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariablesLoaderInterface.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariablesLoaderInterface.php b/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariablesLoaderInterface.php new file mode 100644 index 0000000..376f666 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariablesLoaderInterface.php @@ -0,0 +1,13 @@ +files = $files; + $this->path = $path ?: base_path(); + } + + /** + * Load the environment variables for the given environment. + * + * @param string $environment + * @return array + */ + public function load($environment = null) + { + if ($environment == 'production') $environment = null; + + if ( ! $this->files->exists($path = $this->getFile($environment))) + { + return array(); + } + + return array_dot($this->files->getRequire($path)); + } + + /** + * Get the file for the given environment. + * + * @param string $environment + * @return string + */ + protected function getFile($environment) + { + if ($environment) + { + return $this->path.'/.env.'.$environment.'.php'; + } + + return $this->path.'/.env.php'; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Config/FileLoader.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Config/FileLoader.php b/vendor/laravel/framework/src/Illuminate/Config/FileLoader.php new file mode 100755 index 0000000..3563f07 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Config/FileLoader.php @@ -0,0 +1,259 @@ +files = $files; + $this->defaultPath = $defaultPath; + } + + /** + * Load the given configuration group. + * + * @param string $environment + * @param string $group + * @param string $namespace + * @return array + */ + public function load($environment, $group, $namespace = null) + { + $items = array(); + + // First we'll get the root configuration path for the environment which is + // where all of the configuration files live for that namespace, as well + // as any environment folders with their specific configuration items. + $path = $this->getPath($namespace); + + if (is_null($path)) + { + return $items; + } + + // First we'll get the main configuration file for the groups. Once we have + // that we can check for any environment specific files, which will get + // merged on top of the main arrays to make the environments cascade. + $file = "{$path}/{$group}.php"; + + if ($this->files->exists($file)) + { + $items = $this->getRequire($file); + } + + // Finally we're ready to check for the environment specific configuration + // file which will be merged on top of the main arrays so that they get + // precedence over them if we are currently in an environments setup. + $file = "{$path}/{$environment}/{$group}.php"; + + if ($this->files->exists($file)) + { + $items = $this->mergeEnvironment($items, $file); + } + + return $items; + } + + /** + * Merge the items in the given file into the items. + * + * @param array $items + * @param string $file + * @return array + */ + protected function mergeEnvironment(array $items, $file) + { + return array_replace_recursive($items, $this->getRequire($file)); + } + + /** + * Determine if the given group exists. + * + * @param string $group + * @param string $namespace + * @return bool + */ + public function exists($group, $namespace = null) + { + $key = $group.$namespace; + + // We'll first check to see if we have determined if this namespace and + // group combination have been checked before. If they have, we will + // just return the cached result so we don't have to hit the disk. + if (isset($this->exists[$key])) + { + return $this->exists[$key]; + } + + $path = $this->getPath($namespace); + + // To check if a group exists, we will simply get the path based on the + // namespace, and then check to see if this files exists within that + // namespace. False is returned if no path exists for a namespace. + if (is_null($path)) + { + return $this->exists[$key] = false; + } + + $file = "{$path}/{$group}.php"; + + // Finally, we can simply check if this file exists. We will also cache + // the value in an array so we don't have to go through this process + // again on subsequent checks for the existing of the config file. + $exists = $this->files->exists($file); + + return $this->exists[$key] = $exists; + } + + /** + * Apply any cascades to an array of package options. + * + * @param string $env + * @param string $package + * @param string $group + * @param array $items + * @return array + */ + public function cascadePackage($env, $package, $group, $items) + { + // First we will look for a configuration file in the packages configuration + // folder. If it exists, we will load it and merge it with these original + // options so that we will easily "cascade" a package's configurations. + $file = "packages/{$package}/{$group}.php"; + + if ($this->files->exists($path = $this->defaultPath.'/'.$file)) + { + $items = array_merge( + $items, $this->getRequire($path) + ); + } + + // Once we have merged the regular package configuration we need to look for + // an environment specific configuration file. If one exists, we will get + // the contents and merge them on top of this array of options we have. + $path = $this->getPackagePath($env, $package, $group); + + if ($this->files->exists($path)) + { + $items = array_merge( + $items, $this->getRequire($path) + ); + } + + return $items; + } + + /** + * Get the package path for an environment and group. + * + * @param string $env + * @param string $package + * @param string $group + * @return string + */ + protected function getPackagePath($env, $package, $group) + { + $file = "packages/{$package}/{$env}/{$group}.php"; + + return $this->defaultPath.'/'.$file; + } + + /** + * Get the configuration path for a namespace. + * + * @param string $namespace + * @return string + */ + protected function getPath($namespace) + { + if (is_null($namespace)) + { + return $this->defaultPath; + } + elseif (isset($this->hints[$namespace])) + { + return $this->hints[$namespace]; + } + } + + /** + * Add a new namespace to the loader. + * + * @param string $namespace + * @param string $hint + * @return void + */ + public function addNamespace($namespace, $hint) + { + $this->hints[$namespace] = $hint; + } + + /** + * Returns all registered namespaces with the config + * loader. + * + * @return array + */ + public function getNamespaces() + { + return $this->hints; + } + + /** + * Get a file's contents by requiring it. + * + * @param string $path + * @return mixed + */ + protected function getRequire($path) + { + return $this->files->getRequire($path); + } + + /** + * Get the Filesystem instance. + * + * @return \Illuminate\Filesystem\Filesystem + */ + public function getFilesystem() + { + return $this->files; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Config/LoaderInterface.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Config/LoaderInterface.php b/vendor/laravel/framework/src/Illuminate/Config/LoaderInterface.php new file mode 100755 index 0000000..d4b6a8f --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Config/LoaderInterface.php @@ -0,0 +1,52 @@ +loader = $loader; + $this->environment = $environment; + } + + /** + * Determine if the given configuration value exists. + * + * @param string $key + * @return bool + */ + public function has($key) + { + $default = microtime(true); + + return $this->get($key, $default) !== $default; + } + + /** + * Determine if a configuration group exists. + * + * @param string $key + * @return bool + */ + public function hasGroup($key) + { + list($namespace, $group, $item) = $this->parseKey($key); + + return $this->loader->exists($group, $namespace); + } + + /** + * Get the specified configuration value. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function get($key, $default = null) + { + list($namespace, $group, $item) = $this->parseKey($key); + + // Configuration items are actually keyed by "collection", which is simply a + // combination of each namespace and groups, which allows a unique way to + // identify the arrays of configuration items for the particular files. + $collection = $this->getCollection($group, $namespace); + + $this->load($group, $namespace, $collection); + + return array_get($this->items[$collection], $item, $default); + } + + /** + * Set a given configuration value. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function set($key, $value) + { + list($namespace, $group, $item) = $this->parseKey($key); + + $collection = $this->getCollection($group, $namespace); + + // We'll need to go ahead and lazy load each configuration groups even when + // we're just setting a configuration item so that the set item does not + // get overwritten if a different item in the group is requested later. + $this->load($group, $namespace, $collection); + + if (is_null($item)) + { + $this->items[$collection] = $value; + } + else + { + array_set($this->items[$collection], $item, $value); + } + } + + /** + * Load the configuration group for the key. + * + * @param string $group + * @param string $namespace + * @param string $collection + * @return void + */ + protected function load($group, $namespace, $collection) + { + $env = $this->environment; + + // If we've already loaded this collection, we will just bail out since we do + // not want to load it again. Once items are loaded a first time they will + // stay kept in memory within this class and not loaded from disk again. + if (isset($this->items[$collection])) + { + return; + } + + $items = $this->loader->load($env, $group, $namespace); + + // If we've already loaded this collection, we will just bail out since we do + // not want to load it again. Once items are loaded a first time they will + // stay kept in memory within this class and not loaded from disk again. + if (isset($this->afterLoad[$namespace])) + { + $items = $this->callAfterLoad($namespace, $group, $items); + } + + $this->items[$collection] = $items; + } + + /** + * Call the after load callback for a namespace. + * + * @param string $namespace + * @param string $group + * @param array $items + * @return array + */ + protected function callAfterLoad($namespace, $group, $items) + { + $callback = $this->afterLoad[$namespace]; + + return call_user_func($callback, $this, $group, $items); + } + + /** + * Parse an array of namespaced segments. + * + * @param string $key + * @return array + */ + protected function parseNamespacedSegments($key) + { + list($namespace, $item) = explode('::', $key); + + // If the namespace is registered as a package, we will just assume the group + // is equal to the namespace since all packages cascade in this way having + // a single file per package, otherwise we'll just parse them as normal. + if (in_array($namespace, $this->packages)) + { + return $this->parsePackageSegments($key, $namespace, $item); + } + + return parent::parseNamespacedSegments($key); + } + + /** + * Parse the segments of a package namespace. + * + * @param string $key + * @param string $namespace + * @param string $item + * @return array + */ + protected function parsePackageSegments($key, $namespace, $item) + { + $itemSegments = explode('.', $item); + + // If the configuration file doesn't exist for the given package group we can + // assume that we should implicitly use the config file matching the name + // of the namespace. Generally packages should use one type or another. + if ( ! $this->loader->exists($itemSegments[0], $namespace)) + { + return array($namespace, 'config', $item); + } + + return parent::parseNamespacedSegments($key); + } + + /** + * Register a package for cascading configuration. + * + * @param string $package + * @param string $hint + * @param string $namespace + * @return void + */ + public function package($package, $hint, $namespace = null) + { + $namespace = $this->getPackageNamespace($package, $namespace); + + $this->packages[] = $namespace; + + // First we will simply register the namespace with the repository so that it + // can be loaded. Once we have done that we'll register an after namespace + // callback so that we can cascade an application package configuration. + $this->addNamespace($namespace, $hint); + + $this->afterLoading($namespace, function($me, $group, $items) use ($package) + { + $env = $me->getEnvironment(); + + $loader = $me->getLoader(); + + return $loader->cascadePackage($env, $package, $group, $items); + }); + } + + /** + * Get the configuration namespace for a package. + * + * @param string $package + * @param string $namespace + * @return string + */ + protected function getPackageNamespace($package, $namespace) + { + if (is_null($namespace)) + { + list($vendor, $namespace) = explode('/', $package); + } + + return $namespace; + } + + /** + * Register an after load callback for a given namespace. + * + * @param string $namespace + * @param \Closure $callback + * @return void + */ + public function afterLoading($namespace, Closure $callback) + { + $this->afterLoad[$namespace] = $callback; + } + + /** + * Get the collection identifier. + * + * @param string $group + * @param string $namespace + * @return string + */ + protected function getCollection($group, $namespace = null) + { + $namespace = $namespace ?: '*'; + + return $namespace.'::'.$group; + } + + /** + * Add a new namespace to the loader. + * + * @param string $namespace + * @param string $hint + * @return void + */ + public function addNamespace($namespace, $hint) + { + $this->loader->addNamespace($namespace, $hint); + } + + /** + * Returns all registered namespaces with the config + * loader. + * + * @return array + */ + public function getNamespaces() + { + return $this->loader->getNamespaces(); + } + + /** + * Get the loader implementation. + * + * @return \Illuminate\Config\LoaderInterface + */ + public function getLoader() + { + return $this->loader; + } + + /** + * Set the loader implementation. + * + * @param \Illuminate\Config\LoaderInterface $loader + * @return void + */ + public function setLoader(LoaderInterface $loader) + { + $this->loader = $loader; + } + + /** + * Get the current configuration environment. + * + * @return string + */ + public function getEnvironment() + { + return $this->environment; + } + + /** + * Get the after load callback array. + * + * @return array + */ + public function getAfterLoadCallbacks() + { + return $this->afterLoad; + } + + /** + * Get all of the configuration items. + * + * @return array + */ + public function getItems() + { + return $this->items; + } + + /** + * Determine if the given configuration option exists. + * + * @param string $key + * @return bool + */ + public function offsetExists($key) + { + return $this->has($key); + } + + /** + * Get a configuration option. + * + * @param string $key + * @return mixed + */ + public function offsetGet($key) + { + return $this->get($key); + } + + /** + * Set a configuration option. + * + * @param string $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value) + { + $this->set($key, $value); + } + + /** + * Unset a configuration option. + * + * @param string $key + * @return void + */ + public function offsetUnset($key) + { + $this->set($key, null); + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Config/composer.json ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Config/composer.json b/vendor/laravel/framework/src/Illuminate/Config/composer.json new file mode 100755 index 0000000..921e1b6 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Config/composer.json @@ -0,0 +1,25 @@ +{ + "name": "illuminate/config", + "license": "MIT", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "require": { + "php": ">=5.4.0", + "illuminate/filesystem": "4.2.*", + "illuminate/support": "4.2.*" + }, + "autoload": { + "psr-0": {"Illuminate\\Config": ""} + }, + "target-dir": "Illuminate/Config", + "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/Console/Application.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Console/Application.php b/vendor/laravel/framework/src/Illuminate/Console/Application.php new file mode 100755 index 0000000..f65db40 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Console/Application.php @@ -0,0 +1,243 @@ +boot(); + } + + /** + * Create a new Console application. + * + * @param \Illuminate\Foundation\Application $app + * @return \Illuminate\Console\Application + */ + public static function make($app) + { + $app->boot(); + + $console = with($console = new static('Laravel Framework', $app::VERSION)) + ->setLaravel($app) + ->setExceptionHandler($app['exception']) + ->setAutoExit(false); + + $app->instance('artisan', $console); + + return $console; + } + + /** + * Boot the Console application. + * + * @return $this + */ + public function boot() + { + $path = $this->laravel['path'].'/start/artisan.php'; + + if (file_exists($path)) + { + require $path; + } + + // If the event dispatcher is set on the application, we will fire an event + // with the Artisan instance to provide each listener the opportunity to + // register their commands on this application before it gets started. + if (isset($this->laravel['events'])) + { + $this->laravel['events'] + ->fire('artisan.start', array($this)); + } + + return $this; + } + + /** + * Run an Artisan console command by name. + * + * @param string $command + * @param array $parameters + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return void + */ + public function call($command, array $parameters = array(), OutputInterface $output = null) + { + $parameters['command'] = $command; + + // Unless an output interface implementation was specifically passed to us we + // will use the "NullOutput" implementation by default to keep any writing + // suppressed so it doesn't leak out to the browser or any other source. + $output = $output ?: new NullOutput; + + $input = new ArrayInput($parameters); + + return $this->find($command)->run($input, $output); + } + + /** + * Add a command to the console. + * + * @param \Symfony\Component\Console\Command\Command $command + * @return \Symfony\Component\Console\Command\Command + */ + public function add(SymfonyCommand $command) + { + if ($command instanceof Command) + { + $command->setLaravel($this->laravel); + } + + return $this->addToParent($command); + } + + /** + * Add the command to the parent instance. + * + * @param \Symfony\Component\Console\Command\Command $command + * @return \Symfony\Component\Console\Command\Command + */ + protected function addToParent(SymfonyCommand $command) + { + return parent::add($command); + } + + /** + * Add a command, resolving through the application. + * + * @param string $command + * @return \Symfony\Component\Console\Command\Command + */ + public function resolve($command) + { + return $this->add($this->laravel[$command]); + } + + /** + * Resolve an array of commands through the application. + * + * @param array|mixed $commands + * @return void + */ + public function resolveCommands($commands) + { + $commands = is_array($commands) ? $commands : func_get_args(); + + foreach ($commands as $command) + { + $this->resolve($command); + } + } + + /** + * Get the default input definitions for the applications. + * + * @return \Symfony\Component\Console\Input\InputDefinition + */ + protected function getDefaultInputDefinition() + { + $definition = parent::getDefaultInputDefinition(); + + $definition->addOption($this->getEnvironmentOption()); + + return $definition; + } + + /** + * Get the global environment option for the definition. + * + * @return \Symfony\Component\Console\Input\InputOption + */ + protected function getEnvironmentOption() + { + $message = 'The environment the command should run under.'; + + return new InputOption('--env', null, InputOption::VALUE_OPTIONAL, $message); + } + + /** + * Render the given exception. + * + * @param \Exception $e + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return void + */ + public function renderException($e, $output) + { + // If we have an exception handler instance, we will call that first in case + // it has some handlers that need to be run first. We will pass "true" as + // the second parameter to indicate that it's handling a console error. + if (isset($this->exceptionHandler)) + { + $this->exceptionHandler->handleConsole($e); + } + + parent::renderException($e, $output); + } + + /** + * Set the exception handler instance. + * + * @param \Illuminate\Exception\Handler $handler + * @return $this + */ + public function setExceptionHandler($handler) + { + $this->exceptionHandler = $handler; + + return $this; + } + + /** + * Set the Laravel application instance. + * + * @param \Illuminate\Foundation\Application $laravel + * @return $this + */ + public function setLaravel($laravel) + { + $this->laravel = $laravel; + + return $this; + } + + /** + * Set whether the Console app should auto-exit when done. + * + * @param bool $boolean + * @return $this + */ + public function setAutoExit($boolean) + { + parent::setAutoExit($boolean); + + return $this; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Console/Command.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Console/Command.php b/vendor/laravel/framework/src/Illuminate/Console/Command.php new file mode 100755 index 0000000..a2a4ca3 --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Console/Command.php @@ -0,0 +1,384 @@ +name); + + // We will go ahead and set the name, description, and parameters on console + // commands just to make things a little easier on the developer. This is + // so they don't have to all be manually specified in the constructors. + $this->setDescription($this->description); + + $this->specifyParameters(); + } + + /** + * Specify the arguments and options on the command. + * + * @return void + */ + protected function specifyParameters() + { + // We will loop through all of the arguments and options for the command and + // set them all on the base command instance. This specifies what can get + // passed into these commands as "parameters" to control the execution. + foreach ($this->getArguments() as $arguments) + { + call_user_func_array(array($this, 'addArgument'), $arguments); + } + + foreach ($this->getOptions() as $options) + { + call_user_func_array(array($this, 'addOption'), $options); + } + } + + /** + * Run the console command. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return int + */ + public function run(InputInterface $input, OutputInterface $output) + { + $this->input = $input; + + $this->output = $output; + + return parent::run($input, $output); + } + + /** + * Execute the console command. + * + * @param \Symfony\Component\Console\Input\InputInterface $input + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @return mixed + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + return $this->fire(); + } + + /** + * Call another console command. + * + * @param string $command + * @param array $arguments + * @return int + */ + public function call($command, array $arguments = array()) + { + $instance = $this->getApplication()->find($command); + + $arguments['command'] = $command; + + return $instance->run(new ArrayInput($arguments), $this->output); + } + + /** + * Call another console command silently. + * + * @param string $command + * @param array $arguments + * @return int + */ + public function callSilent($command, array $arguments = array()) + { + $instance = $this->getApplication()->find($command); + + $arguments['command'] = $command; + + return $instance->run(new ArrayInput($arguments), new NullOutput); + } + + /** + * Get the value of a command argument. + * + * @param string $key + * @return string|array + */ + public function argument($key = null) + { + if (is_null($key)) return $this->input->getArguments(); + + return $this->input->getArgument($key); + } + + /** + * Get the value of a command option. + * + * @param string $key + * @return string|array + */ + public function option($key = null) + { + if (is_null($key)) return $this->input->getOptions(); + + return $this->input->getOption($key); + } + + /** + * Confirm a question with the user. + * + * @param string $question + * @param bool $default + * @return bool + */ + public function confirm($question, $default = false) + { + $helper = $this->getHelperSet()->get('question'); + + $question = new ConfirmationQuestion("{$question} ", $default); + + return $helper->ask($this->input, $this->output, $question); + } + + /** + * Prompt the user for input. + * + * @param string $question + * @param string $default + * @return string + */ + public function ask($question, $default = null) + { + $helper = $this->getHelperSet()->get('question'); + + $question = new Question("$question", $default); + + return $helper->ask($this->input, $this->output, $question); + } + + /** + * Prompt the user for input with auto completion. + * + * @param string $question + * @param array $choices + * @param string $default + * @return string + */ + public function askWithCompletion($question, array $choices, $default = null) + { + $helper = $this->getHelperSet()->get('question'); + + $question = new Question("$question", $default); + + $question->setAutocompleterValues($choices); + + return $helper->ask($this->input, $this->output, $question); + } + + /** + * Prompt the user for input but hide the answer from the console. + * + * @param string $question + * @param bool $fallback + * @return string + */ + public function secret($question, $fallback = true) + { + $helper = $this->getHelperSet()->get('question'); + + $question = new Question("$question"); + + $question->setHidden(true)->setHiddenFallback($fallback); + + return $helper->ask($this->input, $this->output, $question); + } + + /** + * Give the user a single choice from an array of answers. + * + * @param string $question + * @param array $choices + * @param string $default + * @param mixed $attempts + * @param bool $multiple + * @return bool + */ + public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null) + { + $helper = $this->getHelperSet()->get('question'); + + $question = new ChoiceQuestion("$question", $choices, $default); + + $question->setMaxAttempts($attempts)->setMultiselect($multiple); + + return $helper->ask($this->input, $this->output, $question); + } + + /** + * Format input to textual table + * + * @param array $headers + * @param array $rows + * @param string $style + * @return void + */ + public function table(array $headers, array $rows, $style = 'default') + { + $table = new Table($this->output); + + $table->setHeaders($headers)->setRows($rows)->setStyle($style)->render(); + } + + /** + * Write a string as information output. + * + * @param string $string + * @return void + */ + public function info($string) + { + $this->output->writeln("$string"); + } + + /** + * Write a string as standard output. + * + * @param string $string + * @return void + */ + public function line($string) + { + $this->output->writeln($string); + } + + /** + * Write a string as comment output. + * + * @param string $string + * @return void + */ + public function comment($string) + { + $this->output->writeln("$string"); + } + + /** + * Write a string as question output. + * + * @param string $string + * @return void + */ + public function question($string) + { + $this->output->writeln("$string"); + } + + /** + * Write a string as error output. + * + * @param string $string + * @return void + */ + public function error($string) + { + $this->output->writeln("$string"); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return array(); + } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return array(); + } + + /** + * Get the output implementation. + * + * @return \Symfony\Component\Console\Output\OutputInterface + */ + public function getOutput() + { + return $this->output; + } + + /** + * Get the Laravel application instance. + * + * @return \Illuminate\Foundation\Application + */ + public function getLaravel() + { + return $this->laravel; + } + + /** + * Set the Laravel application instance. + * + * @param \Illuminate\Foundation\Application $laravel + * @return void + */ + public function setLaravel($laravel) + { + $this->laravel = $laravel; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php b/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php new file mode 100644 index 0000000..69a587a --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php @@ -0,0 +1,50 @@ +getDefaultConfirmCallback(); + + if (call_user_func($shouldConfirm)) + { + if ($this->option('force')) return true; + + $this->comment(str_repeat('*', strlen($warning) + 12)); + $this->comment('* '.$warning.' *'); + $this->comment(str_repeat('*', strlen($warning) + 12)); + $this->output->writeln(''); + + $confirmed = $this->confirm('Do you really wish to run this command?'); + + if ( ! $confirmed) + { + $this->comment('Command Cancelled!'); + + return false; + } + } + + return true; + } + + /** + * Get the default confirmation callback. + * + * @return \Closure + */ + protected function getDefaultConfirmCallback() + { + return function() { return $this->getLaravel()->environment() == 'production'; }; + } + +} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/01413d65/vendor/laravel/framework/src/Illuminate/Console/composer.json ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Console/composer.json b/vendor/laravel/framework/src/Illuminate/Console/composer.json new file mode 100755 index 0000000..c35c6ce --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Console/composer.json @@ -0,0 +1,26 @@ +{ + "name": "illuminate/console", + "license": "MIT", + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "require": { + "php": ">=5.4.0", + "symfony/console": "2.5.*" + }, + "autoload": { + "psr-0": { + "Illuminate\\Console": "" + } + }, + "target-dir": "Illuminate/Console", + "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/Container/BindingResolutionException.php ---------------------------------------------------------------------- diff --git a/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php b/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php new file mode 100644 index 0000000..36975df --- /dev/null +++ b/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php @@ -0,0 +1,3 @@ +