Skip to content

Commit

Permalink
Merge pull request #362 from rmccue/feature/cs-include-require-review
Browse files Browse the repository at this point in the history
CS: review of all include and require statements
  • Loading branch information
ntwb authored Oct 5, 2019
2 parents a356400 + 7e392df commit 56286a0
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/basic-auth.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/cookie.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/cookie_jar.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/get.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/post.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/proxy.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/session.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion examples/timeout.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// First, include Requests
include('../library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';

// Next, make sure Requests can load internal classes
Requests::register_autoloader();
Expand Down
2 changes: 1 addition & 1 deletion library/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static function autoloader($class) {

$file = str_replace('_', '/', $class);
if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
require_once(dirname(__FILE__) . '/' . $file . '.php');
require_once dirname(__FILE__) . '/' . $file . '.php';
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function define_from_env($name, $default = false) {
define_from_env('REQUESTS_HTTP_PROXY_AUTH_USER');
define_from_env('REQUESTS_HTTP_PROXY_AUTH_PASS');

include(dirname(dirname(__FILE__)) . '/library/Requests.php');
require_once dirname(dirname(__FILE__)) . '/library/Requests.php';
Requests::register_autoloader();

function autoload_tests($class) {
Expand All @@ -39,7 +39,7 @@ function autoload_tests($class) {
$class = substr($class, 13);
$file = str_replace('_', '/', $class);
if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
require_once(dirname(__FILE__) . '/' . $file . '.php');
require_once dirname(__FILE__) . '/' . $file . '.php';
}
}

Expand Down

0 comments on commit 56286a0

Please sign in to comment.