Skip to content

Commit

Permalink
add enviro proxy.
Browse files Browse the repository at this point in the history
Summary:

Reviewers:

Test Plan:

Task ID:
  • Loading branch information
Justin Bishop committed Sep 27, 2011
1 parent 0a245ac commit 986dfe5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion WebDriverBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function curl($http_method,
curl_setopt($curl, $option, $value);
}

$raw_results = trim(curl_exec($curl));
$raw_results = trim(WebDriverEnvironment::CurlExec($curl));
$results = json_decode($raw_results, true);

$info = curl_getinfo($curl);
Expand Down
25 changes: 25 additions & 0 deletions WebDriverEnvironment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// For security reasons some enterprises don't allow the use of some built-in
// php functions. This class is meant to be a proxy for these functions.
// Modify these as necessary for your enviroment, and then .gitignore this file
// so you can still easily git pull other changes from the main github repo.

final class WebDriverEnvironment {
public static function CurlExec($ch) {
return curl_exec($ch);
}
}
1 change: 1 addition & 0 deletions __init__.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
require_source('WebDriverContainer.php');
require_source('WebDriverSession.php');
require_source('WebDriverElement.php');
require_source('WebDriverEnvironment.php');
require_source('WebDriverSimpleItem.php');

0 comments on commit 986dfe5

Please sign in to comment.