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

Setup instructions are incomplete #32

Open
UlrichEckhardt opened this issue Oct 29, 2014 · 4 comments
Open

Setup instructions are incomplete #32

UlrichEckhardt opened this issue Oct 29, 2014 · 4 comments

Comments

@UlrichEckhardt
Copy link
Contributor

Hi!
I'm trying to evaluate athletic and I'm having issues getting even a simple example to run. The "sample event" from the readme is obviously not intended to be used as-is, so I

  • created a folder
  • composer init
  • composer require polyfractal/athletic
  • created a simple file SleepEvent.php with a class SleepEvent deriving from AthleticEvent

I'm trying to run using "vendor/bin/athletic -p ./SleepingEvent.php", which fails with "ERROR: Class \SleepingEvent does not exist". I've tried various other combinations, but to no avail. The class name in the error message changes slightly, but that's all. I'm using PHP 5.6, in case that matters.

@UlrichEckhardt
Copy link
Contributor Author

I have found a workaround: If I set up the autoloader to locate that class, I can actually make this work. The necessary stanza in composer.json is

"autoload": {
    "psr-4": {
        "": ""
    }
}

This might be common for many projects, but it still presents a hurdle if you just want to evaluate athletic and should be documented.

@bishopb
Copy link

bishopb commented May 28, 2015

-p takes a directory, I believe, not a single file. Try -p . instead.

@stumpdk
Copy link

stumpdk commented Sep 25, 2015

I also get the same error (ERROR: Class \TestClassEvent does not exist).

I've tried to set the -p parameter to both a single file and a directory.

Does anyone know how to solve this?

@oytuntez
Copy link

As suggested by @UlrichEckhardt, autoloading your benchmarking classes worked with me.

"autoload": {
        "psr-4": {
            "MyCompany\\Benchmarks\\": "benchmarks/"
        }
    },

Then remember to issue composer dump-autoload.

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