File tree Expand file tree Collapse file tree 7 files changed +14
-16
lines changed Expand file tree Collapse file tree 7 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- require_once (' ../src/Blockchain .php ' );
3
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
4
4
5
5
$ api_code = null ;
6
6
if (file_exists ('code.txt ' )) {
7
7
$ api_code = trim (file_get_contents ('code.txt ' ));
8
8
}
9
9
10
- $ Blockchain = new Blockchain ($ api_code );
10
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
11
11
12
12
$ wallet = $ Blockchain ->Create ->create ('weakPassword01! ' );
13
13
Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- $ sRootPath = dirname (__DIR__ );
4
- var_dump ($ sRootPath );
5
- require_once ($ sRootPath . '/vendor/autoload.php ' );
3
+ require_once (dirname (__DIR__ ) . '/vendor/autoload.php ' );
6
4
7
5
$ api_code = null ;
8
6
if (file_exists ('code.txt ' )) {
Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- require_once (' ../src/Blockchain .php ' );
3
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
4
4
5
5
$ api_code = null ;
6
6
if (file_exists ('code.txt ' )) {
7
7
$ api_code = trim (file_get_contents ('code.txt ' ));
8
8
}
9
9
10
- $ Blockchain = new Blockchain ($ api_code );
10
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
11
11
12
12
// The raw transaction hex for a valid transaction, will not
13
13
// send though, since it's an existing transaction
Original file line number Diff line number Diff line change 15
15
<body>
16
16
<pre><?php
17
17
18
- require_once (' ../src/Blockchain .php ' );
18
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
19
19
20
20
$ api_code = null ;
21
21
if (file_exists ('code.txt ' )) {
22
22
$ api_code = trim (file_get_contents ('code.txt ' ));
23
23
}
24
24
25
- $ Blockchain = new Blockchain ($ api_code );
25
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
26
26
27
27
// Convert a fiat amount to BTC
28
28
$ amount = $ Blockchain ->Rates ->toBTC (500 , 'USD ' );
Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- require_once (' ../src/Blockchain .php ' );
3
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
4
4
5
5
$ api_code = null ;
6
6
if (file_exists ('code.txt ' )) {
7
7
$ api_code = trim (file_get_contents ('code.txt ' ));
8
8
}
9
9
10
- $ Blockchain = new Blockchain ($ api_code );
10
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
11
11
12
12
// My receive address
13
13
$ destination = '1Gr6Y7ZJEmZnbDwopWKJKRTri8fBymPDfg ' ;
Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- require_once (' ../src/Blockchain .php ' );
3
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
4
4
5
5
$ api_code = null ;
6
6
if (file_exists ('code.txt ' )) {
7
7
$ api_code = trim (file_get_contents ('code.txt ' ));
8
8
}
9
9
10
- $ Blockchain = new Blockchain ($ api_code );
10
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
11
11
12
12
// Get Statistics
13
13
$ stats = $ Blockchain ->Stats ->get ();
Original file line number Diff line number Diff line change 1
1
<pre><?php
2
2
3
- require_once (' ../src/Blockchain .php ' );
3
+ require_once (dirname ( __DIR__ ) . ' /vendor/autoload .php ' );
4
4
5
5
$ api_code = null ;
6
6
if (file_exists ('code.txt ' )) {
7
7
$ api_code = trim (file_get_contents ('code.txt ' ));
8
8
}
9
9
10
- $ Blockchain = new Blockchain ($ api_code );
10
+ $ Blockchain = new \ Blockchain \ Blockchain ($ api_code );
11
11
12
12
$ wallet_guid = null ;
13
13
$ wallet_pass = null ;
34
34
try {
35
35
// Uncomment to send
36
36
// var_dump($Blockchain->Wallet->send($address, "0.001"));
37
- } catch (Blockchain_ApiError $ e ) {
37
+ } catch (\ Blockchain \ Exception \ ApiError $ e ) {
38
38
echo $ e ->getMessage () . '<br /> ' ;
39
39
}
40
40
You can’t perform that action at this time.
0 commit comments