graphp / graph

GraPHP is the mathematical graph/network library written in PHP.
MIT License
694 stars 74 forks source link

Class 'Graphp\Graph\Graph' not found. May be readme needs an update #201

Closed ssontakke closed 3 years ago

ssontakke commented 3 years ago

I took the README code and tried to run it.

`<?php

require_once 'vendor/autoload.php';

$graph = new Graphp\Graph\Graph();

// create some cities $rome = $graph->createVertex(array('name' => 'Rome')); $madrid = $graph->createVertex(array('name' => 'Madrid')); $cologne = $graph->createVertex(array('name' => 'Cologne'));

// build some roads $graph->createEdgeDirected($cologne, $madrid); $graph->createEdgeDirected($madrid, $rome); // create loop $graph->createEdgeDirected($rome, $rome);`

Error:

Fatal error: Uncaught Error: Class 'Graphp\Graph\Graph' not found in C:\repos\adventofcode\test.php:5 Stack trace:

0 {main}

thrown in C:\repos\adventofcode\test.php on line 5 PHP Fatal error: Uncaught Error: Class 'Graphp\Graph\Graph' not found in C:\repos\adventofcode\test.php:5 Stack trace:

0 {main}

thrown in C:\repos\adventofcode\test.php on line 5

Kolyunya commented 3 years ago

@ssontakke it seems to me that your are using the stable package release and referring to a development version of the documentation. See the stable documentation here.

clue commented 3 years ago

Hi @ssontakke, welcome to this project :wave:

What @Kolyunya said :-) It looks like your referring to the documentation of the current master branch which will be released as v1.0.0 not too far in the future – while you're watching the source code of the v0.9.x release branch.

Please refer to the documentation that comes with your installed version or wait for the v1.0.0 release which will come with a much better architecture and documentation. In the meantime, you can also install from the master branch to get the latest development version :+1:

Refs #190