Version Notes
Download this release
Release Info
Developer | Integrations Team |
Extension | Bitpay_Core |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
- app/code/community/Bitpay/Core/Helper/Data.php +5 -1
- app/code/community/Bitpay/Core/controllers/IndexController.php +0 -2
- app/code/community/Bitpay/Core/controllers/IpnController.php +1 -1
- app/code/community/Bitpay/Core/etc/system.xml +0 -40
- lib/Bitpay/AccessToken.php +1 -1
- lib/Bitpay/AccessTokenInterface.php +1 -1
- lib/Bitpay/Application.php +1 -1
- lib/Bitpay/ApplicationInterface.php +1 -1
- lib/Bitpay/Bill.php +1 -1
- lib/Bitpay/BillInterface.php +1 -1
- lib/Bitpay/Bitpay.php +1 -1
- lib/Bitpay/Buyer.php +1 -1
- lib/Bitpay/BuyerInterface.php +1 -1
- lib/Bitpay/Client/Adapter/AdapterInterface.php +1 -1
- lib/Bitpay/Client/Adapter/CurlAdapter.php +57 -16
- lib/Bitpay/Client/Client.php +272 -12
- lib/Bitpay/Client/ClientInterface.php +49 -6
- lib/Bitpay/Client/Request.php +21 -2
- lib/Bitpay/Client/RequestInterface.php +2 -1
- lib/Bitpay/Client/ResponseInterface.php +1 -1
- lib/Bitpay/Crypto/CryptoInterface.php +1 -1
- lib/Bitpay/Crypto/HashExtension.php +1 -1
- lib/Bitpay/Crypto/OpenSSLExtension.php +2 -2
- lib/Bitpay/Currency.php +5 -3
- lib/Bitpay/CurrencyInterface.php +1 -1
- lib/Bitpay/DependencyInjection/Loader/ArrayLoader.php +1 -1
- lib/Bitpay/Invoice.php +3 -3
- lib/Bitpay/InvoiceInterface.php +1 -1
- lib/Bitpay/ItemInterface.php +1 -1
- lib/Bitpay/Key.php +3 -3
- lib/Bitpay/KeyInterface.php +1 -1
- lib/Bitpay/KeyManager.php +2 -2
- lib/Bitpay/Math/BcEngine.php +52 -31
- lib/Bitpay/Math/GmpEngine.php +5 -0
- lib/Bitpay/Math/Math.php +1 -1
- lib/Bitpay/Math/RichArbitraryPrecisionIntegerMath.php +0 -583
- lib/Bitpay/Math/RpEngine.php +0 -187
- lib/Bitpay/Network/Customnet.php +47 -0
- lib/Bitpay/Network/Livenet.php +6 -1
- lib/Bitpay/Network/NetworkAware.php +1 -1
- lib/Bitpay/Network/NetworkAwareInterface.php +1 -1
- lib/Bitpay/Network/NetworkInterface.php +8 -1
- lib/Bitpay/Network/Testnet.php +6 -1
- lib/Bitpay/Payout.php +442 -0
- lib/Bitpay/PayoutInstruction.php +219 -0
- lib/Bitpay/PayoutInstructionInterface.php +57 -0
- lib/Bitpay/PayoutInterface.php +158 -0
- lib/Bitpay/PayoutTransaction.php +95 -0
- lib/Bitpay/PayoutTransactionInterface.php +32 -0
- lib/Bitpay/Point.php +1 -1
- lib/Bitpay/PointInterface.php +1 -1
- lib/Bitpay/PrivateKey.php +2 -2
- lib/Bitpay/PublicKey.php +3 -3
- lib/Bitpay/SinKey.php +2 -1
- lib/Bitpay/Storage/EncryptedFilesystemStorage.php +1 -1
- lib/Bitpay/Storage/FilesystemStorage.php +1 -1
- lib/Bitpay/Storage/MockStorage.php +1 -1
- lib/Bitpay/Storage/StorageInterface.php +1 -1
- lib/Bitpay/Token.php +1 -1
- lib/Bitpay/TokenInterface.php +1 -1
- lib/Bitpay/User.php +1 -1
- lib/Bitpay/UserInterface.php +1 -1
- lib/Bitpay/Util/CurveParameterInterface.php +1 -1
- lib/Bitpay/Util/Error.php +5 -1
- lib/Bitpay/Util/Fingerprint.php +1 -1
- lib/Bitpay/Util/Secp256k1.php +9 -9
- lib/Bitpay/Util/SecureRandom.php +1 -1
- lib/Bitpay/Util/Util.php +5 -34
- lib/Symfony/Component/Config/ConfigCache.php +3 -3
- lib/Symfony/Component/Config/Definition/ArrayNode.php +5 -5
- lib/Symfony/Component/Config/Definition/BaseNode.php +2 -2
- lib/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +5 -5
- lib/Symfony/Component/Config/Definition/Builder/MergeBuilder.php +2 -2
- lib/Symfony/Component/Config/Definition/Builder/NodeDefinition.php +3 -3
- lib/Symfony/Component/Config/Definition/NodeInterface.php +3 -3
- lib/Symfony/Component/Config/Definition/PrototypedArrayNode.php +4 -4
- lib/Symfony/Component/Config/Definition/VariableNode.php +1 -1
- lib/Symfony/Component/Config/Loader/FileLoader.php +1 -1
- lib/Symfony/Component/DependencyInjection/Alias.php +3 -3
- lib/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php +2 -2
- lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php +2 -2
- lib/Symfony/Component/DependencyInjection/Container.php +12 -8
- lib/Symfony/Component/DependencyInjection/ContainerBuilder.php +16 -16
- lib/Symfony/Component/DependencyInjection/ContainerInterface.php +5 -5
- lib/Symfony/Component/DependencyInjection/Definition.php +8 -8
- lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php +4 -4
- lib/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php +4 -4
- lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +65 -16
- lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +2 -2
- lib/Symfony/Component/DependencyInjection/Extension/Extension.php +1 -1
- lib/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php +1 -1
- lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php +6 -6
- lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php +2 -2
- lib/Symfony/Component/DependencyInjection/Reference.php +3 -3
- lib/Symfony/Component/DependencyInjection/SimpleXMLElement.php +2 -2
- lib/Symfony/Component/Filesystem/Filesystem.php +20 -19
- package.xml +1 -1
app/code/community/Bitpay/Core/Helper/Data.php
CHANGED
@@ -118,11 +118,15 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
118 |
sprintf('Sending Pairing Request for SIN "%s"', (string) $sin)
|
119 |
);
|
120 |
|
|
|
|
|
|
|
|
|
121 |
$token = $this->getBitpayClient()->createToken(
|
122 |
array(
|
123 |
'id' => (string) $sin,
|
124 |
'pairingCode' => $pairingCode,
|
125 |
-
'label' =>
|
126 |
)
|
127 |
);
|
128 |
|
118 |
sprintf('Sending Pairing Request for SIN "%s"', (string) $sin)
|
119 |
);
|
120 |
|
121 |
+
// Sanitize label
|
122 |
+
$label = preg_replace('/[^a-zA-Z0-9 \-\_\.]/', '', Mage::app()->getStore()->getName());
|
123 |
+
$label = substr('Magento - '.$label, 0, 59);
|
124 |
+
|
125 |
$token = $this->getBitpayClient()->createToken(
|
126 |
array(
|
127 |
'id' => (string) $sin,
|
128 |
'pairingCode' => $pairingCode,
|
129 |
+
'label' => $label,
|
130 |
)
|
131 |
);
|
132 |
|
app/code/community/Bitpay/Core/controllers/IndexController.php
CHANGED
@@ -21,8 +21,6 @@ class Bitpay_Core_IndexController extends Mage_Core_Controller_Front_Action
|
|
21 |
Mage::helper('bitpay')->debugData(
|
22 |
$params
|
23 |
);
|
24 |
-
//$quoteId = $params['quote'];
|
25 |
-
//$paid = Mage::getModel('bitpay/ipn')->getQuotePaid($quoteId);
|
26 |
}
|
27 |
|
28 |
$this->loadLayout();
|
21 |
Mage::helper('bitpay')->debugData(
|
22 |
$params
|
23 |
);
|
|
|
|
|
24 |
}
|
25 |
|
26 |
$this->loadLayout();
|
app/code/community/Bitpay/Core/controllers/IpnController.php
CHANGED
@@ -107,7 +107,7 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
|
|
107 |
$state = Mage::getStoreConfig(sprintf('payment/bitpay/invoice_%s', $invoice->getStatus()));
|
108 |
$order->addStatusToHistory(
|
109 |
$state,
|
110 |
-
sprintf('Incoming IPN status "%s"
|
111 |
)->save();
|
112 |
}
|
113 |
}
|
107 |
$state = Mage::getStoreConfig(sprintf('payment/bitpay/invoice_%s', $invoice->getStatus()));
|
108 |
$order->addStatusToHistory(
|
109 |
$state,
|
110 |
+
sprintf('Incoming IPN status "%s" updated order state to "%s"', $invoice->getStatus(), $state)
|
111 |
)->save();
|
112 |
}
|
113 |
}
|
app/code/community/Bitpay/Core/etc/system.xml
CHANGED
@@ -167,17 +167,6 @@
|
|
167 |
<show_in_website>1</show_in_website>
|
168 |
<show_in_store>1</show_in_store>
|
169 |
</invoice>
|
170 |
-
<!--
|
171 |
-
<invoice_new translate="label">
|
172 |
-
<label>New</label>
|
173 |
-
<frontend_type>select</frontend_type>
|
174 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
175 |
-
<sort_order>110</sort_order>
|
176 |
-
<show_in_default>1</show_in_default>
|
177 |
-
<show_in_website>1</show_in_website>
|
178 |
-
<show_in_store>1</show_in_store>
|
179 |
-
</invoice_new>
|
180 |
-
-->
|
181 |
<invoice_paid translate="label">
|
182 |
<label>Paid</label>
|
183 |
<comment>
|
@@ -217,26 +206,6 @@
|
|
217 |
<show_in_website>1</show_in_website>
|
218 |
<show_in_store>1</show_in_store>
|
219 |
</invoice_complete>
|
220 |
-
<!--
|
221 |
-
<invoice_expired translate="label">
|
222 |
-
<label>Expired</label>
|
223 |
-
<frontend_type>select</frontend_type>
|
224 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
225 |
-
<sort_order>150</sort_order>
|
226 |
-
<show_in_default>1</show_in_default>
|
227 |
-
<show_in_website>1</show_in_website>
|
228 |
-
<show_in_store>1</show_in_store>
|
229 |
-
</invoice_expired>
|
230 |
-
<invoice_invalid translate="label">
|
231 |
-
<label>Invalid</label>
|
232 |
-
<frontend_type>select</frontend_type>
|
233 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
234 |
-
<sort_order>160</sort_order>
|
235 |
-
<show_in_default>1</show_in_default>
|
236 |
-
<show_in_website>1</show_in_website>
|
237 |
-
<show_in_store>1</show_in_store>
|
238 |
-
</invoice_invalid>
|
239 |
-
-->
|
240 |
<requirements>
|
241 |
<label>Requirements</label>
|
242 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -248,15 +217,6 @@
|
|
248 |
<show_in_website>1</show_in_website>
|
249 |
<show_in_store>1</show_in_store>
|
250 |
</requirements>
|
251 |
-
<has_gmp>
|
252 |
-
<label>GMP</label>
|
253 |
-
<php_extension>gmp</php_extension>
|
254 |
-
<frontend_model>bitpay/adminhtml_system_config_form_field_extension</frontend_model>
|
255 |
-
<sort_order>510</sort_order>
|
256 |
-
<show_in_default>1</show_in_default>
|
257 |
-
<show_in_website>1</show_in_website>
|
258 |
-
<show_in_store>1</show_in_store>
|
259 |
-
</has_gmp>
|
260 |
<has_openssl>
|
261 |
<label>OpenSSL</label>
|
262 |
<php_extension>openssl</php_extension>
|
167 |
<show_in_website>1</show_in_website>
|
168 |
<show_in_store>1</show_in_store>
|
169 |
</invoice>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
<invoice_paid translate="label">
|
171 |
<label>Paid</label>
|
172 |
<comment>
|
206 |
<show_in_website>1</show_in_website>
|
207 |
<show_in_store>1</show_in_store>
|
208 |
</invoice_complete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
<requirements>
|
210 |
<label>Requirements</label>
|
211 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
217 |
<show_in_website>1</show_in_website>
|
218 |
<show_in_store>1</show_in_store>
|
219 |
</requirements>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
<has_openssl>
|
221 |
<label>OpenSSL</label>
|
222 |
<php_extension>openssl</php_extension>
|
lib/Bitpay/AccessToken.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/AccessTokenInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Application.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/ApplicationInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Bill.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/BillInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Bitpay.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Buyer.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/BuyerInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Client/Adapter/AdapterInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Client/Adapter/CurlAdapter.php
CHANGED
@@ -19,28 +19,45 @@ use Bitpay\Client\Response;
|
|
19 |
*/
|
20 |
class CurlAdapter implements AdapterInterface
|
21 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* @inheritdoc
|
24 |
*/
|
25 |
public function sendRequest(RequestInterface $request)
|
26 |
{
|
27 |
$curl = curl_init();
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
CURLOPT_RETURNTRANSFER => true,
|
39 |
-
CURLOPT_FORBID_REUSE => 1,
|
40 |
-
CURLOPT_FRESH_CONNECT => 1,
|
41 |
-
CURLOPT_HEADER => true,
|
42 |
-
)
|
43 |
-
);
|
44 |
|
45 |
if (RequestInterface::METHOD_POST == $request->getMethod()) {
|
46 |
curl_setopt_array(
|
@@ -67,4 +84,28 @@ class CurlAdapter implements AdapterInterface
|
|
67 |
|
68 |
return $response;
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
19 |
*/
|
20 |
class CurlAdapter implements AdapterInterface
|
21 |
{
|
22 |
+
/**
|
23 |
+
* @var array
|
24 |
+
*/
|
25 |
+
protected $curlOptions;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @param array $curlOptions
|
29 |
+
*/
|
30 |
+
public function __construct(array $curlOptions = array())
|
31 |
+
{
|
32 |
+
$this->curlOptions = $curlOptions;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Returns an array of curl settings to use
|
37 |
+
*
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function getCurlOptions()
|
41 |
+
{
|
42 |
+
return $this->curlOptions;
|
43 |
+
}
|
44 |
+
|
45 |
/**
|
46 |
* @inheritdoc
|
47 |
*/
|
48 |
public function sendRequest(RequestInterface $request)
|
49 |
{
|
50 |
$curl = curl_init();
|
51 |
+
|
52 |
+
$default_curl_options = $this->getCurlDefaultOptions($request);
|
53 |
+
|
54 |
+
foreach ($this->getCurlOptions() as $curl_option_key => $curl_option_value) {
|
55 |
+
if (!is_null($curl_option_value)) {
|
56 |
+
$default_curl_options[$curl_option_key] = $curl_option_value;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
curl_setopt_array($curl, $default_curl_options);
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
if (RequestInterface::METHOD_POST == $request->getMethod()) {
|
63 |
curl_setopt_array(
|
84 |
|
85 |
return $response;
|
86 |
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Returns an array of default curl settings to use
|
90 |
+
*
|
91 |
+
* @param RequestInterface $request
|
92 |
+
* @return array
|
93 |
+
*/
|
94 |
+
private function getCurlDefaultOptions(RequestInterface $request)
|
95 |
+
{
|
96 |
+
return array(
|
97 |
+
CURLOPT_URL => $request->getUri(),
|
98 |
+
CURLOPT_PORT => $request->getPort(),
|
99 |
+
CURLOPT_CUSTOMREQUEST => $request->getMethod(),
|
100 |
+
CURLOPT_HTTPHEADER => $request->getHeaderFields(),
|
101 |
+
CURLOPT_TIMEOUT => 10,
|
102 |
+
CURLOPT_SSL_VERIFYPEER => 1,
|
103 |
+
CURLOPT_SSL_VERIFYHOST => 2,
|
104 |
+
CURLOPT_CAINFO => __DIR__.'/ca-bundle.crt',
|
105 |
+
CURLOPT_RETURNTRANSFER => true,
|
106 |
+
CURLOPT_FORBID_REUSE => 1,
|
107 |
+
CURLOPT_FRESH_CONNECT => 1,
|
108 |
+
CURLOPT_HEADER => true,
|
109 |
+
);
|
110 |
+
}
|
111 |
}
|
lib/Bitpay/Client/Client.php
CHANGED
@@ -10,6 +10,7 @@ use Bitpay\Client\Adapter\AdapterInterface;
|
|
10 |
use Bitpay\Network\NetworkInterface;
|
11 |
use Bitpay\TokenInterface;
|
12 |
use Bitpay\InvoiceInterface;
|
|
|
13 |
use Bitpay\Util\Util;
|
14 |
use Bitpay\PublicKey;
|
15 |
use Bitpay\PrivateKey;
|
@@ -97,7 +98,7 @@ class Client implements ClientInterface
|
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
-
* @param
|
101 |
* @return ClientInterface
|
102 |
*/
|
103 |
public function setToken(TokenInterface $token)
|
@@ -176,9 +177,7 @@ class Client implements ClientInterface
|
|
176 |
}
|
177 |
|
178 |
/**
|
179 |
-
*
|
180 |
-
*
|
181 |
-
* @return array
|
182 |
*/
|
183 |
public function getCurrencies()
|
184 |
{
|
@@ -210,10 +209,263 @@ class Client implements ClientInterface
|
|
210 |
}
|
211 |
|
212 |
/**
|
213 |
-
*
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
*/
|
218 |
public function createToken(array $payload = array())
|
219 |
{
|
@@ -264,8 +516,7 @@ class Client implements ClientInterface
|
|
264 |
}
|
265 |
|
266 |
/**
|
267 |
-
* @
|
268 |
-
* @return InvoiceInterface
|
269 |
*/
|
270 |
public function getInvoice($invoiceId)
|
271 |
{
|
@@ -305,7 +556,7 @@ class Client implements ClientInterface
|
|
305 |
}
|
306 |
|
307 |
/**
|
308 |
-
* @param
|
309 |
* @return ResponseInterface
|
310 |
*/
|
311 |
public function sendRequest(RequestInterface $request)
|
@@ -339,9 +590,17 @@ class Client implements ClientInterface
|
|
339 |
throw new \Exception('Please set your Private Key');
|
340 |
}
|
341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
$message = sprintf(
|
343 |
'%s%s',
|
344 |
-
$
|
345 |
$request->getBody()
|
346 |
);
|
347 |
|
@@ -357,6 +616,7 @@ class Client implements ClientInterface
|
|
357 |
{
|
358 |
$request = new Request();
|
359 |
$request->setHost($this->network->getApiHost());
|
|
|
360 |
$this->prepareRequestHeaders($request);
|
361 |
|
362 |
return $request;
|
10 |
use Bitpay\Network\NetworkInterface;
|
11 |
use Bitpay\TokenInterface;
|
12 |
use Bitpay\InvoiceInterface;
|
13 |
+
use Bitpay\PayoutInterface;
|
14 |
use Bitpay\Util\Util;
|
15 |
use Bitpay\PublicKey;
|
16 |
use Bitpay\PrivateKey;
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
+
* @param TokenInterface $token
|
102 |
* @return ClientInterface
|
103 |
*/
|
104 |
public function setToken(TokenInterface $token)
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
+
* @inheritdoc
|
|
|
|
|
181 |
*/
|
182 |
public function getCurrencies()
|
183 |
{
|
209 |
}
|
210 |
|
211 |
/**
|
212 |
+
* @inheritdoc
|
213 |
+
*/
|
214 |
+
public function createPayout(PayoutInterface $payout)
|
215 |
+
{
|
216 |
+
$request = $this->createNewRequest();
|
217 |
+
$request->setMethod($request::METHOD_POST);
|
218 |
+
$request->setPath('payouts');
|
219 |
+
|
220 |
+
$amount = $payout->getAmount();
|
221 |
+
$currency = $payout->getCurrency();
|
222 |
+
$effectiveDate = $payout->getEffectiveDate();
|
223 |
+
$token = $payout->getToken();
|
224 |
+
|
225 |
+
$body = array(
|
226 |
+
'token' => $token->getToken(),
|
227 |
+
'amount' => $amount,
|
228 |
+
'currency' => $currency->getCode(),
|
229 |
+
'instructions' => array(),
|
230 |
+
'effectiveDate' => $effectiveDate,
|
231 |
+
'pricingMethod' => $payout->getPricingMethod(),
|
232 |
+
'guid' => Util::guid(),
|
233 |
+
'nonce' => Util::nonce()
|
234 |
+
);
|
235 |
+
|
236 |
+
// Optional
|
237 |
+
foreach (array('reference','notificationURL','notificationEmail') as $value) {
|
238 |
+
$function = 'get' . ucfirst($value);
|
239 |
+
if ($payout->$function() != null) {
|
240 |
+
$body[$value] = $payout->$function();
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
// Add instructions
|
245 |
+
foreach ($payout->getInstructions() as $instruction) {
|
246 |
+
$body['instructions'][] = array(
|
247 |
+
'label' => $instruction->getLabel(),
|
248 |
+
'address' => $instruction->getAddress(),
|
249 |
+
'amount' => $instruction->getAmount()
|
250 |
+
);
|
251 |
+
}
|
252 |
+
|
253 |
+
$request->setBody(json_encode($body));
|
254 |
+
$this->addIdentityHeader($request);
|
255 |
+
$this->addSignatureHeader($request);
|
256 |
+
|
257 |
+
$this->request = $request;
|
258 |
+
$this->response = $this->sendRequest($request);
|
259 |
+
$body = json_decode($this->response->getBody(), true);
|
260 |
+
if (isset($body['error']) || isset($body['errors'])) {
|
261 |
+
throw new \Exception('Error with request');
|
262 |
+
}
|
263 |
+
|
264 |
+
$data = $body['data'];
|
265 |
+
$payout
|
266 |
+
->setId($data['id'])
|
267 |
+
->setAccountId($data['account'])
|
268 |
+
->setResponseToken($data['token'])
|
269 |
+
->setStatus($data['status']);
|
270 |
+
|
271 |
+
foreach ($data['instructions'] as $c => $instruction) {
|
272 |
+
$payout->updateInstruction($c, 'setId', $instruction['id']);
|
273 |
+
}
|
274 |
+
|
275 |
+
return $payout;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* @inheritdoc
|
280 |
+
*/
|
281 |
+
public function getPayouts($status = null)
|
282 |
+
{
|
283 |
+
$request = $this->createNewRequest();
|
284 |
+
$request->setMethod(Request::METHOD_GET);
|
285 |
+
$path = 'payouts?token='
|
286 |
+
. $this->token->getToken()
|
287 |
+
. (($status == null) ? '' : '&status=' . $status);
|
288 |
+
$request->setPath($path);
|
289 |
+
|
290 |
+
$this->addIdentityHeader($request);
|
291 |
+
$this->addSignatureHeader($request);
|
292 |
+
|
293 |
+
$this->request = $request;
|
294 |
+
$this->response = $this->sendRequest($this->request);
|
295 |
+
$body = json_decode($this->response->getBody(), true);
|
296 |
+
if (isset($body['error']) || isset($body['errors'])) {
|
297 |
+
throw new \Exception('Error with request');
|
298 |
+
}
|
299 |
+
|
300 |
+
$payouts = array();
|
301 |
+
|
302 |
+
array_walk($body['data'], function ($value, $key) use (&$payouts) {
|
303 |
+
$payout = new \Bitpay\Payout();
|
304 |
+
$payout
|
305 |
+
->setId($value['id'])
|
306 |
+
->setAccountId($value['account'])
|
307 |
+
->setCurrency(new \Bitpay\Currency($value['currency']))
|
308 |
+
->setEffectiveDate($value['effectiveDate'])
|
309 |
+
->setPricingMethod($value['pricingMethod'])
|
310 |
+
->setRate(@$value['rate'])
|
311 |
+
->setRequestdate($value['requestDate'])
|
312 |
+
->setStatus($value['status'])
|
313 |
+
->setResponseToken($value['token'])
|
314 |
+
->setReference(@$value['reference'])
|
315 |
+
->setNotificationURL(@$value['notificationURL'])
|
316 |
+
->setNotificationEmail(@$value['notificationEmail']);
|
317 |
+
|
318 |
+
array_walk($value['instructions'], function ($value, $key) use (&$payout) {
|
319 |
+
$instruction = new \Bitpay\PayoutInstruction();
|
320 |
+
$instruction
|
321 |
+
->setId($value['id'])
|
322 |
+
->setLabel($value['label'])
|
323 |
+
->setAddress($value['address'])
|
324 |
+
->setAmount($value['amount'])
|
325 |
+
->setStatus($value['status']);
|
326 |
+
|
327 |
+
array_walk($value['transactions'], function ($value, $key) use (&$instruction) {
|
328 |
+
$transaction = new \Bitpay\PayoutTransaction();
|
329 |
+
$transaction
|
330 |
+
->setTransactionId($value['txid'])
|
331 |
+
->setAmount($value['amount'])
|
332 |
+
->setDate($value['date']);
|
333 |
+
|
334 |
+
$instruction->addTransaction($transaction);
|
335 |
+
});
|
336 |
+
|
337 |
+
$payout->addInstruction($instruction);
|
338 |
+
});
|
339 |
+
|
340 |
+
$payouts[] = $payout;
|
341 |
+
});
|
342 |
+
|
343 |
+
return $payouts;
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* @inheritdoc
|
348 |
+
*/
|
349 |
+
public function deletePayout(PayoutInterface $payout)
|
350 |
+
{
|
351 |
+
$request = $this->createNewRequest();
|
352 |
+
$request->setMethod(Request::METHOD_DELETE);
|
353 |
+
$request->setPath(sprintf('payouts/%s?token=%s', $payout->getId(), $payout->getResponseToken()));
|
354 |
+
|
355 |
+
$this->addIdentityHeader($request);
|
356 |
+
$this->addSignatureHeader($request);
|
357 |
+
|
358 |
+
$this->request = $request;
|
359 |
+
$this->response = $this->sendRequest($this->request);
|
360 |
+
|
361 |
+
$body = json_decode($this->response->getBody(), true);
|
362 |
+
if (empty($body['data'])) {
|
363 |
+
throw new \Exception('Error with request');
|
364 |
+
}
|
365 |
+
|
366 |
+
$data = $body['data'];
|
367 |
+
|
368 |
+
$payout->setStatus($data['status']);
|
369 |
+
|
370 |
+
return $payout;
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* @inheritdoc
|
375 |
+
*/
|
376 |
+
public function getPayout($payoutId)
|
377 |
+
{
|
378 |
+
$request = $this->createNewRequest();
|
379 |
+
$request->setMethod(Request::METHOD_GET);
|
380 |
+
$request->setPath(sprintf('payouts/%s?token=%s', $payoutId, $this->token->getToken()));
|
381 |
+
$this->addIdentityHeader($request);
|
382 |
+
$this->addSignatureHeader($request);
|
383 |
+
|
384 |
+
$this->request = $request;
|
385 |
+
$this->response = $this->sendRequest($this->request);
|
386 |
+
|
387 |
+
$body = json_decode($this->response->getBody(), true);
|
388 |
+
if (empty($body['data'])) {
|
389 |
+
throw new \Exception('Error with request');
|
390 |
+
}
|
391 |
+
$data = $body['data'];
|
392 |
+
|
393 |
+
$payout = new \Bitpay\Payout();
|
394 |
+
$payout
|
395 |
+
->setId($data['id'])
|
396 |
+
->setAccountId($data['account'])
|
397 |
+
->setStatus($data['status'])
|
398 |
+
->setCurrency(new \Bitpay\Currency($data['currency']))
|
399 |
+
->setPricingMethod(@$data['pricingMethod'])
|
400 |
+
->setReference(@$data['reference'])
|
401 |
+
->setNotificationEmail(@$data['notificationEmail'])
|
402 |
+
->setNotificationUrl(@$data['notificationURL'])
|
403 |
+
->setRequestDate($data['requestDate'])
|
404 |
+
->setEffectiveDate($data['effectiveDate'])
|
405 |
+
->setResponseToken($data['token']);
|
406 |
+
|
407 |
+
array_walk($data['instructions'], function ($value, $key) use (&$payout) {
|
408 |
+
$instruction = new \Bitpay\PayoutInstruction();
|
409 |
+
$instruction
|
410 |
+
->setId($value['id'])
|
411 |
+
->setLabel($value['label'])
|
412 |
+
->setAddress($value['address'])
|
413 |
+
->setStatus($value['status'])
|
414 |
+
->setAmount($value['amount'])
|
415 |
+
->setBtc($value['btc']);
|
416 |
+
|
417 |
+
array_walk($value['transactions'], function ($value, $key) use (&$instruction) {
|
418 |
+
$transaction = new \Bitpay\PayoutTransaction();
|
419 |
+
$transaction
|
420 |
+
->setTransactionId($value['txid'])
|
421 |
+
->setAmount($value['amount'])
|
422 |
+
->setDate($value['date']);
|
423 |
+
|
424 |
+
$instruction->addTransaction($transaction);
|
425 |
+
});
|
426 |
+
|
427 |
+
$payout->addInstruction($instruction);
|
428 |
+
});
|
429 |
+
|
430 |
+
return $payout;
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* @inheritdoc
|
435 |
+
*/
|
436 |
+
public function getTokens()
|
437 |
+
{
|
438 |
+
$request = $this->createNewRequest();
|
439 |
+
$request->setMethod(Request::METHOD_GET);
|
440 |
+
$request->setPath('tokens');
|
441 |
+
$this->addIdentityHeader($request);
|
442 |
+
$this->addSignatureHeader($request);
|
443 |
+
|
444 |
+
$this->request = $request;
|
445 |
+
$this->response = $this->sendRequest($this->request);
|
446 |
+
$body = json_decode($this->response->getBody(), true);
|
447 |
+
if (empty($body['data'])) {
|
448 |
+
throw new \Exception('Error with request');
|
449 |
+
}
|
450 |
+
|
451 |
+
$tokens = array();
|
452 |
+
|
453 |
+
array_walk($body['data'], function ($value, $key) use (&$tokens) {
|
454 |
+
$key = current(array_keys($value));
|
455 |
+
$value = current(array_values($value));
|
456 |
+
$token = new \Bitpay\Token();
|
457 |
+
$token
|
458 |
+
->setFacade($key)
|
459 |
+
->setToken($value);
|
460 |
+
|
461 |
+
$tokens[$token->getFacade()] = $token;
|
462 |
+
});
|
463 |
+
|
464 |
+
return $tokens;
|
465 |
+
}
|
466 |
+
|
467 |
+
/**
|
468 |
+
* @inheritdoc
|
469 |
*/
|
470 |
public function createToken(array $payload = array())
|
471 |
{
|
516 |
}
|
517 |
|
518 |
/**
|
519 |
+
* @inheritdoc
|
|
|
520 |
*/
|
521 |
public function getInvoice($invoiceId)
|
522 |
{
|
556 |
}
|
557 |
|
558 |
/**
|
559 |
+
* @param RequestInterface $request
|
560 |
* @return ResponseInterface
|
561 |
*/
|
562 |
public function sendRequest(RequestInterface $request)
|
590 |
throw new \Exception('Please set your Private Key');
|
591 |
}
|
592 |
|
593 |
+
if (isset($this->network->isPortRequiredInUrl)) {
|
594 |
+
if ($this->network->isPortRequiredInUrl === true) {
|
595 |
+
$url = $request->getUriWithPort();
|
596 |
+
}
|
597 |
+
} else {
|
598 |
+
$url = $request->getUri();
|
599 |
+
}
|
600 |
+
|
601 |
$message = sprintf(
|
602 |
'%s%s',
|
603 |
+
$url,
|
604 |
$request->getBody()
|
605 |
);
|
606 |
|
616 |
{
|
617 |
$request = new Request();
|
618 |
$request->setHost($this->network->getApiHost());
|
619 |
+
$request->setPort($this->network->getApiPort());
|
620 |
$this->prepareRequestHeaders($request);
|
621 |
|
622 |
return $request;
|
lib/Bitpay/Client/ClientInterface.php
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay\Client;
|
8 |
|
9 |
use Bitpay\InvoiceInterface;
|
|
|
10 |
|
11 |
/**
|
12 |
* Sends request(s) to bitpay server
|
@@ -40,9 +41,20 @@ interface ClientInterface
|
|
40 |
|
41 |
public function getCurrencies();
|
42 |
|
|
|
|
|
|
|
|
|
|
|
43 |
public function createInvoice(InvoiceInterface $invoice);
|
44 |
//public function getInvoices();
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
//public function getLedgers();
|
48 |
//public function getLedger(CurrencyInterface $currency);
|
@@ -51,15 +63,46 @@ interface ClientInterface
|
|
51 |
//public function getOrg($orgId);
|
52 |
//public function updateOrg(OrgInterface $org);
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
//public function updatePayout(PayoutInterface $payout);
|
58 |
|
59 |
//public function getRates();
|
60 |
//public function getRate(CurrencyInterface $currency);
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
//public function getUser();
|
65 |
//public function updateUser(UserInterface $user);
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay\Client;
|
8 |
|
9 |
use Bitpay\InvoiceInterface;
|
10 |
+
use Bitpay\PayoutInterface;
|
11 |
|
12 |
/**
|
13 |
* Sends request(s) to bitpay server
|
41 |
|
42 |
public function getCurrencies();
|
43 |
|
44 |
+
/**
|
45 |
+
* @param InvoiceInterface $invoiceId
|
46 |
+
* @return \Bitpay\Invoice
|
47 |
+
* @throws \Exception
|
48 |
+
*/
|
49 |
public function createInvoice(InvoiceInterface $invoice);
|
50 |
//public function getInvoices();
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @param $invoiceId
|
54 |
+
* @return InvoiceInterface
|
55 |
+
* @throws \Exception
|
56 |
+
*/
|
57 |
+
public function getInvoice($invoiceId);
|
58 |
|
59 |
//public function getLedgers();
|
60 |
//public function getLedger(CurrencyInterface $currency);
|
63 |
//public function getOrg($orgId);
|
64 |
//public function updateOrg(OrgInterface $org);
|
65 |
|
66 |
+
/**
|
67 |
+
* Create a Payout Request on Bitpay
|
68 |
+
* @param PayoutInterface $payout
|
69 |
+
* @return PayoutInterface|mixed
|
70 |
+
* @throws \Exception
|
71 |
+
*/
|
72 |
+
public function createPayout(PayoutInterface $payout);
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @param null $status
|
76 |
+
* @return array
|
77 |
+
* @throws \Exception
|
78 |
+
*/
|
79 |
+
public function getPayouts($status = null);
|
80 |
+
|
81 |
+
/**
|
82 |
+
* @param $payoutId
|
83 |
+
* @return \Bitpay\Payout
|
84 |
+
* @throws \Exception
|
85 |
+
*/
|
86 |
+
public function getPayout($payoutId);
|
87 |
+
|
88 |
+
/**
|
89 |
+
* @param PayoutInterface
|
90 |
+
* @return PayoutInterface|mixed
|
91 |
+
* @throws \Exception
|
92 |
+
*/
|
93 |
+
public function deletePayout(PayoutInterface $payout);
|
94 |
+
|
95 |
//public function updatePayout(PayoutInterface $payout);
|
96 |
|
97 |
//public function getRates();
|
98 |
//public function getRate(CurrencyInterface $currency);
|
99 |
|
100 |
+
/**
|
101 |
+
* Get an array of tokens indexed by facade
|
102 |
+
* @return array
|
103 |
+
* @throws \Exception
|
104 |
+
*/
|
105 |
+
public function getTokens();
|
106 |
|
107 |
//public function getUser();
|
108 |
//public function updateUser(UserInterface $user);
|
lib/Bitpay/Client/Request.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -51,6 +51,13 @@ class Request implements RequestInterface
|
|
51 |
*/
|
52 |
protected $path;
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
*/
|
56 |
public function __construct()
|
@@ -61,6 +68,8 @@ class Request implements RequestInterface
|
|
61 |
'X-BitPay-Plugin-Info' => null,
|
62 |
);
|
63 |
|
|
|
|
|
64 |
// Default method is POST
|
65 |
$this->method = self::METHOD_POST;
|
66 |
}
|
@@ -93,7 +102,17 @@ class Request implements RequestInterface
|
|
93 |
*/
|
94 |
public function getPort()
|
95 |
{
|
96 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
51 |
*/
|
52 |
protected $path;
|
53 |
|
54 |
+
/**
|
55 |
+
* Default is 443 but should be changed by whatever is passed in through the Adapter.
|
56 |
+
*
|
57 |
+
* @var integer
|
58 |
+
*/
|
59 |
+
protected $port;
|
60 |
+
|
61 |
/**
|
62 |
*/
|
63 |
public function __construct()
|
68 |
'X-BitPay-Plugin-Info' => null,
|
69 |
);
|
70 |
|
71 |
+
$this->port = 443;
|
72 |
+
|
73 |
// Default method is POST
|
74 |
$this->method = self::METHOD_POST;
|
75 |
}
|
102 |
*/
|
103 |
public function getPort()
|
104 |
{
|
105 |
+
return $this->port;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* This is called in the Adapter
|
110 |
+
*
|
111 |
+
* @inheritdoc
|
112 |
+
*/
|
113 |
+
public function setPort($port)
|
114 |
+
{
|
115 |
+
$this->port = $port;
|
116 |
}
|
117 |
|
118 |
/**
|
lib/Bitpay/Client/RequestInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -15,6 +15,7 @@ interface RequestInterface
|
|
15 |
const METHOD_POST = 'POST';
|
16 |
const METHOD_GET = 'GET';
|
17 |
const METHOD_PUT = 'PUT';
|
|
|
18 |
|
19 |
/**
|
20 |
* Returns the method for this request
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
15 |
const METHOD_POST = 'POST';
|
16 |
const METHOD_GET = 'GET';
|
17 |
const METHOD_PUT = 'PUT';
|
18 |
+
const METHOD_DELETE = 'DELETE';
|
19 |
|
20 |
/**
|
21 |
* Returns the method for this request
|
lib/Bitpay/Client/ResponseInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Crypto/CryptoInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Crypto/HashExtension.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Crypto/OpenSSLExtension.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -97,7 +97,7 @@ class OpenSSLExtension implements CryptoInterface
|
|
97 |
|
98 |
return false;
|
99 |
}
|
100 |
-
} catch (
|
101 |
while ($msg = openssl_error_string()) {
|
102 |
throw new \Exception('Error in generateOpenSSLKeypair: OpenSSL reported error: '.$msg);
|
103 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
97 |
|
98 |
return false;
|
99 |
}
|
100 |
+
} catch (Exception $e) {
|
101 |
while ($msg = openssl_error_string()) {
|
102 |
throw new \Exception('Error in generateOpenSSLKeypair: OpenSSL reported error: '.$msg);
|
103 |
}
|
lib/Bitpay/Currency.php
CHANGED
@@ -34,7 +34,7 @@ class Currency implements CurrencyInterface
|
|
34 |
'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'STD', 'SVC', 'SYP', 'SZL',
|
35 |
'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH',
|
36 |
'UGX', 'USD', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XAG',
|
37 |
-
'XAU', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW', 'ZWL'
|
38 |
);
|
39 |
|
40 |
/**
|
@@ -83,6 +83,8 @@ class Currency implements CurrencyInterface
|
|
83 |
protected $payoutFields;
|
84 |
|
85 |
/**
|
|
|
|
|
86 |
*/
|
87 |
public function __construct($code = null)
|
88 |
{
|
@@ -105,8 +107,8 @@ class Currency implements CurrencyInterface
|
|
105 |
/**
|
106 |
* This will change the $code to all uppercase
|
107 |
*
|
108 |
-
* @param
|
109 |
-
*
|
110 |
* @return CurrencyInterface
|
111 |
*/
|
112 |
public function setCode($code)
|
34 |
'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'STD', 'SVC', 'SYP', 'SZL',
|
35 |
'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH',
|
36 |
'UGX', 'USD', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XAG',
|
37 |
+
'XAU', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW', 'ZWL'
|
38 |
);
|
39 |
|
40 |
/**
|
83 |
protected $payoutFields;
|
84 |
|
85 |
/**
|
86 |
+
* @param string $code The Currency Code to use, ie USD
|
87 |
+
* @throws Exception Throws an exception if the Currency Code is not supported
|
88 |
*/
|
89 |
public function __construct($code = null)
|
90 |
{
|
107 |
/**
|
108 |
* This will change the $code to all uppercase
|
109 |
*
|
110 |
+
* @param string $code The Currency Code to use, ie USD
|
111 |
+
* @throws Exception Throws an exception if the Currency Code is not supported
|
112 |
* @return CurrencyInterface
|
113 |
*/
|
114 |
public function setCode($code)
|
lib/Bitpay/CurrencyInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/DependencyInjection/Loader/ArrayLoader.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Invoice.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -78,12 +78,12 @@ class Invoice implements InvoiceInterface
|
|
78 |
protected $btcPrice;
|
79 |
|
80 |
/**
|
81 |
-
* @var DateTime
|
82 |
*/
|
83 |
protected $invoiceTime;
|
84 |
|
85 |
/**
|
86 |
-
* @var DateTime
|
87 |
*/
|
88 |
protected $expirationTime;
|
89 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
78 |
protected $btcPrice;
|
79 |
|
80 |
/**
|
81 |
+
* @var \DateTime
|
82 |
*/
|
83 |
protected $invoiceTime;
|
84 |
|
85 |
/**
|
86 |
+
* @var \DateTime
|
87 |
*/
|
88 |
protected $expirationTime;
|
89 |
|
lib/Bitpay/InvoiceInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/ItemInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Key.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -47,7 +47,7 @@ abstract class Key extends Point implements KeyInterface
|
|
47 |
/**
|
48 |
* Returns a new instance of self.
|
49 |
*
|
50 |
-
* @param
|
51 |
* @return \Bitpay\KeyInterface
|
52 |
*/
|
53 |
public static function create($id = null)
|
@@ -102,7 +102,7 @@ abstract class Key extends Point implements KeyInterface
|
|
102 |
$this->dec
|
103 |
) = unserialize($data);
|
104 |
}
|
105 |
-
|
106 |
/**
|
107 |
* @return boolean
|
108 |
*/
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
47 |
/**
|
48 |
* Returns a new instance of self.
|
49 |
*
|
50 |
+
* @param string $id
|
51 |
* @return \Bitpay\KeyInterface
|
52 |
*/
|
53 |
public static function create($id = null)
|
102 |
$this->dec
|
103 |
) = unserialize($data);
|
104 |
}
|
105 |
+
|
106 |
/**
|
107 |
* @return boolean
|
108 |
*/
|
lib/Bitpay/KeyInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/KeyManager.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -14,7 +14,7 @@ namespace Bitpay;
|
|
14 |
class KeyManager
|
15 |
{
|
16 |
/**
|
17 |
-
* @var
|
18 |
*/
|
19 |
protected $storage;
|
20 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
14 |
class KeyManager
|
15 |
{
|
16 |
/**
|
17 |
+
* @var Bitpay\Storage\StorageInterface
|
18 |
*/
|
19 |
protected $storage;
|
20 |
|
lib/Bitpay/Math/BcEngine.php
CHANGED
@@ -46,36 +46,49 @@ class BcEngine implements EngineInterface
|
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
-
*
|
50 |
-
*
|
|
|
|
|
|
|
|
|
|
|
51 |
*/
|
52 |
-
public function invertm($
|
53 |
{
|
54 |
-
$
|
55 |
-
$
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
$
|
60 |
-
|
61 |
-
$z = '0';
|
62 |
-
$c = '0';
|
63 |
-
$mod = $modulus;
|
64 |
-
$num = $number;
|
65 |
do {
|
66 |
-
$
|
67 |
-
|
68 |
-
$
|
69 |
-
|
70 |
-
$num = $
|
71 |
-
|
72 |
-
$
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
|
78 |
-
return
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -126,21 +139,29 @@ class BcEngine implements EngineInterface
|
|
126 |
return bcsub($a, $b);
|
127 |
}
|
128 |
|
129 |
-
|
130 |
{
|
131 |
-
if (
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
|
135 |
for ($dec = '0', $i = 0; $i < strlen($hex); $i++) {
|
136 |
$current = strpos('0123456789abcdef', $hex[$i]);
|
137 |
$dec = bcadd(bcmul($dec, 16), $current);
|
138 |
}
|
139 |
|
140 |
-
return $dec;
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
|
143 |
-
return $x;
|
144 |
}
|
145 |
|
146 |
/**
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
+
* Finds inverse number $inv for $num by modulus $mod, such as:
|
50 |
+
* $inv * $num = 1 (mod $mod)
|
51 |
+
*
|
52 |
+
* @param string $num
|
53 |
+
* @param string $mod
|
54 |
+
* @return string
|
55 |
+
* @access public
|
56 |
*/
|
57 |
+
public function invertm($num, $mod)
|
58 |
{
|
59 |
+
$num = $this->input($num);
|
60 |
+
$mod = $this->input($mod);
|
61 |
+
|
62 |
+
$x = '1';
|
63 |
+
$y = '0';
|
64 |
+
$num1 = $mod;
|
65 |
+
|
|
|
|
|
|
|
|
|
66 |
do {
|
67 |
+
$tmp = bcmod($num, $num1);
|
68 |
+
|
69 |
+
$q = bcdiv($num, $num1);
|
70 |
+
|
71 |
+
$num = $num1;
|
72 |
+
|
73 |
+
$num1 = $tmp;
|
74 |
+
|
75 |
+
$tmp = bcsub($x, bcmul($y, $q));
|
76 |
+
|
77 |
+
$x = $y;
|
78 |
+
|
79 |
+
$y = $tmp;
|
80 |
+
|
81 |
+
} while (bccomp($num1, '0'));
|
82 |
+
|
83 |
+
if (bccomp($x, '0') < 0) {
|
84 |
+
$x = bcadd($x, $mod);
|
85 |
+
}
|
86 |
+
|
87 |
+
if (substr($num, 0, 1) === '-') {
|
88 |
+
$x = bcsub($mod, $x);
|
89 |
}
|
90 |
|
91 |
+
return $x;
|
92 |
}
|
93 |
|
94 |
/**
|
139 |
return bcsub($a, $b);
|
140 |
}
|
141 |
|
142 |
+
public function input($x)
|
143 |
{
|
144 |
+
if (empty($x)) {
|
145 |
+
return '0';
|
146 |
+
}
|
147 |
+
$x = strtolower(trim($x));
|
148 |
+
if (preg_match('/^(-?)0x([0-9a-f]+)$/', $x, $matches)) {
|
149 |
+
$sign = $matches[1];
|
150 |
+
$hex = $matches[2];
|
151 |
|
152 |
for ($dec = '0', $i = 0; $i < strlen($hex); $i++) {
|
153 |
$current = strpos('0123456789abcdef', $hex[$i]);
|
154 |
$dec = bcadd(bcmul($dec, 16), $current);
|
155 |
}
|
156 |
|
157 |
+
return $sign.$dec;
|
158 |
+
|
159 |
+
} elseif (preg_match('/^-?[0-9]+$/', $x)) {
|
160 |
+
return $x;
|
161 |
+
} else {
|
162 |
+
throw new \Exception("The input must be a numeric string in decimal or hexadecimal (with leading 0x) format.\n".var_export($x, false));
|
163 |
}
|
164 |
|
|
|
165 |
}
|
166 |
|
167 |
/**
|
lib/Bitpay/Math/GmpEngine.php
CHANGED
@@ -50,6 +50,11 @@ class GmpEngine implements EngineInterface
|
|
50 |
*/
|
51 |
public function mod($a, $b)
|
52 |
{
|
|
|
|
|
|
|
|
|
|
|
53 |
return gmp_strval(gmp_mod($a, $b));
|
54 |
}
|
55 |
|
50 |
*/
|
51 |
public function mod($a, $b)
|
52 |
{
|
53 |
+
// gmp_mod has weird behavior when the left operand is negative - https://bugs.php.net/bug.php?id=52906
|
54 |
+
if (substr($a, 0, 1) === '-') {
|
55 |
+
return gmp_strval(gmp_sub(gmp_mod($a, $b), $b));
|
56 |
+
}
|
57 |
+
|
58 |
return gmp_strval(gmp_mod($a, $b));
|
59 |
}
|
60 |
|
lib/Bitpay/Math/Math.php
CHANGED
@@ -27,7 +27,7 @@ class Math
|
|
27 |
} elseif (extension_loaded('bcmath')) {
|
28 |
static::$engine = new BcEngine();
|
29 |
} else {
|
30 |
-
|
31 |
}
|
32 |
}
|
33 |
|
27 |
} elseif (extension_loaded('bcmath')) {
|
28 |
static::$engine = new BcEngine();
|
29 |
} else {
|
30 |
+
throw new \Exception('The GMP or BCMATH extension for PHP is required.');
|
31 |
}
|
32 |
}
|
33 |
|
lib/Bitpay/Math/RichArbitraryPrecisionIntegerMath.php
DELETED
@@ -1,583 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
-
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
-
*/
|
6 |
-
|
7 |
-
namespace Bitpay\Math;
|
8 |
-
|
9 |
-
class RichArbitraryPrecisionIntegerMath
|
10 |
-
{
|
11 |
-
const HEX_CHARS = '0123456789abcdef';
|
12 |
-
/**
|
13 |
-
* @param String $a Numeric String
|
14 |
-
* @param String $b Numeric String
|
15 |
-
*/
|
16 |
-
|
17 |
-
private $internal = false;
|
18 |
-
private $a_orig_size = 0;
|
19 |
-
private $b_orig_size = 0;
|
20 |
-
private $a_padded_size = 0;
|
21 |
-
private $b_padded_size = 0;
|
22 |
-
private $subtotal = '0';
|
23 |
-
private $a_orig = '';
|
24 |
-
private $b_orig = '';
|
25 |
-
private $a_now = '';
|
26 |
-
private $b_now = '';
|
27 |
-
private $init_called = false;
|
28 |
-
private $math_type = '';
|
29 |
-
private $test = false;
|
30 |
-
private $maxint = 0;
|
31 |
-
private $digits = array();
|
32 |
-
|
33 |
-
/* public constructor method to initialize important class properties */
|
34 |
-
public function __construct()
|
35 |
-
{
|
36 |
-
for ($x = 0; $x < 256; $x++) {
|
37 |
-
$this->digits[$x] = chr($x);
|
38 |
-
}
|
39 |
-
if (PHP_INT_SIZE > 4) {
|
40 |
-
$this->maxint = 10;
|
41 |
-
} else {
|
42 |
-
$this->maxint = 5;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
final public function rpmod($a, $b)
|
47 |
-
{
|
48 |
-
try {
|
49 |
-
settype($a, 'string');
|
50 |
-
settype($b, 'string');
|
51 |
-
if (trim($b) == '' || empty($b)) {
|
52 |
-
return 'undefined';
|
53 |
-
}
|
54 |
-
if (trim($a) == '' || empty($a)) {
|
55 |
-
//return array('quotient' => '0', 'remainder' => '0');
|
56 |
-
return '0';
|
57 |
-
}
|
58 |
-
$len_a = strlen($a);
|
59 |
-
$len_b = strlen($b);
|
60 |
-
if ($len_a < $this->maxint && $len_b < $this->maxint) {
|
61 |
-
//return array('quotient' => (int)((int)$a / (int)$b), 'remainder' => (int)((int)$a % (int)$b));
|
62 |
-
return (int) ((int) $a % (int) $b);
|
63 |
-
}
|
64 |
-
$c = 0;
|
65 |
-
$s = 0;
|
66 |
-
$i = 0;
|
67 |
-
$rem = '';
|
68 |
-
$result = '';
|
69 |
-
$scale = $len_a - $len_b;
|
70 |
-
$larger = $this->rpcomp($a, $b);
|
71 |
-
switch ($larger) {
|
72 |
-
case 1:
|
73 |
-
$q = $len_a - 1;
|
74 |
-
$r = $len_b - 1;
|
75 |
-
$quo = $a;
|
76 |
-
$div = $b;
|
77 |
-
break;
|
78 |
-
case 0:
|
79 |
-
//return array('quotient' => '1', 'remainder' => '0');
|
80 |
-
return '0';
|
81 |
-
case -1:
|
82 |
-
//return array('quotient' => '0', 'remainder' => $a);
|
83 |
-
return $a;
|
84 |
-
default:
|
85 |
-
return false;
|
86 |
-
}
|
87 |
-
$c_temp = 0;
|
88 |
-
$s_temp = 0;
|
89 |
-
$number_string = '';
|
90 |
-
$result_r = '';
|
91 |
-
$quotient = '';
|
92 |
-
$passes = array();
|
93 |
-
$rem = $quo;
|
94 |
-
$qq = 0;
|
95 |
-
$mainbreak = false;
|
96 |
-
$chunk_size = $len_b;
|
97 |
-
$c_temp = substr($quo, 0, $chunk_size);
|
98 |
-
$position = strlen($c_temp) - 1;
|
99 |
-
while (!$mainbreak >= 0 && $qq < 10) {
|
100 |
-
$i = 0;
|
101 |
-
$break = false;
|
102 |
-
while ($this->rpcomp($c_temp, $div) < 0) {
|
103 |
-
$quotient = $quotient.'0';
|
104 |
-
$i++;
|
105 |
-
$c_temp = $c_temp.substr($quo, $position + $i, 1);
|
106 |
-
}
|
107 |
-
$position = $this->rpadd($position, $i);
|
108 |
-
$i = 0;
|
109 |
-
$chunk_size = 1;
|
110 |
-
while (!$break) {
|
111 |
-
$i++;
|
112 |
-
$s_temp = $this->rpmul($div, $i);
|
113 |
-
if ($this->rpcomp($s_temp, $c_temp) > 0) {
|
114 |
-
$i--;
|
115 |
-
break;
|
116 |
-
}
|
117 |
-
if ($this->rpcomp($s_temp, $c_temp) == 0) {
|
118 |
-
break;
|
119 |
-
}
|
120 |
-
if ($i > 9) {
|
121 |
-
break;
|
122 |
-
}
|
123 |
-
}
|
124 |
-
$quotient = $quotient.$i;
|
125 |
-
$rem = $this->rpsub($c_temp, $this->rpmul($div, $i));
|
126 |
-
if (isset($quo[$position + 1])) {
|
127 |
-
$c_temp = $rem.$quo[$position + 1];
|
128 |
-
} else {
|
129 |
-
$mainbreak = true;
|
130 |
-
break;
|
131 |
-
}
|
132 |
-
$position = $this->rpadd($position, '1');
|
133 |
-
$qq++;
|
134 |
-
}
|
135 |
-
if (trim($rem) == '') {
|
136 |
-
$rem = '0';
|
137 |
-
}
|
138 |
-
$quotient_len = strlen($quotient);
|
139 |
-
while (substr($quotient, 0, 1) === '0' && $quotient_len > 0) {
|
140 |
-
$quotient = substr($quotient, 1);
|
141 |
-
$quotient_len--;
|
142 |
-
}
|
143 |
-
//return array('quotient' => $quotient, 'remainder' => $rem);
|
144 |
-
return $rem;
|
145 |
-
} catch (\Exception $e) {
|
146 |
-
throw $e;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
/* multiplies a number 'a' by a number 'b' */
|
151 |
-
final public function rpmul($x, $y)
|
152 |
-
{
|
153 |
-
try {
|
154 |
-
settype($x, 'string');
|
155 |
-
settype($y, 'string');
|
156 |
-
if ((trim($x) == '' || empty($x)) || (trim($y) == '' || empty($y))) {
|
157 |
-
return '0';
|
158 |
-
}
|
159 |
-
if ($y == '1') {
|
160 |
-
return $x;
|
161 |
-
}
|
162 |
-
if ($x == '1') {
|
163 |
-
return $y;
|
164 |
-
}
|
165 |
-
$x_size = strlen($x);
|
166 |
-
$y_size = strlen($y);
|
167 |
-
$chunk = 0;
|
168 |
-
if ($x_size > $y_size) {
|
169 |
-
$chunk = $x_size;
|
170 |
-
} else {
|
171 |
-
$chunk = $y_size;
|
172 |
-
}
|
173 |
-
if ($chunk < $this->maxint) {
|
174 |
-
return (int) ((int) $x * (int) $y);
|
175 |
-
}
|
176 |
-
$m = (int) ((int) $chunk / 2);
|
177 |
-
$x1 = substr($x, 0, -$m);
|
178 |
-
$x2 = substr($x, -$m);
|
179 |
-
$y1 = substr($y, 0, -$m);
|
180 |
-
$y2 = substr($y, -$m);
|
181 |
-
$a = $this->rpmul($x2, $y2);
|
182 |
-
$b = $this->rpmul($x1, $y1);
|
183 |
-
$c = $this->rpmul($this->rpadd($x1, $x2), $this->rpadd($y1, $y2));
|
184 |
-
$d = $this->rpsub($this->rpsub($c, $a), $b);
|
185 |
-
for ($qq = 0; $qq < $m; $qq++) {
|
186 |
-
$d = $d.'0';
|
187 |
-
}
|
188 |
-
$e = $b;
|
189 |
-
for ($qq = 0; $qq < ($m * 2); $qq++) {
|
190 |
-
$e = $e.'0';
|
191 |
-
}
|
192 |
-
|
193 |
-
return $this->rpadd($a, $this->rpadd($d, $e));
|
194 |
-
} catch (\Exception $e) {
|
195 |
-
throw $e;
|
196 |
-
}
|
197 |
-
}
|
198 |
-
/* adds a number 'a' by a number 'b' */
|
199 |
-
final public function rpadd($a, $b)
|
200 |
-
{
|
201 |
-
try {
|
202 |
-
settype($a, 'string');
|
203 |
-
settype($b, 'string');
|
204 |
-
if ((trim($a) == '' || empty($a)) && !empty($b)) {
|
205 |
-
return $b;
|
206 |
-
}
|
207 |
-
if ((trim($b) == '' || empty($b)) && !empty($a)) {
|
208 |
-
return $a;
|
209 |
-
}
|
210 |
-
if ((trim($a) == '' || empty($a)) && (trim($b) == '' || empty($b))) {
|
211 |
-
return '0';
|
212 |
-
}
|
213 |
-
$len_a = strlen($a);
|
214 |
-
$len_b = strlen($b);
|
215 |
-
if ($len_a < $this->maxint && $len_b < $this->maxint) {
|
216 |
-
return ((int) $a + (int) $b);
|
217 |
-
}
|
218 |
-
if ($a[0] == '0') {
|
219 |
-
while ($len_a > 0 && $a[0] == '0') {
|
220 |
-
$a = substr($a, 1);
|
221 |
-
$len_a--;
|
222 |
-
}
|
223 |
-
}
|
224 |
-
if ($b[0] == '0') {
|
225 |
-
while ($len_b > 0 && $b[0] == '0') {
|
226 |
-
$b = substr($b, 1);
|
227 |
-
$len_b--;
|
228 |
-
}
|
229 |
-
}
|
230 |
-
if ($a[0] == '-' || $b[0] == '-') {
|
231 |
-
return $this->rpsub($a, $b);
|
232 |
-
}
|
233 |
-
if ((trim($a) == '' || empty($a)) && !empty($b)) {
|
234 |
-
return $b;
|
235 |
-
}
|
236 |
-
if ((trim($b) == '' || empty($b)) && !empty($a)) {
|
237 |
-
return $a;
|
238 |
-
}
|
239 |
-
if ((trim($a) == '' || empty($a)) && (trim($b) == '' || empty($b))) {
|
240 |
-
return '0';
|
241 |
-
}
|
242 |
-
while ($len_a > $len_b) {
|
243 |
-
$b = '0'.$b;
|
244 |
-
$len_b++;
|
245 |
-
}
|
246 |
-
while ($len_b > $len_a) {
|
247 |
-
$a = '0'.$a;
|
248 |
-
$len_a++;
|
249 |
-
}
|
250 |
-
$q = $len_a - 1;
|
251 |
-
$c_temp = 0;
|
252 |
-
$s_temp = 0;
|
253 |
-
$result = $number_string = '';
|
254 |
-
while ($q >= 0) {
|
255 |
-
$s_temp = (int) $a[$q] + (int) $b[$q] + (int) $c_temp;
|
256 |
-
if ($s_temp >= 10) {
|
257 |
-
$c_temp = 1;
|
258 |
-
$str_s_temp = (string) $s_temp;
|
259 |
-
$result = $str_s_temp[1];
|
260 |
-
} else {
|
261 |
-
$c_temp = 0;
|
262 |
-
$result = $s_temp;
|
263 |
-
}
|
264 |
-
$q--;
|
265 |
-
$number_string .= $result;
|
266 |
-
}
|
267 |
-
if ($q < 0 && $c_temp == 1) {
|
268 |
-
$number_string .= '1';
|
269 |
-
}
|
270 |
-
$number_string = strrev($number_string);
|
271 |
-
$number_string_len = strlen($number_string);
|
272 |
-
while ($number_string[0] == '0' && $number_string_len > 0) {
|
273 |
-
$number_string = substr($number_string, 1);
|
274 |
-
$number_string_len--;
|
275 |
-
}
|
276 |
-
|
277 |
-
return $number_string;
|
278 |
-
} catch (\Exception $e) {
|
279 |
-
throw $e;
|
280 |
-
}
|
281 |
-
}
|
282 |
-
/* subtracts a number 'a' by a number 'b' */
|
283 |
-
final public function rpsub($a, $b)
|
284 |
-
{
|
285 |
-
try {
|
286 |
-
settype($a, 'string');
|
287 |
-
settype($b, 'string');
|
288 |
-
$len_a = strlen($a);
|
289 |
-
$len_b = strlen($b);
|
290 |
-
if ($len_a < $this->maxint && $len_b < $this->maxint) {
|
291 |
-
return ((int) $a - (int) $b);
|
292 |
-
}
|
293 |
-
$c = 0;
|
294 |
-
$s = 0;
|
295 |
-
$i = 0;
|
296 |
-
$apad = 0;
|
297 |
-
$bpad = 0;
|
298 |
-
$result = '';
|
299 |
-
$numerator = '';
|
300 |
-
$denominator = '';
|
301 |
-
$sign = '';
|
302 |
-
$sign_a = '';
|
303 |
-
$sign_b = '';
|
304 |
-
if ($a[0] == '-') {
|
305 |
-
$sign_a = '-';
|
306 |
-
$a = substr($a, 1);
|
307 |
-
$len_a--;
|
308 |
-
}
|
309 |
-
if ($b[0] == '-') {
|
310 |
-
$sign_b = '-';
|
311 |
-
$b = substr($b, 1);
|
312 |
-
$len_b--;
|
313 |
-
}
|
314 |
-
$larger = $this->rpcomp($a, $b);
|
315 |
-
switch ($larger) {
|
316 |
-
case 1:
|
317 |
-
$numerator = $a;
|
318 |
-
$denominator = $b;
|
319 |
-
if ($sign_a == '' && $sign_b == '') {
|
320 |
-
$sign = '';
|
321 |
-
}
|
322 |
-
if ($sign_a == '' && $sign_b == '-') {
|
323 |
-
return $this->rpadd($a, $b);
|
324 |
-
}
|
325 |
-
if ($sign_a == '-' && $sign_b == '-') {
|
326 |
-
$sign = '-';
|
327 |
-
}
|
328 |
-
if ($sign_a == '-' && $sign_b == '') {
|
329 |
-
$sign = '-';
|
330 |
-
}
|
331 |
-
break;
|
332 |
-
case 0:
|
333 |
-
$numerator = $a;
|
334 |
-
$denominator = $b;
|
335 |
-
if ($sign_a == '' && $sign_b == '') {
|
336 |
-
return '0';
|
337 |
-
}
|
338 |
-
if ($sign_a == '' && $sign_b == '-') {
|
339 |
-
return $this->rpadd($a, $b);
|
340 |
-
}
|
341 |
-
if ($sign_a == '-' && $sign_b == '-') {
|
342 |
-
$sign = '-';
|
343 |
-
}
|
344 |
-
if ($sign_a == '-' && $sign_b == '') {
|
345 |
-
return '0';
|
346 |
-
}
|
347 |
-
break;
|
348 |
-
case -1:
|
349 |
-
$numerator = $b;
|
350 |
-
$denominator = $a;
|
351 |
-
if ($sign_a == '' && $sign_b == '') {
|
352 |
-
$sign = '-';
|
353 |
-
}
|
354 |
-
if ($sign_a == '' && $sign_b == '-') {
|
355 |
-
return $this->rpadd($a, $b);
|
356 |
-
}
|
357 |
-
if ($sign_a == '-' && $sign_b == '-') {
|
358 |
-
$sign = '';
|
359 |
-
}
|
360 |
-
if ($sign_a == '-' && $sign_b == '') {
|
361 |
-
$sign = '-';
|
362 |
-
}
|
363 |
-
break;
|
364 |
-
default:
|
365 |
-
die('FATAL - unable to determine num/denom from comp() result!');
|
366 |
-
}
|
367 |
-
while (strlen($numerator) > strlen($denominator)) {
|
368 |
-
$denominator = '0'.$denominator;
|
369 |
-
}
|
370 |
-
$q = strlen($numerator) - 1;
|
371 |
-
$c_temp = 0;
|
372 |
-
$number_string = '';
|
373 |
-
$s_temp = 0;
|
374 |
-
while ($q >= 0) {
|
375 |
-
$num_temp = (int) substr($numerator, $q, 1);
|
376 |
-
$denom_temp = (int) substr($denominator, $q, 1);
|
377 |
-
$borrow_temp = (int) $num_temp - (int) $c_temp;
|
378 |
-
if ($borrow_temp > $denom_temp) {
|
379 |
-
$s_temp = (int) $borrow_temp - (int) $denom_temp;
|
380 |
-
$c_temp = 0;
|
381 |
-
}
|
382 |
-
if ($denom_temp > $borrow_temp) {
|
383 |
-
$s_temp = (10 + $borrow_temp) - $denom_temp;
|
384 |
-
$c_temp = 1;
|
385 |
-
}
|
386 |
-
if ($borrow_temp == $denom_temp) {
|
387 |
-
$s_temp = 0;
|
388 |
-
$c_temp = 0;
|
389 |
-
}
|
390 |
-
$q = $q - 1;
|
391 |
-
$number_string = $number_string.$s_temp;
|
392 |
-
}
|
393 |
-
$result_a = strrev($number_string);
|
394 |
-
$result_a_len = strlen($result_a);
|
395 |
-
while (substr($result_a, 0, 1) === '0' && $result_a_len > 0) {
|
396 |
-
$result_a = substr($result_a, 1);
|
397 |
-
$result_a_len--;
|
398 |
-
}
|
399 |
-
|
400 |
-
return $sign.$result_a;
|
401 |
-
} catch (\Exception $e) {
|
402 |
-
throw $e;
|
403 |
-
}
|
404 |
-
}
|
405 |
-
/* divides a number 'a' by a number 'b' */
|
406 |
-
final public function rpdiv($a, $b)
|
407 |
-
{
|
408 |
-
try {
|
409 |
-
settype($a, 'string');
|
410 |
-
settype($b, 'string');
|
411 |
-
if (trim($b) == '' || empty($b)) {
|
412 |
-
return 'undefined';
|
413 |
-
}
|
414 |
-
if (trim($a) == '' || empty($a)) {
|
415 |
-
//return array('quotient' => '0', 'remainder' => '0');
|
416 |
-
return '0';
|
417 |
-
}
|
418 |
-
$len_a = strlen($a);
|
419 |
-
$len_b = strlen($b);
|
420 |
-
if ($len_a < $this->maxint && $len_b < $this->maxint) {
|
421 |
-
//return array('quotient' => (int)((int)$a / (int)$b), 'remainder' => (int)((int)$a % (int)$b));
|
422 |
-
return (int) ((int) $a / (int) $b);
|
423 |
-
}
|
424 |
-
$c = 0;
|
425 |
-
$s = 0;
|
426 |
-
$i = 0;
|
427 |
-
$rem = '';
|
428 |
-
$result = '';
|
429 |
-
$scale = $len_a - $len_b;
|
430 |
-
$larger = $this->rpcomp($a, $b);
|
431 |
-
switch ($larger) {
|
432 |
-
case 1:
|
433 |
-
$q = $len_a - 1;
|
434 |
-
$r = $len_b - 1;
|
435 |
-
$quo = $a;
|
436 |
-
$div = $b;
|
437 |
-
break;
|
438 |
-
case 0:
|
439 |
-
//return array('quotient' => '1', 'remainder' => '0');
|
440 |
-
return '1';
|
441 |
-
case -1:
|
442 |
-
//return array('quotient' => '0', 'remainder' => $a);
|
443 |
-
return '0';
|
444 |
-
default:
|
445 |
-
return false;
|
446 |
-
}
|
447 |
-
$c_temp = 0;
|
448 |
-
$s_temp = 0;
|
449 |
-
$number_string = '';
|
450 |
-
$result_r = '';
|
451 |
-
$quotient = '';
|
452 |
-
$passes = array();
|
453 |
-
$rem = $quo;
|
454 |
-
$qq = 0;
|
455 |
-
$mainbreak = false;
|
456 |
-
$chunk_size = $len_b;
|
457 |
-
$c_temp = substr($quo, 0, $chunk_size);
|
458 |
-
$position = strlen($c_temp) - 1;
|
459 |
-
while (!$mainbreak >= 0 && $qq < 10) {
|
460 |
-
$i = 0;
|
461 |
-
$break = false;
|
462 |
-
while ($this->rpcomp($c_temp, $div) < 0) {
|
463 |
-
$quotient = $quotient.'0';
|
464 |
-
$i++;
|
465 |
-
$c_temp = $c_temp.substr($quo, $position + $i, 1);
|
466 |
-
}
|
467 |
-
$position = $this->rpadd($position, $i);
|
468 |
-
$i = 0;
|
469 |
-
$chunk_size = 1;
|
470 |
-
while (!$break) {
|
471 |
-
$i++;
|
472 |
-
$s_temp = $this->rpmul($div, $i);
|
473 |
-
if ($this->rpcomp($s_temp, $c_temp) > 0) {
|
474 |
-
$i--;
|
475 |
-
break;
|
476 |
-
}
|
477 |
-
if ($this->rpcomp($s_temp, $c_temp) == 0) {
|
478 |
-
break;
|
479 |
-
}
|
480 |
-
if ($i > 9) {
|
481 |
-
break;
|
482 |
-
}
|
483 |
-
}
|
484 |
-
$quotient = $quotient.$i;
|
485 |
-
$rem = $this->rpsub($c_temp, $this->rpmul($div, $i));
|
486 |
-
if (isset($quo[$position + 1])) {
|
487 |
-
$c_temp = $rem.$quo[$position + 1];
|
488 |
-
} else {
|
489 |
-
$mainbreak = true;
|
490 |
-
break;
|
491 |
-
}
|
492 |
-
$position = $this->rpadd($position, '1');
|
493 |
-
$qq++;
|
494 |
-
}
|
495 |
-
if (trim($rem) == '') {
|
496 |
-
$rem = '0';
|
497 |
-
}
|
498 |
-
$quotient_len = strlen($quotient);
|
499 |
-
while (substr($quotient, 0, 1) === '0' && $quotient_len > 0) {
|
500 |
-
$quotient = substr($quotient, 1);
|
501 |
-
$quotient_len--;
|
502 |
-
}
|
503 |
-
//return array('quotient' => $quotient, 'remainder' => $rem);
|
504 |
-
return $quotient;
|
505 |
-
} catch (\Exception $e) {
|
506 |
-
throw $e;
|
507 |
-
}
|
508 |
-
}
|
509 |
-
/* raises a number 'a' to a power 'b' */
|
510 |
-
final public function rppow($a, $b)
|
511 |
-
{
|
512 |
-
try {
|
513 |
-
settype($a, 'string');
|
514 |
-
settype($b, 'string');
|
515 |
-
if (trim($b) == '' || empty($b)) {
|
516 |
-
return '1';
|
517 |
-
}
|
518 |
-
$len_a = strlen($a);
|
519 |
-
$len_b = strlen($b);
|
520 |
-
if ($len_a < $this->maxint && $len_b < $this->maxint) {
|
521 |
-
return pow((int) $a, (int) $b);
|
522 |
-
}
|
523 |
-
$i = 1;
|
524 |
-
$q = 0;
|
525 |
-
$result = $a;
|
526 |
-
$number_string = '';
|
527 |
-
while ($this->rpcomp($b, $i) > 0 && $q < 100) {
|
528 |
-
$result = $this->rpmul($result, $a);
|
529 |
-
$q++;
|
530 |
-
$i++;
|
531 |
-
}
|
532 |
-
if ($q >= 100) {
|
533 |
-
return 'overflow';
|
534 |
-
} else {
|
535 |
-
return $result;
|
536 |
-
}
|
537 |
-
} catch (\Exception $e) {
|
538 |
-
throw $e;
|
539 |
-
}
|
540 |
-
}
|
541 |
-
/* compares two numbers and returns 1 if a>b, 0 if a=b, -1 if a<b */
|
542 |
-
final public function rpcomp($a, $b)
|
543 |
-
{
|
544 |
-
try {
|
545 |
-
settype($a, 'string');
|
546 |
-
settype($b, 'string');
|
547 |
-
if ((trim($a) == '' || empty($a)) && (trim($b) == '' || empty($b))) {
|
548 |
-
return 0;
|
549 |
-
}
|
550 |
-
if (trim($a) == '' || empty($a)) {
|
551 |
-
return -1;
|
552 |
-
}
|
553 |
-
if (trim($b) == '' || empty($b)) {
|
554 |
-
return 1;
|
555 |
-
}
|
556 |
-
$i = 0;
|
557 |
-
$a_size = strlen($a);
|
558 |
-
$b_size = strlen($b);
|
559 |
-
if ($a_size > $b_size) {
|
560 |
-
return 1;
|
561 |
-
}
|
562 |
-
if ($b_size > $a_size) {
|
563 |
-
return -1;
|
564 |
-
}
|
565 |
-
if ($a == $b) {
|
566 |
-
return 0;
|
567 |
-
}
|
568 |
-
while ($i < $a_size) {
|
569 |
-
if ((int) $a[$i] > (int) $b[$i]) {
|
570 |
-
return 1;
|
571 |
-
}
|
572 |
-
if ((int) $b[$i] > (int) $a[$i]) {
|
573 |
-
return -1;
|
574 |
-
}
|
575 |
-
$i++;
|
576 |
-
}
|
577 |
-
|
578 |
-
return 0;
|
579 |
-
} catch (\Exception $e) {
|
580 |
-
throw $e;
|
581 |
-
}
|
582 |
-
}
|
583 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Bitpay/Math/RpEngine.php
DELETED
@@ -1,187 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
-
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
-
*/
|
6 |
-
|
7 |
-
namespace Bitpay\Math;
|
8 |
-
|
9 |
-
class RpEngine implements EngineInterface
|
10 |
-
{
|
11 |
-
const HEX_CHARS = '0123456789abcdef';
|
12 |
-
public $rp;
|
13 |
-
|
14 |
-
/* public constructor method to initialize important class properties */
|
15 |
-
public function __construct()
|
16 |
-
{
|
17 |
-
$this->math = new RichArbitraryPrecisionIntegerMath();
|
18 |
-
}
|
19 |
-
/**
|
20 |
-
* @param String $a Numeric String
|
21 |
-
* @param String $b Numeric String
|
22 |
-
*/
|
23 |
-
public function add($a, $b)
|
24 |
-
{
|
25 |
-
$a = $this->input($a);
|
26 |
-
$b = $this->input($b);
|
27 |
-
|
28 |
-
return $this->math->rpadd($a, $b);
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param String $a Numeric String
|
33 |
-
* @param String $b Numeric String
|
34 |
-
*/
|
35 |
-
public function cmp($a, $b)
|
36 |
-
{
|
37 |
-
$a = $this->input($a);
|
38 |
-
$b = $this->input($b);
|
39 |
-
|
40 |
-
return $this->math->rpcomp($a, $b);
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @param String $a Numeric String
|
45 |
-
* @param String $b Numeric String
|
46 |
-
*/
|
47 |
-
public function div($a, $b)
|
48 |
-
{
|
49 |
-
$a = $this->input($a);
|
50 |
-
$b = $this->input($b);
|
51 |
-
|
52 |
-
return $this->math->rpdiv($a, $b);
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @param String $a Numeric String
|
57 |
-
* @param String $b Numeric String
|
58 |
-
*/
|
59 |
-
public function invertm($a, $b)
|
60 |
-
{
|
61 |
-
$number = $this->input($a);
|
62 |
-
$modulus = $this->input($b);
|
63 |
-
if (!$this->coprime($number, $modulus)) {
|
64 |
-
return '0';
|
65 |
-
}
|
66 |
-
$a = '1';
|
67 |
-
$b = '0';
|
68 |
-
$z = '0';
|
69 |
-
$c = '0';
|
70 |
-
$mod = $modulus;
|
71 |
-
$num = $number;
|
72 |
-
do {
|
73 |
-
$z = $this->math->rpmod($num, $mod);
|
74 |
-
$c = $this->math->rpdiv($num, $mod);
|
75 |
-
$mod = $z;
|
76 |
-
$z = $this->math->rpsub($a, $this->math->rpmul($b, $c));
|
77 |
-
$num = $mod;
|
78 |
-
$a = $b;
|
79 |
-
$b = $z;
|
80 |
-
} while ($this->math->rpcomp($mod, '0') > 0);
|
81 |
-
if ($this->math->rpcomp($a, '0') < 0) {
|
82 |
-
$a = $this->math->rpadd($a, $modulus);
|
83 |
-
}
|
84 |
-
|
85 |
-
return (string) $a;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @param String $a Numeric String
|
90 |
-
* @param String $b Numeric String
|
91 |
-
*/
|
92 |
-
public function mod($a, $b)
|
93 |
-
{
|
94 |
-
$a = $this->input($a);
|
95 |
-
$b = $this->input($b);
|
96 |
-
|
97 |
-
return $this->math->rpmod($a, $b);
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* @param String $a Numeric String
|
102 |
-
* @param String $b Numeric String
|
103 |
-
*/
|
104 |
-
public function mul($a, $b)
|
105 |
-
{
|
106 |
-
$a = $this->input($a);
|
107 |
-
$b = $this->input($b);
|
108 |
-
|
109 |
-
return $this->math->rpmul($a, $b);
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* @param String $a Numeric String
|
114 |
-
* @param String $b Numeric String
|
115 |
-
*/
|
116 |
-
public function pow($a, $b)
|
117 |
-
{
|
118 |
-
$a = $this->input($a);
|
119 |
-
$b = $this->input($b);
|
120 |
-
|
121 |
-
return $this->math->rppow($a, $b);
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* @param String $a Numeric String
|
126 |
-
* @param String $b Numeric String
|
127 |
-
*/
|
128 |
-
public function sub($a, $b)
|
129 |
-
{
|
130 |
-
$a = $this->input($a);
|
131 |
-
$b = $this->input($b);
|
132 |
-
|
133 |
-
return $this->math->rpsub($a, $b);
|
134 |
-
}
|
135 |
-
|
136 |
-
private function input($x)
|
137 |
-
{
|
138 |
-
if (is_string($x) && strtolower(substr($x, 0, 2)) == '0x') {
|
139 |
-
$hex = strtolower($x);
|
140 |
-
$hex = substr($hex, 2);
|
141 |
-
|
142 |
-
for ($dec = '0', $i = 0; $i < strlen($hex); $i++) {
|
143 |
-
$current = strpos('0123456789abcdef', $hex[$i]);
|
144 |
-
$dec = $this->math->rpadd($this->math->rpmul($dec, 16), $current);
|
145 |
-
}
|
146 |
-
|
147 |
-
return $dec;
|
148 |
-
}
|
149 |
-
|
150 |
-
return $x;
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* Function to determine if two numbers are
|
155 |
-
* co-prime according to the Euclidean algo.
|
156 |
-
*
|
157 |
-
* @param string $a First param to check.
|
158 |
-
* @param string $b Second param to check.
|
159 |
-
* @return bool Whether the params are cp.
|
160 |
-
*/
|
161 |
-
public function coprime($a, $b)
|
162 |
-
{
|
163 |
-
$small = 0;
|
164 |
-
$diff = 0;
|
165 |
-
while ($this->math->rpcomp($a, '0') > 0 && $this->math->rpcomp($b, '0') > 0) {
|
166 |
-
if ($this->math->rpcomp($a, $b) == -1) {
|
167 |
-
$small = $a;
|
168 |
-
$diff = $this->math->rpmod($b, $a);
|
169 |
-
}
|
170 |
-
if ($this->math->rpcomp($a, $b) == 1) {
|
171 |
-
$small = $b;
|
172 |
-
$diff = $this->math->rpmod($a, $b);
|
173 |
-
}
|
174 |
-
if ($this->math->rpcomp($a, $b) == 0) {
|
175 |
-
$small = $a;
|
176 |
-
$diff = $this->math->rpmod($b, $a);
|
177 |
-
}
|
178 |
-
$a = $small;
|
179 |
-
$b = $diff;
|
180 |
-
}
|
181 |
-
if ($this->math->rpcomp($a, '1') == 0) {
|
182 |
-
return true;
|
183 |
-
}
|
184 |
-
|
185 |
-
return false;
|
186 |
-
}
|
187 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Bitpay/Network/Customnet.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay\Network;
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
* @package Bitcore
|
12 |
+
*/
|
13 |
+
class Customnet implements NetworkInterface
|
14 |
+
{
|
15 |
+
protected $host_url;
|
16 |
+
|
17 |
+
protected $host_port;
|
18 |
+
|
19 |
+
public $isPortRequiredInUrl;
|
20 |
+
|
21 |
+
public function __construct($url, $port, $isPortRequiredInUrl = false)
|
22 |
+
{
|
23 |
+
$this->host_url = $url;
|
24 |
+
$this->host_port = $port;
|
25 |
+
$this->isPortRequiredInUrl = $isPortRequiredInUrl;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getName()
|
29 |
+
{
|
30 |
+
return 'Custom Network';
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getAddressVersion()
|
34 |
+
{
|
35 |
+
return 0x00;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getApiHost()
|
39 |
+
{
|
40 |
+
return $this->host_url;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getApiPort()
|
44 |
+
{
|
45 |
+
return $this->host_port;
|
46 |
+
}
|
47 |
+
}
|
lib/Bitpay/Network/Livenet.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -26,4 +26,9 @@ class Livenet implements NetworkInterface
|
|
26 |
{
|
27 |
return 'bitpay.com';
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
26 |
{
|
27 |
return 'bitpay.com';
|
28 |
}
|
29 |
+
|
30 |
+
public function getApiPort()
|
31 |
+
{
|
32 |
+
return 443;
|
33 |
+
}
|
34 |
}
|
lib/Bitpay/Network/NetworkAware.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Network/NetworkAwareInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Network/NetworkInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -33,4 +33,11 @@ interface NetworkInterface
|
|
33 |
* @return string
|
34 |
*/
|
35 |
public function getApiHost();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
33 |
* @return string
|
34 |
*/
|
35 |
public function getApiHost();
|
36 |
+
|
37 |
+
/**
|
38 |
+
* The port of the host
|
39 |
+
*
|
40 |
+
* @return integer
|
41 |
+
*/
|
42 |
+
public function getApiPort();
|
43 |
}
|
lib/Bitpay/Network/Testnet.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -26,4 +26,9 @@ class Testnet implements NetworkInterface
|
|
26 |
{
|
27 |
return 'test.bitpay.com';
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
26 |
{
|
27 |
return 'test.bitpay.com';
|
28 |
}
|
29 |
+
|
30 |
+
public function getApiPort()
|
31 |
+
{
|
32 |
+
return 443;
|
33 |
+
}
|
34 |
}
|
lib/Bitpay/Payout.php
ADDED
@@ -0,0 +1,442 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class Payout
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
class Payout implements PayoutInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
protected $id;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $account_id;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
protected $status;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var float
|
32 |
+
*/
|
33 |
+
protected $amount;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @var CurrencyInterface
|
37 |
+
*/
|
38 |
+
protected $currency;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
protected $effectiveDate;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @var string
|
47 |
+
*/
|
48 |
+
protected $requestDate;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @var array
|
52 |
+
*/
|
53 |
+
protected $instructions = array();
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
protected $notificationEmail;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @var string
|
62 |
+
*/
|
63 |
+
protected $notificationUrl;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @var string
|
67 |
+
*/
|
68 |
+
protected $pricingMethod;
|
69 |
+
|
70 |
+
/**
|
71 |
+
* @var string
|
72 |
+
*/
|
73 |
+
protected $rate;
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @var string
|
77 |
+
*/
|
78 |
+
protected $reference;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @var string
|
82 |
+
*/
|
83 |
+
protected $responseToken;
|
84 |
+
|
85 |
+
/**
|
86 |
+
* @var TokenInterface
|
87 |
+
*/
|
88 |
+
protected $token;
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @inheritdoc
|
92 |
+
*/
|
93 |
+
public function getId()
|
94 |
+
{
|
95 |
+
return $this->id;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Set the batch ID as assigned from bitpay.
|
100 |
+
*
|
101 |
+
* @param $id
|
102 |
+
* @return $this
|
103 |
+
*/
|
104 |
+
public function setId($id)
|
105 |
+
{
|
106 |
+
if (!empty($id) && ctype_print($id)) {
|
107 |
+
$this->id = trim($id);
|
108 |
+
}
|
109 |
+
|
110 |
+
return $this;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @inheritdoc
|
115 |
+
*/
|
116 |
+
public function getAccountId()
|
117 |
+
{
|
118 |
+
return $this->account_id;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Set Account Id - Bitpays account ID for the payout.
|
123 |
+
*
|
124 |
+
* @param $id
|
125 |
+
* @return $this
|
126 |
+
*/
|
127 |
+
public function setAccountId($id)
|
128 |
+
{
|
129 |
+
if (!empty($id) && ctype_print($id)) {
|
130 |
+
$this->account_id = $id;
|
131 |
+
}
|
132 |
+
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* @inheritdoc
|
138 |
+
*/
|
139 |
+
public function getAmount()
|
140 |
+
{
|
141 |
+
return $this->amount;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Sets the amount for this payout.
|
146 |
+
* @param $amount
|
147 |
+
* @return $this
|
148 |
+
*/
|
149 |
+
private function setAmount($amount)
|
150 |
+
{
|
151 |
+
if (!empty($amount)) {
|
152 |
+
$this->amount = $amount;
|
153 |
+
}
|
154 |
+
|
155 |
+
return $this;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* @interitdoc
|
160 |
+
*/
|
161 |
+
public function getCurrency()
|
162 |
+
{
|
163 |
+
return $this->currency;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Set Currency
|
168 |
+
* @param CurrencyInterface $currency
|
169 |
+
* @return $this
|
170 |
+
*/
|
171 |
+
public function setCurrency(CurrencyInterface $currency)
|
172 |
+
{
|
173 |
+
if (!empty($currency)) {
|
174 |
+
$this->currency = $currency;
|
175 |
+
}
|
176 |
+
|
177 |
+
return $this;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* @inheritdoc
|
182 |
+
*/
|
183 |
+
public function getEffectiveDate()
|
184 |
+
{
|
185 |
+
return $this->effectiveDate;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Set Effective date - date payout should be given to employees.
|
190 |
+
* @param $effectiveDate
|
191 |
+
* @return $this
|
192 |
+
*/
|
193 |
+
public function setEffectiveDate($effectiveDate)
|
194 |
+
{
|
195 |
+
if (!empty($effectiveDate)) {
|
196 |
+
$this->effectiveDate = $effectiveDate;
|
197 |
+
}
|
198 |
+
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Get rate assigned to payout at effectiveDate
|
204 |
+
*/
|
205 |
+
public function getRate()
|
206 |
+
{
|
207 |
+
return $this->rate;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Set the rate in bitcoin for the payouts of this transaction.
|
212 |
+
* @param $rate
|
213 |
+
* @return $this
|
214 |
+
*/
|
215 |
+
public function setRate($rate)
|
216 |
+
{
|
217 |
+
if (!empty($rate)) {
|
218 |
+
$this->rate = $rate;
|
219 |
+
}
|
220 |
+
|
221 |
+
return $this;
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* @inheritdoc
|
226 |
+
*/
|
227 |
+
public function getRequestDate()
|
228 |
+
{
|
229 |
+
return $this->requestDate;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Set
|
234 |
+
*/
|
235 |
+
public function setRequestDate($requestDate)
|
236 |
+
{
|
237 |
+
if (!empty($requestDate)) {
|
238 |
+
$this->requestDate = $requestDate;
|
239 |
+
}
|
240 |
+
|
241 |
+
return $this;
|
242 |
+
}
|
243 |
+
/**
|
244 |
+
* @inheritdoc
|
245 |
+
*/
|
246 |
+
public function getInstructions()
|
247 |
+
{
|
248 |
+
return $this->instructions;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Add Instruction of PayoutInstructionInterface type
|
253 |
+
* Increases $this->amount by value.
|
254 |
+
*
|
255 |
+
* @param PayoutInstructionInterface $instruction
|
256 |
+
* @return $this
|
257 |
+
*/
|
258 |
+
public function addInstruction(PayoutInstructionInterface $instruction)
|
259 |
+
{
|
260 |
+
if (!empty($instruction)) {
|
261 |
+
$this->instructions[] = $instruction;
|
262 |
+
$new_total = $this->getAmount() + $instruction->getAmount();
|
263 |
+
$this->setAmount($new_total);
|
264 |
+
}
|
265 |
+
|
266 |
+
return $this;
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Update Instruction - Supply an index of the instruction to update,
|
271 |
+
* plus the function and single argument, to do something to an instruction.
|
272 |
+
*
|
273 |
+
* @param $index
|
274 |
+
* @param $function
|
275 |
+
* @param $argument
|
276 |
+
* @return $this
|
277 |
+
*/
|
278 |
+
public function updateInstruction($index, $function, $argument)
|
279 |
+
{
|
280 |
+
if (!empty($argument) && ctype_print($argument)) {
|
281 |
+
$this->instructions[$index]->$function($argument);
|
282 |
+
}
|
283 |
+
|
284 |
+
return $this;
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* @inheritdoc
|
289 |
+
*/
|
290 |
+
public function getStatus()
|
291 |
+
{
|
292 |
+
return $this->status;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Sets the status for the current payout request
|
297 |
+
* @param $status
|
298 |
+
* @return $this
|
299 |
+
*/
|
300 |
+
public function setStatus($status)
|
301 |
+
{
|
302 |
+
if (!empty($status) && ctype_print($status)) {
|
303 |
+
$this->status = trim($status);
|
304 |
+
}
|
305 |
+
|
306 |
+
return $this;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* @inheritdoc
|
311 |
+
*/
|
312 |
+
public function getToken()
|
313 |
+
{
|
314 |
+
return $this->token;
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Set the token to authorize this request.
|
319 |
+
* @param TokenInterface $token
|
320 |
+
* @return $this
|
321 |
+
*/
|
322 |
+
public function setToken(TokenInterface $token)
|
323 |
+
{
|
324 |
+
if (!empty($token)) {
|
325 |
+
$this->token = $token;
|
326 |
+
}
|
327 |
+
return $this;
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* @inheritdoc
|
332 |
+
*/
|
333 |
+
public function getResponseToken()
|
334 |
+
{
|
335 |
+
return $this->responseToken;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Set Response Token - returned by Bitpay when payout request is created
|
340 |
+
*
|
341 |
+
* @param $responseToken
|
342 |
+
* @return $this
|
343 |
+
*/
|
344 |
+
public function setResponseToken($responseToken)
|
345 |
+
{
|
346 |
+
if (!empty($responseToken)) {
|
347 |
+
$this->responseToken = trim($responseToken);
|
348 |
+
}
|
349 |
+
return $this;
|
350 |
+
}
|
351 |
+
|
352 |
+
/**
|
353 |
+
* @inheritdoc
|
354 |
+
*/
|
355 |
+
public function getPricingMethod()
|
356 |
+
{
|
357 |
+
return $this->pricingMethod;
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Set the pricing method for this payout request
|
362 |
+
* @param $pricingMethod
|
363 |
+
* @return $this
|
364 |
+
*/
|
365 |
+
public function setPricingMethod($pricingMethod)
|
366 |
+
{
|
367 |
+
if (!empty($pricingMethod) && ctype_print($pricingMethod)) {
|
368 |
+
$this->pricingMethod = trim($pricingMethod);
|
369 |
+
}
|
370 |
+
|
371 |
+
return $this;
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* @inheritdoc
|
376 |
+
*/
|
377 |
+
public function getReference()
|
378 |
+
{
|
379 |
+
return $this->reference;
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Set the payroll providers reference for this payout
|
384 |
+
*
|
385 |
+
* @param $reference
|
386 |
+
* @return $this
|
387 |
+
*/
|
388 |
+
public function setReference($reference)
|
389 |
+
{
|
390 |
+
if (!empty($reference) && ctype_print($reference)) {
|
391 |
+
$this->reference = trim($reference);
|
392 |
+
}
|
393 |
+
|
394 |
+
return $this;
|
395 |
+
}
|
396 |
+
|
397 |
+
/**
|
398 |
+
* @inheritdoc
|
399 |
+
*/
|
400 |
+
public function getNotificationEmail()
|
401 |
+
{
|
402 |
+
return $this->notificationEmail;
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Set an email address where updates to payout status should be sent.
|
407 |
+
*
|
408 |
+
* @param $notificationEmail
|
409 |
+
* @return $this
|
410 |
+
*/
|
411 |
+
public function setNotificationEmail($notificationEmail)
|
412 |
+
{
|
413 |
+
if (!empty($notificationEmail) && ctype_print($notificationEmail)) {
|
414 |
+
$this->notificationEmail = trim($notificationEmail);
|
415 |
+
}
|
416 |
+
|
417 |
+
return $this;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* @inheritdoc
|
422 |
+
*/
|
423 |
+
public function getNotificationUrl()
|
424 |
+
{
|
425 |
+
return $this->notificationUrl;
|
426 |
+
}
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Set a notification url - where updated Payout objects will be sent
|
430 |
+
*
|
431 |
+
* @param $notificationUrl
|
432 |
+
* @return $this
|
433 |
+
*/
|
434 |
+
public function setNotificationUrl($notificationUrl)
|
435 |
+
{
|
436 |
+
if (!empty($notificationUrl) && ctype_print($notificationUrl)) {
|
437 |
+
$this->notificationUrl = trim($notificationUrl);
|
438 |
+
}
|
439 |
+
|
440 |
+
return $this;
|
441 |
+
}
|
442 |
+
}
|
lib/Bitpay/PayoutInstruction.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class PayoutInstruction
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
class PayoutInstruction implements PayoutInstructionInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* A transaction is unpaid when the payout in bitcoin has not yet occured.
|
17 |
+
*/
|
18 |
+
const STATUS_UNPAID = 'unpaid';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A transaction is marked as paid once the payroll is complete and bitcoins are
|
22 |
+
* sent to the recipient
|
23 |
+
*/
|
24 |
+
const STATUS_PAID = 'paid';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $id;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $btc;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
protected $label;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
protected $address;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @var float
|
48 |
+
*/
|
49 |
+
protected $amount;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
protected $status;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @var array
|
58 |
+
*/
|
59 |
+
protected $transactions = array();
|
60 |
+
|
61 |
+
public function __construct()
|
62 |
+
{
|
63 |
+
$this->transactions = array();
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @inheritdoc
|
68 |
+
*/
|
69 |
+
public function getId()
|
70 |
+
{
|
71 |
+
return $this->id;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Set the Bitpay ID for this payout instruction
|
76 |
+
*
|
77 |
+
* @param $id
|
78 |
+
* @return $this
|
79 |
+
*/
|
80 |
+
public function setId($id)
|
81 |
+
{
|
82 |
+
if (!empty($id)) {
|
83 |
+
$this->id = trim($id);
|
84 |
+
}
|
85 |
+
return $this;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* @inheritdoc
|
90 |
+
*/
|
91 |
+
public function getLabel()
|
92 |
+
{
|
93 |
+
return $this->label;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Set the employers label for this instruction.
|
98 |
+
* @param $label
|
99 |
+
* @return $this
|
100 |
+
*/
|
101 |
+
public function setLabel($label)
|
102 |
+
{
|
103 |
+
if (!empty($label)) {
|
104 |
+
$this->label = trim($label);
|
105 |
+
}
|
106 |
+
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* @inheritdoc
|
112 |
+
*/
|
113 |
+
public function getAddress()
|
114 |
+
{
|
115 |
+
return $this->address;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Set the bitcoin address for this instruction.
|
120 |
+
* @param $address
|
121 |
+
* @return $this
|
122 |
+
*/
|
123 |
+
public function setAddress($address)
|
124 |
+
{
|
125 |
+
if (!empty($address)) {
|
126 |
+
$this->address = trim($address);
|
127 |
+
}
|
128 |
+
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @inheritdoc
|
134 |
+
*/
|
135 |
+
public function getAmount()
|
136 |
+
{
|
137 |
+
return $this->amount;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Set the amount for this instruction.
|
142 |
+
* @param $amount
|
143 |
+
* @return $this
|
144 |
+
*/
|
145 |
+
public function setAmount($amount)
|
146 |
+
{
|
147 |
+
if (!empty($amount)) {
|
148 |
+
$this->amount = $amount;
|
149 |
+
}
|
150 |
+
|
151 |
+
return $this;
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* @inheritdoc
|
156 |
+
*/
|
157 |
+
public function getBtc()
|
158 |
+
{
|
159 |
+
return $this->btc;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Set BTC array (available once rates are set)
|
164 |
+
* @param $btc
|
165 |
+
* @return $this
|
166 |
+
*/
|
167 |
+
public function setBtc($btc)
|
168 |
+
{
|
169 |
+
if (!empty($btc) && is_array($btc)) {
|
170 |
+
$this->btc = $btc;
|
171 |
+
}
|
172 |
+
|
173 |
+
return $this;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* @inheritdoc
|
178 |
+
*/
|
179 |
+
public function getStatus()
|
180 |
+
{
|
181 |
+
return $this->status;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Set the status for this instruction
|
186 |
+
* @param $status
|
187 |
+
* @return $this
|
188 |
+
*/
|
189 |
+
public function setStatus($status)
|
190 |
+
{
|
191 |
+
if (!empty($status) && ctype_print($status)) {
|
192 |
+
$this->status = trim($status);
|
193 |
+
}
|
194 |
+
|
195 |
+
return $this;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* @inheritdoc
|
200 |
+
*/
|
201 |
+
public function getTransactions()
|
202 |
+
{
|
203 |
+
return $this->transactions;
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Add payout transaction to the
|
208 |
+
* @param PayoutTransactionInterface $transaction
|
209 |
+
* @return $this
|
210 |
+
*/
|
211 |
+
public function addTransaction(PayoutTransactionInterface $transaction)
|
212 |
+
{
|
213 |
+
if (!empty($transaction)) {
|
214 |
+
$this->transactions[] = $transaction;
|
215 |
+
}
|
216 |
+
|
217 |
+
return $this;
|
218 |
+
}
|
219 |
+
}
|
lib/Bitpay/PayoutInstructionInterface.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Interface PayoutInstructionInterface
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
interface PayoutInstructionInterface
|
14 |
+
{
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get Bitpay ID for this instruction.
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function getId();
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get Label for instruction payout.
|
24 |
+
* @return string
|
25 |
+
*/
|
26 |
+
public function getLabel();
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get the bitcoin address for the recipient.
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getAddress();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Return the amount to pay the recipient.
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function getAmount();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Get the BTC array (once rates are set)
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function getBtc();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Return the status of this payout instruction
|
48 |
+
* @return string
|
49 |
+
*/
|
50 |
+
public function getStatus();
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Return the transactions for this payout
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public function getTransactions();
|
57 |
+
}
|
lib/Bitpay/PayoutInterface.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Interface PayoutInterface
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
interface PayoutInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* The payroll flow begins with the payroll provider creating a payout request,
|
17 |
+
* using the payroll facade.
|
18 |
+
*/
|
19 |
+
const STATUS_NEW = 'new';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Once Bitpay receives a corresponding ACH transfer from the payroll provider,
|
23 |
+
* the finance group marks the payout as 'funded'.
|
24 |
+
*/
|
25 |
+
const STATUS_FUNDED = 'funded';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* A payout is marked as processing when it has begun to be processed, but
|
29 |
+
* is not yet complete.
|
30 |
+
*/
|
31 |
+
const STATUS_PROCESSING = 'processing';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* A batch is marked as complete when all payments have been delivered to the
|
35 |
+
* destinations.
|
36 |
+
*/
|
37 |
+
const STATUS_COMPLETE = 'complete';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* A payout can be cancelled by making a request on the API with a payout specific
|
41 |
+
* token (returned when payout was requested)
|
42 |
+
*/
|
43 |
+
const STATUS_CANCELLED = 'cancelled';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* The batch ID of the payout assigned by Bitpay.com
|
47 |
+
*
|
48 |
+
* @return string
|
49 |
+
*/
|
50 |
+
public function getId();
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Return the account parameter given by Bitpay.
|
54 |
+
*
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
public function getAccountId();
|
58 |
+
|
59 |
+
/**
|
60 |
+
* This is the total amount of the batch. Note, this amount must equal the sum of
|
61 |
+
* the amounts paid to the individual addresses. Adding an instruction to a payout
|
62 |
+
* will automatically increase this value.
|
63 |
+
*
|
64 |
+
* @return float
|
65 |
+
*/
|
66 |
+
public function getAmount();
|
67 |
+
|
68 |
+
/**
|
69 |
+
* This is the currency code set for the batch amount. The pricing currencies
|
70 |
+
* currently supported are USD and EUR.
|
71 |
+
*
|
72 |
+
* @return \Bitpay\CurrencyInterface
|
73 |
+
*/
|
74 |
+
public function getCurrency();
|
75 |
+
|
76 |
+
/**
|
77 |
+
* The date and time when the batch should be sent. The time is in milliseconds
|
78 |
+
* since midnight January 1, 1970.
|
79 |
+
*
|
80 |
+
* @return \DateTime
|
81 |
+
*/
|
82 |
+
public function getEffectiveDate();
|
83 |
+
|
84 |
+
/**
|
85 |
+
* The date and time when the batch was created by the payee. The time is in milliseconds
|
86 |
+
* since midnight January 1, 1970.
|
87 |
+
*
|
88 |
+
* @return \DateTime
|
89 |
+
*/
|
90 |
+
public function getRequestDate();
|
91 |
+
|
92 |
+
/**
|
93 |
+
* This is an array containing the details of the batch. Each payment instruction
|
94 |
+
* entry specifies the details for a single payout. There is no specific upper
|
95 |
+
* limit on the number of payment instruction entries in the batch instructions
|
96 |
+
*
|
97 |
+
* @return array
|
98 |
+
*/
|
99 |
+
public function getInstructions();
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Status updates for the batch will be sent to this email address. If no value is
|
103 |
+
* specified, the Merchant email will be used as a notification.
|
104 |
+
*
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
public function getNotificationEmail();
|
108 |
+
|
109 |
+
/**
|
110 |
+
* A URL to send status update messages to your server (this must be an https
|
111 |
+
* URL, unencrypted http URLs or any other type of URL is not supported).
|
112 |
+
* Bitpay.com will send a POST request with a JSON encoding of the batch to this
|
113 |
+
* URL when the batch status changes.
|
114 |
+
*
|
115 |
+
* @return string
|
116 |
+
*/
|
117 |
+
public function getNotificationUrl();
|
118 |
+
|
119 |
+
/**
|
120 |
+
* The method you select determines the exchange rate used to compute the
|
121 |
+
* payouts for the entire batch.
|
122 |
+
*
|
123 |
+
* @return string
|
124 |
+
*/
|
125 |
+
public function getPricingMethod();
|
126 |
+
|
127 |
+
/**
|
128 |
+
* This is your reference label for this batch. It will be passedthrough on each
|
129 |
+
* response for you to identify the batch in your system. Maximum string length is
|
130 |
+
* 100 characters.
|
131 |
+
* This passthrough variable can be a JSONencoded string, for example
|
132 |
+
* { "ref":711454, "company":"Johns Data Center" }
|
133 |
+
*
|
134 |
+
* @return string
|
135 |
+
*/
|
136 |
+
public function getReference();
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Get the status for this payout.
|
140 |
+
*
|
141 |
+
* @return $string;
|
142 |
+
*/
|
143 |
+
public function getStatus();
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Get the payroll token
|
147 |
+
*
|
148 |
+
* @return mixed
|
149 |
+
*/
|
150 |
+
public function getToken();
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Get the response token, for cancelling payout requests later.
|
154 |
+
*
|
155 |
+
* @return string
|
156 |
+
*/
|
157 |
+
public function getResponseToken();
|
158 |
+
}
|
lib/Bitpay/PayoutTransaction.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class PayoutTransaction
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
class PayoutTransaction implements PayoutTransactionInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
protected $txid;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var float
|
22 |
+
*/
|
23 |
+
protected $amount;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
protected $date;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @inheritdoc
|
32 |
+
*/
|
33 |
+
public function getTransactionId()
|
34 |
+
{
|
35 |
+
return $this->txid;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Set transaction ID for payout.
|
40 |
+
* @param $txid
|
41 |
+
* @return $this
|
42 |
+
*/
|
43 |
+
public function setTransactionId($txid)
|
44 |
+
{
|
45 |
+
if (!empty($txid)) {
|
46 |
+
$this->txid = $txid;
|
47 |
+
}
|
48 |
+
|
49 |
+
return $this;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @inheritdoc
|
54 |
+
*/
|
55 |
+
public function getAmount()
|
56 |
+
{
|
57 |
+
return $this->amount;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Set the amount of bitcoin paid in the paout.
|
62 |
+
* @param $amount
|
63 |
+
* @return $this
|
64 |
+
*/
|
65 |
+
public function setAmount($amount)
|
66 |
+
{
|
67 |
+
if (!empty($amount)) {
|
68 |
+
$this->amount = $amount;
|
69 |
+
}
|
70 |
+
|
71 |
+
return $this;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @inheritdoc
|
76 |
+
*/
|
77 |
+
public function getDate()
|
78 |
+
{
|
79 |
+
return $this->date;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Set the date and time of when the payment was sent.
|
84 |
+
* @param $date
|
85 |
+
* @return $this
|
86 |
+
*/
|
87 |
+
public function setDate($date)
|
88 |
+
{
|
89 |
+
if (!empty($date)) {
|
90 |
+
$this->date = $date;
|
91 |
+
}
|
92 |
+
|
93 |
+
return $this;
|
94 |
+
}
|
95 |
+
}
|
lib/Bitpay/PayoutTransactionInterface.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
+
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace Bitpay;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class PayoutTransaction
|
11 |
+
* @package Bitpay
|
12 |
+
*/
|
13 |
+
interface PayoutTransactionInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Get bitcoin blockchain transaction ID for the payout transaction.
|
17 |
+
* @return mixed
|
18 |
+
*/
|
19 |
+
public function getTransactionID();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The amount of bitcoin paid.
|
23 |
+
* @return float
|
24 |
+
*/
|
25 |
+
public function getAmount();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The date and time when the payment was sent.
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function getDate();
|
32 |
+
}
|
lib/Bitpay/Point.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/PointInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/PrivateKey.php
CHANGED
@@ -243,7 +243,7 @@ class PrivateKey extends Key
|
|
243 |
* Decodes PEM data to retrieve the keypair.
|
244 |
*
|
245 |
* @param string $pem_data The data to decode.
|
246 |
-
* @return array
|
247 |
*/
|
248 |
public function pemDecode($pem_data)
|
249 |
{
|
@@ -292,7 +292,7 @@ class PrivateKey extends Key
|
|
292 |
* Encodes keypair data to PEM format.
|
293 |
*
|
294 |
* @param array $keypair The keypair info.
|
295 |
-
* @return string
|
296 |
*/
|
297 |
public function pemEncode($keypair)
|
298 |
{
|
243 |
* Decodes PEM data to retrieve the keypair.
|
244 |
*
|
245 |
* @param string $pem_data The data to decode.
|
246 |
+
* @return array The keypair info.
|
247 |
*/
|
248 |
public function pemDecode($pem_data)
|
249 |
{
|
292 |
* Encodes keypair data to PEM format.
|
293 |
*
|
294 |
* @param array $keypair The keypair info.
|
295 |
+
* @return string The data to decode.
|
296 |
*/
|
297 |
public function pemEncode($keypair)
|
298 |
{
|
lib/Bitpay/PublicKey.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
|
|
9 |
use Bitpay\Util\Secp256k1;
|
10 |
use Bitpay\Util\Util;
|
11 |
-
use Bitpay\Math\Math;
|
12 |
|
13 |
/**
|
14 |
* @package Bitcore
|
@@ -125,7 +125,7 @@ class PublicKey extends Key
|
|
125 |
*/
|
126 |
public function isValid()
|
127 |
{
|
128 |
-
return ((!empty($this->hex) &&
|
129 |
}
|
130 |
|
131 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
9 |
+
use Bitpay\Math\Math;
|
10 |
use Bitpay\Util\Secp256k1;
|
11 |
use Bitpay\Util\Util;
|
|
|
12 |
|
13 |
/**
|
14 |
* @package Bitcore
|
125 |
*/
|
126 |
public function isValid()
|
127 |
{
|
128 |
+
return ((!empty($this->hex) && ctype_xdigit($this->hex)) && (!empty($this->dec) && ctype_digit($this->dec)));
|
129 |
}
|
130 |
|
131 |
/**
|
lib/Bitpay/SinKey.php
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
9 |
use Bitpay\Util\Base58;
|
|
|
10 |
use Bitpay\Util\Util;
|
11 |
|
12 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
9 |
use Bitpay\Util\Base58;
|
10 |
+
use Bitpay\Util\Gmp;
|
11 |
use Bitpay\Util\Util;
|
12 |
|
13 |
/**
|
lib/Bitpay/Storage/EncryptedFilesystemStorage.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Storage/FilesystemStorage.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Storage/MockStorage.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Storage/StorageInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Token.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/TokenInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/User.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/UserInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Util/CurveParameterInterface.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Util/Error.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -102,8 +102,10 @@ class Error
|
|
102 |
switch (strtolower($action)) {
|
103 |
case 'restore':
|
104 |
return restore_error_handler();
|
|
|
105 |
case 'set':
|
106 |
return set_error_handler($callable_handler, $error_types);
|
|
|
107 |
default:
|
108 |
return false;
|
109 |
}
|
@@ -112,8 +114,10 @@ class Error
|
|
112 |
switch (strtolower($action)) {
|
113 |
case 'restore':
|
114 |
return restore_exception_handler();
|
|
|
115 |
case 'set':
|
116 |
return set_exception_handler($callable_handler);
|
|
|
117 |
default:
|
118 |
return false;
|
119 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
102 |
switch (strtolower($action)) {
|
103 |
case 'restore':
|
104 |
return restore_error_handler();
|
105 |
+
break;
|
106 |
case 'set':
|
107 |
return set_error_handler($callable_handler, $error_types);
|
108 |
+
break;
|
109 |
default:
|
110 |
return false;
|
111 |
}
|
114 |
switch (strtolower($action)) {
|
115 |
case 'restore':
|
116 |
return restore_exception_handler();
|
117 |
+
break;
|
118 |
case 'set':
|
119 |
return set_exception_handler($callable_handler);
|
120 |
+
break;
|
121 |
default:
|
122 |
return false;
|
123 |
}
|
lib/Bitpay/Util/Fingerprint.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Util/Secp256k1.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
@@ -26,41 +26,41 @@ class Secp256k1 implements CurveParameterInterface
|
|
26 |
|
27 |
public function aHex()
|
28 |
{
|
29 |
-
return '0x'.strtolower(self::A);
|
30 |
}
|
31 |
|
32 |
public function bHex()
|
33 |
{
|
34 |
-
return '0x'.strtolower(self::B);
|
35 |
}
|
36 |
|
37 |
public function gHex()
|
38 |
{
|
39 |
-
return '0x'.strtolower(self::G);
|
40 |
}
|
41 |
|
42 |
public function gxHex()
|
43 |
{
|
44 |
-
return '0x'.substr(strtolower(self::G), 0, 64);
|
45 |
}
|
46 |
|
47 |
public function gyHex()
|
48 |
{
|
49 |
-
return '0x'.substr(strtolower(self::G), 66, 64);
|
50 |
}
|
51 |
|
52 |
public function hHex()
|
53 |
{
|
54 |
-
return '0x'.strtolower(self::H);
|
55 |
}
|
56 |
|
57 |
public function nHex()
|
58 |
{
|
59 |
-
return '0x'.strtolower(self::N);
|
60 |
}
|
61 |
|
62 |
public function pHex()
|
63 |
{
|
64 |
-
return '0x'.strtolower(self::P);
|
65 |
}
|
66 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
26 |
|
27 |
public function aHex()
|
28 |
{
|
29 |
+
return '0x' . strtolower(self::A);
|
30 |
}
|
31 |
|
32 |
public function bHex()
|
33 |
{
|
34 |
+
return '0x' . strtolower(self::B);
|
35 |
}
|
36 |
|
37 |
public function gHex()
|
38 |
{
|
39 |
+
return '0x' . strtolower(self::G);
|
40 |
}
|
41 |
|
42 |
public function gxHex()
|
43 |
{
|
44 |
+
return '0x' . substr(strtolower(self::G), 0, 64);
|
45 |
}
|
46 |
|
47 |
public function gyHex()
|
48 |
{
|
49 |
+
return '0x' . substr(strtolower(self::G), 66, 64);
|
50 |
}
|
51 |
|
52 |
public function hHex()
|
53 |
{
|
54 |
+
return '0x' . strtolower(self::H);
|
55 |
}
|
56 |
|
57 |
public function nHex()
|
58 |
{
|
59 |
+
return '0x' . strtolower(self::N);
|
60 |
}
|
61 |
|
62 |
public function pHex()
|
63 |
{
|
64 |
+
return '0x' . strtolower(self::P);
|
65 |
}
|
66 |
}
|
lib/Bitpay/Util/SecureRandom.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* see https://github.com/bitpay/php-bitpay-client/blob/master/LICENSE
|
5 |
*/
|
6 |
|
lib/Bitpay/Util/Util.php
CHANGED
@@ -99,9 +99,6 @@ class Util
|
|
99 |
*/
|
100 |
public static function twoSha256($data, $binary = false)
|
101 |
{
|
102 |
-
//$pass1 = self::sha256(hex2bin($data), true);
|
103 |
-
//$pass2 = strrev(bin2hex(self::sha256($pass1, true)));
|
104 |
-
|
105 |
return self::sha256(self::sha256($data, $binary), $binary);
|
106 |
}
|
107 |
|
@@ -195,8 +192,11 @@ class Util
|
|
195 |
}
|
196 |
|
197 |
$tmp = self::decToBin($hex);
|
|
|
198 |
$n = strlen($tmp) - 1;
|
|
|
199 |
$S = new Point(PointInterface::INFINITY, PointInterface::INFINITY);
|
|
|
200 |
|
201 |
while ($n >= 0) {
|
202 |
$S = self::pointDouble($S);
|
@@ -285,7 +285,9 @@ class Util
|
|
285 |
$ymul = Math::mul($s, $ysub);
|
286 |
$ysub2 = Math::sub(0, $point->getY());
|
287 |
$yadd = Math::add($ysub2, $ymul);
|
|
|
288 |
$R['y'] = Math::mod($yadd, $p);
|
|
|
289 |
} catch (\Exception $e) {
|
290 |
throw new \Exception('Error in Util::pointDouble(): '.$e->getMessage());
|
291 |
}
|
@@ -401,35 +403,4 @@ class Util
|
|
401 |
|
402 |
return strrev($byte);
|
403 |
}
|
404 |
-
|
405 |
-
/**
|
406 |
-
* y^2 (mod p) = x^3 + ax + b (mod p)
|
407 |
-
*
|
408 |
-
* @param PointInterface $point
|
409 |
-
* @param CurveParameterInterface $parameters
|
410 |
-
*/
|
411 |
-
public static function pointTest(PointInterface $point, CurveParameterInterface $parameters = null)
|
412 |
-
{
|
413 |
-
if (null === $parameters) {
|
414 |
-
$parameters = new Secp256k1();
|
415 |
-
}
|
416 |
-
|
417 |
-
// y^2
|
418 |
-
$y2 = Math::pow($point->getY(), 2);
|
419 |
-
// x^3
|
420 |
-
$x3 = Math::pow($point->getX(), 3);
|
421 |
-
// ax
|
422 |
-
$ax = Math::mul($parameters->aHex(), $point->getX());
|
423 |
-
|
424 |
-
$left = Math::mod($y2, $parameters->pHex());
|
425 |
-
$right = Math::mod(
|
426 |
-
Math::add(
|
427 |
-
Math::add($x3, $ax),
|
428 |
-
$parameters->bHex()
|
429 |
-
),
|
430 |
-
$parameters->pHex()
|
431 |
-
);
|
432 |
-
|
433 |
-
return ($left == $right);
|
434 |
-
}
|
435 |
}
|
99 |
*/
|
100 |
public static function twoSha256($data, $binary = false)
|
101 |
{
|
|
|
|
|
|
|
102 |
return self::sha256(self::sha256($data, $binary), $binary);
|
103 |
}
|
104 |
|
192 |
}
|
193 |
|
194 |
$tmp = self::decToBin($hex);
|
195 |
+
|
196 |
$n = strlen($tmp) - 1;
|
197 |
+
$old = 11;
|
198 |
$S = new Point(PointInterface::INFINITY, PointInterface::INFINITY);
|
199 |
+
$gmpS = new Point(PointInterface::INFINITY, PointInterface::INFINITY);
|
200 |
|
201 |
while ($n >= 0) {
|
202 |
$S = self::pointDouble($S);
|
285 |
$ymul = Math::mul($s, $ysub);
|
286 |
$ysub2 = Math::sub(0, $point->getY());
|
287 |
$yadd = Math::add($ysub2, $ymul);
|
288 |
+
|
289 |
$R['y'] = Math::mod($yadd, $p);
|
290 |
+
|
291 |
} catch (\Exception $e) {
|
292 |
throw new \Exception('Error in Util::pointDouble(): '.$e->getMessage());
|
293 |
}
|
403 |
|
404 |
return strrev($byte);
|
405 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
}
|
lib/Symfony/Component/Config/ConfigCache.php
CHANGED
@@ -31,8 +31,8 @@ class ConfigCache
|
|
31 |
/**
|
32 |
* Constructor.
|
33 |
*
|
34 |
-
* @param string
|
35 |
-
* @param bool
|
36 |
*/
|
37 |
public function __construct($file, $debug)
|
38 |
{
|
@@ -56,7 +56,7 @@ class ConfigCache
|
|
56 |
* This method always returns true when debug is off and the
|
57 |
* cache file exists.
|
58 |
*
|
59 |
-
* @return bool
|
60 |
*/
|
61 |
public function isFresh()
|
62 |
{
|
31 |
/**
|
32 |
* Constructor.
|
33 |
*
|
34 |
+
* @param string $file The absolute cache path
|
35 |
+
* @param bool $debug Whether debugging is enabled or not
|
36 |
*/
|
37 |
public function __construct($file, $debug)
|
38 |
{
|
56 |
* This method always returns true when debug is off and the
|
57 |
* cache file exists.
|
58 |
*
|
59 |
+
* @return bool true if the cache is fresh, false otherwise
|
60 |
*/
|
61 |
public function isFresh()
|
62 |
{
|
lib/Symfony/Component/Config/Definition/ArrayNode.php
CHANGED
@@ -99,7 +99,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
99 |
* Sets whether to add default values for this array if it has not been
|
100 |
* defined in any of the configuration files.
|
101 |
*
|
102 |
-
* @param bool
|
103 |
*/
|
104 |
public function setAddIfNotSet($boolean)
|
105 |
{
|
@@ -109,7 +109,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
109 |
/**
|
110 |
* Sets whether false is allowed as value indicating that the array should be unset.
|
111 |
*
|
112 |
-
* @param bool
|
113 |
*/
|
114 |
public function setAllowFalse($allow)
|
115 |
{
|
@@ -119,7 +119,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
119 |
/**
|
120 |
* Sets whether new keys can be defined in subsequent configurations.
|
121 |
*
|
122 |
-
* @param bool
|
123 |
*/
|
124 |
public function setAllowNewKeys($allow)
|
125 |
{
|
@@ -129,7 +129,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
129 |
/**
|
130 |
* Sets if deep merging should occur.
|
131 |
*
|
132 |
-
* @param bool
|
133 |
*/
|
134 |
public function setPerformDeepMerging($boolean)
|
135 |
{
|
@@ -139,7 +139,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
139 |
/**
|
140 |
* Whether extra keys should just be ignore without an exception.
|
141 |
*
|
142 |
-
* @param bool
|
143 |
*/
|
144 |
public function setIgnoreExtraKeys($boolean)
|
145 |
{
|
99 |
* Sets whether to add default values for this array if it has not been
|
100 |
* defined in any of the configuration files.
|
101 |
*
|
102 |
+
* @param bool $boolean
|
103 |
*/
|
104 |
public function setAddIfNotSet($boolean)
|
105 |
{
|
109 |
/**
|
110 |
* Sets whether false is allowed as value indicating that the array should be unset.
|
111 |
*
|
112 |
+
* @param bool $allow
|
113 |
*/
|
114 |
public function setAllowFalse($allow)
|
115 |
{
|
119 |
/**
|
120 |
* Sets whether new keys can be defined in subsequent configurations.
|
121 |
*
|
122 |
+
* @param bool $allow
|
123 |
*/
|
124 |
public function setAllowNewKeys($allow)
|
125 |
{
|
129 |
/**
|
130 |
* Sets if deep merging should occur.
|
131 |
*
|
132 |
+
* @param bool $boolean
|
133 |
*/
|
134 |
public function setPerformDeepMerging($boolean)
|
135 |
{
|
139 |
/**
|
140 |
* Whether extra keys should just be ignore without an exception.
|
141 |
*
|
142 |
+
* @param bool $boolean To allow extra keys
|
143 |
*/
|
144 |
public function setIgnoreExtraKeys($boolean)
|
145 |
{
|
lib/Symfony/Component/Config/Definition/BaseNode.php
CHANGED
@@ -133,7 +133,7 @@ abstract class BaseNode implements NodeInterface
|
|
133 |
/**
|
134 |
* Set this node as required.
|
135 |
*
|
136 |
-
* @param bool
|
137 |
*/
|
138 |
public function setRequired($boolean)
|
139 |
{
|
@@ -143,7 +143,7 @@ abstract class BaseNode implements NodeInterface
|
|
143 |
/**
|
144 |
* Sets if this node can be overridden.
|
145 |
*
|
146 |
-
* @param bool
|
147 |
*/
|
148 |
public function setAllowOverwrite($allow)
|
149 |
{
|
133 |
/**
|
134 |
* Set this node as required.
|
135 |
*
|
136 |
+
* @param bool $boolean Required node
|
137 |
*/
|
138 |
public function setRequired($boolean)
|
139 |
{
|
143 |
/**
|
144 |
* Sets if this node can be overridden.
|
145 |
*
|
146 |
+
* @param bool $allow
|
147 |
*/
|
148 |
public function setAllowOverwrite($allow)
|
149 |
{
|
lib/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
CHANGED
@@ -97,7 +97,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|
97 |
/**
|
98 |
* Adds children with a default value when none are defined.
|
99 |
*
|
100 |
-
* @param int|string|array|null
|
101 |
*
|
102 |
* This method is applicable to prototype nodes only.
|
103 |
*
|
@@ -176,8 +176,8 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|
176 |
*
|
177 |
* This method is applicable to prototype nodes only.
|
178 |
*
|
179 |
-
* @param string
|
180 |
-
* @param bool
|
181 |
*
|
182 |
* @return ArrayNodeDefinition
|
183 |
*/
|
@@ -192,7 +192,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|
192 |
/**
|
193 |
* Sets whether the node can be unset.
|
194 |
*
|
195 |
-
* @param bool
|
196 |
*
|
197 |
* @return ArrayNodeDefinition
|
198 |
*/
|
@@ -295,7 +295,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|
295 |
/**
|
296 |
* Sets key normalization.
|
297 |
*
|
298 |
-
* @param bool
|
299 |
*
|
300 |
* @return ArrayNodeDefinition
|
301 |
*/
|
97 |
/**
|
98 |
* Adds children with a default value when none are defined.
|
99 |
*
|
100 |
+
* @param int|string|array|null $children The number of children|The child name|The children names to be added
|
101 |
*
|
102 |
* This method is applicable to prototype nodes only.
|
103 |
*
|
176 |
*
|
177 |
* This method is applicable to prototype nodes only.
|
178 |
*
|
179 |
+
* @param string $name The name of the key
|
180 |
+
* @param bool $removeKeyItem Whether or not the key item should be removed.
|
181 |
*
|
182 |
* @return ArrayNodeDefinition
|
183 |
*/
|
192 |
/**
|
193 |
* Sets whether the node can be unset.
|
194 |
*
|
195 |
+
* @param bool $allow
|
196 |
*
|
197 |
* @return ArrayNodeDefinition
|
198 |
*/
|
295 |
/**
|
296 |
* Sets key normalization.
|
297 |
*
|
298 |
+
* @param bool $bool Whether to enable key normalization
|
299 |
*
|
300 |
* @return ArrayNodeDefinition
|
301 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/MergeBuilder.php
CHANGED
@@ -35,7 +35,7 @@ class MergeBuilder
|
|
35 |
/**
|
36 |
* Sets whether the node can be unset.
|
37 |
*
|
38 |
-
* @param bool
|
39 |
*
|
40 |
* @return MergeBuilder
|
41 |
*/
|
@@ -49,7 +49,7 @@ class MergeBuilder
|
|
49 |
/**
|
50 |
* Sets whether the node can be overwritten.
|
51 |
*
|
52 |
-
* @param bool
|
53 |
*
|
54 |
* @return MergeBuilder
|
55 |
*/
|
35 |
/**
|
36 |
* Sets whether the node can be unset.
|
37 |
*
|
38 |
+
* @param bool $allow
|
39 |
*
|
40 |
* @return MergeBuilder
|
41 |
*/
|
49 |
/**
|
50 |
* Sets whether the node can be overwritten.
|
51 |
*
|
52 |
+
* @param bool $deny Whether the overwriting is forbidden or not
|
53 |
*
|
54 |
* @return MergeBuilder
|
55 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
CHANGED
@@ -93,7 +93,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|
93 |
* Sets an attribute on the node.
|
94 |
*
|
95 |
* @param string $key
|
96 |
-
* @param mixed
|
97 |
*
|
98 |
* @return NodeDefinition
|
99 |
*/
|
@@ -117,7 +117,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|
117 |
/**
|
118 |
* Creates the node.
|
119 |
*
|
120 |
-
* @param bool
|
121 |
*
|
122 |
* @return NodeInterface
|
123 |
*/
|
@@ -279,7 +279,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|
279 |
/**
|
280 |
* Sets whether the node can be overwritten.
|
281 |
*
|
282 |
-
* @param bool
|
283 |
*
|
284 |
* @return NodeDefinition
|
285 |
*/
|
93 |
* Sets an attribute on the node.
|
94 |
*
|
95 |
* @param string $key
|
96 |
+
* @param mixed $value
|
97 |
*
|
98 |
* @return NodeDefinition
|
99 |
*/
|
117 |
/**
|
118 |
* Creates the node.
|
119 |
*
|
120 |
+
* @param bool $forceRootNode Whether to force this node as the root node
|
121 |
*
|
122 |
* @return NodeInterface
|
123 |
*/
|
279 |
/**
|
280 |
* Sets whether the node can be overwritten.
|
281 |
*
|
282 |
+
* @param bool $deny Whether the overwriting is forbidden or not
|
283 |
*
|
284 |
* @return NodeDefinition
|
285 |
*/
|
lib/Symfony/Component/Config/Definition/NodeInterface.php
CHANGED
@@ -38,21 +38,21 @@ interface NodeInterface
|
|
38 |
/**
|
39 |
* Returns true when the node is required.
|
40 |
*
|
41 |
-
* @return bool
|
42 |
*/
|
43 |
public function isRequired();
|
44 |
|
45 |
/**
|
46 |
* Returns true when the node has a default value.
|
47 |
*
|
48 |
-
* @return bool
|
49 |
*/
|
50 |
public function hasDefaultValue();
|
51 |
|
52 |
/**
|
53 |
* Returns the default value of the node.
|
54 |
*
|
55 |
-
* @return mixed
|
56 |
* @throws \RuntimeException if the node has no default value
|
57 |
*/
|
58 |
public function getDefaultValue();
|
38 |
/**
|
39 |
* Returns true when the node is required.
|
40 |
*
|
41 |
+
* @return bool If the node is required
|
42 |
*/
|
43 |
public function isRequired();
|
44 |
|
45 |
/**
|
46 |
* Returns true when the node has a default value.
|
47 |
*
|
48 |
+
* @return bool If the node has a default value
|
49 |
*/
|
50 |
public function hasDefaultValue();
|
51 |
|
52 |
/**
|
53 |
* Returns the default value of the node.
|
54 |
*
|
55 |
+
* @return mixed The default value
|
56 |
* @throws \RuntimeException if the node has no default value
|
57 |
*/
|
58 |
public function getDefaultValue();
|
lib/Symfony/Component/Config/Definition/PrototypedArrayNode.php
CHANGED
@@ -34,7 +34,7 @@ class PrototypedArrayNode extends ArrayNode
|
|
34 |
* Sets the minimum number of elements that a prototype based node must
|
35 |
* contain. By default this is zero, meaning no elements.
|
36 |
*
|
37 |
-
* @param int
|
38 |
*/
|
39 |
public function setMinNumberOfElements($number)
|
40 |
{
|
@@ -62,8 +62,8 @@ class PrototypedArrayNode extends ArrayNode
|
|
62 |
* If you'd like "'id' => 'my_name'" to still be present in the resulting
|
63 |
* array, then you can set the second argument of this method to false.
|
64 |
*
|
65 |
-
* @param string
|
66 |
-
* @param bool
|
67 |
*/
|
68 |
public function setKeyAttribute($attribute, $remove = true)
|
69 |
{
|
@@ -110,7 +110,7 @@ class PrototypedArrayNode extends ArrayNode
|
|
110 |
/**
|
111 |
* Adds default children when none are set.
|
112 |
*
|
113 |
-
* @param int|string|array|null
|
114 |
*/
|
115 |
public function setAddChildrenIfNoneSet($children = array('defaults'))
|
116 |
{
|
34 |
* Sets the minimum number of elements that a prototype based node must
|
35 |
* contain. By default this is zero, meaning no elements.
|
36 |
*
|
37 |
+
* @param int $number
|
38 |
*/
|
39 |
public function setMinNumberOfElements($number)
|
40 |
{
|
62 |
* If you'd like "'id' => 'my_name'" to still be present in the resulting
|
63 |
* array, then you can set the second argument of this method to false.
|
64 |
*
|
65 |
+
* @param string $attribute The name of the attribute which value is to be used as a key
|
66 |
+
* @param bool $remove Whether or not to remove the key
|
67 |
*/
|
68 |
public function setKeyAttribute($attribute, $remove = true)
|
69 |
{
|
110 |
/**
|
111 |
* Adds default children when none are set.
|
112 |
*
|
113 |
+
* @param int|string|array|null $children The number of children|The child name|The children names to be added
|
114 |
*/
|
115 |
public function setAddChildrenIfNoneSet($children = array('defaults'))
|
116 |
{
|
lib/Symfony/Component/Config/Definition/VariableNode.php
CHANGED
@@ -55,7 +55,7 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface
|
|
55 |
/**
|
56 |
* Sets if this node is allowed to have an empty value.
|
57 |
*
|
58 |
-
* @param bool
|
59 |
*/
|
60 |
public function setAllowEmptyValue($boolean)
|
61 |
{
|
55 |
/**
|
56 |
* Sets if this node is allowed to have an empty value.
|
57 |
*
|
58 |
+
* @param bool $boolean True if this entity will accept empty values.
|
59 |
*/
|
60 |
public function setAllowEmptyValue($boolean)
|
61 |
{
|
lib/Symfony/Component/Config/Loader/FileLoader.php
CHANGED
@@ -91,7 +91,7 @@ abstract class FileLoader extends Loader
|
|
91 |
}
|
92 |
|
93 |
$resources = is_array($resource) ? $resource : array($resource);
|
94 |
-
for ($i = 0; $i < $resourcesCount = count($resources); $i++
|
95 |
if (isset(self::$loading[$resources[$i]])) {
|
96 |
if ($i == $resourcesCount-1) {
|
97 |
throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));
|
91 |
}
|
92 |
|
93 |
$resources = is_array($resource) ? $resource : array($resource);
|
94 |
+
for ($i = 0; $i < $resourcesCount = count($resources); $i++) {
|
95 |
if (isset(self::$loading[$resources[$i]])) {
|
96 |
if ($i == $resourcesCount-1) {
|
97 |
throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));
|
lib/Symfony/Component/DependencyInjection/Alias.php
CHANGED
@@ -22,8 +22,8 @@ class Alias
|
|
22 |
/**
|
23 |
* Constructor.
|
24 |
*
|
25 |
-
* @param string
|
26 |
-
* @param bool
|
27 |
*
|
28 |
* @api
|
29 |
*/
|
@@ -48,7 +48,7 @@ class Alias
|
|
48 |
/**
|
49 |
* Sets if this Alias is public.
|
50 |
*
|
51 |
-
* @param bool
|
52 |
*
|
53 |
* @api
|
54 |
*/
|
22 |
/**
|
23 |
* Constructor.
|
24 |
*
|
25 |
+
* @param string $id Alias identifier
|
26 |
+
* @param bool $public If this alias is public
|
27 |
*
|
28 |
* @api
|
29 |
*/
|
48 |
/**
|
49 |
* Sets if this Alias is public.
|
50 |
*
|
51 |
+
* @param bool $boolean If this Alias should be public
|
52 |
*
|
53 |
* @api
|
54 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php
CHANGED
@@ -36,7 +36,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
|
|
36 |
/**
|
37 |
* Constructor.
|
38 |
*
|
39 |
-
* @param bool
|
40 |
*/
|
41 |
public function __construct($onlyConstructorArguments = false)
|
42 |
{
|
36 |
/**
|
37 |
* Constructor.
|
38 |
*
|
39 |
+
* @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls
|
40 |
*/
|
41 |
public function __construct($onlyConstructorArguments = false)
|
42 |
{
|
lib/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
CHANGED
@@ -114,7 +114,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
|
|
114 |
* @param string $id
|
115 |
* @param Definition $definition
|
116 |
*
|
117 |
-
* @return bool
|
118 |
*/
|
119 |
private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition)
|
120 |
{
|
114 |
* @param string $id
|
115 |
* @param Definition $definition
|
116 |
*
|
117 |
+
* @return bool If the definition is inlineable
|
118 |
*/
|
119 |
private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition)
|
120 |
{
|
lib/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php
CHANGED
@@ -69,8 +69,8 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
|
|
69 |
/**
|
70 |
* Processes arguments to determine invalid references.
|
71 |
*
|
72 |
-
* @param array
|
73 |
-
* @param bool
|
74 |
*
|
75 |
* @return array
|
76 |
*
|
69 |
/**
|
70 |
* Processes arguments to determine invalid references.
|
71 |
*
|
72 |
+
* @param array $arguments An array of Reference objects
|
73 |
+
* @param bool $inMethodCall
|
74 |
*
|
75 |
* @return array
|
76 |
*
|
lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php
CHANGED
@@ -63,7 +63,7 @@ class ServiceReferenceGraphNode
|
|
63 |
/**
|
64 |
* Checks if the value of this node is an Alias.
|
65 |
*
|
66 |
-
* @return bool
|
67 |
*/
|
68 |
public function isAlias()
|
69 |
{
|
@@ -73,7 +73,7 @@ class ServiceReferenceGraphNode
|
|
73 |
/**
|
74 |
* Checks if the value of this node is a Definition.
|
75 |
*
|
76 |
-
* @return bool
|
77 |
*/
|
78 |
public function isDefinition()
|
79 |
{
|
63 |
/**
|
64 |
* Checks if the value of this node is an Alias.
|
65 |
*
|
66 |
+
* @return bool True if the value is an Alias instance
|
67 |
*/
|
68 |
public function isAlias()
|
69 |
{
|
73 |
/**
|
74 |
* Checks if the value of this node is a Definition.
|
75 |
*
|
76 |
+
* @return bool True if the value is a Definition instance
|
77 |
*/
|
78 |
public function isDefinition()
|
79 |
{
|
lib/Symfony/Component/DependencyInjection/Container.php
CHANGED
@@ -110,7 +110,7 @@ class Container implements IntrospectableContainerInterface
|
|
110 |
/**
|
111 |
* Returns true if the container parameter bag are frozen.
|
112 |
*
|
113 |
-
* @return bool
|
114 |
*
|
115 |
* @api
|
116 |
*/
|
@@ -136,7 +136,7 @@ class Container implements IntrospectableContainerInterface
|
|
136 |
*
|
137 |
* @param string $name The parameter name
|
138 |
*
|
139 |
-
* @return mixed
|
140 |
*
|
141 |
* @throws InvalidArgumentException if the parameter is not defined
|
142 |
*
|
@@ -152,7 +152,7 @@ class Container implements IntrospectableContainerInterface
|
|
152 |
*
|
153 |
* @param string $name The parameter name
|
154 |
*
|
155 |
-
* @return bool
|
156 |
*
|
157 |
* @api
|
158 |
*/
|
@@ -184,7 +184,7 @@ class Container implements IntrospectableContainerInterface
|
|
184 |
* @param object $service The service instance
|
185 |
* @param string $scope The scope of the service
|
186 |
*
|
187 |
-
* @throws RuntimeException
|
188 |
* @throws InvalidArgumentException When trying to set a service in the prototype scope
|
189 |
*
|
190 |
* @api
|
@@ -231,7 +231,7 @@ class Container implements IntrospectableContainerInterface
|
|
231 |
*
|
232 |
* @param string $id The service identifier
|
233 |
*
|
234 |
-
* @return bool
|
235 |
*
|
236 |
* @api
|
237 |
*/
|
@@ -256,8 +256,8 @@ class Container implements IntrospectableContainerInterface
|
|
256 |
* If a service is defined both through a set() method and
|
257 |
* with a get{$id}Service() method, the former has always precedence.
|
258 |
*
|
259 |
-
* @param string
|
260 |
-
* @param int
|
261 |
*
|
262 |
* @return object The associated service
|
263 |
*
|
@@ -348,7 +348,7 @@ class Container implements IntrospectableContainerInterface
|
|
348 |
*
|
349 |
* @param string $id The service identifier
|
350 |
*
|
351 |
-
* @return bool
|
352 |
*/
|
353 |
public function initialized($id)
|
354 |
{
|
@@ -360,6 +360,10 @@ class Container implements IntrospectableContainerInterface
|
|
360 |
return true;
|
361 |
}
|
362 |
|
|
|
|
|
|
|
|
|
363 |
return isset($this->services[$id]) || array_key_exists($id, $this->services);
|
364 |
}
|
365 |
|
110 |
/**
|
111 |
* Returns true if the container parameter bag are frozen.
|
112 |
*
|
113 |
+
* @return bool true if the container parameter bag are frozen, false otherwise
|
114 |
*
|
115 |
* @api
|
116 |
*/
|
136 |
*
|
137 |
* @param string $name The parameter name
|
138 |
*
|
139 |
+
* @return mixed The parameter value
|
140 |
*
|
141 |
* @throws InvalidArgumentException if the parameter is not defined
|
142 |
*
|
152 |
*
|
153 |
* @param string $name The parameter name
|
154 |
*
|
155 |
+
* @return bool The presence of parameter in container
|
156 |
*
|
157 |
* @api
|
158 |
*/
|
184 |
* @param object $service The service instance
|
185 |
* @param string $scope The scope of the service
|
186 |
*
|
187 |
+
* @throws RuntimeException When trying to set a service in an inactive scope
|
188 |
* @throws InvalidArgumentException When trying to set a service in the prototype scope
|
189 |
*
|
190 |
* @api
|
231 |
*
|
232 |
* @param string $id The service identifier
|
233 |
*
|
234 |
+
* @return bool true if the service is defined, false otherwise
|
235 |
*
|
236 |
* @api
|
237 |
*/
|
256 |
* If a service is defined both through a set() method and
|
257 |
* with a get{$id}Service() method, the former has always precedence.
|
258 |
*
|
259 |
+
* @param string $id The service identifier
|
260 |
+
* @param int $invalidBehavior The behavior when the service does not exist
|
261 |
*
|
262 |
* @return object The associated service
|
263 |
*
|
348 |
*
|
349 |
* @param string $id The service identifier
|
350 |
*
|
351 |
+
* @return bool true if service has already been initialized, false otherwise
|
352 |
*/
|
353 |
public function initialized($id)
|
354 |
{
|
360 |
return true;
|
361 |
}
|
362 |
|
363 |
+
if (isset($this->aliases[$id])) {
|
364 |
+
$id = $this->aliases[$id];
|
365 |
+
}
|
366 |
+
|
367 |
return isset($this->services[$id]) || array_key_exists($id, $this->services);
|
368 |
}
|
369 |
|
lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
CHANGED
@@ -90,7 +90,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
90 |
* If you are not using the loaders and therefore don't want
|
91 |
* to depend on the Config component, set this flag to false.
|
92 |
*
|
93 |
-
* @param bool
|
94 |
*/
|
95 |
public function setResourceTracking($track)
|
96 |
{
|
@@ -100,7 +100,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
100 |
/**
|
101 |
* Checks if resources are tracked.
|
102 |
*
|
103 |
-
* @return bool
|
104 |
*/
|
105 |
public function isTrackingResources()
|
106 |
{
|
@@ -174,7 +174,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
174 |
*
|
175 |
* @param string $name The name of the extension
|
176 |
*
|
177 |
-
* @return bool
|
178 |
*
|
179 |
* @api
|
180 |
*/
|
@@ -279,7 +279,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
279 |
* @param string $extension The extension alias or namespace
|
280 |
* @param array $values An array of values that customizes the extension
|
281 |
*
|
282 |
-
* @return ContainerBuilder
|
283 |
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
284 |
*
|
285 |
* @throws \LogicException if the container is frozen
|
@@ -428,7 +428,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
428 |
*
|
429 |
* @param string $id The service identifier
|
430 |
*
|
431 |
-
* @return bool
|
432 |
*
|
433 |
* @api
|
434 |
*/
|
@@ -442,8 +442,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
442 |
/**
|
443 |
* Gets a service.
|
444 |
*
|
445 |
-
* @param string
|
446 |
-
* @param int
|
447 |
*
|
448 |
* @return object The associated service
|
449 |
*
|
@@ -572,8 +572,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
572 |
/**
|
573 |
* Prepends a config array to the configs of the given extension.
|
574 |
*
|
575 |
-
* @param string $name
|
576 |
-
* @param array $config
|
577 |
*/
|
578 |
public function prependExtensionConfig($name, array $config)
|
579 |
{
|
@@ -665,8 +665,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
665 |
/**
|
666 |
* Sets an alias for an existing service.
|
667 |
*
|
668 |
-
* @param string
|
669 |
-
* @param string|Alias
|
670 |
*
|
671 |
* @throws InvalidArgumentException if the id is not a string or an Alias
|
672 |
* @throws InvalidArgumentException if the alias is for itself
|
@@ -709,7 +709,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
709 |
*
|
710 |
* @param string $id The service identifier
|
711 |
*
|
712 |
-
* @return bool
|
713 |
*
|
714 |
* @api
|
715 |
*/
|
@@ -839,7 +839,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
839 |
*
|
840 |
* @param string $id The service identifier
|
841 |
*
|
842 |
-
* @return bool
|
843 |
*
|
844 |
* @api
|
845 |
*/
|
@@ -901,9 +901,9 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
901 |
*
|
902 |
* @return object The service described by the service definition
|
903 |
*
|
904 |
-
* @throws RuntimeException
|
905 |
-
* @throws RuntimeException
|
906 |
-
* @throws RuntimeException
|
907 |
* @throws InvalidArgumentException When configure callable is not callable
|
908 |
*
|
909 |
* @internal this method is public because of PHP 5.3 limitations, do not use it explicitly in your code
|
90 |
* If you are not using the loaders and therefore don't want
|
91 |
* to depend on the Config component, set this flag to false.
|
92 |
*
|
93 |
+
* @param bool $track true if you want to track resources, false otherwise
|
94 |
*/
|
95 |
public function setResourceTracking($track)
|
96 |
{
|
100 |
/**
|
101 |
* Checks if resources are tracked.
|
102 |
*
|
103 |
+
* @return bool true if resources are tracked, false otherwise
|
104 |
*/
|
105 |
public function isTrackingResources()
|
106 |
{
|
174 |
*
|
175 |
* @param string $name The name of the extension
|
176 |
*
|
177 |
+
* @return bool If the extension exists
|
178 |
*
|
179 |
* @api
|
180 |
*/
|
279 |
* @param string $extension The extension alias or namespace
|
280 |
* @param array $values An array of values that customizes the extension
|
281 |
*
|
282 |
+
* @return ContainerBuilder The current instance
|
283 |
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
284 |
*
|
285 |
* @throws \LogicException if the container is frozen
|
428 |
*
|
429 |
* @param string $id The service identifier
|
430 |
*
|
431 |
+
* @return bool true if the service is defined, false otherwise
|
432 |
*
|
433 |
* @api
|
434 |
*/
|
442 |
/**
|
443 |
* Gets a service.
|
444 |
*
|
445 |
+
* @param string $id The service identifier
|
446 |
+
* @param int $invalidBehavior The behavior when the service does not exist
|
447 |
*
|
448 |
* @return object The associated service
|
449 |
*
|
572 |
/**
|
573 |
* Prepends a config array to the configs of the given extension.
|
574 |
*
|
575 |
+
* @param string $name The name of the extension
|
576 |
+
* @param array $config The config to set
|
577 |
*/
|
578 |
public function prependExtensionConfig($name, array $config)
|
579 |
{
|
665 |
/**
|
666 |
* Sets an alias for an existing service.
|
667 |
*
|
668 |
+
* @param string $alias The alias to create
|
669 |
+
* @param string|Alias $id The service to alias
|
670 |
*
|
671 |
* @throws InvalidArgumentException if the id is not a string or an Alias
|
672 |
* @throws InvalidArgumentException if the alias is for itself
|
709 |
*
|
710 |
* @param string $id The service identifier
|
711 |
*
|
712 |
+
* @return bool true if the alias exists, false otherwise
|
713 |
*
|
714 |
* @api
|
715 |
*/
|
839 |
*
|
840 |
* @param string $id The service identifier
|
841 |
*
|
842 |
+
* @return bool true if the service definition exists, false otherwise
|
843 |
*
|
844 |
* @api
|
845 |
*/
|
901 |
*
|
902 |
* @return object The service described by the service definition
|
903 |
*
|
904 |
+
* @throws RuntimeException When the scope is inactive
|
905 |
+
* @throws RuntimeException When the factory definition is incomplete
|
906 |
+
* @throws RuntimeException When the service is a synthetic service
|
907 |
* @throws InvalidArgumentException When configure callable is not callable
|
908 |
*
|
909 |
* @internal this method is public because of PHP 5.3 limitations, do not use it explicitly in your code
|
lib/Symfony/Component/DependencyInjection/ContainerInterface.php
CHANGED
@@ -50,9 +50,9 @@ interface ContainerInterface
|
|
50 |
*
|
51 |
* @return object The associated service
|
52 |
*
|
53 |
-
* @throws InvalidArgumentException
|
54 |
* @throws ServiceCircularReferenceException When a circular reference is detected
|
55 |
-
* @throws ServiceNotFoundException
|
56 |
*
|
57 |
* @see Reference
|
58 |
*
|
@@ -65,7 +65,7 @@ interface ContainerInterface
|
|
65 |
*
|
66 |
* @param string $id The service identifier
|
67 |
*
|
68 |
-
* @return bool
|
69 |
*
|
70 |
* @api
|
71 |
*/
|
@@ -76,7 +76,7 @@ interface ContainerInterface
|
|
76 |
*
|
77 |
* @param string $name The parameter name
|
78 |
*
|
79 |
-
* @return mixed
|
80 |
*
|
81 |
* @throws InvalidArgumentException if the parameter is not defined
|
82 |
*
|
@@ -89,7 +89,7 @@ interface ContainerInterface
|
|
89 |
*
|
90 |
* @param string $name The parameter name
|
91 |
*
|
92 |
-
* @return bool
|
93 |
*
|
94 |
* @api
|
95 |
*/
|
50 |
*
|
51 |
* @return object The associated service
|
52 |
*
|
53 |
+
* @throws InvalidArgumentException if the service is not defined
|
54 |
* @throws ServiceCircularReferenceException When a circular reference is detected
|
55 |
+
* @throws ServiceNotFoundException When the service is not defined
|
56 |
*
|
57 |
* @see Reference
|
58 |
*
|
65 |
*
|
66 |
* @param string $id The service identifier
|
67 |
*
|
68 |
+
* @return bool true if the service is defined, false otherwise
|
69 |
*
|
70 |
* @api
|
71 |
*/
|
76 |
*
|
77 |
* @param string $name The parameter name
|
78 |
*
|
79 |
+
* @return mixed The parameter value
|
80 |
*
|
81 |
* @throws InvalidArgumentException if the parameter is not defined
|
82 |
*
|
89 |
*
|
90 |
* @param string $name The parameter name
|
91 |
*
|
92 |
+
* @return bool The presence of parameter in container
|
93 |
*
|
94 |
* @api
|
95 |
*/
|
lib/Symfony/Component/DependencyInjection/Definition.php
CHANGED
@@ -267,8 +267,8 @@ class Definition
|
|
267 |
/**
|
268 |
* Sets a specific argument
|
269 |
*
|
270 |
-
* @param int
|
271 |
-
* @param mixed
|
272 |
*
|
273 |
* @return Definition The current instance
|
274 |
*
|
@@ -302,7 +302,7 @@ class Definition
|
|
302 |
/**
|
303 |
* Gets an argument to pass to the service constructor/factory method.
|
304 |
*
|
305 |
-
* @param int
|
306 |
*
|
307 |
* @return mixed The argument value
|
308 |
*
|
@@ -575,7 +575,7 @@ class Definition
|
|
575 |
/**
|
576 |
* Sets the visibility of this service.
|
577 |
*
|
578 |
-
* @param bool
|
579 |
*
|
580 |
* @return Definition The current instance
|
581 |
*
|
@@ -603,7 +603,7 @@ class Definition
|
|
603 |
/**
|
604 |
* Sets the synchronized flag of this service.
|
605 |
*
|
606 |
-
* @param bool
|
607 |
*
|
608 |
* @return Definition The current instance
|
609 |
*
|
@@ -631,7 +631,7 @@ class Definition
|
|
631 |
/**
|
632 |
* Sets the lazy flag of this service.
|
633 |
*
|
634 |
-
* @param bool
|
635 |
*
|
636 |
* @return Definition The current instance
|
637 |
*/
|
@@ -656,7 +656,7 @@ class Definition
|
|
656 |
* Sets whether this definition is synthetic, that is not constructed by the
|
657 |
* container, but dynamically injected.
|
658 |
*
|
659 |
-
* @param bool
|
660 |
*
|
661 |
* @return Definition the current instance
|
662 |
*
|
@@ -686,7 +686,7 @@ class Definition
|
|
686 |
* Whether this definition is abstract, that means it merely serves as a
|
687 |
* template for other definitions.
|
688 |
*
|
689 |
-
* @param bool
|
690 |
*
|
691 |
* @return Definition the current instance
|
692 |
*
|
267 |
/**
|
268 |
* Sets a specific argument
|
269 |
*
|
270 |
+
* @param int $index
|
271 |
+
* @param mixed $argument
|
272 |
*
|
273 |
* @return Definition The current instance
|
274 |
*
|
302 |
/**
|
303 |
* Gets an argument to pass to the service constructor/factory method.
|
304 |
*
|
305 |
+
* @param int $index
|
306 |
*
|
307 |
* @return mixed The argument value
|
308 |
*
|
575 |
/**
|
576 |
* Sets the visibility of this service.
|
577 |
*
|
578 |
+
* @param bool $boolean
|
579 |
*
|
580 |
* @return Definition The current instance
|
581 |
*
|
603 |
/**
|
604 |
* Sets the synchronized flag of this service.
|
605 |
*
|
606 |
+
* @param bool $boolean
|
607 |
*
|
608 |
* @return Definition The current instance
|
609 |
*
|
631 |
/**
|
632 |
* Sets the lazy flag of this service.
|
633 |
*
|
634 |
+
* @param bool $lazy
|
635 |
*
|
636 |
* @return Definition The current instance
|
637 |
*/
|
656 |
* Sets whether this definition is synthetic, that is not constructed by the
|
657 |
* container, but dynamically injected.
|
658 |
*
|
659 |
+
* @param bool $boolean
|
660 |
*
|
661 |
* @return Definition the current instance
|
662 |
*
|
686 |
* Whether this definition is abstract, that means it merely serves as a
|
687 |
* template for other definitions.
|
688 |
*
|
689 |
+
* @param bool $boolean
|
690 |
*
|
691 |
* @return Definition the current instance
|
692 |
*
|
lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
CHANGED
@@ -166,7 +166,7 @@ class DefinitionDecorator extends Definition
|
|
166 |
* If replaceArgument() has been used to replace an argument, this method
|
167 |
* will return the replacement value.
|
168 |
*
|
169 |
-
* @param int
|
170 |
*
|
171 |
* @return mixed The argument value
|
172 |
*
|
@@ -197,10 +197,10 @@ class DefinitionDecorator extends Definition
|
|
197 |
* certain conventions when you want to overwrite the arguments of the
|
198 |
* parent definition, otherwise your arguments will only be appended.
|
199 |
*
|
200 |
-
* @param int
|
201 |
-
* @param mixed
|
202 |
*
|
203 |
-
* @return DefinitionDecorator
|
204 |
* @throws InvalidArgumentException when $index isn't an integer
|
205 |
*
|
206 |
* @api
|
166 |
* If replaceArgument() has been used to replace an argument, this method
|
167 |
* will return the replacement value.
|
168 |
*
|
169 |
+
* @param int $index
|
170 |
*
|
171 |
* @return mixed The argument value
|
172 |
*
|
197 |
* certain conventions when you want to overwrite the arguments of the
|
198 |
* parent definition, otherwise your arguments will only be appended.
|
199 |
*
|
200 |
+
* @param int $index
|
201 |
+
* @param mixed $value
|
202 |
*
|
203 |
+
* @return DefinitionDecorator the current instance
|
204 |
* @throws InvalidArgumentException when $index isn't an integer
|
205 |
*
|
206 |
* @api
|
lib/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
CHANGED
@@ -123,10 +123,10 @@ class GraphvizDumper extends Dumper
|
|
123 |
/**
|
124 |
* Finds all edges belonging to a specific service id.
|
125 |
*
|
126 |
-
* @param string
|
127 |
-
* @param array
|
128 |
-
* @param bool
|
129 |
-
* @param string
|
130 |
*
|
131 |
* @return array An array of edges
|
132 |
*/
|
123 |
/**
|
124 |
* Finds all edges belonging to a specific service id.
|
125 |
*
|
126 |
+
* @param string $id The service id used to find edges
|
127 |
+
* @param array $arguments An array of arguments
|
128 |
+
* @param bool $required
|
129 |
+
* @param string $name
|
130 |
*
|
131 |
* @return array An array of edges
|
132 |
*/
|
lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
CHANGED
@@ -54,6 +54,8 @@ class PhpDumper extends Dumper
|
|
54 |
private $variableCount;
|
55 |
private $reservedVariables = array('instance', 'class');
|
56 |
private $expressionLanguage;
|
|
|
|
|
57 |
|
58 |
/**
|
59 |
* @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface
|
@@ -99,12 +101,36 @@ class PhpDumper extends Dumper
|
|
99 |
*/
|
100 |
public function dump(array $options = array())
|
101 |
{
|
|
|
102 |
$options = array_merge(array(
|
103 |
'class' => 'ProjectServiceContainer',
|
104 |
'base_class' => 'Container',
|
105 |
'namespace' => '',
|
106 |
), $options);
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
$code = $this->startClass($options['class'], $options['base_class'], $options['namespace']);
|
109 |
|
110 |
if ($this->container->isFrozen()) {
|
@@ -119,6 +145,7 @@ class PhpDumper extends Dumper
|
|
119 |
$this->endClass().
|
120 |
$this->addProxyClasses()
|
121 |
;
|
|
|
122 |
|
123 |
return $code;
|
124 |
}
|
@@ -246,7 +273,7 @@ class PhpDumper extends Dumper
|
|
246 |
*
|
247 |
* @return string
|
248 |
*
|
249 |
-
* @throws RuntimeException
|
250 |
* @throws ServiceCircularReferenceException When a circular reference is detected
|
251 |
*/
|
252 |
private function addServiceInlinedDefinitions($id, $definition)
|
@@ -982,9 +1009,9 @@ EOF;
|
|
982 |
/**
|
983 |
* Exports parameters.
|
984 |
*
|
985 |
-
* @param array
|
986 |
-
* @param string
|
987 |
-
* @param int
|
988 |
*
|
989 |
* @return string
|
990 |
*
|
@@ -1005,7 +1032,7 @@ EOF;
|
|
1005 |
} elseif ($value instanceof Expression) {
|
1006 |
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
|
1007 |
} else {
|
1008 |
-
$value =
|
1009 |
}
|
1010 |
|
1011 |
$php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value);
|
@@ -1055,9 +1082,9 @@ EOF;
|
|
1055 |
/**
|
1056 |
* Builds service calls from arguments.
|
1057 |
*
|
1058 |
-
* @param array
|
1059 |
-
* @param array
|
1060 |
-
* @param array
|
1061 |
*/
|
1062 |
private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior)
|
1063 |
{
|
@@ -1134,10 +1161,10 @@ EOF;
|
|
1134 |
/**
|
1135 |
* Checks if a service id has a reference.
|
1136 |
*
|
1137 |
-
* @param string
|
1138 |
-
* @param array
|
1139 |
-
* @param bool
|
1140 |
-
* @param array
|
1141 |
*
|
1142 |
* @return bool
|
1143 |
*/
|
@@ -1173,8 +1200,8 @@ EOF;
|
|
1173 |
/**
|
1174 |
* Dumps values.
|
1175 |
*
|
1176 |
-
* @param array
|
1177 |
-
* @param bool
|
1178 |
*
|
1179 |
* @return string
|
1180 |
*
|
@@ -1244,14 +1271,14 @@ EOF;
|
|
1244 |
return "'.".$that->dumpParameter(strtolower($match[2])).".'";
|
1245 |
};
|
1246 |
|
1247 |
-
$code = str_replace('%%', '%', preg_replace_callback('/(?<!%)(%)([^%]+)\1/', $replaceParameters,
|
1248 |
|
1249 |
return $code;
|
1250 |
}
|
1251 |
} elseif (is_object($value) || is_resource($value)) {
|
1252 |
throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
|
1253 |
} else {
|
1254 |
-
return
|
1255 |
}
|
1256 |
}
|
1257 |
|
@@ -1377,4 +1404,26 @@ EOF;
|
|
1377 |
|
1378 |
return $this->expressionLanguage;
|
1379 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1380 |
}
|
54 |
private $variableCount;
|
55 |
private $reservedVariables = array('instance', 'class');
|
56 |
private $expressionLanguage;
|
57 |
+
private $targetDirRegex;
|
58 |
+
private $targetDirMaxMatches;
|
59 |
|
60 |
/**
|
61 |
* @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface
|
101 |
*/
|
102 |
public function dump(array $options = array())
|
103 |
{
|
104 |
+
$this->targetDirRegex = null;
|
105 |
$options = array_merge(array(
|
106 |
'class' => 'ProjectServiceContainer',
|
107 |
'base_class' => 'Container',
|
108 |
'namespace' => '',
|
109 |
), $options);
|
110 |
|
111 |
+
if (!empty($options['file']) && is_dir($dir = dirname($options['file']))) {
|
112 |
+
// Build a regexp where the first two root dirs are mandatory,
|
113 |
+
// but every other sub-dir is optional up to the full path in $dir
|
114 |
+
|
115 |
+
$dir = explode(DIRECTORY_SEPARATOR, realpath($dir));
|
116 |
+
$i = count($dir);
|
117 |
+
|
118 |
+
if (3 <= $i) {
|
119 |
+
$regex = '';
|
120 |
+
$this->targetDirMaxMatches = $i - 3;
|
121 |
+
|
122 |
+
while (2 < --$i) {
|
123 |
+
$regex = sprintf('(%s%s)?', preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex);
|
124 |
+
}
|
125 |
+
|
126 |
+
do {
|
127 |
+
$regex = preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#').$regex;
|
128 |
+
} while (0 < --$i);
|
129 |
+
|
130 |
+
$this->targetDirRegex = '#'.preg_quote($dir[0], '#').$regex.'#';
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
$code = $this->startClass($options['class'], $options['base_class'], $options['namespace']);
|
135 |
|
136 |
if ($this->container->isFrozen()) {
|
145 |
$this->endClass().
|
146 |
$this->addProxyClasses()
|
147 |
;
|
148 |
+
$this->targetDirRegex = null;
|
149 |
|
150 |
return $code;
|
151 |
}
|
273 |
*
|
274 |
* @return string
|
275 |
*
|
276 |
+
* @throws RuntimeException When the factory definition is incomplete
|
277 |
* @throws ServiceCircularReferenceException When a circular reference is detected
|
278 |
*/
|
279 |
private function addServiceInlinedDefinitions($id, $definition)
|
1009 |
/**
|
1010 |
* Exports parameters.
|
1011 |
*
|
1012 |
+
* @param array $parameters
|
1013 |
+
* @param string $path
|
1014 |
+
* @param int $indent
|
1015 |
*
|
1016 |
* @return string
|
1017 |
*
|
1032 |
} elseif ($value instanceof Expression) {
|
1033 |
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
|
1034 |
} else {
|
1035 |
+
$value = $this->export($value);
|
1036 |
}
|
1037 |
|
1038 |
$php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value);
|
1082 |
/**
|
1083 |
* Builds service calls from arguments.
|
1084 |
*
|
1085 |
+
* @param array $arguments
|
1086 |
+
* @param array &$calls By reference
|
1087 |
+
* @param array &$behavior By reference
|
1088 |
*/
|
1089 |
private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior)
|
1090 |
{
|
1161 |
/**
|
1162 |
* Checks if a service id has a reference.
|
1163 |
*
|
1164 |
+
* @param string $id
|
1165 |
+
* @param array $arguments
|
1166 |
+
* @param bool $deep
|
1167 |
+
* @param array $visited
|
1168 |
*
|
1169 |
* @return bool
|
1170 |
*/
|
1200 |
/**
|
1201 |
* Dumps values.
|
1202 |
*
|
1203 |
+
* @param array $value
|
1204 |
+
* @param bool $interpolate
|
1205 |
*
|
1206 |
* @return string
|
1207 |
*
|
1271 |
return "'.".$that->dumpParameter(strtolower($match[2])).".'";
|
1272 |
};
|
1273 |
|
1274 |
+
$code = str_replace('%%', '%', preg_replace_callback('/(?<!%)(%)([^%]+)\1/', $replaceParameters, $this->export($value)));
|
1275 |
|
1276 |
return $code;
|
1277 |
}
|
1278 |
} elseif (is_object($value) || is_resource($value)) {
|
1279 |
throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
|
1280 |
} else {
|
1281 |
+
return $this->export($value);
|
1282 |
}
|
1283 |
}
|
1284 |
|
1404 |
|
1405 |
return $this->expressionLanguage;
|
1406 |
}
|
1407 |
+
|
1408 |
+
private function export($value)
|
1409 |
+
{
|
1410 |
+
if (null !== $this->targetDirRegex && is_string($value) && preg_match($this->targetDirRegex, $value, $matches, PREG_OFFSET_CAPTURE)) {
|
1411 |
+
$prefix = $matches[0][1] ? var_export(substr($value, 0, $matches[0][1]), true).'.' : '';
|
1412 |
+
$suffix = $matches[0][1] + strlen($matches[0][0]);
|
1413 |
+
$suffix = isset($value[$suffix]) ? '.'.var_export(substr($value, $suffix), true) : '';
|
1414 |
+
$dirname = '__DIR__';
|
1415 |
+
|
1416 |
+
for ($i = $this->targetDirMaxMatches - count($matches); 0 <= $i; --$i) {
|
1417 |
+
$dirname = sprintf('dirname(%s)', $dirname);
|
1418 |
+
}
|
1419 |
+
|
1420 |
+
if ($prefix || $suffix) {
|
1421 |
+
return sprintf('(%s%s%s)', $prefix, $dirname, $suffix);
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
return $dirname;
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
return var_export($value, true);
|
1428 |
+
}
|
1429 |
}
|
lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
CHANGED
@@ -290,8 +290,8 @@ class YamlDumper extends Dumper
|
|
290 |
/**
|
291 |
* Prepares parameters.
|
292 |
*
|
293 |
-
* @param array
|
294 |
-
* @param bool
|
295 |
*
|
296 |
* @return array
|
297 |
*/
|
290 |
/**
|
291 |
* Prepares parameters.
|
292 |
*
|
293 |
+
* @param array $parameters
|
294 |
+
* @param bool $escape
|
295 |
*
|
296 |
* @return array
|
297 |
*/
|
lib/Symfony/Component/DependencyInjection/Extension/Extension.php
CHANGED
@@ -109,7 +109,7 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn
|
|
109 |
* @param ContainerBuilder $container
|
110 |
* @param array $config
|
111 |
*
|
112 |
-
* @return bool
|
113 |
*
|
114 |
* @throws InvalidArgumentException When the config is not enableable
|
115 |
*/
|
109 |
* @param ContainerBuilder $container
|
110 |
* @param array $config
|
111 |
*
|
112 |
+
* @return bool Whether the configuration is enabled
|
113 |
*
|
114 |
* @throws InvalidArgumentException When the config is not enableable
|
115 |
*/
|
lib/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php
CHANGED
@@ -25,7 +25,7 @@ interface IntrospectableContainerInterface extends ContainerInterface
|
|
25 |
*
|
26 |
* @param string $id
|
27 |
*
|
28 |
-
* @return bool
|
29 |
*
|
30 |
*/
|
31 |
public function initialized($id);
|
25 |
*
|
26 |
* @param string $id
|
27 |
*
|
28 |
+
* @return bool true if the service has been initialized, false otherwise
|
29 |
*
|
30 |
*/
|
31 |
public function initialized($id);
|
lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
CHANGED
@@ -80,7 +80,7 @@ class ParameterBag implements ParameterBagInterface
|
|
80 |
*
|
81 |
* @param string $name The parameter name
|
82 |
*
|
83 |
-
* @return mixed
|
84 |
*
|
85 |
* @throws ParameterNotFoundException if the parameter is not defined
|
86 |
*
|
@@ -127,7 +127,7 @@ class ParameterBag implements ParameterBagInterface
|
|
127 |
*
|
128 |
* @param string $name The parameter name
|
129 |
*
|
130 |
-
* @return bool
|
131 |
*
|
132 |
* @api
|
133 |
*/
|
@@ -181,9 +181,9 @@ class ParameterBag implements ParameterBagInterface
|
|
181 |
*
|
182 |
* @return mixed The resolved value
|
183 |
*
|
184 |
-
* @throws ParameterNotFoundException
|
185 |
* @throws ParameterCircularReferenceException if a circular reference if detected
|
186 |
-
* @throws RuntimeException
|
187 |
*/
|
188 |
public function resolveValue($value, array $resolving = array())
|
189 |
{
|
@@ -211,9 +211,9 @@ class ParameterBag implements ParameterBagInterface
|
|
211 |
*
|
212 |
* @return string The resolved string
|
213 |
*
|
214 |
-
* @throws ParameterNotFoundException
|
215 |
* @throws ParameterCircularReferenceException if a circular reference if detected
|
216 |
-
* @throws RuntimeException
|
217 |
*/
|
218 |
public function resolveString($value, array $resolving = array())
|
219 |
{
|
80 |
*
|
81 |
* @param string $name The parameter name
|
82 |
*
|
83 |
+
* @return mixed The parameter value
|
84 |
*
|
85 |
* @throws ParameterNotFoundException if the parameter is not defined
|
86 |
*
|
127 |
*
|
128 |
* @param string $name The parameter name
|
129 |
*
|
130 |
+
* @return bool true if the parameter name is defined, false otherwise
|
131 |
*
|
132 |
* @api
|
133 |
*/
|
181 |
*
|
182 |
* @return mixed The resolved value
|
183 |
*
|
184 |
+
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
|
185 |
* @throws ParameterCircularReferenceException if a circular reference if detected
|
186 |
+
* @throws RuntimeException when a given parameter has a type problem.
|
187 |
*/
|
188 |
public function resolveValue($value, array $resolving = array())
|
189 |
{
|
211 |
*
|
212 |
* @return string The resolved string
|
213 |
*
|
214 |
+
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
|
215 |
* @throws ParameterCircularReferenceException if a circular reference if detected
|
216 |
+
* @throws RuntimeException when a given parameter has a type problem.
|
217 |
*/
|
218 |
public function resolveString($value, array $resolving = array())
|
219 |
{
|
lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php
CHANGED
@@ -52,7 +52,7 @@ interface ParameterBagInterface
|
|
52 |
*
|
53 |
* @param string $name The parameter name
|
54 |
*
|
55 |
-
* @return mixed
|
56 |
*
|
57 |
* @throws ParameterNotFoundException if the parameter is not defined
|
58 |
*
|
@@ -75,7 +75,7 @@ interface ParameterBagInterface
|
|
75 |
*
|
76 |
* @param string $name The parameter name
|
77 |
*
|
78 |
-
* @return bool
|
79 |
*
|
80 |
* @api
|
81 |
*/
|
52 |
*
|
53 |
* @param string $name The parameter name
|
54 |
*
|
55 |
+
* @return mixed The parameter value
|
56 |
*
|
57 |
* @throws ParameterNotFoundException if the parameter is not defined
|
58 |
*
|
75 |
*
|
76 |
* @param string $name The parameter name
|
77 |
*
|
78 |
+
* @return bool true if the parameter name is defined, false otherwise
|
79 |
*
|
80 |
* @api
|
81 |
*/
|
lib/Symfony/Component/DependencyInjection/Reference.php
CHANGED
@@ -27,9 +27,9 @@ class Reference
|
|
27 |
/**
|
28 |
* Constructor.
|
29 |
*
|
30 |
-
* @param string
|
31 |
-
* @param int
|
32 |
-
* @param bool
|
33 |
*
|
34 |
* @see Container
|
35 |
*/
|
27 |
/**
|
28 |
* Constructor.
|
29 |
*
|
30 |
+
* @param string $id The service identifier
|
31 |
+
* @param int $invalidBehavior The behavior when the service does not exist
|
32 |
+
* @param bool $strict Sets how this reference is validated
|
33 |
*
|
34 |
* @see Container
|
35 |
*/
|
lib/Symfony/Component/DependencyInjection/SimpleXMLElement.php
CHANGED
@@ -38,8 +38,8 @@ class SimpleXMLElement extends \SimpleXMLElement
|
|
38 |
/**
|
39 |
* Returns arguments as valid PHP types.
|
40 |
*
|
41 |
-
* @param string
|
42 |
-
* @param bool
|
43 |
*
|
44 |
* @return mixed
|
45 |
*/
|
38 |
/**
|
39 |
* Returns arguments as valid PHP types.
|
40 |
*
|
41 |
+
* @param string $name
|
42 |
+
* @param bool $lowercase
|
43 |
*
|
44 |
* @return mixed
|
45 |
*/
|
lib/Symfony/Component/Filesystem/Filesystem.php
CHANGED
@@ -28,9 +28,9 @@ class Filesystem
|
|
28 |
*
|
29 |
* By default, if the target already exists, it is not overridden.
|
30 |
*
|
31 |
-
* @param string
|
32 |
-
* @param string
|
33 |
-
* @param bool
|
34 |
*
|
35 |
* @throws FileNotFoundException When originFile doesn't exist
|
36 |
* @throws IOException When copy fails
|
@@ -98,7 +98,7 @@ class Filesystem
|
|
98 |
*
|
99 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
|
100 |
*
|
101 |
-
* @return bool
|
102 |
*/
|
103 |
public function exists($files)
|
104 |
{
|
@@ -246,9 +246,9 @@ class Filesystem
|
|
246 |
/**
|
247 |
* Renames a file or a directory.
|
248 |
*
|
249 |
-
* @param string
|
250 |
-
* @param string
|
251 |
-
* @param bool
|
252 |
*
|
253 |
* @throws IOException When target file or directory already exists
|
254 |
* @throws IOException When origin cannot be renamed
|
@@ -268,9 +268,9 @@ class Filesystem
|
|
268 |
/**
|
269 |
* Creates a symbolic link or copy a directory.
|
270 |
*
|
271 |
-
* @param string
|
272 |
-
* @param string
|
273 |
-
* @param bool
|
274 |
*
|
275 |
* @throws IOException When symlink fails
|
276 |
*/
|
@@ -354,10 +354,10 @@ class Filesystem
|
|
354 |
* @param string $targetDir The target directory
|
355 |
* @param \Traversable $iterator A Traversable instance
|
356 |
* @param array $options An array of boolean options
|
357 |
-
*
|
358 |
-
*
|
359 |
-
*
|
360 |
-
*
|
361 |
*
|
362 |
* @throws IOException When file type is unknown
|
363 |
*/
|
@@ -445,11 +445,12 @@ class Filesystem
|
|
445 |
/**
|
446 |
* Atomically dumps content into a file.
|
447 |
*
|
448 |
-
* @param
|
449 |
-
* @param
|
450 |
-
* @param
|
451 |
-
*
|
452 |
-
*
|
|
|
453 |
*/
|
454 |
public function dumpFile($filename, $content, $mode = 0666)
|
455 |
{
|
28 |
*
|
29 |
* By default, if the target already exists, it is not overridden.
|
30 |
*
|
31 |
+
* @param string $originFile The original filename
|
32 |
+
* @param string $targetFile The target filename
|
33 |
+
* @param bool $override Whether to override an existing file or not
|
34 |
*
|
35 |
* @throws FileNotFoundException When originFile doesn't exist
|
36 |
* @throws IOException When copy fails
|
98 |
*
|
99 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
|
100 |
*
|
101 |
+
* @return bool true if the file exists, false otherwise
|
102 |
*/
|
103 |
public function exists($files)
|
104 |
{
|
246 |
/**
|
247 |
* Renames a file or a directory.
|
248 |
*
|
249 |
+
* @param string $origin The origin filename or directory
|
250 |
+
* @param string $target The new filename or directory
|
251 |
+
* @param bool $overwrite Whether to overwrite the target if it already exists
|
252 |
*
|
253 |
* @throws IOException When target file or directory already exists
|
254 |
* @throws IOException When origin cannot be renamed
|
268 |
/**
|
269 |
* Creates a symbolic link or copy a directory.
|
270 |
*
|
271 |
+
* @param string $originDir The origin directory path
|
272 |
+
* @param string $targetDir The symbolic link name
|
273 |
+
* @param bool $copyOnWindows Whether to copy files if on Windows
|
274 |
*
|
275 |
* @throws IOException When symlink fails
|
276 |
*/
|
354 |
* @param string $targetDir The target directory
|
355 |
* @param \Traversable $iterator A Traversable instance
|
356 |
* @param array $options An array of boolean options
|
357 |
+
* Valid options are:
|
358 |
+
* - $options['override'] Whether to override an existing file on copy or not (see copy())
|
359 |
+
* - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink())
|
360 |
+
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
|
361 |
*
|
362 |
* @throws IOException When file type is unknown
|
363 |
*/
|
445 |
/**
|
446 |
* Atomically dumps content into a file.
|
447 |
*
|
448 |
+
* @param string $filename The file to be written to.
|
449 |
+
* @param string $content The data to write into the file.
|
450 |
+
* @param null|int $mode The file mode (octal). If null, file permissions are not modified
|
451 |
+
* Deprecated since version 2.3.12, to be removed in 3.0.
|
452 |
+
*
|
453 |
+
* @throws IOException If the file cannot be written to.
|
454 |
*/
|
455 |
public function dumpFile($filename, $content, $mode = 0666)
|
456 |
{
|
package.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>Bitpay_Core</name><version>2.1.0</version><stability>stable</stability><license uri="https://github.com/bitpay/magento-plugin/blob/master/LICENSE">MIT</license><channel>community</channel><extends/><summary/><description/><notes/><authors><author><name>Joshua Estes</name><user>BitPayJoshua</user><email>support@bitpay.com</email></author></authors><date>2014-11-24</date><time>9:19:27</time><compatible/><dependencies/><required php_min="5.4.0" php_max="6.0.0">php</required><extensions><name>gmp<min/><max/></name><name>openssl<min/><max/></name><name>mcrypt<min/><max/></name></extensions><contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Bitpay"><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Extension.php" hash="80b5a2837b0077cc1d349a7a1a532ef8"/><file name="Header.php" hash="115fbc1b966ecc9ad52a2afaf0170947"/></dir></dir></dir></dir></dir><dir name="Form"><file name="Bitpay.php" hash="a720aec5391c0c9cfa9a84239b4d0165"/></dir><file name="Iframe.php" hash="1adec7fac67f9e5448536bf019fc0d51"/><file name="Info.php" hash="e08b38ba2bc75441fc485f98ebea76b9"/></dir><dir name="controllers"><file name="IndexController.php" hash="58531e3da72d765f1af253351904dc60"/><file name="IpnController.php" hash="b5c27165f62ad658279f5b39f86dca24"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a3d6e1c3fb81e271a85260aba4f9f797"/><file name="config.xml" hash="5d131d785a389615421b279796ac2aa3"/><file name="system.xml" hash="98936efe3cb6678b94622868aed6616a"/></dir><dir name="Helper"><file name="Data.php" hash="a3562f9dbdd719a04cdc98eaeb235815"/></dir><file name="LICENSE" hash="c443b0598a4770735bb68838f7d563a3"/><dir name="Model"><dir name="Config"><file name="PairingCode.php" hash="4134601160d1351d3ef37175094e5e44"/></dir><file name="Invoice.php" hash="54a93e232a7ffbb75cc294d06b15b31e"/><file name="Ipn.php" hash="10cdfe78efea3eb9e6776b35f48acc9d"/><dir name="Method"><file name="Bitcoin.php" hash="b84637450f3f3f7947efba732218cb35"/></dir><dir name="Mysql4"><dir name="Invoice"><file name="Collection.php" hash="9f133b3a850ed81ee2b10afddaa8f192"/></dir><file name="Invoice.php" hash="09eef9e9eb8fd73a0e0991f0b06ed8f7"/><dir name="Ipn"><file name="Collection.php" hash="5731cf9f07a7542a5fb7c357713b1415"/></dir><file name="Ipn.php" hash="c4d06de91130340c90e2b823d3221e98"/></dir><file name="Network.php" hash="f5b26b26c9e37e8c0afa017c61aa02a2"/><file name="Observer.php" hash="06e346a10c702ccbac7e6c694f3680c2"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b7bb6c723c948626da6a2af91ca6ce1b"/></dir></dir><file name="Status.php" hash="36c5b681659bd5a44bd2a7f8fdf86eef"/><file name="TransactionSpeed.php" hash="14f2bec5848c3be13f1d01420dbf1108"/></dir><file name="README.md" hash="e33d856153a0d0b501e5e17a926cc59c"/><dir name="sql"><dir name="bitpay_setup"><file name="mysql4-install-2.0.0.php" hash="dbc4ded8c37cf1fdc798fe24f259ae1e"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="info"><file name="default.phtml" hash="647029fe9f25cd398346b98a39526a5e"/></dir><dir name="system"><dir name="config"><dir name="field"><file name="header.phtml" hash="8f82364aa99736ef33499aa1162c0176"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="form"><file name="bitpay.phtml" hash="e672ef8c02b000293cb04febfdbb3f26"/></dir><file name="iframe.phtml" hash="fcff11f0d6090b5dacb839257c40802a"/><dir name="info"><file name="default.phtml" hash="8ccc37fb65b7ffd9bb93bfffaed4460c"/></dir><file name="json.phtml" hash="cc43e25d0445d5ba15b448ba946dabfd"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Bitpay_Core.xml" hash="d59f55b764493144419eccae1b52eb1d"/></dir></dir><dir name="locale"><dir name="en_US"><file name="Bitpay_Core.csv" hash="1f6198bdeee3f77f87c36b4e09b45be2"/></dir></dir></dir><dir name="lib"><dir name="Bitpay"><file name="AccessToken.php" hash="b650732953cc76fe62e572942b831ec4"/><file name="AccessTokenInterface.php" hash="e0fbcecc6bcbb34047c2e57dc820d803"/><file name="Application.php" hash="31c64f4b70e8ffe2708710f02979849c"/><file name="ApplicationInterface.php" hash="aa59d6ce3f4b267623111ba12108e87b"/><file name="Autoloader.php" hash="109400039e04ef345ac879a944fe45ba"/><file name="Bill.php" hash="3b4a81cdc0ad3a138dd524e7c3a04566"/><file name="BillInterface.php" hash="5a994dd5417344888fc056a2390f191c"/><file name="Bitpay.php" hash="4fb82d028494bb6209007949694d8cfa"/><file name="Buyer.php" hash="4412021acee929e178c420cd65ce79a9"/><file name="BuyerInterface.php" hash="e559c92941a0c1be01d524d738ae34ba"/><dir name="Client"><dir name="Adapter"><file name="AdapterInterface.php" hash="05fd3e768f3c52212c2d2039f4cfae96"/><file name="ca-bundle.crt" hash="9025ca14554240fc05c4e919ae3f8923"/><file name="CurlAdapter.php" hash="23cd5edccc0760cf98a42bd1139fcc99"/></dir><file name="Client.php" hash="4e7834724caafe6eb5a0e0642c182f15"/><file name="ClientInterface.php" hash="90ac8f4a1c2422d1acdf07293145725f"/><file name="Request.php" hash="916f4be97abd6be563745fbf45dbdd27"/><file name="RequestInterface.php" hash="914e0878fc00df470364f1ed176b7065"/><file name="Response.php" hash="195796fb21d235e1348caca2a990910d"/><file name="ResponseInterface.php" hash="a71df973cd59390032d190d77f6ddf2b"/></dir><dir name="Config"><file name="Configuration.php" hash="7cb0441f0dce52bab9f30f0cc3dee2fa"/></dir><dir name="Crypto"><file name="CryptoInterface.php" hash="713f075d91ca1ab6d550d835019cc324"/><file name="HashExtension.php" hash="e3620eb17401f6be6216e6c508d880ae"/><file name="McryptExtension.php" hash="160e7e94e6ec50b255742bb5366dea29"/><file name="OpenSSLExtension.php" hash="e19769ca76ceee3ec0cc3c2d14658e1b"/></dir><file name="Currency.php" hash="fb49a1aa1f4a93e7174722d2ec136d4d"/><file name="CurrencyInterface.php" hash="830f5b13306e7f15e13688b92f77c5fb"/><dir name="DependencyInjection"><file name="BitpayExtension.php" hash="fc361f93a85be0b066dd1a60bb5d4a15"/><dir name="Loader"><file name="ArrayLoader.php" hash="7028b1912819de4cb6185264902728bb"/></dir><file name="services.xml" hash="cda4e79bf0e6f6821e5b4c2e16c240cb"/></dir><file name="Invoice.php" hash="2ef2048160a8b0a97b6b7aadf9cb8a3b"/><file name="InvoiceInterface.php" hash="003f327484b4533028274e7a986c33d3"/><file name="Item.php" hash="2f320697b5e4b93697d43e9b1ef0dfd7"/><file name="ItemInterface.php" hash="28dc0f30ce0e5e50280ef1c5e511114c"/><file name="Key.php" hash="07a1c007120ecacc76fee73c28d09c1b"/><file name="KeyInterface.php" hash="5d3c11cb4e771a2bb639b385f7cd49d1"/><file name="KeyManager.php" hash="4872a78714d8b1fc7e65fdd6feb59249"/><dir name="Math"><file name="BcEngine.php" hash="84d633a6ca577cd8ee574e28b3383d3f"/><file name="EngineInterface.php" hash="a0de5260325608e0911d4128fe3e52c2"/><file name="GmpEngine.php" hash="3136a8196599b00f097c15c0aa3a4c49"/><file name="Math.php" hash="7b99aff7f0f1cca5cb5a7d1c9eeae468"/><file name="RichArbitraryPrecisionIntegerMath.php" hash="f69259ec66c8dd951fb96850879a40a9"/><file name="RpEngine.php" hash="1d8ba3598f2f37a0b9447c975e5fd381"/></dir><dir name="Network"><file name="Livenet.php" hash="7cca4b4f5d5539fac02e263781e3620c"/><file name="NetworkAware.php" hash="ec7ef539507c3f30fcd8c343ad6b3742"/><file name="NetworkAwareInterface.php" hash="8cd0db65e5ebf3d7ec24ba386354426d"/><file name="NetworkInterface.php" hash="1a8d453e5c5a2df2386dc732f5a7ffb1"/><file name="Testnet.php" hash="089a25f2ec48d0ae764b721ce8ba0c94"/></dir><file name="Point.php" hash="5f4ffeaabe1182e104d69995ecae0aca"/><file name="PointInterface.php" hash="0b0b14023aaa49755b9f5a59dd63d9c5"/><file name="PrivateKey.php" hash="b134d2e47736cc311aea4f6a1347e4e7"/><file name="PublicKey.php" hash="daa8913351013562de89c4aa593e4df9"/><file name="SinKey.php" hash="252aa5fe69be7709d3e9272ffda97095"/><dir name="Storage"><file name="EncryptedFilesystemStorage.php" hash="1c8676d4257283e8160a6124be41db1f"/><file name="FilesystemStorage.php" hash="1ec6871a4ccdfd62f899577a8042069c"/><file name="MagentoStorage.php" hash="3066b70d4ecad0da42efba88ede524aa"/><file name="MockStorage.php" hash="f2e4711e61ba404a2d5d925128c0a315"/><file name="StorageInterface.php" hash="03c173ef3c5b6e0d712f8187da03696a"/></dir><file name="Token.php" hash="df240bbfc93a2a7118220a222282a4a1"/><file name="TokenInterface.php" hash="1527fd7deb81d5b3009df2c53fadb436"/><file name="User.php" hash="fbfcec4453d8f650d5da2aba075f17e0"/><file name="UserInterface.php" hash="1a09e8d78525c4603be8337eca903490"/><dir name="Util"><file name="Base58.php" hash="544526f4f89848bfb61f7bfcae348af6"/><file name="CurveParameterInterface.php" hash="89b1c87b5ca7cae773f5603b1b3eedbb"/><file name="Error.php" hash="7d0a10ce0891db57d4ac9b7c4d62be90"/><file name="Fingerprint.php" hash="e30304f9f8f49fe37de30329c0792715"/><file name="Secp256k1.php" hash="51008a9b442042c6dc9519850864e357"/><file name="SecureRandom.php" hash="f7e301e9000bba7047ad5130d645c4ae"/><file name="Util.php" hash="d0b81461eee9740445f7e38ec6948127"/></dir></dir><dir name="Symfony"><dir name="Component"><dir name="Config"><file name="CHANGELOG.md" hash="2e855ecea3b2fd176fcde9dcbee078b4"/><file name="composer.json" hash="f811d1f0df9a5b256c16a7029dae9513"/><file name="ConfigCache.php" hash="a9af8f74f9cdc8bbc84e49407254b7f7"/><dir name="Definition"><file name="ArrayNode.php" hash="1b4be73d30531074ca395c2e3849c833"/><file name="BaseNode.php" hash="e3b785b743f87f91c5d98dd4e8bb4878"/><file name="BooleanNode.php" hash="35e38c75b51cdff67f3098103a791e44"/><dir name="Builder"><file name="ArrayNodeDefinition.php" hash="bd75ebfc0e24ad3a643214fb565faa7f"/><file name="BooleanNodeDefinition.php" hash="3241b942a983dc282827a75fe4bbe666"/><file name="EnumNodeDefinition.php" hash="2935ae381b785ced6f6ec1eded9a9ce0"/><file name="ExprBuilder.php" hash="4612723b84cd2729dd94020f1412539a"/><file name="FloatNodeDefinition.php" hash="ea6a82bed9a7bfe2f7c7e4bded4ba25e"/><file name="IntegerNodeDefinition.php" hash="0de24b6c3b0846189e0e7140340e4c20"/><file name="MergeBuilder.php" hash="726a8b34dadf9eca63e6cabc4587cdb3"/><file name="NodeBuilder.php" hash="11c167f7db0435c311dfab6b90960194"/><file name="NodeDefinition.php" hash="d7107fa0f2bd308422590edd03563de7"/><file name="NodeParentInterface.php" hash="511a0150b959a7eab00cbf0fed174c0a"/><file name="NormalizationBuilder.php" hash="f03726ad2acc69648e3f4c92c3436b63"/><file name="NumericNodeDefinition.php" hash="5432ea41087e28803130a9cbe74e4356"/><file name="ParentNodeDefinitionInterface.php" hash="ac0a6d2f8ae048f365844d761db049db"/><file name="ScalarNodeDefinition.php" hash="d9fa4186f4448c3cad8152bb9b08a10d"/><file name="TreeBuilder.php" hash="48f136a2fe26ef3b84f2f4e785dafdca"/><file name="ValidationBuilder.php" hash="8c0ab61f8ce4e8a0b95fae338d07289d"/><file name="VariableNodeDefinition.php" hash="b2d76649ce3c123cbd3488fd7b449b71"/></dir><file name="ConfigurationInterface.php" hash="3c993b6405debf926234927327e1540e"/><dir name="Dumper"><file name="XmlReferenceDumper.php" hash="ff8ec25bb68fe90df74a0ad5ce81acf6"/><file name="YamlReferenceDumper.php" hash="b3872d7001d6e2720a867a2bf09af371"/></dir><file name="EnumNode.php" hash="4718c796e11ef0403e41dce26b7224ea"/><dir name="Exception"><file name="DuplicateKeyException.php" hash="ede2ab4177afff995069bc54c4517f9e"/><file name="Exception.php" hash="a7eb222da39a7eefc7b0c04a1583cc44"/><file name="ForbiddenOverwriteException.php" hash="e2a12d6760feb9f7c96d61e502f68b2c"/><file name="InvalidConfigurationException.php" hash="df898eea27890a50cb912e1dbb88f1b2"/><file name="InvalidDefinitionException.php" hash="aeb2ca3c7e035486a4ccebeac363125c"/><file name="InvalidTypeException.php" hash="4dc25832f90b656b88da8ac50789784a"/><file name="UnsetKeyException.php" hash="55c97aa4e81643f04c3abd943cc29a24"/></dir><file name="FloatNode.php" hash="7dfded8c4692130fc554b4078fb50f60"/><file name="IntegerNode.php" hash="9ccc83daaba13a6119645846977462c1"/><file name="NodeInterface.php" hash="a954948fdd3baf1683e082e9195425a3"/><file name="NumericNode.php" hash="e1f6089157b5651cbcab6b672f3d40d5"/><file name="Processor.php" hash="4d853174c3a8b201b3684fd8cdc5b768"/><file name="PrototypedArrayNode.php" hash="d9ac1d01a5991315767bcd5a61fb6901"/><file name="PrototypeNodeInterface.php" hash="ef44def01e8a4abfa4eaabdab44a3e1e"/><file name="ReferenceDumper.php" hash="52e870bf26dfc67c5cc508f35728877d"/><file name="ScalarNode.php" hash="f132a3acf024a2e7fdbcf311900ac6cf"/><file name="VariableNode.php" hash="07a8db1e3785053ea6f250ad6e9824f0"/></dir><dir name="Exception"><file name="FileLoaderImportCircularReferenceException.php" hash="b00d7fdeddee90ff6e91ffa0c0475e91"/><file name="FileLoaderLoadException.php" hash="c72ffdb8bb37fc40fb9c45d5bb7fea6c"/></dir><file name="FileLocator.php" hash="026635098bb87b0f3d9aa9db277372ea"/><file name="FileLocatorInterface.php" hash="19f6ce347d97710e6e204f6072080d7f"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><dir name="Loader"><file name="DelegatingLoader.php" hash="55f0bb12cab11e866f3b8dc990acfe44"/><file name="FileLoader.php" hash="a01a86e04ad1c7d6224080628c4e5cf5"/><file name="Loader.php" hash="ee72e1f5134967e385909103288f1f28"/><file name="LoaderInterface.php" hash="186d2f94152a27ccec52ef09dee3ff5b"/><file name="LoaderResolver.php" hash="fa0e5cf636fcb699349bc383ac1c58e4"/><file name="LoaderResolverInterface.php" hash="b5b88cd457cd2722513763f34d91181f"/></dir><file name="phpunit.xml.dist" hash="605cf1675c2d220c39f6c275855da588"/><file name="README.md" hash="80fb119edb21de39ff671d640fc7f381"/><dir name="Resource"><file name="DirectoryResource.php" hash="6920b0a4fcff8b6499ea3a12d2c6ac6c"/><file name="FileResource.php" hash="67e90b9f2144af1021feef854ed138f4"/><file name="ResourceInterface.php" hash="8f062b489e002da9b8c9fedde7686f53"/></dir><dir name="Util"><file name="XmlUtils.php" hash="58db59d5ad3b6664d4c664c1556f2755"/></dir></dir><dir name="DependencyInjection"><file name="Alias.php" hash="44391e2b8477a0c0e656857d5503de22"/><file name="CHANGELOG.md" hash="0316942313ddf17e8db0729defedc187"/><dir name="Compiler"><file name="AnalyzeServiceReferencesPass.php" hash="9bfb7acaf393c6670c82e019031778ff"/><file name="CheckCircularReferencesPass.php" hash="2b6f29700b6e8a7c12f4b1455f3f1627"/><file name="CheckDefinitionValidityPass.php" hash="2b373903ccf9d566a6927aed6c3c6650"/><file name="CheckExceptionOnInvalidReferenceBehaviorPass.php" hash="69b6713e0ee778e9b2cad497a9082151"/><file name="CheckReferenceValidityPass.php" hash="f676fc1ca0c1761af99fe7d2d9395078"/><file name="Compiler.php" hash="14bcd46172f5ac3e022e1d8f4fe1b08c"/><file name="CompilerPassInterface.php" hash="1292a88c9fadf67d117a659fb0bfd499"/><file name="DecoratorServicePass.php" hash="058412adc061c83531b229a0e588295f"/><file name="InlineServiceDefinitionsPass.php" hash="a48e5b2436c3f36a11d8482f64299c3c"/><file name="LoggingFormatter.php" hash="d18aa0d044d4725eaacd006c55b8e366"/><file name="MergeExtensionConfigurationPass.php" hash="8e74f04cb687ee9d86f90d0f1ddc2425"/><file name="PassConfig.php" hash="9173d4b56e1e0383fc40a5fc86077db1"/><file name="RemoveAbstractDefinitionsPass.php" hash="270937e454d381dae233d817e52069ec"/><file name="RemovePrivateAliasesPass.php" hash="77d93353f41f2505251e003a33993f31"/><file name="RemoveUnusedDefinitionsPass.php" hash="e8e05577d6086ebe2b4251e665919489"/><file name="RepeatablePassInterface.php" hash="bee7b2336c610435c89fdc854101b604"/><file name="RepeatedPass.php" hash="c61bdf647720f5b93874c9d123cd42aa"/><file name="ReplaceAliasByActualDefinitionPass.php" hash="0ece3d877daaabc8be38509d97752e2c"/><file name="ResolveDefinitionTemplatesPass.php" hash="28318b7955b5e5dce88315b7c008a1b1"/><file name="ResolveInvalidReferencesPass.php" hash="a4985c97e5b641806e57bceddcc5aa59"/><file name="ResolveParameterPlaceHoldersPass.php" hash="f33dfb27625ccb59d575de3fd0e3862f"/><file name="ResolveReferencesToAliasesPass.php" hash="29d8ba719ae7c1b2286083201664b4c5"/><file name="ServiceReferenceGraph.php" hash="ee56e0a4fcdc016088e61c2d9afbfa80"/><file name="ServiceReferenceGraphEdge.php" hash="0e3f4ba1f08962ec73803a78f7a8c3f2"/><file name="ServiceReferenceGraphNode.php" hash="1abd296cfabc9c0870be1b66ba79042c"/></dir><file name="composer.json" hash="7ba3739efbddb446a81690fd1d9519ec"/><file name="Container.php" hash="7982a39411a79b9a11f56ea0de561d9d"/><file name="ContainerAware.php" hash="4318c2ce4d160e6d183edce4928db696"/><file name="ContainerAwareInterface.php" hash="b4bbd2a21e9afe2cd25d26c37c54bfa9"/><file name="ContainerAwareTrait.php" hash="304f3c4322c235b332992d829d68e50b"/><file name="ContainerBuilder.php" hash="df6e25c35b097cef141ac6543aca445d"/><file name="ContainerInterface.php" hash="b8b780e8e9ed69da91d8324e8afb1ad2"/><file name="Definition.php" hash="a167e2ccb180b6ede4a943fd9368dfdf"/><file name="DefinitionDecorator.php" hash="61218eada886aac1aa01a3e5e6654d55"/><dir name="Dumper"><file name="Dumper.php" hash="3b295c276bb774433a45f1ee0339a299"/><file name="DumperInterface.php" hash="b9dd1589f9ffac4366fd4148d9e78ade"/><file name="GraphvizDumper.php" hash="826066b8e97448eeeffdebdb29b8c0bf"/><file name="PhpDumper.php" hash="798e7816b1662f6cbc4156e473a130d6"/><file name="XmlDumper.php" hash="e20198ac9362bb0b401dee15644761ef"/><file name="YamlDumper.php" hash="e7cb4a5dbcb8ec90dc8cc870f0e8454f"/></dir><dir name="Exception"><file name="BadMethodCallException.php" hash="7881aa76d06f7b9e4bd45dc85ae0d52e"/><file name="ExceptionInterface.php" hash="d79633abb224cffc0597be170aca74ea"/><file name="InactiveScopeException.php" hash="9022cb0f19ecaf1198318f0c178c5264"/><file name="InvalidArgumentException.php" hash="f1b09121e6850f5271d8bd3a6837efd3"/><file name="LogicException.php" hash="5b78b4f59982df23deaf0242aec3d4a9"/><file name="OutOfBoundsException.php" hash="792b235a45e9f4c0c7a7280580b1a2a3"/><file name="ParameterCircularReferenceException.php" hash="7b059f59730003361cceadd8965ad7c5"/><file name="ParameterNotFoundException.php" hash="6d83c2934f82a5ef7992b7081eaeffd7"/><file name="RuntimeException.php" hash="4e4d9c135fec917ae3fa78f25fbd7f85"/><file name="ScopeCrossingInjectionException.php" hash="0d73336fcf6534c59887f8b5687d1bd6"/><file name="ScopeWideningInjectionException.php" hash="719ca3a89890fcb941cca1b16a0fafef"/><file name="ServiceCircularReferenceException.php" hash="8ac40af4863b3c6cd9311cc1a29cf802"/><file name="ServiceNotFoundException.php" hash="9785d054cb75a079dcecc97fc77a8ebb"/></dir><file name="ExpressionLanguage.php" hash="3eebc81d79682bdbfe5ce43980d2ab92"/><dir name="Extension"><file name="ConfigurationExtensionInterface.php" hash="91e7049535b88272b10235d421b515ae"/><file name="Extension.php" hash="6d73372d9d8ed2d2b1de54a22027df78"/><file name="ExtensionInterface.php" hash="d9f5df364b37addf087305ce17842de9"/><file name="PrependExtensionInterface.php" hash="0eea6361b5960d4ff58646b75864898f"/></dir><file name="IntrospectableContainerInterface.php" hash="74080dc03d56e690a5f381f3e3942be9"/><dir name="LazyProxy"><dir name="Instantiator"><file name="InstantiatorInterface.php" hash="2195bb770e5851fa1ebd680906ae112b"/><file name="RealServiceInstantiator.php" hash="f89b9132dd5853375551eb8347e8e51f"/></dir><dir name="PhpDumper"><file name="DumperInterface.php" hash="0ff96280df12f153aee121649615763f"/><file name="NullDumper.php" hash="55c3aaf28d4107dd40fb2905ce91c692"/></dir></dir><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><dir name="Loader"><file name="ClosureLoader.php" hash="e435524e4fe5c3bb374a9d89dcc4abcc"/><file name="FileLoader.php" hash="4327841db6a3761ad17e54553178cf28"/><file name="IniFileLoader.php" hash="7ea10963772ecf6f0c18fb04faead289"/><file name="PhpFileLoader.php" hash="2cd10bb9323270c20e818347691d13d0"/><dir name="schema"><dir name="dic"><dir name="services"><file name="services-1.0.xsd" hash="8fdc942dfd53dfae77fef5e6fe565dd8"/></dir></dir></dir><file name="XmlFileLoader.php" hash="02d6d28b68190ea6436e5700339f9dd2"/><file name="YamlFileLoader.php" hash="b20857baf643ec4ddf789dc7ff7ddfe3"/></dir><file name="Parameter.php" hash="7b2faf5e73ce778720b67e94cf6d2bba"/><dir name="ParameterBag"><file name="FrozenParameterBag.php" hash="7a5a470e2d4ae055483c4370995ed030"/><file name="ParameterBag.php" hash="6af96ff7fe8306a013d572a0b070b72b"/><file name="ParameterBagInterface.php" hash="12a975df5c61d43b943486725f6a6c53"/></dir><file name="phpunit.xml.dist" hash="feee5228ed5181328e2df056380ae84c"/><file name="README.md" hash="4a37dd76abb0d970c3c58030be21a993"/><file name="Reference.php" hash="b3dc1acee42f7a69673292c296c6417d"/><file name="Scope.php" hash="d464293058a891542cef77f9e14e18b4"/><file name="ScopeInterface.php" hash="b990c20640f9a64135bcf0369f4e22a6"/><file name="SimpleXMLElement.php" hash="19d292e6f2f51e472d2c9437c6e032a1"/><file name="TaggedContainerInterface.php" hash="3c47bde46b89617dcd69f4ebf5056865"/><file name="Variable.php" hash="ed13f0022bf056748456b80c702dbe21"/></dir><dir name="Filesystem"><file name="CHANGELOG.md" hash="1537577578897cb0d5702f346fae3c82"/><file name="composer.json" hash="d685adc2374ea7ec68ebb150e6e69d7c"/><dir name="Exception"><file name="ExceptionInterface.php" hash="11a7d451ae71b6aeba9e1236a53865f0"/><file name="FileNotFoundException.php" hash="8a8b119b88f20a5a3078e051a308f741"/><file name="IOException.php" hash="79569770a034723c06472d45b57d74da"/><file name="IOExceptionInterface.php" hash="9ce81ced7d137497a4aa3639b2c445fe"/></dir><file name="Filesystem.php" hash="e244fd96218ae0654aabde5288049d12"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><file name="phpunit.xml.dist" hash="e4529d07bfbb4b93cf7115435a20de00"/><file name="README.md" hash="e499eea57ed2f13503b64641c0890418"/></dir></dir></dir></dir></target></contents></package>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>Bitpay_Core</name><version>2.1.1</version><stability>stable</stability><license uri="https://github.com/bitpay/magento-plugin/blob/master/LICENSE">MIT</license><channel>community</channel><extends/><summary/><description/><notes/><authors><author><name>Integrations Team</name><user>BitPayInc</user><email>support@bitpay.com</email></author></authors><date>2014-12-11</date><time>17:52:24</time><compatible/><dependencies/><required php_min="5.4.0" php_max="6.0.0">php</required><extensions><name>openssl<min/><max/></name><name>mcrypt<min/><max/></name></extensions><contents><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="form"><file name="bitpay.phtml" hash="e672ef8c02b000293cb04febfdbb3f26"/></dir><file name="iframe.phtml" hash="fcff11f0d6090b5dacb839257c40802a"/><dir name="info"><file name="default.phtml" hash="8ccc37fb65b7ffd9bb93bfffaed4460c"/></dir><file name="json.phtml" hash="cc43e25d0445d5ba15b448ba946dabfd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="info"><file name="default.phtml" hash="647029fe9f25cd398346b98a39526a5e"/></dir><dir name="system"><dir name="config"><dir name="field"><file name="header.phtml" hash="8f82364aa99736ef33499aa1162c0176"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Bitpay_Core.xml" hash="d59f55b764493144419eccae1b52eb1d"/></dir></dir><dir name="locale"><dir name="en_US"><file name="Bitpay_Core.csv" hash="1f6198bdeee3f77f87c36b4e09b45be2"/></dir></dir><dir name="code"><dir name="community"><dir name="Bitpay"><dir name="Core"><dir name="controllers"><file name="IpnController.php" hash="f53cb748646056ac13fa0542dcbda450"/><file name="IndexController.php" hash="e91b49bf2141492d1b9b12e03723ed04"/></dir><dir name="Block"><dir name="Form"><file name="Bitpay.php" hash="a720aec5391c0c9cfa9a84239b4d0165"/></dir><file name="Iframe.php" hash="1adec7fac67f9e5448536bf019fc0d51"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Header.php" hash="115fbc1b966ecc9ad52a2afaf0170947"/><file name="Extension.php" hash="80b5a2837b0077cc1d349a7a1a532ef8"/></dir></dir></dir></dir></dir><file name="Info.php" hash="e08b38ba2bc75441fc485f98ebea76b9"/></dir><file name="README.md" hash="e33d856153a0d0b501e5e17a926cc59c"/><dir name="etc"><file name="adminhtml.xml" hash="a3d6e1c3fb81e271a85260aba4f9f797"/><file name="config.xml" hash="5d131d785a389615421b279796ac2aa3"/><file name="system.xml" hash="177a038d50021efd72ca536968989a9f"/></dir><file name="LICENSE" hash="c443b0598a4770735bb68838f7d563a3"/><dir name="sql"><dir name="bitpay_setup"><file name="mysql4-install-2.0.0.php" hash="dbc4ded8c37cf1fdc798fe24f259ae1e"/></dir></dir><dir name="Model"><file name="TransactionSpeed.php" hash="14f2bec5848c3be13f1d01420dbf1108"/><file name="Network.php" hash="f5b26b26c9e37e8c0afa017c61aa02a2"/><file name="Status.php" hash="36c5b681659bd5a44bd2a7f8fdf86eef"/><dir name="Mysql4"><dir name="Ipn"><file name="Collection.php" hash="5731cf9f07a7542a5fb7c357713b1415"/></dir><file name="Invoice.php" hash="09eef9e9eb8fd73a0e0991f0b06ed8f7"/><dir name="Invoice"><file name="Collection.php" hash="9f133b3a850ed81ee2b10afddaa8f192"/></dir><file name="Ipn.php" hash="c4d06de91130340c90e2b823d3221e98"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b7bb6c723c948626da6a2af91ca6ce1b"/></dir></dir><file name="Observer.php" hash="06e346a10c702ccbac7e6c694f3680c2"/><file name="Invoice.php" hash="54a93e232a7ffbb75cc294d06b15b31e"/><dir name="Method"><file name="Bitcoin.php" hash="b84637450f3f3f7947efba732218cb35"/></dir><file name="Ipn.php" hash="10cdfe78efea3eb9e6776b35f48acc9d"/><dir name="Config"><file name="PairingCode.php" hash="4134601160d1351d3ef37175094e5e44"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e954c8dd36a10f6adb098dab3c0fa70c"/></dir></dir></dir></dir></dir></dir><dir name="lib"><dir name="Bitpay"><file name="Token.php" hash="8440fcdcbf7d20d8bda3e7ee7e6ad73f"/><dir name="Client"><file name="Request.php" hash="fbdd615774ab606df4062b3874c03496"/><dir name="Adapter"><file name="ca-bundle.crt" hash="9025ca14554240fc05c4e919ae3f8923"/><file name="AdapterInterface.php" hash="b85307a1bd110c08141a7eb29b305973"/><file name="CurlAdapter.php" hash="bbaa12cd6f55dc11f8592be6afca2e1b"/></dir><file name="Response.php" hash="195796fb21d235e1348caca2a990910d"/><file name="ResponseInterface.php" hash="1d53f3b84efc12e370c72ac7be0e8211"/><file name="RequestInterface.php" hash="1a77530dddf63f24a78ce488c401f499"/><file name="ClientInterface.php" hash="365b7a595eb15705bd4bd88273d10293"/><file name="Client.php" hash="958f19ff3a204c8b7f0731249c6c7fbe"/></dir><dir name="Storage"><file name="EncryptedFilesystemStorage.php" hash="e42a3c81bd19393ae78c10fed77dfb75"/><file name="MagentoStorage.php" hash="3066b70d4ecad0da42efba88ede524aa"/><file name="StorageInterface.php" hash="bb136e52d599fdb59739f32d027a1602"/><file name="FilesystemStorage.php" hash="673528691f5b999fc5481ff112140dfe"/><file name="MockStorage.php" hash="2570dbf74083bb8a7117595a6c4aefb4"/></dir><file name="AccessTokenInterface.php" hash="57b7b403c1644dba10474d67b3b781ca"/><file name="Currency.php" hash="bcb762551a0dcbcb5aa8ce013e83eedc"/><file name="KeyInterface.php" hash="30253c1e42ee7b452bbb0a7451c88685"/><file name="ItemInterface.php" hash="94e9fc64fafde84425cb30f73b96dc48"/><file name="PointInterface.php" hash="2a8fce4bbc8e84e221563c27ce7b57ce"/><file name="Point.php" hash="605d50d4b9890f2e1a3120fb5b0c50d2"/><dir name="Util"><file name="CurveParameterInterface.php" hash="72ca86056b4abfebbcfec87037478db7"/><file name="Base58.php" hash="544526f4f89848bfb61f7bfcae348af6"/><file name="Fingerprint.php" hash="0dde9668583a04391a2faf99d4b72914"/><file name="SecureRandom.php" hash="9e699a6e383cb439a604f6e6e1837833"/><file name="Util.php" hash="50d3eaeb02b2ad1652ebb15db1e68563"/><file name="Error.php" hash="d4e4ba021b73f94467793043db14cc93"/><file name="Secp256k1.php" hash="84d9a363e0f185200664c712832b8759"/></dir><file name="PayoutInstruction.php" hash="ef96db181023671aecac43950b709001"/><file name="Bitpay.php" hash="50120aeed758c3acb3bebfc4b202f168"/><file name="ApplicationInterface.php" hash="8721d3fe85f80dbf71ead7df93eb3f82"/><file name="InvoiceInterface.php" hash="1e280dbf85d96ad462b47c087fbe6d9f"/><file name="Payout.php" hash="ca73c1f0a81a642ed0a6fed6fd1002c1"/><file name="SinKey.php" hash="f126c1344247e87aa5c108d57f0ca354"/><file name="UserInterface.php" hash="7714dd84ab21eac77736a80d9e19f7c0"/><file name="Bill.php" hash="d41fc149de27e026546cda7db6c060cb"/><file name="Application.php" hash="832324bd621f53ac57d5d4d04ecf4e1c"/><dir name="Math"><file name="EngineInterface.php" hash="a0de5260325608e0911d4128fe3e52c2"/><file name="BcEngine.php" hash="cf0ccc0f167fe563d06fa9bd5d94cc7d"/><file name="Math.php" hash="98fb61ecc9379c625c9b970df7e0ac54"/><file name="GmpEngine.php" hash="8d7dc45a36229dc49dbf4cc9c2362286"/></dir><file name="BillInterface.php" hash="4d4f7c1e6b8ea9421a5e6651c7bd0654"/><file name="User.php" hash="061f9f4dcff8d3090cb358ae1b87e259"/><file name="Buyer.php" hash="aa43ea51f57b00568e3827d1e7ba2025"/><file name="PrivateKey.php" hash="d3e6ec3b5c91eb9627509365b26fb744"/><file name="Autoloader.php" hash="109400039e04ef345ac879a944fe45ba"/><file name="PublicKey.php" hash="dca40e9a5e8679f21d143d205cd2c389"/><dir name="Crypto"><file name="McryptExtension.php" hash="160e7e94e6ec50b255742bb5366dea29"/><file name="HashExtension.php" hash="62f5d49ddafbc7e7ca19aaaea76830ba"/><file name="CryptoInterface.php" hash="13ac34aa5f26fe5640c037511c7789f4"/><file name="OpenSSLExtension.php" hash="e8393638871fc2605dbd6ec58e7a7564"/></dir><file name="TokenInterface.php" hash="a0da969c86e363b201cc48c0a228ebed"/><file name="BuyerInterface.php" hash="749f9fc623ff65e5bce296a5b4dfdbbc"/><file name="PayoutTransaction.php" hash="80ed69aae8134c32caddbfd8e17a85e3"/><file name="Invoice.php" hash="f93959d593e54c30f01ccae85f521168"/><dir name="Network"><file name="Customnet.php" hash="d2af606a4a63babf0a08d0e8abac72f5"/><file name="Livenet.php" hash="7107f34a87978e78588482e5b1f868d4"/><file name="NetworkAwareInterface.php" hash="1d1f87d25469a8ce2d0f1f2eaaf03ef1"/><file name="NetworkInterface.php" hash="998b026f803b4d99daec03b876d2d132"/><file name="NetworkAware.php" hash="d92aad1b38105078cd5055b295014a11"/><file name="Testnet.php" hash="98b315759b32549c558e143e50a365ad"/></dir><file name="PayoutTransactionInterface.php" hash="43a42bf47814d44b431328b5e70731a4"/><file name="Key.php" hash="0c6bdce34e7b3a650914393c9da5c99d"/><file name="CurrencyInterface.php" hash="561ff6c529ab29813e751999e70fb166"/><file name="KeyManager.php" hash="ad48cd3f5ddba0c47606659a32e85e7b"/><dir name="DependencyInjection"><dir name="Loader"><file name="ArrayLoader.php" hash="5176febbc2ff9bf1646f623dccd54cd7"/></dir><file name="BitpayExtension.php" hash="fc361f93a85be0b066dd1a60bb5d4a15"/><file name="services.xml" hash="cda4e79bf0e6f6821e5b4c2e16c240cb"/></dir><file name="PayoutInterface.php" hash="5fe5e08a395d2179e64baa3364ff512c"/><file name="PayoutInstructionInterface.php" hash="5d6c51b0b6a980d84bfad21ecaecf92c"/><file name="Item.php" hash="2f320697b5e4b93697d43e9b1ef0dfd7"/><file name="AccessToken.php" hash="dd33ed2e4802be42097c3c09e0d12b63"/><dir name="Config"><file name="Configuration.php" hash="7cb0441f0dce52bab9f30f0cc3dee2fa"/></dir></dir><dir name="Symfony"><dir name="Component"><dir name="Filesystem"><file name="Filesystem.php" hash="edb49d36e815cf4ce917d94ec97b4f0c"/><file name="composer.json" hash="d685adc2374ea7ec68ebb150e6e69d7c"/><file name="CHANGELOG.md" hash="1537577578897cb0d5702f346fae3c82"/><file name="phpunit.xml.dist" hash="e4529d07bfbb4b93cf7115435a20de00"/><dir name="Exception"><file name="IOException.php" hash="79569770a034723c06472d45b57d74da"/><file name="IOExceptionInterface.php" hash="9ce81ced7d137497a4aa3639b2c445fe"/><file name="FileNotFoundException.php" hash="8a8b119b88f20a5a3078e051a308f741"/><file name="ExceptionInterface.php" hash="11a7d451ae71b6aeba9e1236a53865f0"/></dir><file name="README.md" hash="e499eea57ed2f13503b64641c0890418"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/></dir><dir name="DependencyInjection"><file name="Variable.php" hash="ed13f0022bf056748456b80c702dbe21"/><file name="composer.json" hash="7ba3739efbddb446a81690fd1d9519ec"/><dir name="Extension"><file name="PrependExtensionInterface.php" hash="0eea6361b5960d4ff58646b75864898f"/><file name="Extension.php" hash="ae958d857ad986bfa7ac7280f93309f4"/><file name="ConfigurationExtensionInterface.php" hash="91e7049535b88272b10235d421b515ae"/><file name="ExtensionInterface.php" hash="d9f5df364b37addf087305ce17842de9"/></dir><file name="Container.php" hash="55e374251b9a6b77f006be11afedd186"/><file name="ContainerInterface.php" hash="a0757378d7d6af1a83b39353fb6e0433"/><file name="TaggedContainerInterface.php" hash="3c47bde46b89617dcd69f4ebf5056865"/><dir name="Dumper"><file name="PhpDumper.php" hash="631503f37f14db170e56f74c86d4e136"/><file name="YamlDumper.php" hash="afce5af8be425e1a636faca889705489"/><file name="XmlDumper.php" hash="e20198ac9362bb0b401dee15644761ef"/><file name="GraphvizDumper.php" hash="1a322cf7994e091ee5f4fbc5dee172ac"/><file name="Dumper.php" hash="3b295c276bb774433a45f1ee0339a299"/><file name="DumperInterface.php" hash="b9dd1589f9ffac4366fd4148d9e78ade"/></dir><file name="CHANGELOG.md" hash="0316942313ddf17e8db0729defedc187"/><file name="ExpressionLanguage.php" hash="3eebc81d79682bdbfe5ce43980d2ab92"/><file name="DefinitionDecorator.php" hash="350c7c88d50274205f06db8c6363d944"/><file name="ContainerBuilder.php" hash="3b1cb5b5b565b32f68fcade60d973f26"/><dir name="Loader"><file name="FileLoader.php" hash="4327841db6a3761ad17e54553178cf28"/><file name="ClosureLoader.php" hash="e435524e4fe5c3bb374a9d89dcc4abcc"/><dir name="schema"><dir name="dic"><dir name="services"><file name="services-1.0.xsd" hash="8fdc942dfd53dfae77fef5e6fe565dd8"/></dir></dir></dir><file name="IniFileLoader.php" hash="7ea10963772ecf6f0c18fb04faead289"/><file name="XmlFileLoader.php" hash="02d6d28b68190ea6436e5700339f9dd2"/><file name="YamlFileLoader.php" hash="b20857baf643ec4ddf789dc7ff7ddfe3"/><file name="PhpFileLoader.php" hash="2cd10bb9323270c20e818347691d13d0"/></dir><file name="Parameter.php" hash="7b2faf5e73ce778720b67e94cf6d2bba"/><file name="phpunit.xml.dist" hash="feee5228ed5181328e2df056380ae84c"/><dir name="ParameterBag"><file name="ParameterBagInterface.php" hash="ef0511892d36e002bad1b86affec9b0a"/><file name="ParameterBag.php" hash="870224c3721e05e6617703e0b3ac200d"/><file name="FrozenParameterBag.php" hash="7a5a470e2d4ae055483c4370995ed030"/></dir><file name="Alias.php" hash="08d0c245ef3762be097338102e96debf"/><dir name="Exception"><file name="ParameterCircularReferenceException.php" hash="7b059f59730003361cceadd8965ad7c5"/><file name="OutOfBoundsException.php" hash="792b235a45e9f4c0c7a7280580b1a2a3"/><file name="InvalidArgumentException.php" hash="f1b09121e6850f5271d8bd3a6837efd3"/><file name="LogicException.php" hash="5b78b4f59982df23deaf0242aec3d4a9"/><file name="ScopeWideningInjectionException.php" hash="719ca3a89890fcb941cca1b16a0fafef"/><file name="InactiveScopeException.php" hash="9022cb0f19ecaf1198318f0c178c5264"/><file name="ServiceCircularReferenceException.php" hash="8ac40af4863b3c6cd9311cc1a29cf802"/><file name="ParameterNotFoundException.php" hash="6d83c2934f82a5ef7992b7081eaeffd7"/><file name="RuntimeException.php" hash="4e4d9c135fec917ae3fa78f25fbd7f85"/><file name="BadMethodCallException.php" hash="7881aa76d06f7b9e4bd45dc85ae0d52e"/><file name="ScopeCrossingInjectionException.php" hash="0d73336fcf6534c59887f8b5687d1bd6"/><file name="ServiceNotFoundException.php" hash="9785d054cb75a079dcecc97fc77a8ebb"/><file name="ExceptionInterface.php" hash="d79633abb224cffc0597be170aca74ea"/></dir><file name="ContainerAwareTrait.php" hash="304f3c4322c235b332992d829d68e50b"/><file name="README.md" hash="4a37dd76abb0d970c3c58030be21a993"/><file name="IntrospectableContainerInterface.php" hash="7577ca734861035a9f992c5d1a6be2b4"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><dir name="LazyProxy"><dir name="PhpDumper"><file name="NullDumper.php" hash="55c3aaf28d4107dd40fb2905ce91c692"/><file name="DumperInterface.php" hash="0ff96280df12f153aee121649615763f"/></dir><dir name="Instantiator"><file name="InstantiatorInterface.php" hash="2195bb770e5851fa1ebd680906ae112b"/><file name="RealServiceInstantiator.php" hash="f89b9132dd5853375551eb8347e8e51f"/></dir></dir><file name="ContainerAwareInterface.php" hash="b4bbd2a21e9afe2cd25d26c37c54bfa9"/><dir name="Compiler"><file name="RepeatedPass.php" hash="c61bdf647720f5b93874c9d123cd42aa"/><file name="CheckDefinitionValidityPass.php" hash="2b373903ccf9d566a6927aed6c3c6650"/><file name="PassConfig.php" hash="9173d4b56e1e0383fc40a5fc86077db1"/><file name="RemoveAbstractDefinitionsPass.php" hash="270937e454d381dae233d817e52069ec"/><file name="ResolveDefinitionTemplatesPass.php" hash="28318b7955b5e5dce88315b7c008a1b1"/><file name="Compiler.php" hash="14bcd46172f5ac3e022e1d8f4fe1b08c"/><file name="RepeatablePassInterface.php" hash="bee7b2336c610435c89fdc854101b604"/><file name="DecoratorServicePass.php" hash="058412adc061c83531b229a0e588295f"/><file name="CompilerPassInterface.php" hash="1292a88c9fadf67d117a659fb0bfd499"/><file name="ServiceReferenceGraph.php" hash="ee56e0a4fcdc016088e61c2d9afbfa80"/><file name="LoggingFormatter.php" hash="d18aa0d044d4725eaacd006c55b8e366"/><file name="ServiceReferenceGraphNode.php" hash="bed96bf3e9ad54306a37bbc45e884f2d"/><file name="CheckExceptionOnInvalidReferenceBehaviorPass.php" hash="69b6713e0ee778e9b2cad497a9082151"/><file name="RemoveUnusedDefinitionsPass.php" hash="e8e05577d6086ebe2b4251e665919489"/><file name="ServiceReferenceGraphEdge.php" hash="0e3f4ba1f08962ec73803a78f7a8c3f2"/><file name="ResolveParameterPlaceHoldersPass.php" hash="f33dfb27625ccb59d575de3fd0e3862f"/><file name="AnalyzeServiceReferencesPass.php" hash="77d48a44db3ac5428d50ec8ebf228cb3"/><file name="CheckCircularReferencesPass.php" hash="2b6f29700b6e8a7c12f4b1455f3f1627"/><file name="ResolveReferencesToAliasesPass.php" hash="29d8ba719ae7c1b2286083201664b4c5"/><file name="ResolveInvalidReferencesPass.php" hash="499e4e7357d1e565d334b146f3e05863"/><file name="MergeExtensionConfigurationPass.php" hash="8e74f04cb687ee9d86f90d0f1ddc2425"/><file name="CheckReferenceValidityPass.php" hash="f676fc1ca0c1761af99fe7d2d9395078"/><file name="ReplaceAliasByActualDefinitionPass.php" hash="0ece3d877daaabc8be38509d97752e2c"/><file name="InlineServiceDefinitionsPass.php" hash="eab7d43cb04a3252d731a5e8527eefc5"/><file name="RemovePrivateAliasesPass.php" hash="77d93353f41f2505251e003a33993f31"/></dir><file name="Scope.php" hash="d464293058a891542cef77f9e14e18b4"/><file name="ContainerAware.php" hash="4318c2ce4d160e6d183edce4928db696"/><file name="ScopeInterface.php" hash="b990c20640f9a64135bcf0369f4e22a6"/><file name="Reference.php" hash="7367f27d64a597705da4de9f3e91d2d4"/><file name="SimpleXMLElement.php" hash="41fe9a267150ceee2ac80c11156b863b"/><file name="Definition.php" hash="74311dc33c39183396e981fadebe41d8"/></dir><dir name="Config"><file name="FileLocatorInterface.php" hash="19f6ce347d97710e6e204f6072080d7f"/><file name="composer.json" hash="f811d1f0df9a5b256c16a7029dae9513"/><dir name="Util"><file name="XmlUtils.php" hash="58db59d5ad3b6664d4c664c1556f2755"/></dir><file name="CHANGELOG.md" hash="2e855ecea3b2fd176fcde9dcbee078b4"/><dir name="Loader"><file name="LoaderResolver.php" hash="fa0e5cf636fcb699349bc383ac1c58e4"/><file name="Loader.php" hash="ee72e1f5134967e385909103288f1f28"/><file name="LoaderInterface.php" hash="186d2f94152a27ccec52ef09dee3ff5b"/><file name="FileLoader.php" hash="5cf3b0ea85d4ec9c88347f2836e6829a"/><file name="LoaderResolverInterface.php" hash="b5b88cd457cd2722513763f34d91181f"/><file name="DelegatingLoader.php" hash="55f0bb12cab11e866f3b8dc990acfe44"/></dir><file name="FileLocator.php" hash="026635098bb87b0f3d9aa9db277372ea"/><file name="phpunit.xml.dist" hash="605cf1675c2d220c39f6c275855da588"/><dir name="Exception"><file name="FileLoaderImportCircularReferenceException.php" hash="b00d7fdeddee90ff6e91ffa0c0475e91"/><file name="FileLoaderLoadException.php" hash="c72ffdb8bb37fc40fb9c45d5bb7fea6c"/></dir><file name="README.md" hash="80fb119edb21de39ff671d640fc7f381"/><dir name="Definition"><file name="ConfigurationInterface.php" hash="3c993b6405debf926234927327e1540e"/><file name="BooleanNode.php" hash="35e38c75b51cdff67f3098103a791e44"/><file name="IntegerNode.php" hash="9ccc83daaba13a6119645846977462c1"/><file name="PrototypedArrayNode.php" hash="3d0baac9726afc546668ede050877690"/><dir name="Dumper"><file name="YamlReferenceDumper.php" hash="b3872d7001d6e2720a867a2bf09af371"/><file name="XmlReferenceDumper.php" hash="ff8ec25bb68fe90df74a0ad5ce81acf6"/></dir><file name="VariableNode.php" hash="3e4b560662b4c12afc027e67a7ccf286"/><file name="BaseNode.php" hash="63e11f9397fbab26d89c667d174f60c9"/><file name="ReferenceDumper.php" hash="52e870bf26dfc67c5cc508f35728877d"/><file name="NumericNode.php" hash="e1f6089157b5651cbcab6b672f3d40d5"/><dir name="Exception"><file name="DuplicateKeyException.php" hash="ede2ab4177afff995069bc54c4517f9e"/><file name="Exception.php" hash="a7eb222da39a7eefc7b0c04a1583cc44"/><file name="InvalidTypeException.php" hash="4dc25832f90b656b88da8ac50789784a"/><file name="InvalidConfigurationException.php" hash="df898eea27890a50cb912e1dbb88f1b2"/><file name="ForbiddenOverwriteException.php" hash="e2a12d6760feb9f7c96d61e502f68b2c"/><file name="UnsetKeyException.php" hash="55c97aa4e81643f04c3abd943cc29a24"/><file name="InvalidDefinitionException.php" hash="aeb2ca3c7e035486a4ccebeac363125c"/></dir><file name="PrototypeNodeInterface.php" hash="ef44def01e8a4abfa4eaabdab44a3e1e"/><file name="ScalarNode.php" hash="f132a3acf024a2e7fdbcf311900ac6cf"/><file name="ArrayNode.php" hash="684defea39e4aa1cd112eb9b81bc11cb"/><file name="EnumNode.php" hash="4718c796e11ef0403e41dce26b7224ea"/><file name="NodeInterface.php" hash="d4d5849e645f20a1da8585fc117c865b"/><dir name="Builder"><file name="ExprBuilder.php" hash="4612723b84cd2729dd94020f1412539a"/><file name="FloatNodeDefinition.php" hash="ea6a82bed9a7bfe2f7c7e4bded4ba25e"/><file name="ParentNodeDefinitionInterface.php" hash="ac0a6d2f8ae048f365844d761db049db"/><file name="EnumNodeDefinition.php" hash="2935ae381b785ced6f6ec1eded9a9ce0"/><file name="TreeBuilder.php" hash="48f136a2fe26ef3b84f2f4e785dafdca"/><file name="MergeBuilder.php" hash="5057c1e1846430d716f3bcb082a1f36a"/><file name="NodeBuilder.php" hash="11c167f7db0435c311dfab6b90960194"/><file name="NodeParentInterface.php" hash="511a0150b959a7eab00cbf0fed174c0a"/><file name="NumericNodeDefinition.php" hash="5432ea41087e28803130a9cbe74e4356"/><file name="IntegerNodeDefinition.php" hash="0de24b6c3b0846189e0e7140340e4c20"/><file name="NodeDefinition.php" hash="9b97f7f23dc5c957e7ab16bcc6defd6c"/><file name="NormalizationBuilder.php" hash="f03726ad2acc69648e3f4c92c3436b63"/><file name="ValidationBuilder.php" hash="8c0ab61f8ce4e8a0b95fae338d07289d"/><file name="ScalarNodeDefinition.php" hash="d9fa4186f4448c3cad8152bb9b08a10d"/><file name="BooleanNodeDefinition.php" hash="3241b942a983dc282827a75fe4bbe666"/><file name="VariableNodeDefinition.php" hash="b2d76649ce3c123cbd3488fd7b449b71"/><file name="ArrayNodeDefinition.php" hash="21e3f5e637dd4a2bc46cda050c6e2245"/></dir><file name="Processor.php" hash="4d853174c3a8b201b3684fd8cdc5b768"/><file name="FloatNode.php" hash="7dfded8c4692130fc554b4078fb50f60"/></dir><dir name="Resource"><file name="ResourceInterface.php" hash="8f062b489e002da9b8c9fedde7686f53"/><file name="FileResource.php" hash="67e90b9f2144af1021feef854ed138f4"/><file name="DirectoryResource.php" hash="6920b0a4fcff8b6499ea3a12d2c6ac6c"/></dir><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><file name="ConfigCache.php" hash="42fe66cd64cd32ea55cefd056c7a1b67"/></dir></dir></dir></dir></target></contents></package>
|