Commit 17f7fcad authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #20 from GrahamForks/guzzle

Guzzle 5 And Other Cool Stuff
parents 79aed5cf b2089d46
......@@ -10,10 +10,12 @@
}
],
"autoload": {
"classmap": ["src"]
"psr-4": {
"Laravel\\Installer\\Console\\": "src/"
}
},
"require": {
"guzzlehttp/guzzle": "~4.0",
"guzzlehttp/guzzle": "~5.0",
"symfony/console": "~2.3",
"symfony/process": "~2.3"
},
......
......@@ -4,25 +4,24 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "30f7952460ad672b7384653c225281c1",
"hash": "2e0d460d3256326008b6c2c37cce09d0",
"packages": [
{
"name": "guzzlehttp/guzzle",
"version": "4.2.3",
"version": "5.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "66fd916e9f9130bc22c51450476823391cb2f67c"
"reference": "475b29ccd411f2fa8a408e64576418728c032cfa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd916e9f9130bc22c51450476823391cb2f67c",
"reference": "66fd916e9f9130bc22c51450476823391cb2f67c",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/475b29ccd411f2fa8a408e64576418728c032cfa",
"reference": "475b29ccd411f2fa8a408e64576418728c032cfa",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/streams": "~2.1",
"guzzlehttp/ringphp": "~1.0",
"php": ">=5.4.0"
},
"require-dev": {
......@@ -30,22 +29,16 @@
"phpunit/phpunit": "~4.0",
"psr/log": "~1.0"
},
"suggest": {
"ext-curl": "Guzzle will use specific adapters if cURL is present"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
"dev-master": "5.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
},
"files": [
"src/functions.php"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
......@@ -69,20 +62,71 @@
"rest",
"web service"
],
"time": "2014-10-05 19:29:14"
"time": "2015-01-28 01:03:29"
},
{
"name": "guzzlehttp/ringphp",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/guzzle/RingPHP.git",
"reference": "f43ab34aad69ca0ba04172cf2c3cd5c12fc0e5a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/RingPHP/zipball/f43ab34aad69ca0ba04172cf2c3cd5c12fc0e5a4",
"reference": "f43ab34aad69ca0ba04172cf2c3cd5c12fc0e5a4",
"shasum": ""
},
"require": {
"guzzlehttp/streams": "~3.0",
"php": ">=5.4.0",
"react/promise": "~2.0"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "~4.0"
},
"suggest": {
"ext-curl": "Guzzle will use specific adapters if cURL is present"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Ring\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
"time": "2015-02-26 20:43:09"
},
{
"name": "guzzlehttp/streams",
"version": "2.1.0",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/streams.git",
"reference": "f91b721d73f0e561410903b3b3c90a5d0e40b534"
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/streams/zipball/f91b721d73f0e561410903b3b3c90a5d0e40b534",
"reference": "f91b721d73f0e561410903b3b3c90a5d0e40b534",
"url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
"shasum": ""
},
"require": {
......@@ -94,16 +138,13 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Stream\\": "src/"
},
"files": [
"src/functions.php"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
......@@ -116,13 +157,57 @@
"homepage": "https://github.com/mtdowling"
}
],
"description": "Provides a simple abstraction over streams of data (Guzzle 4+)",
"description": "Provides a simple abstraction over streams of data",
"homepage": "http://guzzlephp.org/",
"keywords": [
"Guzzle",
"stream"
],
"time": "2014-08-17 21:15:53"
"time": "2014-10-12 19:18:40"
},
{
"name": "react/promise",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
"reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/promise/zipball/365fcee430dfa4ace1fbc75737ca60ceea7eeeef",
"reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"React\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jan Sorgalla",
"email": "jsorgalla@googlemail.com"
}
],
"description": "A lightweight implementation of CommonJS Promises/A for PHP",
"time": "2014-12-30 13:32:42"
},
{
"name": "symfony/console",
......
<?php namespace Laravel\Installer\Console;
use ZipArchive;
use RuntimeException;
use GuzzleHttp\Client;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class NewCommand extends \Symfony\Component\Console\Command\Command
class NewCommand extends Command
{
/**
* Configure the command options.
*
......@@ -17,8 +19,8 @@ class NewCommand extends \Symfony\Component\Console\Command\Command
protected function configure()
{
$this->setName('new')
->setDescription('Create a new Laravel application.')
->addArgument('name', InputArgument::REQUIRED);
->setDescription('Create a new Laravel application.')
->addArgument('name', InputArgument::REQUIRED);
}
/**
......@@ -66,9 +68,7 @@ class NewCommand extends \Symfony\Component\Console\Command\Command
protected function verifyApplicationDoesntExist($directory, OutputInterface $output)
{
if (is_dir($directory)) {
$output->writeln('<error>Application already exists!</error>');
exit(1);
throw new RuntimeException('Application already exists!');
}
}
......@@ -90,9 +90,9 @@ class NewCommand extends \Symfony\Component\Console\Command\Command
*/
protected function download($zipFile)
{
$response = \GuzzleHttp\get('http://cabinet.laravel.com/latest.zip')->getBody();
$response = (new Client)->get('http://cabinet.laravel.com/latest.zip');
file_put_contents($zipFile, $response);
file_put_contents($zipFile, $response->getBody());
return $this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment