Code Monkey home page Code Monkey logo

Comments (8)

fenric avatar fenric commented on June 14, 2024

hi! try to run the following command:

composer dumpautoload

from vin.

rnyit avatar rnyit commented on June 14, 2024

Still the same problem.

C:\xampp\php>php composer.phar require sunrise/vin
Using version ^1.1 for sunrise/vin
./composer.json has been updated
Running composer update sunrise/vin
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files

C:\xampp\php>php composer.phar dumpautoload
Generating autoload files
Generated autoload files

C:\xampp\php>
Warning: The use statement with non-compound name 'InvalidArgumentException' has no effect in C:\xampp\htdocs\_test\test.php on line 2

Fatal error: Uncaught Error: Class "Sunrise\Vin\Vin" not found in C:\xampp\htdocs\_test\test.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\_test\test.php on line 6

from vin.

fenric avatar fenric commented on June 14, 2024

Please, show me all your code, the content of the index.php...

from vin.

rnyit avatar rnyit commented on June 14, 2024
<?php
use InvalidArgumentException;
use Sunrise\Vin\Vin;

try {
    $vin = new Vin('WVWZZZ1KZ6W612305');
} catch (InvalidArgumentException $e) {
    // It isn't a valid VIN...
}

$vin->getVin(); // returns "WVWZZZ1KZ6W612305"
$vin->getWmi(); // returns "WVW"
$vin->getVds(); // returns "ZZZ1KZ"
$vin->getVis(); // returns "6W612305"
$vin->getRegion(); // returns "Europe"
$vin->getCountry(); // returns "Germany"
$vin->getManufacturer(); // returns "Volkswagen"
$vin->getModelYear(); // returns [2006]

from vin.

fenric avatar fenric commented on June 14, 2024

you should add to the top of the index.php the following code:

require __DIR__ . '/vendor/autoload.php';

from vin.

rnyit avatar rnyit commented on June 14, 2024

Still didn't work but I found the vendor directory in php directory from xampp, so I copied it to htdocs folder and I added the line but I still get one more error:
Warning: The use statement with non-compound name 'InvalidArgumentException' has no effect in C:\xampp\htdocs\_test\test.php on line 4

from vin.

fenric avatar fenric commented on June 14, 2024

you don't use namespace, because you may remove the following code:

use InvalidArgumentException;

from vin.

fenric avatar fenric commented on June 14, 2024

it's not problem of the package, it's PHP)

from vin.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.