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

vendor/autoload.php is missing #61

Closed
ridculy opened this issue Jan 10, 2013 · 34 comments
Closed

vendor/autoload.php is missing #61

ridculy opened this issue Jan 10, 2013 · 34 comments
Labels

Comments

@ridculy
Copy link

ridculy commented Jan 10, 2013

The vendor/autoload.php is missing on github, it's used in the demo and test.

Could some add this or tell me where I can get this?

@videlalvaro
Copy link
Collaborator

I think this is managed by composer according to the docs: Class autoloading and dependencies are managed by composer so install it: ………

@romainneutron
Copy link
Contributor

Right, the vendor dir is automatically created by composer.

Please read this doc for PhpAmqpLib install / use : http://getcomposer.org/doc/01-basic-usage.md

I think we can close this isssue

@videlalvaro
Copy link
Collaborator

@Lewiscowles1986 You might not agree with the decision, but there's no need to call others "stupid" here.

@anton-siardziuk
Copy link
Contributor

@Lewiscowles1986 you can use this library without composer if you wish: just download it, put in whatever dir you want and add it to any PSR-0 autoloader. But if you want to run examples or tests for this library, you should use composer

@pinepain
Copy link

@Lewiscowles1986, yeah, it is very professional to call decision "stupid" only because you think it should be done in your way.

@anton-siardziuk
Copy link
Contributor

@Lewiscowles1986 like I said, nobody forces you to use composer actually. You can use every kind of PSR-0 autoloader to load this lib classes.

@anton-siardziuk
Copy link
Contributor

@Lewiscowles1986 Using PSR-0 is not about skilling up quickly, it is just about the simplest way to do autoloading - use standard one. Basic PSR-0 autoloader is about 10 lines of code - it is the simplest possible way to automatically load classes. Do you mean every library should copy-paste this autoloader inside it because some of its users do not familar with PSR-0, autoloading and composer and do not want to learn it? If so, I can not agree with you about it.

@anton-siardziuk
Copy link
Contributor

@Lewiscowles1986 sorry, my English knowledge doesnt allow me to find out was your statement about "attacking style" a sarcasm or not. If it wasnt - np ) If it was - sorry, I am not native English speaker, so I can not adjust my style - I just speak how I can )

@videlalvaro
Copy link
Collaborator

@Lewiscowles1986 if you want to propose a solution, you can add one file to the demo folder on how to have an auto loader in case someone doesn't want to use composer. I happily merge it as long as it is kept simple and for illustration purposes.

@besancon
Copy link

Hello

In order to make things progress, i let you know that the loader from https://gist.github.com/jwage/221634 enabled me to use the PHP tutorials from http://www.rabbitmq.com/tutorials/tutorial-one-php.html (and so on).

I don't use composer neither but i wanted to contribute positively.

Thanks to Alvaro Videla for his book that walked me to this thread. Let's focus on RabbitMQ use now.

Best regards.
Thierry BESANCON

videlalvaro added a commit that referenced this issue Mar 18, 2014
@videlalvaro
Copy link
Collaborator

@besancon I've added a note to the README. Thanks

@kanflo
Copy link

kanflo commented Oct 17, 2014

Based on the solution by @besancon I wanted to share the exact steps to get the demos running with the proposed loader:

Download the raw gist from https://gist.github.com/jwage/221634 to php-amqplib/demo

Edit php-amqplib/demo/config.php replacing the line
require_once __DIR__ . '/../vendor/autoload.php';
with the lines
require_once __DIR__ . '/SplClassLoader.php'; // https://gist.github.com/jwage/221634 $classLoader = new SplClassLoader('PhpAmqpLib', '/path/to/php-amqplib'); $classLoader->register();

The demos should now run without autoloader complaints.

@fprochazka
Copy link
Contributor

You guys should be using composer. There is no good reason not to. I see only stupid excuses so far.

@kanflo
Copy link

kanflo commented Oct 17, 2014

Oh, we most likely will in the end. I for one am not too fond of recursion when it comes to learning new tools/frameworks/whatever. I am eager to learn A, which happen to force me to learn B. B might of course be an excellent choice further down the road but right now I only have time and interest to learn A, any shortcuts around B will thus be most appreciated.

