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

Error in Connection to filemaker #1

Open
bhyri opened this issue Nov 17, 2015 · 23 comments
Open

Error in Connection to filemaker #1

bhyri opened this issue Nov 17, 2015 · 23 comments

Comments

@bhyri
Copy link

bhyri commented Nov 17, 2015

Hi,
I'm trying to connect Filemaker database, i tired all the steps given
https://github.com/andrewmile/FMLaravel
but it showing me the below error...

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'FileMaker' not found

I'm not getting from where this thing is happening....

Can any one suggest me regarding this issue.... Any Help

@andrewmile
Copy link
Contributor

Can you confirm that you have the fm-api directory in vendor/andrewmile? Also try running a composer install.

@bhyri
Copy link
Author

bhyri commented Nov 18, 2015

Hi,
Thankq for your reply...
Yes i have fm-api... and i tired composer install by removing composer.lock...
In vendor/andrewmile i have 3 folders shown below...
fm-api -- consists of Filemakaer api and Filemaker folder
fm-hash
fm-laravel
and none of the folder was empty....

Now i'm getting empty array as shown below

Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
)

)
Actually i have a layout by name adress.. having fileds as name,adress
So... i have a doubt that whether its connecting to the DB or not atleast... and if connecting then whats the problem to get records from there....

Can You help me to break this confusion... and to sorted out this thing....

@andrewmile
Copy link
Contributor

Can you give me a snippet of what type of query you are running? In addition, what version of FileMaker server are you running?

@bhyri
Copy link
Author

bhyri commented Nov 19, 2015

Hi,
Im using (FileMaker Pro) Filemaker 13 server.....
Below are the code snippet...

database.php ....

'default' => env('DB_CONNECTION', 'filemaker'),
'filemaker' => [
'driver' => 'filemaker',
'host' => env('DB_HOST'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),

]

.env

DB_HOST=host
DB_DATABASE=TestDB
DB_USERNAME=admin
DB_PASSWORD=admin


Task.php

@bhyri
Copy link
Author

bhyri commented Nov 20, 2015

Hi,
Can You suggest me how to solve this issue.... or is there any thing that i missed......
I gave the total details of files where i wrote my code....
Thank You...

@andrewmile
Copy link
Contributor

I've taken some time to look at this and I think there is an issue with the all() method. I am working on fixing that functionality but in the meantime have you tried running any other queries? If you run a find() or where() query you should be able to confirm that your database connection is working correctly.

@bhyri
Copy link
Author

bhyri commented Dec 2, 2015

Hi,
Thank You for your reply... it means a lot for me...
Actually... i have tired maximum queries on this to check whether connection is establishing or not... but its returning a empty line only...
Help me to sort out this thing....
Thank You....

@cariboufute
Copy link

A quick fix is to add the FileMaker.php file from vendor into the autoload/classmap object in the composer.json file

...
"autoload": {
        "classmap": [
            ...
            "vendor/andrewmile/fm-api/src/FMAPI/FileMaker.php"
        ],
        ...
    },
...

However, this fm-api really needs to be updated. It can't run in PHP 7 since it uses old PHP syntax like same name as class constructors. Also it needs to have proper namespacing to avoid this kind of patching. I tried to fix it myself but it is very long and I would rather use a more recent version of FileMaker for PHP API.

@bossroom
Copy link

this fm-api really needs to be updated. It can't run in PHP 7 since it uses old PHP syntax like same name as class constructors.

I agree with you!

@andrewmile
Copy link
Contributor

The API version included in the fm-api package is for server 13. I have not yet done anything on server 14 with this project. If you are on server 14 you can drop the updated API version in instead. I included the server 13 version as a convenience but I don't have a way currently to swap between versions.

@bossroom
Copy link

No changes in the PHP API for FileMaker 14.

@andrewmile
Copy link
Contributor

Okay, right now I don't have access to server 14 to upgrade the api version. If someone wants to make a PR to fm-api I'll merge if there are no breaking changes.

@bossroom
Copy link

@andrewmile
Copy link
Contributor

If this is for server 14 it is identical to the server 13 version.

@bossroom
Copy link

Yes, as I said. They don't have changed nothing. Just downloaded from one of mine FileMaker Server 14.

@andrewmile
Copy link
Contributor

I see. I misunderstood you. In that case we can't really support PHP 7 until FM updates their API.

@bossroom
Copy link

Yes, I agree... This API is ancient. They don't have changed nothing since 11 version (they added some function for container fields in 12, but all the rest is the same).

@cariboufute
Copy link

Mmm can we make our own version of FM API then? I checked quickly the code and the problem is mostly PHP 4 style constructors (Class::class() instead of Class::__construct).

I could try this and make a pull request once it is tested.

@cariboufute
Copy link

cariboufute commented Apr 25, 2016

Also, there are no visibility keyword before methods (public/protected/private). This will be fixed too (they will be all public for the moment).

@cariboufute
Copy link

I made a modernized version of FMAPI. I made a pull request for it on andrewmile/FMAPI.

@andrewmile
Copy link
Contributor

Thank you for looking into that. I'll take a look and will merge if everything still works well.

@ballet-mecanique
Copy link

Hi - just curious if there is any chance of merging cariboufute's pull request for andrewmile/FMAPI to make FMLaravel compatible with php 7?

@andrewmile
Copy link
Contributor

Hi @ballet-mecanique , unfortunately I no longer have access to a FileMaker server to test any changes so this repo has not received any updates in quite some time. I wrote FMLaravel while working for a former employer, whom I believe is still using it in production. I have reached out to them to see if they will take over the repo and if not, I will update this project to reflect its current state.

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

5 participants