Skip to content

Commit

Permalink
Replace Guzzle with Requests library
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakb committed Dec 29, 2013
1 parent 362880e commit d4655dc
Show file tree
Hide file tree
Showing 613 changed files with 9,635 additions and 56,036 deletions.
3 changes: 0 additions & 3 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@
// PHPDiff
'DiffRenderer' => 'Diff_Renderer_Html_SideBySide',

// Guzzle
'Client' => 'Guzzle\Http\Client',

// Sayakb
'Captcha' => 'Sayakb\Captcha\Facades\Captcha',

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/CreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CreateController extends BaseController {
* @return \Illuminate\Support\Facades\View
*/
public function getCreate()
{
{System::submitStats();
// Build the view data
$data = array(
'languages' => Highlighter::make()->languages(),
Expand Down
23 changes: 7 additions & 16 deletions app/lib/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* @filesource
*/

use Client;
use File;
use Input;
use Lang;
use Request;
use Requests;
use Route;
use Session;
use Site;
Expand Down Expand Up @@ -193,22 +193,13 @@ public static function action()
*/
public static function submitStats()
{
try
{
$client = new Client();

$request = $client->post(Site::config('services')->statsUrl, NULL, array(
'fqdn' => Site::config('general')->fqdn,
'action' => Request::segment(2),
'version' => Config::get('app.version'),
));
$data = array(
'fqdn' => Site::config('general')->fqdn,
'action' => Request::segment(2),
'version' => Config::get('app.version'),
);

$request->send();
}
catch (Exception $e)
{
// Suppress the exception
}
Requests::post(Site::config('services')->statsUrl, array(), $data);
}

}
34 changes: 17 additions & 17 deletions bootstrap/compiled.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function getDirectories()
use ReflectionParameter;
class BindingResolutionException extends \Exception
{

}
class Container implements ArrayAccess
{
Expand Down Expand Up @@ -451,7 +451,7 @@ public function bindInstallPaths(array $paths)
}
public static function getBootstrapFile()
{
return __DIR__.'/../vendor/laravel/framework/src/Illuminate/Foundation' . '/start.php';
return '/media/sayakb/storage/Apache/sticky-notes-src/vendor/laravel/framework/src/Illuminate/Foundation' . '/start.php';
}
public function startExceptionHandling()
{
Expand Down Expand Up @@ -1833,7 +1833,7 @@ private function setPhpDefaultLocale($locale)
\Locale::setDefault($locale);
}
} catch (\Exception $e) {

}
}
private function getUrlencodedPrefix($string, $prefix)
Expand Down Expand Up @@ -2410,7 +2410,7 @@ public function getLastUsed()
}
public function clear()
{

}
public function getName()
{
Expand Down Expand Up @@ -2791,7 +2791,7 @@ public function __construct($app)
}
public function boot()
{

}
public abstract function register();
public function package($package, $namespace = null, $path = null)
Expand Down Expand Up @@ -3300,17 +3300,17 @@ public function handle($level, $message, $file = 'unknown', $line = 0, $context
}
if ($this->displayErrors && error_reporting() & $level && $this->level & $level) {
if (!class_exists('Symfony\\Component\\Debug\\Exception\\ContextErrorException')) {
require __DIR__.'/../vendor/symfony/debug/Symfony/Component/Debug' . '/Exception/ContextErrorException.php';
require '/media/sayakb/storage/Apache/sticky-notes-src/vendor/symfony/debug/Symfony/Component/Debug' . '/Exception/ContextErrorException.php';
}
$exception = new ContextErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line), 0, $level, $file, $line, $context);
$exceptionHandler = set_exception_handler(function () {

});
restore_exception_handler();
if (is_array($exceptionHandler) && $exceptionHandler[0] instanceof ExceptionHandler) {
$exceptionHandler[0]->handle($exception);
if (!class_exists('Symfony\\Component\\Debug\\Exception\\DummyException')) {
require __DIR__.'/../vendor/symfony/debug/Symfony/Component/Debug' . '/Exception/DummyException.php';
require '/media/sayakb/storage/Apache/sticky-notes-src/vendor/symfony/debug/Symfony/Component/Debug' . '/Exception/DummyException.php';
}
set_exception_handler(function (\Exception $e) use($exceptionHandler) {
if (!$e instanceof DummyException) {
Expand Down Expand Up @@ -3340,7 +3340,7 @@ public function handleFatal()
return;
}
$exceptionHandler = set_exception_handler(function () {

});
restore_exception_handler();
if (is_array($exceptionHandler) && $exceptionHandler[0] instanceof ExceptionHandler) {
Expand Down Expand Up @@ -3369,7 +3369,7 @@ private function handleFatalError(ExceptionHandler $exceptionHandler, array $err
use Symfony\Component\Debug\ErrorHandler as DebugErrorHandler;
class ErrorHandler extends DebugErrorHandler
{

}
namespace Illuminate\Config;

Expand Down Expand Up @@ -3668,7 +3668,7 @@ public function cascadePackage($environment, $package, $group, $items);
use Symfony\Component\Finder\Finder;
class FileNotFoundException extends \Exception
{

}
class Filesystem
{
Expand Down Expand Up @@ -6533,7 +6533,7 @@ public function fromDateTime($value)
{
$format = $this->getDateFormat();
if ($value instanceof DateTime) {

} elseif (is_numeric($value)) {
$value = Carbon::createFromTimestamp($value);
} elseif (preg_match('/^(\\d{4})-(\\d{2})-(\\d{2})$/', $value)) {
Expand Down Expand Up @@ -7513,7 +7513,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ

class DecryptException extends \RuntimeException
{

}
class Encrypter
{
Expand Down Expand Up @@ -7972,7 +7972,7 @@ public function handleBatch(array $records)
}
public function close()
{

}
public function pushProcessor($callback)
{
Expand Down Expand Up @@ -8024,7 +8024,7 @@ public function __destruct()
try {
$this->close();
} catch (\Exception $e) {

}
}
protected function getDefaultFormatter()
Expand Down Expand Up @@ -9871,7 +9871,7 @@ class Cookie
protected $httpOnly;
public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)
{
if (preg_match('/[=,;
if (preg_match('/[=,;
]/', $name)) {
throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
}
Expand Down Expand Up @@ -10205,7 +10205,7 @@ public function handle()
return Handler::DONE;
}
if (!($resources = $this->getResourcesPath())) {
$resources = __DIR__.'/../vendor/filp/whoops/src/Whoops/Handler' . '/../Resources';
$resources = '/media/sayakb/storage/Apache/sticky-notes-src/vendor/filp/whoops/src/Whoops/Handler' . '/../Resources';
}
$templateFile = "{$resources}/pretty-template.php";
$cssFile = "{$resources}/pretty-page.css";
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"laravel/framework": "4.1.*",
"sayakb/akismet": "dev-master",
"sayakb/captcha": "dev-master",
"guzzle/guzzle": "~3.7"
"rmccue/requests": ">=1.0"
},
"autoload": {
"classmap": [
Expand Down
Loading

0 comments on commit d4655dc

Please sign in to comment.