@videlalvaro
Copy link
Collaborator

@kanflo this as simple as download/install composer. Then run composer install inside the project folder, there is no need to "learn" composer to run said steps.

@kennasoft
Copy link

Hi videlalvaro,

I tried using composer... (not too familiar with it). I keep running into the below error whenever I run composer install:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package videlalvaro/php-amqplib could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Below is my composer.json file:

{
  "name": "genio/ozinta",
  "description": "Ozinta description",
  "require": {
      "videlalvaro/php-amqplib": "2.4.*"
  }
}

Any help would be appreciated, as I don't want to use an alternative means to load the library. Thanks

@videlalvaro
Copy link
Collaborator

I copy pasted your composer.json and ran the commands, everything worked just fine:

avidela:test avidela$ composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing videlalvaro/php-amqplib (v2.4.1)
    Downloading: 100%         

Writing lock file
Generating autoload files
avidela:test avidela$ ll
total 16
-rw-r--r--  1 avidela  wheel   132 Jan 25 22:35 composer.json
-rw-r--r--  1 avidela  wheel  2347 Jan 25 22:35 composer.lock
drwxr-xr-x  5 avidela  wheel   170 Jan 25 22:35 vendor/
avidela:test avidela$ ll vendor/
total 8
-rw-r--r--  1 avidela  wheel  183 Jan 25 22:35 autoload.php
drwxr-xr-x  8 avidela  wheel  272 Jan 25 22:35 composer/
drwxr-xr-x  3 avidela  wheel  102 Jan 25 22:35 videlalvaro/

@kennasoft
Copy link

Very strange indeed. One more thing: I'm running this via terminal on a mac. I even tried sudo composer install, and got the same error.

@videlalvaro
Copy link
Collaborator

I'm also running this from a Mac. Maybe ask on the composer mailing list.
On Mon, Jan 26, 2015 at 8:21 AM Ikenna Okonkwo [email protected]
wrote:

Very strange indeed. One more thing: I'm running this via terminal on a
mac. I even tried sudo composer install, and got the same error.


Reply to this email directly or view it on GitHub
#61 (comment)
.

@LMS0815
Copy link

LMS0815 commented Feb 9, 2015

Is there an easy way to run the demo within an windows (IEE) environment?
I really love the API idea, but to get only the example.php "running" within a IEE environment seems to be impossible without installing all PHP developer tools.

Unfortunately the 'SplClassLoader.php' Trick is not working for me.

ERROR: Class 'Bubelbub\SmartHomePHP\SmartHome' not found in C:\WebApps\SmartHome\index.php

@Creased
Copy link

Creased commented Oct 23, 2015

Obviously, it's too late for the initial issuer but for myself, I've solved this issue by running php /usr/sbin/composer.phar install -vvv -o inside the project folder, IMO the argument "-o" omitted in first installation is necessary for some installations ...

composer.json:

{
    "name": "root/project",
    "description": "DESCRIPTION",
    "authors": [
        {
            "name": "Firstname LASTNAME",
            "email": "[email protected]",
            "homepage": "http://www.domain.tld/",
            "role": "Developer"
        }
    ],
    "autoload": {
        "psr-4": {
            "App\\": "application"
        }
    },
    "require": {}
}

@troindx
Copy link

troindx commented Dec 18, 2015

Hi, I just want to add one tiny thing.

I Hate composer, composer is probably the worst thing ever invented. I get the idea is good but by far the only thing i've suffered with composer is delays and more delays. I spent 2 straight days trying to figure out why composer couldn't install a dependency on my mac. I get that composer can help you to organise things and as a dependency manager it doesn't go that much far off. But when composer fucks up (and it will eventually do) it fucks up for good. Libraries that depend on one place and that are installed on some other place but that are not compatible because two different libraries use different versions of a third library and cant coexist between them....

let me tell you. I hate composer , I ran into this very same problem and i've discovered that I needed to use composer to install certain libraries .

Not only i am not going to use composer, i'm going to have to switch from PHPMailer to some other library that does the same trick because of this very same issue.

I hope you are happy.....
fad

@troindx
Copy link

troindx commented Dec 18, 2015

