1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-01-29 11:17:44 +01:00

Reorganizing docs

This commit is contained in:
Michael Dowling 2014-02-13 20:05:40 -08:00
parent ef42e31fc0
commit f35c07eba4
7 changed files with 56 additions and 291 deletions

View File

@ -1,122 +0,0 @@
/* Hero unit on homepage */
.hero-unit h1 {
font-size: 49px;
margin-bottom: 12px;
}
.hero-unit {
padding: 40px;
}
.hero-unit p {
font-size: 17px;
}
.masthead img {
float: left;
margin-right: 17px;
}
.hero-unit ul li {
margin-left: 220px;
}
.hero-unit .buttons {
text-align: center;
}
.jumbotron {
position: relative;
padding: 40px 0;
color: #fff;
text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075);
background: #00312F;
background: -moz-linear-gradient(45deg, #002F31 0%, #335A6D 100%);
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#00312D), color-stop(100%,#33566D));
background: -webkit-linear-gradient(45deg, #020031 0%,#334F6D 100%);
background: -o-linear-gradient(45deg, #002D31 0%,#334D6D 100%);
background: -ms-linear-gradient(45deg, #002F31 0%,#33516D 100%);
background: linear-gradient(45deg, #020031 0%,#33516D 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 );
-webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, .2), inset 0 -3px 7px rgba(0, 0, 0, .2);
-moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
box-shadow: inset 0 3px 7px rgba(0, 0, 0, .2), inset 0 -3px 7px rgba(0, 0, 0, .2);
}
.jumbotron h1 {
font-size: 80px;
font-weight: bold;
letter-spacing: -1px;
line-height: 1;
}
.jumbotron p {
font-size: 24px;
font-weight: 300;
line-height: 1.25;
margin-bottom: 30px;
}
.masthead {
padding: 40px 0 30px;
margin-bottom: 0;
color: #fff;
margin-top: -19px;
}
.masthead h1 {
display: none;
}
.masthead p {
font-size: 40px;
font-weight: 200;
line-height: 1.25;
margin: 12px 0 0 0;
}
.masthead .btn {
padding: 19px 24px;
font-size: 24px;
font-weight: 200;
border: 0;
}
/* Social bar on homepage */
.social {
padding: 2px 0;
text-align: center;
background-color: #f5f5f5;
border-top: 1px solid #fff;
border-bottom: 1px solid #ddd;
margin: 0 0 20px 0;
}
.social ul {
margin-top: 0;
}
.social-buttons {
margin-left: 0;
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.social-buttons li {
display: inline-block;
padding: 5px 8px;
line-height: 1;
*display: inline;
*zoom: 1;
}
.center-announcement {
padding: 10px;
background-color: rgb(238, 243, 255);
border-radius: 8px;
text-align: center;
margin: 24px 0;
}

View File

@ -1,101 +0,0 @@
<link rel="stylesheet" type="text/css" href="{{ pathto('_static/homepage.css', 1) }}" />
<div class="jumbotron masthead">
<div class="container">
<img src="{{ pathto('_static/logo.png', 1) }}" alt="guzzle" width="199" height="260" />
<h1>Guzzle</h1>
<p>Guzzle is a PHP HTTP client<br />&amp; framework for building RESTful web service clients.</p>
<p>
<a class="btn btn-primary btn-lg" href="https://github.com/guzzle/guzzle">View Guzzle on GitHub</a>
<a class="btn btn-default btn-lg" href="{{ pathto('docs') }}">Read the docs</a>
</p>
</div>
</div>
<div class="social">
<ul class="social-buttons">
<li>
<iframe src="http://ghbtns.com/github-btn.html?user=guzzle&repo=guzzle&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
</li>
<li>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://guzzlephp.org" data-text="Guzzle, PHP HTTP client &amp; framework for building RESTful web service clients" data-via="mtdowling">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</li>
<li>
<a href="https://twitter.com/mtdowling" class="twitter-follow-button" data-show-count="false">Follow @mtdowling</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</li>
</ul>
</div>
<div class="container">
<h1>Introducing Guzzle</h1>
<p>Guzzle takes the pain out of sending HTTP requests and the redundancy out of creating web service clients. It's
a framework that includes the tools needed to create a robust web service client, including:
Service descriptions for defining the inputs and outputs of an API, resource iterators for traversing
paginated resources, batching for sending a large number of requests as efficiently as possible.</p>
<ul>
<li>All the power of cURL with a simple interface.</li>
<li>Persistent connections and parallel requests.</li>
<li>Streams request and response bodies</li>
<li><a href="{{ pathto('webservice-client/guzzle-service-descriptions') }}">Service descriptions</a> for quickly building clients.</li>
<li>Powered by the Symfony2 EventDispatcher.</li>
<li>Use all of the code or only <a href="https://packagist.org/packages/guzzle/">specific components</a>.</li>
<li><a href="{{ pathto('plugins/plugins-overview') }}">Plugins</a> for caching, logging, OAuth, mocks, and more</a>
<li>Includes a custom node.js webserver to <a href="{{ pathto('testing/unit-testing') }}">test your clients</a>.</li>
</ul>
<div class="center-announcement">
Guzzle is now part of Drupal 8 core and powers the official <a href="https://github.com/aws/aws-sdk-php">AWS SDK for PHP</a>
</div>
<h2>Quick Twitter example</h2>
<pre class="prettyprint">&lt;?php
require_once 'vendor/autoload.php';
use Guzzle\Http\Client;
// Create a client and provide a base URL
$client = new Client('https://api.github.com');
// Create a request with basic Auth
$request = $client->get('/user')->setAuth('user', 'pass');
// Send the request and get the response
$response = $request->send();
echo $response->getBody();
// >>> {"type":"User", ...
echo $response->getHeader('Content-Length');
// >>> 792
// Create a client to work with the Twitter API
$client = new Client('https://api.twitter.com/{version}', array(
'version' => '1.1'
));
// Sign all requests with the OauthPlugin
$client->addSubscriber(new Guzzle\Plugin\Oauth\OauthPlugin(array(
'consumer_key' => '***',
'consumer_secret' => '***',
'token' => '***',
'token_secret' => '***'
)));
echo $client->get('statuses/user_timeline.json')->send()->getBody();
// >>> {"public_gists":6,"type":"User" ...
// Create a tweet using POST
$request = $client->post('statuses/update.json', null, array(
'status' => 'Tweeted with Guzzle, http://guzzlephp.org'
));
// Send the request and parse the JSON response into an array
$data = $request->send()->json();
echo $data['text'];
// >>> Tweeted with Guzzle, http://t.co/kngJMfRk
</pre>
</div>
<script type="text/javascript">prettyPrint();</script>

View File

@ -1,4 +1,3 @@
<li><a href="{{ pathto('docs') }}">Docs</a></li>
<li><a href="https://github.com/guzzle/guzzle">GitHub</a></li>
<li><a href="https://groups.google.com/forum/?hl=en#!forum/guzzle">Forum</a></li>
<li><a href="irc:irc.freenode.com/#guzzlephp">IRC</a></li>

View File

@ -45,14 +45,12 @@ htmlhelp_basename = 'Guzzledoc'
sys.path.insert(0, '/Users/dowling/projects/guzzle_sphinx_theme')
import guzzle_sphinx_theme
pygments_style = 'guzzle_sphinx_theme.GuzzleStyle'
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
"index_template": "index.html",
"project_nav_name": "Guzzle",
"github_user": "guzzle",
"github_repo": "guzzle",

View File

@ -1,43 +0,0 @@
.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services
====================
Guzzle Documentation
====================
User guide
----------
.. toctree::
:maxdepth: 2
overview
quickstart
clients
requests
streams
subscribers
faq
Libraries
---------
There are a number of libraries that can be used on top of or alongside
Guzzle. Here is a list of components that makeup Guzzle itself, official
libraries provided by the Guzzle organization, and commonly used libraries
provided by third party developers.
.. toctree::
:maxdepth: 2
libraries/components
libraries/guzzle
libraries/guzzle-service
libraries/third-party
API Documentation
-----------------
.. toctree::
:maxdepth: 2
api

View File

@ -1,5 +1,58 @@
.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services
.. toctree::
:hidden:
docs.rst
======
Guzzle
======
Guzzle is a PHP HTTP client that is easy to customize.
- Pluggable HTTP adapters for sending requests serially or in parallel
- Does not require cURL, but ships with a built-in cURL adapter that provides
parallel requests and persistent connections.
- Streams request and response bodies.
- Event driven customization hooks.
- Small core library.
- Plugins for caching, logging, OAuth, mocks, and more.
.. code-block:: php
$client = new GuzzleHttp\Client();
$response = $client->get('http://guzzlephp.org');
User guide
----------
.. toctree::
:maxdepth: 2
overview
quickstart
clients
requests
streams
subscribers
faq
Libraries
---------
There are a number of libraries that can be used on top of or alongside
Guzzle. Here is a list of components that makeup Guzzle itself, official
libraries provided by the Guzzle organization, and commonly used libraries
provided by third party developers.
.. toctree::
:maxdepth: 2
libraries/components
libraries/guzzle
libraries/guzzle-service
libraries/third-party
API Documentation
-----------------
.. toctree::
:maxdepth: 2
api

View File

@ -2,25 +2,6 @@
Overview
========
Guzzle is a PHP HTTP client that is easy to customize.
- Pluggable HTTP adapters for sending requests serially or in parallel
- Does not require cURL, but ships with a built-in cURL adapter that provides
parallel requests and persistent connections.
- Streams request and response bodies.
- Event driven customization hooks.
- Small core library.
- Plugins for caching, logging, OAuth, mocks, and more.
.. code-block:: php
// Really simple usage using the procedural API
$response = GuzzleHttp\get('http://guzzlephp.org');
// Client usage
$client = new GuzzleHttp\Client('http://guzzlephp.org');
$response = $client->get('/');
Requirements
============