Skip to content

Commit c219b9b

Browse files
committed
Merge pull request #10 from c88lopez/master
Adding composer install availability feature
2 parents a4aaf9a + 8455c01 commit c219b9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1755
-740
lines changed

.gitignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### vim template
3+
[._]*.s[a-w][a-z]
4+
[._]s[a-w][a-z]
5+
*.un~
6+
Session.vim
7+
.netrwhist
8+
*~
9+
10+
11+
### JetBrains template
12+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
13+
14+
*.iml
15+
16+
## Directory-based project format:
17+
.idea/
18+
# if you remove the above rule, at least ignore the following:
19+
20+
# User-specific stuff:
21+
# .idea/workspace.xml
22+
# .idea/tasks.xml
23+
# .idea/dictionaries
24+
25+
# Sensitive or high-churn files:
26+
# .idea/dataSources.ids
27+
# .idea/dataSources.xml
28+
# .idea/sqlDataSources.xml
29+
# .idea/dynamic.xml
30+
# .idea/uiDesigner.xml
31+
32+
# Gradle:
33+
# .idea/gradle.xml
34+
# .idea/libraries
35+
36+
# Mongo Explorer plugin:
37+
# .idea/mongoSettings.xml
38+
39+
## File-based project format:
40+
*.ipr
41+
*.iws
42+
43+
## Plugin-specific files:
44+
45+
# IntelliJ
46+
out/
47+
48+
# mpeltonen/sbt-idea plugin
49+
.idea_modules/
50+
51+
# JIRA plugin
52+
atlassian-ide-plugin.xml
53+
54+
# Crashlytics plugin (for Android Studio and IntelliJ)
55+
com_crashlytics_export_strings.xml
56+
crashlytics.properties
57+
crashlytics-build.properties
58+
59+
60+
### SublimeText template
61+
# cache files for sublime text
62+
*.tmlanguage.cache
63+
*.tmPreferences.cache
64+
*.stTheme.cache
65+
66+
# workspace files are user-specific
67+
*.sublime-workspace
68+
69+
# project files should be checked into the repository, unless a significant
70+
# proportion of contributors will probably not be using SublimeText
71+
# *.sublime-project
72+
73+
# sftp configuration file
74+
sftp-config.json
75+
76+
77+
### Composer stuffs
78+
vendor/
79+
composer.lock

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2-
"name": "blockchain/blockchain",
2+
"name": "Blockchain/Blockchain",
33
"description": "Blockchain API client library",
44
"keywords": ["bitcoin", "blockchain"],
55
"homepage": "https://github.com/blockchain/api-v1-client-php",
66
"license": "MIT",
77
"autoload": {
8-
"psr-4": { "": "lib/" }
8+
"psr-4": {
9+
"Blockchain\\": "src/"
10+
}
911
},
1012
"require": {
1113
"php": ">=5.3.0",

example/create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
$wallet = $Blockchain->Create->create('weakPassword01!');
1313

example/explorer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
// List all blocks at a certain height
1313
// var_dump($Blockchain->Explorer->getBlocksAtHeight(1));

example/pushtx.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
// The raw transaction hex for a valid transaction, will not
1313
// send though, since it's an existing transaction

example/rates.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
<body>
1616
<pre><?php
1717

18-
require_once('../lib/Blockchain.php');
18+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
1919

2020
$api_code = null;
2121
if(file_exists('code.txt')) {
2222
$api_code = trim(file_get_contents('code.txt'));
2323
}
2424

25-
$Blockchain = new Blockchain($api_code);
25+
$Blockchain = new \Blockchain\Blockchain($api_code);
2626

2727
// Convert a fiat amount to BTC
2828
$amount = $Blockchain->Rates->toBTC(500, 'USD');

example/receive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
// My receive address
1313
$destination = '1Gr6Y7ZJEmZnbDwopWKJKRTri8fBymPDfg';

example/stats.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
// Get Statistics
1313
$stats = $Blockchain->Stats->get();

example/wallet.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<pre><?php
22

3-
require_once('../lib/Blockchain.php');
3+
require_once(dirname(__DIR__) . '/vendor/autoload.php');
44

55
$api_code = null;
66
if(file_exists('code.txt')) {
77
$api_code = trim(file_get_contents('code.txt'));
88
}
99

10-
$Blockchain = new Blockchain($api_code);
10+
$Blockchain = new \Blockchain\Blockchain($api_code);
1111

1212
$wallet_guid = null;
1313
$wallet_pass = null;
@@ -34,7 +34,7 @@
3434
try {
3535
// Uncomment to send
3636
// var_dump($Blockchain->Wallet->send($address, "0.001"));
37-
} catch (Blockchain_ApiError $e) {
37+
} catch (\Blockchain\Exception\ApiError $e) {
3838
echo $e->getMessage() . '<br />';
3939
}
4040

lib/Blockchain.php

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)