-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
612fe82
commit 2f2a95e
Showing
18 changed files
with
757 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PSR2' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'no_unused_imports' => true, | ||
'method_argument_space' => false, | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
) | ||
; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
{ | ||
"name": "grpc/grpc-gcp", | ||
"type": "library", | ||
"description": "gcp extension for gRPC PHP", | ||
"keywords": ["rpc"], | ||
"homepage": "https://grpc.io", | ||
"name": "google/cloud-grpc", | ||
"description": "gRPC gcp library for channel management", | ||
"license": "Apache-2.0", | ||
"version": "0.0.1", | ||
"config": { | ||
"preferred-install": "source" | ||
}, | ||
"require": { | ||
"php": ">=5.5.0", | ||
"grpc/grpc": ">=1.13.0" | ||
"google/protobuf": "^v3.3.0", | ||
"grpc/grpc": "dev-master", | ||
"psr/cache": "^1.0.1" | ||
}, | ||
"require-dev": { | ||
"google/auth": "v0.9" | ||
}, | ||
"suggest": { | ||
"ext-protobuf": "For better performance, install the protobuf C extension.", | ||
"google/protobuf": "To get started using grpc quickly, install the native protobuf library." | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Grpc\\GCP\\": "src/lib" | ||
"Google\\Cloud\\Grpc\\": "src/", | ||
"": ["src/generated/"] | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/* | ||
* | ||
* Copyright 2018 gRPC authors. | ||
* | ||
* 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. | ||
* | ||
*/ | ||
namespace Google\Cloud\Grpc; | ||
|
||
/** | ||
* DeserializeCheck is used to check whether _ChannelRef is created by deserialization or not. | ||
* If it is, $real_channel is invalid thus we need to recreate it using $opts. | ||
* If not, we can use $real_channel directly instead of creating a new one. | ||
* It is useful to handle 'force_new' channel option. | ||
* This is a private class | ||
*/ | ||
class CreatedByDeserializeCheck implements \Serializable | ||
{ | ||
// TODO(ddyihai): remove it once the serialzer handler for \Grpc\Channel is implemented. | ||
private $data; | ||
public function __construct() | ||
{ | ||
$this->data = 1; | ||
} | ||
public function serialize() | ||
{ | ||
return '0'; | ||
} | ||
public function unserialize($data) | ||
{ | ||
$this->data = 1; | ||
} | ||
public function setData($data) | ||
{ | ||
$this->data = $data; | ||
} | ||
public function getData() | ||
{ | ||
return $this->data; | ||
} | ||
} |
Oops, something went wrong.