PHP Composer autoload not working, no classes initiatedHow can I prevent SQL injection in PHP?Deleting an element from an array in PHPConvert HTML + CSS to PDF with PHP?startsWith() and endsWith() functions in PHPHow do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?Convert Postman request to guzzle or other PHP HTTP client
Very lazy puppy
Can a business put whatever they want into a contract?
A Pixelated Sequence - Find the Continuation
Rare Earth Elements in the outer solar system
how to know this integral finite or infinite
Wrong Schengen Visa exit stamp on my passport, who can I complain to?
Plot irregular circle in latex
How to install Rasbian Stretch on Raspberry Pi 4?
Bash attempts to write two shell prompts?
Why does an orbit become hyperbolic when total orbital energy is positive?
What are some examples of research that does not solve a existing problem (maybe the problem is not obvious yet) but present a unique discovery?
Other than good shoes and a stick, what are some ways to preserve your knees on long hikes?
Anagrams Question
What does the Free Recovery sign (UK) actually mean?
Exam design: give maximum score per question or not?
Madrid to London w/ Expired 90/180 days stay as US citizen
Why 1.5fill is 0pt
Why is the UK still pressing on with Brexit?
What does the "capacitor into resistance" symbol mean?
Can an infinite series be thought of as adding up "infinitely many" terms?
What is the difference between an engine skirt and an engine nozzle?
How does doing something together work?
Have you ever been issued a passport or national identity card for travel by any other country?
Why cannot a convert make certain statements? I feel they are being pushed away at the same time respect is being given to them
PHP Composer autoload not working, no classes initiated
How can I prevent SQL injection in PHP?Deleting an element from an array in PHPConvert HTML + CSS to PDF with PHP?startsWith() and endsWith() functions in PHPHow do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?Convert Postman request to guzzle or other PHP HTTP client
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to use Composer within PHP. I've installed composer within my project directory, then installed some needed PHP classes/methods with cli:
php composer.phar require ahsankhatri/firestore-php
php composer.phar require guzzlehttp/guzzle
Great, this worked fine!
After installing succesfully, I optimized the lockfile with:
php composer.phar dump-autoload --optimize
101 classes where added (cli returned this message).
Now I added the autoloader to my PHP file, I thought this would be easy... just add the autoload.php
<?php
require 'vendor/autoload.php';
//print_r(get_declared_classes());
$firestoreClient = new FirestoreClient('Dimo-233713', '
AIzaSyCNHz_EbF13KuAvEnlBIto_2n1eIqkCnzk', [
'database' => 'test',
]);
But, when I run this script on my XAMPP, the PHP log says:
[28-Mar-2019 13:27:33 Europe/Berlin] PHP Fatal error: Uncaught Error: Class 'FirestoreClient' not found in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php:6
Stack trace:
#0 main
thrown in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php on line 6
Class cannot be found. I dumped all classes as you can see at the commented line. But there is no class loaded I requested with composer. Not one of the 101 classes...
What is wrong here?
Working with PHPStorm. Running on XAMPP with PHP7.2.4
And here is the Composer.json file
"require":
"guzzlehttp/guzzle": "^6.3",
"ahsankhatri/firestore-php": "^2.0"
And this is the composer.lock file's json
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "caedd171718e9452e0e742dcd84f2235",
"packages": [
"name": "ahsankhatri/firestore-php",
"version": "v2.0.1",
"source":
"type": "git",
"url": "https://github.com/ahsankhatri/firestore-php.git",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ahsankhatri/firestore-php/zipball/ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"shasum": ""
,
"require": ~4.0",
"php": ">=5.6.6"
,
"require-dev":
"phpunit/phpunit": "5.7"
,
"type": "library",
"autoload":
"psr-4":
"MrShan0\PHPFirestore\": "src"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ahsaan Muhammad Yousuf",
"email": "ahsankhatri1992@gmail.com",
"homepage": "https://ahsaan.me",
"role": "Developer"
],
"description": "Firestore PHP Client",
"homepage": "https://github.com/ahsankhatri/firestore-php",
"keywords": [
"firebase",
"firestore",
"google",
"php"
],
"time": "2019-02-25T13:27:14+00:00"
,
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source":
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
,
"require":
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
,
"require-dev": ,
"suggest":
"psr/log": "Required for using the Log middleware"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "6.3-dev"
,
"autoload":
"files": [
"src/functions_include.php"
],
"psr-4":
"GuzzleHttp\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22T15:46:56+00:00"
,
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source":
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
,
"require":
"php": ">=5.5.0"
,
"require-dev":
"phpunit/phpunit": "^4.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.4-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Promise\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
,
"name": "guzzlehttp/psr7",
"version": "1.5.2",
"source":
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "9f83dded91781a01c63574e387eaa769be769115"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
,
"require":
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
,
"provide":
"psr/http-message-implementation": "1.0"
,
"require-dev": ,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.5-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Psr7\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
,
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2018-12-04T20:46:45+00:00"
,
"name": "psr/http-message",
"version": "1.0.1",
"source":
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
,
"require":
"php": ">=5.3.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.0.x-dev"
,
"autoload":
"psr-4":
"Psr\Http\Message\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
,
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source":
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
,
"require":
"php": ">=5.3"
,
"require-dev":
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
,
"type": "library",
"autoload":
"files": [
"src/getallheaders.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11T07:05:27+00:00"
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
php composer-php
|
show 1 more comment
I'm trying to use Composer within PHP. I've installed composer within my project directory, then installed some needed PHP classes/methods with cli:
php composer.phar require ahsankhatri/firestore-php
php composer.phar require guzzlehttp/guzzle
Great, this worked fine!
After installing succesfully, I optimized the lockfile with:
php composer.phar dump-autoload --optimize
101 classes where added (cli returned this message).
Now I added the autoloader to my PHP file, I thought this would be easy... just add the autoload.php
<?php
require 'vendor/autoload.php';
//print_r(get_declared_classes());
$firestoreClient = new FirestoreClient('Dimo-233713', '
AIzaSyCNHz_EbF13KuAvEnlBIto_2n1eIqkCnzk', [
'database' => 'test',
]);
But, when I run this script on my XAMPP, the PHP log says:
[28-Mar-2019 13:27:33 Europe/Berlin] PHP Fatal error: Uncaught Error: Class 'FirestoreClient' not found in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php:6
Stack trace:
#0 main
thrown in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php on line 6
Class cannot be found. I dumped all classes as you can see at the commented line. But there is no class loaded I requested with composer. Not one of the 101 classes...
What is wrong here?
Working with PHPStorm. Running on XAMPP with PHP7.2.4
And here is the Composer.json file
"require":
"guzzlehttp/guzzle": "^6.3",
"ahsankhatri/firestore-php": "^2.0"
And this is the composer.lock file's json
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "caedd171718e9452e0e742dcd84f2235",
"packages": [
"name": "ahsankhatri/firestore-php",
"version": "v2.0.1",
"source":
"type": "git",
"url": "https://github.com/ahsankhatri/firestore-php.git",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ahsankhatri/firestore-php/zipball/ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"shasum": ""
,
"require": ~4.0",
"php": ">=5.6.6"
,
"require-dev":
"phpunit/phpunit": "5.7"
,
"type": "library",
"autoload":
"psr-4":
"MrShan0\PHPFirestore\": "src"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ahsaan Muhammad Yousuf",
"email": "ahsankhatri1992@gmail.com",
"homepage": "https://ahsaan.me",
"role": "Developer"
],
"description": "Firestore PHP Client",
"homepage": "https://github.com/ahsankhatri/firestore-php",
"keywords": [
"firebase",
"firestore",
"google",
"php"
],
"time": "2019-02-25T13:27:14+00:00"
,
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source":
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
,
"require":
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
,
"require-dev": ,
"suggest":
"psr/log": "Required for using the Log middleware"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "6.3-dev"
,
"autoload":
"files": [
"src/functions_include.php"
],
"psr-4":
"GuzzleHttp\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22T15:46:56+00:00"
,
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source":
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
,
"require":
"php": ">=5.5.0"
,
"require-dev":
"phpunit/phpunit": "^4.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.4-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Promise\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
,
"name": "guzzlehttp/psr7",
"version": "1.5.2",
"source":
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "9f83dded91781a01c63574e387eaa769be769115"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
,
"require":
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
,
"provide":
"psr/http-message-implementation": "1.0"
,
"require-dev": ,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.5-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Psr7\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
,
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2018-12-04T20:46:45+00:00"
,
"name": "psr/http-message",
"version": "1.0.1",
"source":
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
,
"require":
"php": ">=5.3.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.0.x-dev"
,
"autoload":
"psr-4":
"Psr\Http\Message\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
,
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source":
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
,
"require":
"php": ">=5.3"
,
"require-dev":
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
,
"type": "library",
"autoload":
"files": [
"src/getallheaders.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11T07:05:27+00:00"
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
php composer-php
Can you share thecomposer.json
file?
– manuerumx
Mar 28 at 12:51
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
In your first example you forgot theuse
statement:use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
3
No, that's not what the autoloader does. You are still required to resolve names likeFirestoreClient
to their fully qualified nameMrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using ause
statement. The autoloader will onlyrequire_once
the right file for this class when you use it.
– Ulrich Eckhardt
Mar 29 at 8:10
|
show 1 more comment
I'm trying to use Composer within PHP. I've installed composer within my project directory, then installed some needed PHP classes/methods with cli:
php composer.phar require ahsankhatri/firestore-php
php composer.phar require guzzlehttp/guzzle
Great, this worked fine!
After installing succesfully, I optimized the lockfile with:
php composer.phar dump-autoload --optimize
101 classes where added (cli returned this message).
Now I added the autoloader to my PHP file, I thought this would be easy... just add the autoload.php
<?php
require 'vendor/autoload.php';
//print_r(get_declared_classes());
$firestoreClient = new FirestoreClient('Dimo-233713', '
AIzaSyCNHz_EbF13KuAvEnlBIto_2n1eIqkCnzk', [
'database' => 'test',
]);
But, when I run this script on my XAMPP, the PHP log says:
[28-Mar-2019 13:27:33 Europe/Berlin] PHP Fatal error: Uncaught Error: Class 'FirestoreClient' not found in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php:6
Stack trace:
#0 main
thrown in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php on line 6
Class cannot be found. I dumped all classes as you can see at the commented line. But there is no class loaded I requested with composer. Not one of the 101 classes...
What is wrong here?
Working with PHPStorm. Running on XAMPP with PHP7.2.4
And here is the Composer.json file
"require":
"guzzlehttp/guzzle": "^6.3",
"ahsankhatri/firestore-php": "^2.0"
And this is the composer.lock file's json
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "caedd171718e9452e0e742dcd84f2235",
"packages": [
"name": "ahsankhatri/firestore-php",
"version": "v2.0.1",
"source":
"type": "git",
"url": "https://github.com/ahsankhatri/firestore-php.git",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ahsankhatri/firestore-php/zipball/ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"shasum": ""
,
"require": ~4.0",
"php": ">=5.6.6"
,
"require-dev":
"phpunit/phpunit": "5.7"
,
"type": "library",
"autoload":
"psr-4":
"MrShan0\PHPFirestore\": "src"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ahsaan Muhammad Yousuf",
"email": "ahsankhatri1992@gmail.com",
"homepage": "https://ahsaan.me",
"role": "Developer"
],
"description": "Firestore PHP Client",
"homepage": "https://github.com/ahsankhatri/firestore-php",
"keywords": [
"firebase",
"firestore",
"google",
"php"
],
"time": "2019-02-25T13:27:14+00:00"
,
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source":
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
,
"require":
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
,
"require-dev": ,
"suggest":
"psr/log": "Required for using the Log middleware"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "6.3-dev"
,
"autoload":
"files": [
"src/functions_include.php"
],
"psr-4":
"GuzzleHttp\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22T15:46:56+00:00"
,
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source":
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
,
"require":
"php": ">=5.5.0"
,
"require-dev":
"phpunit/phpunit": "^4.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.4-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Promise\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
,
"name": "guzzlehttp/psr7",
"version": "1.5.2",
"source":
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "9f83dded91781a01c63574e387eaa769be769115"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
,
"require":
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
,
"provide":
"psr/http-message-implementation": "1.0"
,
"require-dev": ,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.5-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Psr7\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
,
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2018-12-04T20:46:45+00:00"
,
"name": "psr/http-message",
"version": "1.0.1",
"source":
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
,
"require":
"php": ">=5.3.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.0.x-dev"
,
"autoload":
"psr-4":
"Psr\Http\Message\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
,
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source":
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
,
"require":
"php": ">=5.3"
,
"require-dev":
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
,
"type": "library",
"autoload":
"files": [
"src/getallheaders.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11T07:05:27+00:00"
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
php composer-php
I'm trying to use Composer within PHP. I've installed composer within my project directory, then installed some needed PHP classes/methods with cli:
php composer.phar require ahsankhatri/firestore-php
php composer.phar require guzzlehttp/guzzle
Great, this worked fine!
After installing succesfully, I optimized the lockfile with:
php composer.phar dump-autoload --optimize
101 classes where added (cli returned this message).
Now I added the autoloader to my PHP file, I thought this would be easy... just add the autoload.php
<?php
require 'vendor/autoload.php';
//print_r(get_declared_classes());
$firestoreClient = new FirestoreClient('Dimo-233713', '
AIzaSyCNHz_EbF13KuAvEnlBIto_2n1eIqkCnzk', [
'database' => 'test',
]);
But, when I run this script on my XAMPP, the PHP log says:
[28-Mar-2019 13:27:33 Europe/Berlin] PHP Fatal error: Uncaught Error: Class 'FirestoreClient' not found in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php:6
Stack trace:
#0 main
thrown in /Users/***/Documents/Websites/xampp/domare.nl/htdocs/subdomains/portal/firestore.php on line 6
Class cannot be found. I dumped all classes as you can see at the commented line. But there is no class loaded I requested with composer. Not one of the 101 classes...
What is wrong here?
Working with PHPStorm. Running on XAMPP with PHP7.2.4
And here is the Composer.json file
"require":
"guzzlehttp/guzzle": "^6.3",
"ahsankhatri/firestore-php": "^2.0"
And this is the composer.lock file's json
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "caedd171718e9452e0e742dcd84f2235",
"packages": [
"name": "ahsankhatri/firestore-php",
"version": "v2.0.1",
"source":
"type": "git",
"url": "https://github.com/ahsankhatri/firestore-php.git",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ahsankhatri/firestore-php/zipball/ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"reference": "ecdd92bdcb3f00c0b94e0e1909ac104fe20b1eb8",
"shasum": ""
,
"require": ~4.0",
"php": ">=5.6.6"
,
"require-dev":
"phpunit/phpunit": "5.7"
,
"type": "library",
"autoload":
"psr-4":
"MrShan0\PHPFirestore\": "src"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ahsaan Muhammad Yousuf",
"email": "ahsankhatri1992@gmail.com",
"homepage": "https://ahsaan.me",
"role": "Developer"
],
"description": "Firestore PHP Client",
"homepage": "https://github.com/ahsankhatri/firestore-php",
"keywords": [
"firebase",
"firestore",
"google",
"php"
],
"time": "2019-02-25T13:27:14+00:00"
,
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source":
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
,
"require":
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
,
"require-dev": ,
"suggest":
"psr/log": "Required for using the Log middleware"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "6.3-dev"
,
"autoload":
"files": [
"src/functions_include.php"
],
"psr-4":
"GuzzleHttp\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22T15:46:56+00:00"
,
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source":
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
,
"require":
"php": ">=5.5.0"
,
"require-dev":
"phpunit/phpunit": "^4.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.4-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Promise\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
,
"name": "guzzlehttp/psr7",
"version": "1.5.2",
"source":
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "9f83dded91781a01c63574e387eaa769be769115"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
,
"require":
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
,
"provide":
"psr/http-message-implementation": "1.0"
,
"require-dev": ,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.5-dev"
,
"autoload":
"psr-4":
"GuzzleHttp\Psr7\": "src/"
,
"files": [
"src/functions_include.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
,
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2018-12-04T20:46:45+00:00"
,
"name": "psr/http-message",
"version": "1.0.1",
"source":
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
,
"require":
"php": ">=5.3.0"
,
"type": "library",
"extra":
"branch-alias":
"dev-master": "1.0.x-dev"
,
"autoload":
"psr-4":
"Psr\Http\Message\": "src/"
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
,
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source":
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
,
"dist":
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
,
"require":
"php": ">=5.3"
,
"require-dev":
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
,
"type": "library",
"autoload":
"files": [
"src/getallheaders.php"
]
,
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11T07:05:27+00:00"
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
php composer-php
php composer-php
edited Mar 29 at 8:04
Hans Schiessl
asked Mar 28 at 12:50
Hans SchiesslHans Schiessl
92 bronze badges
92 bronze badges
Can you share thecomposer.json
file?
– manuerumx
Mar 28 at 12:51
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
In your first example you forgot theuse
statement:use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
3
No, that's not what the autoloader does. You are still required to resolve names likeFirestoreClient
to their fully qualified nameMrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using ause
statement. The autoloader will onlyrequire_once
the right file for this class when you use it.
– Ulrich Eckhardt
Mar 29 at 8:10
|
show 1 more comment
Can you share thecomposer.json
file?
– manuerumx
Mar 28 at 12:51
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
In your first example you forgot theuse
statement:use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
3
No, that's not what the autoloader does. You are still required to resolve names likeFirestoreClient
to their fully qualified nameMrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using ause
statement. The autoloader will onlyrequire_once
the right file for this class when you use it.
– Ulrich Eckhardt
Mar 29 at 8:10
Can you share the
composer.json
file?– manuerumx
Mar 28 at 12:51
Can you share the
composer.json
file?– manuerumx
Mar 28 at 12:51
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
In your first example you forgot the
use
statement: use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
In your first example you forgot the
use
statement: use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
3
3
No, that's not what the autoloader does. You are still required to resolve names like
FirestoreClient
to their fully qualified name MrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using a use
statement. The autoloader will only require_once
the right file for this class when you use it.– Ulrich Eckhardt
Mar 29 at 8:10
No, that's not what the autoloader does. You are still required to resolve names like
FirestoreClient
to their fully qualified name MrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using a use
statement. The autoloader will only require_once
the right file for this class when you use it.– Ulrich Eckhardt
Mar 29 at 8:10
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55398103%2fphp-composer-autoload-not-working-no-classes-initiated%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55398103%2fphp-composer-autoload-not-working-no-classes-initiated%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share the
composer.json
file?– manuerumx
Mar 28 at 12:51
@manuerumx off course!! I will add it to the post! Thanx in advance.
– Hans Schiessl
Mar 28 at 13:36
In your first example you forgot the
use
statement:use MrShan0PHPFirestoreFirestoreClient;
– xabbuh
Mar 28 at 14:08
@xabbuh thanx but... No, this only adds the class for a few methods in this class only. I need all the dependencies.... of all the 101 added classes in composer, this is what Composer is for though? Someone has the solution?
– Hans Schiessl
Mar 28 at 18:19
3
No, that's not what the autoloader does. You are still required to resolve names like
FirestoreClient
to their fully qualified nameMrShan0PHPFirestoreFirestoreClient
, either by spelling it out or using ause
statement. The autoloader will onlyrequire_once
the right file for this class when you use it.– Ulrich Eckhardt
Mar 29 at 8:10