fightbulc / simplon_mysql

MySQL PDO Wrapper (php, mysql, pdo, crud, library)
71 stars 22 forks source link

Fatal error: Uncaught Error: Class "PDOConnector" not found #23

Open Elijha opened 3 years ago

Elijha commented 3 years ago

Error with basic install / test. on PHP 7.4 server with php74-php-pdo extension enabled.

Error: PHP Fatal error: Uncaught Error: Class "PDOConnector" not found in ...

Code causing error

$pdo = new PDOConnector(
    'localhost',            // server
    'root',      // user
    'rootpass',      // password
    'test'     // database
);

composer.json:

{
    "require": {
        "simplon/mysql": "*"
    }
}

Vendor files are installed - so composer has run and installed OK.

PDO test case shows PHP extension is working OK.

try{
    $dbh = new pdo( 'mysql:host=localhost;dbname=test',
                    'root',
                    'rootpass',
                    array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
    die(json_encode(array('outcome' => true)));
}
catch(PDOException $ex){
    die(json_encode(array('outcome' => false, 'message' => 'Unable to connect')));
}

search of php.net. https://www.php.net/manual-lookup.php?pattern=PDOConnector&scope=quickref

Shows this is not a native PHP class? Dependencies in documentation does list 'PDO' but not what that means exactly .. I'm thinking it is another composer installable class? If so not clear which one.

> composer require PDO
 Did you mean one of these?
      ext-pdo
      aura/sql
      slim/pdo
      faapz/pdo
      dibi/dibi

A Google search for "pdoconnector" only gives results for 'Siverstrip' ... is this a composer module only useful for "SilverStripe"based projects? Doesn't seem to mention or indicate this is the case or am I missing something?

Baptistecottey commented 2 years ago

Same issue from my side, but never been able to solve it :(

Had to use v1.4.3.

As the project has not been updated since multiple years, i'm looking for a replacement.