One friend of mine used composer for a few years and the other day he was diagnosed with cancer.
that's how bad composer is.

Now, back to constructiveness , I get the very same

Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in blablabla

I don't want to use composer because I firmly believe that composer will give me cancer in the anus. But I REALLY REALLY REALLY REALLY like PHPMailer. PHPMailer is nice, cute and atractive and will not give me cancer in the anus. I don't understand about autoloaders and things like that. I just want to know how to , without using composer, in a simple way, add that vendor/blabla thing to my project, more like a drag and drop solution, just place the necessary files in the folder, make it work and move on.

can anyone help me? thank you.

@g012
Copy link

g012 commented Mar 12, 2016

I also don't see the point of providing a zip/tar file for download WITHOUT that file. Doesn't make sense.

@ridculy
Copy link
Author

ridculy commented Mar 12, 2016

it doen't make sense to provide this file. It's from composer and uses a
auto generated feature.

On Sat, Mar 12, 2016 at 10:43 PM, g012 [email protected] wrote:

I also don't see the point of providing a zip/tar file for download
WITHOUT that file. Doesn't make sense.


Reply to this email directly or view it on GitHub
#61 (comment)
.

Mit schönen Grüßen aus Berlin,
Jörg Ohnheiser | Johanniterstrasse 4 | 10961 Berlin
030/30605744 | 0151/10860477

@g012
Copy link

g012 commented Mar 12, 2016

Well I got on this page looking for a solution about this for another project, just noticed. It's the doc from that project which is misleading then, sorry about that.

@troindx
Copy link

troindx commented Mar 14, 2016

Composer can be a very useful tool, but sometimes it just adds a lot of complexness where there is no need to, and it has also been proven by a lot of scientific experiments that using composer leads to cancer in the anus.

Be that as it may, i'd suggest a small package where a stable functioning version of the file is included "out of the box", so that composer isn't needed. cos it could be useful for people who need this for something small, and don't require that much ammount.

it's just a suggestion, suggestions are free of charge :) keep the good work.

@postalservice14
Copy link
Contributor

Back to the original issue. In order to use the demo's and tests, composer is required. Demo's are just used to demonstrate the capabilities of the library. Although you can use the library without composer, it is not the recommended approach and therefore the examples and tests require it.

@troindx please read the CoC and keep your comments/suggestions constructive.

@levhita
Copy link

levhita commented Sep 2, 2016

I'm just going to try to be constructive (altought I really really hate composer), there is no really to point to redirect people to install composer, when the actual dependency is "add any compatible PSR-0 autoloader", such compatible loader could be provided out of the box, or simply as part of the documentation(10 lines of code is not much), which in turn could provide the suggestion to use composer too if wished.

To take composer as a kind of standarized default is the problem here, PSR-O IS AN STANDARD, Composer is only a package manager that some people like to use.

@kheldaroz
Copy link

in my case the issue was with the Mac using its own internal php not the Mamp PHP

@troindx
Copy link

troindx commented Nov 1, 2016

I had the same problem

El 31 oct. 2016 9:51 a. m., "kheldaroz" [email protected] escribió:

in my case the issue was with the Mac using its own internal php not the
Mamp PHP


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#61 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADHN3t8DD5yBaxq1B9X05iXcAzmN9Retks5q5Wk_gaJpZM4AWllU
.

@herbertgatchalian
Copy link

hi, sorry i;m stupid and new to this. but i was able to use composer and install everything.

problem is when i try to run the samples, i'm getting this error

"Fatal error: Class 'Infusionsoft\Infusionsoft' not found in D:\htdocs\infusion\samples\addWithDupCheck.php on line 7"

@ronator
Copy link

ronator commented Apr 3, 2017

I simply can't even just install composer - why are such things happening to stable branch?

@michaelklishin
Copy link
Collaborator

@ronator we can't recommend anything based on "can't even just install composer". This is not a support forum. If you have questions, please post them to rabbitmq-users, our public mailing list.

Usually any obvious installation issue is reported multiple times a day. This is not something we hear about and I personally had to go through the RabbitMQ PHP tutorials that use this client and it worked just fine with both 2.5.x and 2.6.x versions.

@php-amqplib php-amqplib locked and limited conversation to collaborators Apr 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests