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

I must be doing something wrong [continuation] #43

Open
arisslavov opened this issue Jan 31, 2017 · 2 comments
Open

I must be doing something wrong [continuation] #43

arisslavov opened this issue Jan 31, 2017 · 2 comments
Labels

Comments

@arisslavov
Copy link

#39

Continuing where that left off. I actually posted an answer there but it was probably suppressed as a notification for being in a closed thread (and couldnt find how to re-open it myself - cause i probably cant).

After your reply i tried that.
It seems to be throwing a 500 fatal error:
mod_fcgid: stderr: PHP Fatal error: Class 'RecAnalyst\RecordedGame' not found in /recanalyst/recanalyst.php on line 14, referer: /recanalyst/index.html

It's on a php 5.6+ host so that's out of the question.

The current code is as follows:

<?php

require 'vendor/autoload.php';

use RecAnalyst\RecordedGame;

$array = array();
$a = __DIR__ . "/games/" . $_FILES["file"]["name"][0];
move_uploaded_file($_FILES["file"]["tmp_name"][0], $a);
$array[] = $_FILES["file"]["name"][0];
foreach ($array as $val) {
    $filename = __DIR__ . '/games/' . $val;
// Read a recorded game from a file path.
    $rec = new RecordedGame($filename);
// Render a map image. Map images are instances of the \Intervention\Image
// library, so you can easily manipulate them.
    $rec->mapImage()
        ->resize(240, 120)
        ->save('minimap.png');
// Display players and their civilizations.
    echo 'Players: ' . "\n";
    foreach ($rec->players() as $player) {
        echo ' * ' . $player->name . ' (' . $player->civName() . ')' . "\n";
    }
    echo 'Minimap saved in minimap.png.' . "\n";
}
@arisslavov
Copy link
Author

Of course i could always give you access to our server if you're willing to help a bit more, but i don't mind either way if you're too busy to do that.

@goto-bus-stop
Copy link
Owner

Sorry for the delay, I haven't had much time for RecAnalyst recently. What does your directory structure look like now? Does your composer.json file contain a recanalyst/recanalyst key in the dependencies?

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

No branches or pull requests

2 participants