Open ch0wnag3 opened 9 years ago
Hi ch0wnag3, What environment are you using? (OS, Laravel Version, 32 or 64 bit ach..)
Sorry for the late reply. Here are my environment details:
I'm still very new to Laravel development so if I'm omitting something you need please just let me know.
i had issues with this and Laravel 4.2 downgrading to 4.1 works. sounds like extension was renamed in different version
this extension is working on laravel 4.2 as well, im using this - https://github.com/wajatimur/odbc-driver
I dont have any issues,it might have 1 issue with the grammer[namespace issue] part but it is very easy to fix.
gsplash, when you installed the wajatimur/odbc-driver did you run into a "Cannot instantiate abstract class Illuminate\Database\Schema\Grammars\Grammar " error? If so, what did you do to fix it?
Yes I think I had that issue any how thats my odbc connection class -
<?php namespace Foundation\Database\Driver;
use Illuminate\Database\Connection;
class ODBCDriverConnection extends Connection { /* * @return Query\Grammars\Grammar / protected function getDefaultQueryGrammar() { $grammarConfig = $this->getGrammarConfig();
if ($grammarConfig) {
$packageGrammar = "Illuminate\\Database" . $grammarConfig;
if (class_exists($packageGrammar)) {
return $this->withTablePrefix(new $packageGrammar);
}
$illuminateGrammar = "Illuminate\\Database\\Query\\Grammars\\" . $grammarConfig;
if (class_exists($illuminateGrammar)) {
return $this->withTablePrefix(new $illuminateGrammar);
}
}
return $this->withTablePrefix(new \Illuminate\Database\Query\Grammars\Grammar);
}
/**
* Default grammar for specified Schema
* @return Schema\Grammars\Grammar
*/
protected function getDefaultSchemaGrammar()
{
$grammarConfig = $this->getGrammarConfig();
if ($grammarConfig) {
$packageGrammar = "Illuminate\\Database" . $grammarConfig;
if (class_exists($packageGrammar)) {
return $this->withTablePrefix(new $packageGrammar);
}
$illuminateGrammar = "Illuminate\\Database\\Schema\\Grammars\\" . $grammarConfig;
if (class_exists($illuminateGrammar)) {
return $this->withTablePrefix(new $illuminateGrammar);
}
}
}
protected function getGrammarConfig()
{
if ($this->getConfig('grammar')) {
return $this->getConfig('grammar');
}
return false;
}
}
I know its not perfect but was really annoyed by that class so I just left it like that when I got no errors
Apologies if this is just user error, but at this point I'm just spinning my wheels. I'm basically getting the same error as the fellow here:
http://stackoverflow.com/questions/22838307/laravel-4-odbc-class-cannot-find-php-extension
I've verified that the extension is loaded on my system by doing a phpinfo() page and php -m. I'm wondering if this could be something as simple a casing issue. My reasoning is that the extension's name show us as PDO_ODBC in both places.
Change this:
To this:
I'm sure there's a way to test this locally, but until I figure that out, I thought I'd ask here. Thanks in advance for taking the time to read this!