Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get this to work. #1

Closed
proper-systems opened this issue Jan 5, 2022 · 3 comments
Closed

Cant get this to work. #1

proper-systems opened this issue Jan 5, 2022 · 3 comments

Comments

@proper-systems
Copy link

proper-systems commented Jan 5, 2022

I cant get any example to even work because there are no examples that even run auto loader with correct includes.

I know composer is wonderful but I always have problems getting it working.

Just add functional examples - that load things they need to run.

Examples listed

// create a completely new and unique pair of keys.
$keyPair = KeyPair::random();

print($keyPair->getAccountId());
// GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB

print($keyPair->getSecretSeed());
// SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7

And I get:

Fatal error: Uncaught Error: Class 'KeyPair' not found in

How am i suposed to know what to include to bring this class in?

@miguilimzero
Copy link

This is related to your knowledge with composer and auto-loader and not an issue with the package.

You need to find the classes using your IDE suggestions or navigating the package files.

use Soneso\StellarSDK\Crypto\KeyPair;

@proper-systems
Copy link
Author

proper-systems commented Jan 5, 2022

Agreed, I hate composer and whole deployment garbage with abstracted and hidden includes and references.

I wrote my own functions, do not need these SDKs always a headache, if I cant just include the library and start referencing it - i do not want it.

@danbradster
Copy link

This is related to your knowledge with composer and auto-loader and not an issue with the package.

You need to find the classes using your IDE suggestions or navigating the package files.

use Soneso\StellarSDK\Crypto\KeyPair;

`<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require('autoload.php');

use Soneso\StellarSDK\Crypto\KeyPair;

$keyPair = KeyPair::random();
print($keyPair->getAccountId());
print($keyPair->getSecretSeed());
?>`

Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /home/equitiescharts/equitiescharts.com/soneso/vendor/soneso/stellar-php-sdk/Soneso/StellarSDK/Crypto/KeyPair.php on line 32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants