php Uncaught Error: Class 'BitWasp\Bitcoin\Key\PrivateKeyFactory' not found - php

im trying to add a library to my php. I already downloaded all the files from composer but a fatal error happended. here is my code :
require_once('vendor/autoload.php');
use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Address\AddressCreator;
use BitWasp\Bitcoin\Key\PrivateKeyFactory;
use BitWasp\Bitcoin\Key\KeyToScript\Factory\P2pkhScriptDataFactory;
//Rest of my code
ERROR 1 -> Uncaught Error: Class 'BitWasp\Bitcoin\Key\PrivateKeyFactory' not found
ERROR 2 -> Class 'BitWasp\Bitcoin\Key\PrivateKeyFactory' not found

Shouldn't that namespace be BitWasp\Bitcoin\Key\Factory\PrivateKeyFactory?
See here https://github.com/Bit-Wasp/bitcoin-php/blob/1.0/src/Key/Factory/PrivateKeyFactory.php#L5

Related

neo4j graphaware php-client: class not found

When I tray to access my neo4j-DB via Graphaware's php-client using http-protocol, I get the following error message:
Fatal error: Class 'GraphAware\Common\Result\AbstractRecordCursor' not found in ...
On the other hand when I'm using the bolt-protocol t says:
Fatal error: Uncaught Error: Call to undefined method GraphAware\Bolt\Result\Result::getResult() in...
At the beginning of my code I have used
require_once 'vendor/autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
so I thought the classes should be autoloaded which is obviously not the case.
What's wrong?
I have solved this issue by replacing the respective syntax for queries of the example-files by one out of the README.

PHP Fatal error: Class 'Sightengine\\SightengineClient' not found in

after trying different ways of using the API from sightengine I can' get it to work, I followed the instructions on their site , installing via composer, but when I try to use it, I get the Class not found error in apache:
PHP Fatal error: Uncaught Error: Class 'Sightengine\\SightengineClient' not found in /var/www/html/photobooth/app.php
PHP file:
<?php
use Sightengine\SightengineClient;
$client = new SightengineClient('xxxxxxx', 'xxxxxxxxx');
Missed to include the file.
When installing using composer, we have to include the file in our code
require_once 'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
This will help you to include the file in code, so you can start using the class/objects

Fatal error: Class 'phpseclib\Crypt\Base'

Getting this Error in php encription what to do please help
Fatal error: Class 'phpseclib\Crypt\Base' not found in /usr/share/php/phpseclib/Crypt/DES.php on line 55
Are you using the master branch of phpseclib? If so you need to use an autoloader. eg. https://raw.githubusercontent.com/composer/composer/master/src/Composer/Autoload/ClassLoader.php

PHP Fatal error: Class 'Swift_Validate' not found

I am trying to use Swift_Validate::email($email) and I get a php error: PHP Fatal error: Class 'Swift_Validate' not found.
I have the latest version of swiftmailer. Is there some preference settings I need to do?
I have tried including the Validate.php file, but then I get the error: PHP Fatal error: Class 'Swift_DependencyContainer' not found.
I include DependencyContainer.php and I get the error PHP Fatal error: Class 'Swift_DependencyException' not found.
I include DependencyException.php and I get the error: Class 'Swift_SwiftException' not found.
I include SwiftException.php and I still get the same error.
I think I must not have the preferences set up correctly. I am calling:
"require_once($dir.'/swift/swift_required.php');"
The code I am using for the validation is:
if (!Swift_Validate::email($email))
{ $error = true; }
Any help would be greatly appreciated. Using latest Apache and PHP.
Try require_once dirname( __FILE__) . '/lib/swift_required.php'; to use the built-in autoloader, where lib is subfolder of folder where is the current file ( for default directory structure of the library )

PHP Fatal error: Class 'AlbumTest\Bootstrap' not found

I am learning framework2 and I am following this:
http://framework.zend.com/manual/2.0/en/user-guide/routing-and-controllers.html
But I'm getting this error:
PHP Fatal error: Class 'AlbumTest\Bootstrap' not found in
/home/ben/ZendSkeletonApplication/path/to/zf2-tutorial/module/Album/test/AlbumTest/Controller/AlbumControllerTest.php
on line 23
It sounds like a namespace problem. Most likely your controller is in the namespace AlbumTest but you called Bootstrap instead of \Bootstrap. The difference is the latter will look in the root of your namespace for that directory.

Categories