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

Class not found error when try to use XBase lib in PHP #5

Closed
dzarezenko opened this issue May 11, 2015 · 1 comment
Closed

Class not found error when try to use XBase lib in PHP #5

dzarezenko opened this issue May 11, 2015 · 1 comment

Comments

@dzarezenko
Copy link

I am trying to use https://github.com/hisamu/php-xbase lib in my project.
I have copied XBase folder from repository to the my root and created index.php in my root.

When I try this code:

<?php

use XBase\Table;

$table = new Table(dirname(__FILE__) . 'data/test.dbf');

while ($record = $table->nextRecord()) {
    echo $record->my_column;
}

?>

I received this error:

Fatal error: Class 'XBase\Table' not found in ...

What is wrong?

@luads
Copy link
Owner

luads commented May 11, 2015

If you're not using composer to manage your dependencies, you're probably not autoloading the classes, so you should do a require() on all the lib files.

You can also switch into using composer and it's autoloader.

@luads luads closed this as completed Jun 26, 2015
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

2 participants